/* ============================================================
   quiz-6e.css — Styles spécifiques au Quiz 6e
   Couvre toutes les classes générées par quiz-6e.js
   et les éléments statiques de quiz-6e.html.
   Aucun style inline ni <style> dans le HTML.
   ============================================================ */

/* ---- Modes de jeu ---- */

.mode-selection {
    margin: 20px 0;
}

.mode-selection h3 {
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 700;
}

.mode-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    min-width: 130px;
    transition: border-color .2s, background .2s;
    font-family: inherit;
}

.mode-btn:hover  { border-color: #3498db; }
.mode-btn.active { border-color: #3498db; background: #ebf5fb; }

.mode-icon  { font-size: 1.4rem; }
.mode-title { font-size: .95rem; font-weight: 700; }
.mode-desc  { font-size: .78rem; color: #777; }

/* ---- Configuration ---- */

.quiz-config {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin: 16px 0 20px;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.config-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-item label {
    font-weight: 600;
    font-size: .95rem;
}

.config-item input[type="number"] {
    width: 70px;
    padding: 6px 10px;
    border: 1.5px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

/* ---- Barre de progression ---- */

.progress-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.progress-fill {
    flex: 1;
    height: 8px;
    background: #3498db;
    border-radius: 4px;
    transition: width .3s;
}

/* piste de fond */
.progress-bar::before {
    content: '';
    display: none; /* la piste est gérée par le parent */
}

/* wrapper de la barre */
.progress-bar {
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    height: 8px;
    margin-bottom: 16px;
}

.progress-fill {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: #3498db;
    border-radius: 4px;
    transition: width .3s;
}

.progress-text {
    position: absolute;
    right: 0;
    top: -20px;
    font-size: .82rem;
    color: #666;
    white-space: nowrap;
}

/* ---- Chronomètre ---- */

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 1.1rem;
    font-weight: 700;
}

.timer-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #e67e22;
    min-width: 40px;
    text-align: center;
}

.timer-label { color: #666; font-size: .9rem; }

/* Timer critique (< 10s) */
.timer-display.urgent {
    background: #fde8e8;
    border-color: #e74c3c;
    animation: pulse-timer .8s infinite;
}

@keyframes pulse-timer {
    0%, 100% { opacity: 1; }
    50%       { opacity: .7; }
}

/* ---- Score défi ---- */

.defi-score {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 12px 20px;
    background: #fef9e7;
    border: 2px solid #f1c40f;
    border-radius: 10px;
    margin-bottom: 16px;
}

.defi-stat  { display: flex; flex-direction: column; align-items: center; }
.defi-label { font-size: .8rem; color: #888; font-weight: 600; text-transform: uppercase; }
.defi-value { font-size: 2rem; font-weight: 800; color: #e67e22; }

/* ---- Carte de question ---- */

.question-card {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
}

.question-card .chapter-info {
    margin-bottom: 12px;
}

.chap-badge {
    display: inline-block;
    background: #e8eaf6;
    color: #3949ab;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: .8rem;
    font-weight: 600;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #1a1a2e;
}

/* ---- Boutons réponses QCM ---- */

.answers-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.answer-btn {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    line-height: 1.4;
    transition: border-color .15s, background .15s, transform .1s;
}

.answer-btn:hover:not(:disabled) {
    border-color: #3498db;
    background: #ebf5fb;
    transform: translateY(-1px);
}

.answer-btn:disabled {
    cursor: default;
}

.answer-btn.correct {
    border-color: #27ae60;
    background: #eafaf1;
    color: #1e8449;
    font-weight: 700;
}

.answer-btn.incorrect {
    border-color: #e74c3c;
    background: #fde8e8;
    color: #c0392b;
}

/* ---- Feedback réponse ---- */

.answer-feedback {
    min-height: 28px;
    font-size: .95rem;
    font-weight: 600;
    margin-top: 8px;
}

.feedback-correct   { color: #27ae60; }
.feedback-incorrect { color: #e74c3c; }

/* ---- Navigation ---- */

.quiz-navigation {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* ---- Droite graduée ---- */

.droite-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.droite-validate-btn {
    margin-top: 8px;
}

/* ---- Résultats ---- */

.results-container {
    background: #fff;
    border: 1.5px solid #e0e0e0;
    border-radius: 14px;
    padding: 28px 32px;
    max-width: 640px;
    margin: 0 auto;
}

.results-container h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.4rem;
}

.score-summary {
    text-align: center;
    margin-bottom: 24px;
}

.score-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.score-value {
    font-size: 3.5rem;
    font-weight: 900;
    color: #3498db;
    line-height: 1;
}

.score-total {
    font-size: 1.4rem;
    color: #999;
}

.score-percentage {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a2e;
    margin-top: 4px;
}

.score-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.score-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 22px;
    border-radius: 10px;
    background: #f8f9fa;
    min-width: 90px;
}

.score-detail.correct   { background: #eafaf1; }
.score-detail.incorrect { background: #fde8e8; }

.detail-icon  { font-size: 1.3rem; }
.detail-label { font-size: .8rem; color: #666; }

.detail-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #1a1a2e;
}

.score-detail.correct   .detail-value { color: #27ae60; }
.score-detail.incorrect .detail-value { color: #e74c3c; }

/* ---- Message félicitations ---- */

.congrats-message {
    text-align: center;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.05rem;
    font-weight: 600;
}

.congrats-message.success   { background: #eafaf1; color: #1e8449; }
.congrats-message.good      { background: #fef9e7; color: #d35400; }
.congrats-message.encourage { background: #fde8e8; color: #c0392b; }

/* ---- Détail des réponses ---- */

.questions-review {
    margin-bottom: 24px;
}

.questions-review h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.review-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: .92rem;
    line-height: 1.5;
}

.review-icon   { font-size: 1.1rem; flex-shrink: 0; }
.review-text   { flex: 1; }
.review-answer { color: #555; font-size: .88rem; }

/* ---- Actions résultats ---- */

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---- Responsivité ---- */

@media (max-width: 560px) {
    .answers-container {
        grid-template-columns: 1fr;
    }

    .mode-btn {
        min-width: auto;
        width: 100%;
    }

    .mode-buttons {
        flex-direction: column;
    }

    .results-container {
        padding: 18px 16px;
    }

    .score-value {
        font-size: 2.5rem;
    }
}
