/* ================================================================
   CSS PRINCIPAL - ETEO V2
   ================================================================ */

/* ================================================================
   1. RESET & BASE
   ================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ================================================================
   2. BODY - FOND CLAIR ET ATTIRANT
   ================================================================ */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5, #e8f5e9);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    margin: 0;
}

/* ================================================================
   3. CONTENEUR PRINCIPAL
   ================================================================ */

.container {
    max-width: 600px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    padding: 50px 30px 40px;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ================================================================
   4. LOGO ETEO
   ================================================================ */

.logo-container {
    margin-bottom: 20px;
}

.logo-eteo {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease;
}

.logo-eteo:hover {
    transform: scale(1.02);
}

.subtitle {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 3px;
    color: #7f8c8d;
    margin-top: 8px;
    text-transform: uppercase;
}

/* ================================================================
   5. BETA BANNER
   ================================================================ */

.beta-banner {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 30px;
    padding: 12px 20px;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.beta-banner p {
    color: #e65100;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    margin: 0;
}

/* ================================================================
   6. GRILLE DES LANGUES
   ================================================================ */
/* ================================================================
   6. GRILLE DES LANGUES
   ================================================================ */

.languages-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 25px 0 30px;
    flex-wrap: wrap;
}

.lang-btn {
    padding: 14px 40px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    min-width: 140px;
}

.lang-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #b0bec5;
}

.lang-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
    transform: translateY(-3px);
}

.lang-btn:active {
    transform: scale(0.95);
}

/* ================================================================
   7. BOUTONS D'ACTION (ACCUEIL)
   ================================================================ */

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 25px 0 30px;
}

.listen-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.25);
}

.listen-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(33, 150, 243, 0.35);
}

.listen-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.listen-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.listen-btn.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulseListen 1.2s infinite;
}

@keyframes pulseListen {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

.validate-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
}

.validate-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.35);
}

.validate-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.validate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================================================
   8. FOOTER
   ================================================================ */

.footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e8e8e8;
    font-size: 0.7rem;
    color: #aaa;
}

.footer p {
    margin: 3px 0;
    letter-spacing: 0.5px;
}

/* ================================================================
   9. TOAST
   ================================================================ */

.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 12px 28px;
    border-radius: 30px;
    font-size: 0.85rem;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
}

/* ================================================================
   10. PAGE D'INSCRIPTION
   ================================================================ */

.container-form {
    max-width: 500px;
    padding: 40px 30px 30px;
}

.nav-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 10px;
}

.back-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.back-btn:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.listen-btn-small {
    padding: 8px 16px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(33, 150, 243, 0.2);
}

.listen-btn-small:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.listen-btn-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.listen-btn-small.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulseListen 1.2s infinite;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 700;
}

.form-header p {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-top: 5px;
}

.register-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2c3e50;
    text-align: left;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #b0b0b0;
}

.submit-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #66bb6a, #43a047);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.25);
    margin-top: 10px;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(76, 175, 80, 0.35);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ================================================================
   11. PAGE CHOIX DES SPÉCIALITÉS
   ================================================================ */

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin: 20px 0 30px;
    text-align: left;
}

.specialty-card {
    padding: 14px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    color: #2c3e50;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.specialty-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-color: #667eea;
}

.specialty-card.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25);
}

.specialty-card .emoji {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 4px;
}

.specialties-search {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    font-size: 0.95rem;
    width: 100%;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    background: white;
}

.specialties-search:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.specialties-counter {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 15px;
    text-align: center;
}

/* ================================================================
   12. PAGE QUIZ
   ================================================================ */

.quiz-container {
    max-width: 700px;
}

.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.quiz-progress {
    flex: 1;
    min-width: 100px;
}

.quiz-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.quiz-timer {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e67e22;
    min-width: 80px;
    text-align: right;
}

.quiz-question {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 25px;
    line-height: 1.6;
    min-height: 60px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.quiz-option {
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.quiz-option:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f2ff;
}

.quiz-option.selected {
    border-color: #667eea;
    background: #e8edff;
}

.quiz-option.correct {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

.quiz-option.wrong {
    border-color: #e74c3c;
    background: #ffebee;
    color: #c62828;
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.quiz-option .letter {
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    background: #f0f0f0;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 12px;
    color: #555;
}

.quiz-option.correct .letter {
    background: #4caf50;
    color: white;
}

.quiz-option.wrong .letter {
    background: #e74c3c;
    color: white;
}

.quiz-option.selected .letter {
    background: #667eea;
    color: white;
}

.quiz-feedback {
    padding: 16px 20px;
    border-radius: 16px;
    margin: 15px 0;
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.quiz-feedback.wrong {
    background: #ffebee;
    border-left: 4px solid #e74c3c;
}

.quiz-feedback .points {
    font-weight: 700;
    color: #667eea;
}

.quiz-feedback .explanation {
    margin-top: 8px;
    color: #555;
    font-size: 0.9rem;
}

.quiz-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-top: 20px;
}

.quiz-nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.quiz-nav-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.quiz-nav-btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
}

.quiz-nav-btn.primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.quiz-nav-btn.secondary {
    background: #e74c3c;
    color: white;
}

.quiz-nav-btn.secondary:hover {
    background: #c0392b;
}

/* ================================================================
   13. RÉSULTATS
   ================================================================ */

.quiz-results {
    text-align: center;
    padding: 20px 0;
}

.quiz-results .score {
    font-size: 3.5rem;
    font-weight: 900;
    color: #667eea;
}

.quiz-results .score-label {
    font-size: 1.1rem;
    color: #7f8c8d;
}

.quiz-results .percentage {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 10px 0;
    color: #2c3e50;
}

.quiz-results .badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    margin: 15px 0;
}

.quiz-results .badge.pass {
    background: #e8f5e9;
    color: #2e7d32;
}

.quiz-results .badge.fail {
    background: #ffebee;
    color: #c62828;
}

.quiz-results .result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.quiz-results .result-actions button {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-results .result-actions button:hover {
    transform: translateY(-2px);
}

.quiz-results .result-actions .retry {
    background: #667eea;
    color: white;
}

.quiz-results .result-actions .menu {
    background: #e0e0e0;
    color: #2c3e50;
}

/* ================================================================
   14. RESPONSIVE
   ================================================================ */

@media (max-width: 520px) {
    .container {
        padding: 30px 20px 25px;
        border-radius: 30px;
    }

    .container-form {
        padding: 25px 18px 20px;
    }

    .languages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .logo-eteo {
        max-width: 130px;
    }

    .listen-btn,
    .validate-btn {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .nav-top {
        flex-wrap: wrap;
        gap: 8px;
    }

    .back-btn,
    .listen-btn-small {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .form-header h1 {
        font-size: 1.4rem;
    }

    .form-group input,
    .form-group select {
        padding: 10px 14px;
        font-size: 0.9rem;
    }

    .submit-btn {
        font-size: 0.9rem;
        padding: 12px 16px;
    }

    .specialties-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .specialty-card {
        font-size: 0.75rem;
        padding: 10px 8px;
    }

    .quiz-question {
        font-size: 1rem;
    }

    .quiz-option {
        font-size: 0.85rem;
        padding: 12px 14px;
    }

    .quiz-results .score {
        font-size: 2.8rem;
    }
}

@media (max-width: 400px) {
    .languages-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .lang-btn {
        font-size: 0.8rem;
        padding: 10px 6px;
    }

    .logo-eteo {
        max-width: 100px;
    }

    .subtitle {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .specialties-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }

    .specialty-card {
        font-size: 0.7rem;
        padding: 8px 6px;
    }

    .quiz-nav {
        flex-direction: column;
    }
}

/* ================================================================
   15. FALLBACK (si image non trouvée)
   ================================================================ */

.logo-text-fallback {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: 6px;
}

.logo-text-fallback .letter-e {
    color: #2196F3;
}

.logo-text-fallback .letter-t {
    color: #4CAF50;
}

.logo-text-fallback .letter-o {
    color: #FF9800;
}

/* ================================================================
   16. UTILITAIRES
   ================================================================ */

.text-center {
    text-align: center;
}

.text-muted {
    color: #7f8c8d;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

.hidden {
    display: none !important;
}



/* ================================================================
   PAGE QUIZ (MODULAIRE)
   ================================================================ */

.quiz-container {
    max-width: 800px;
}

/* ===== HEADER DU QUIZ ===== */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
    flex-wrap: wrap;
}

.quiz-progress {
    flex: 1;
    min-width: 150px;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.quiz-timer {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e67e22;
    min-width: 80px;
    text-align: right;
}

.quiz-timer span {
    font-size: 1.5rem;
}

/* ===== ÉCRAN D'ACCUEIL ===== */
.welcome-screen {
    text-align: center;
    padding: 60px 20px;
}

.welcome-screen h1 {
    font-size: 2rem;
    color: #667eea;
    margin-bottom: 15px;
}

.welcome-screen p {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.start-quiz-btn {
    padding: 14px 50px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

.start-quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(76, 175, 80, 0.4);
}

/* ===== ÉCRAN DU QUIZ ===== */
.question-container {
    display: none;
    padding: 10px 0;
}

.question-container.show {
    display: block;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 1.4rem;
    color: #667eea;
    margin: 0 0 5px 0;
}

.header p {
    margin: 0;
    color: #888;
    font-size: 0.95rem;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 20px 0 25px;
    line-height: 1.6;
    min-height: 60px;
}

/* ===== OPTIONS ===== */
.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.option-btn {
    padding: 14px 18px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 14px;
    font-size: 0.95rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #2c3e50;
    font-family: inherit;
}

.option-btn:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f2ff;
    transform: translateX(4px);
}

.option-btn.correct {
    background: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.option-btn.wrong {
    background: #ffebee;
    border-color: #e74c3c;
    color: #c62828;
}

.option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.8;
}

.option-btn.selected {
    border-color: #667eea;
    background: #e8edff;
}

/* ===== FEEDBACK ===== */
.feedback-container {
    padding: 16px 20px;
    border-radius: 14px;
    margin: 15px 0;
    display: none;
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.feedback-container.wrong {
    background: #ffebee;
    border-left-color: #e74c3c;
}

.feedback-container .points-badge {
    font-weight: 700;
    margin-left: 10px;
}

.feedback-container .points-badge.correct {
    color: #4caf50;
}

.feedback-container .points-badge.wrong {
    color: #e74c3c;
    font-size: 0.85rem;
}

/* ===== EXPLICATION ===== */
.explanation-box {
    background: #f5f5f5;
    border-radius: 14px;
    padding: 16px 20px;
    margin: 15px 0;
    display: none;
    border-left: 4px solid #667eea;
}

.explanation-box.show {
    display: block;
}

.explanation-title {
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.explanation-box .correct-answer {
    color: #4caf50;
    font-weight: 700;
    margin-top: 8px;
}

/* ===== SCORE ===== */
.score {
    font-size: 1rem;
    color: #2c3e50;
    margin: 10px 0;
    font-weight: 600;
}

/* ===== NAVIGATION ===== */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.nav-btn {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    flex: 1;
}

.nav-btn:first-child {
    background: #e74c3c;
    color: white;
}

.nav-btn:first-child:hover {
    background: #c0392b;
}

.nav-btn:last-child {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.nav-btn:last-child:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

/* ===== RÉSULTATS ===== */
.result-container {
    text-align: center;
    padding: 40px 20px;
    display: none;
}

.result-container.show {
    display: block;
}

.result-container h2 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 10px;
}

.final-score {
    font-size: 3rem;
    font-weight: 900;
    color: #667eea;
    margin: 20px 0;
}

.percentage {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 10px 0;
}

.message {
    font-size: 1.1rem;
    color: #7f8c8d;
    margin: 10px 0 20px;
}

.unlock-badge {
    display: inline-block;
    background: #4caf50;
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    margin: 15px 0;
}

.locked-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    padding: 10px 30px;
    border-radius: 30px;
    font-weight: 700;
    margin: 15px 0;
}

.result-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 25px;
}

.result-buttons button {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.result-buttons button:hover {
    transform: translateY(-3px);
}

.btn-menu {
    background: #3498db;
    color: white;
}

.btn-menu:hover {
    background: #2980b9;
}

.btn-progression {
    background: #9b59b6;
    color: white;
}

.btn-progression:hover {
    background: #8e44ad;
}

.btn-ranking {
    background: #f39c12;
    color: white;
}

.btn-ranking:hover {
    background: #e67e22;
}

/* ===== NIVEAU SELECTOR ===== */
.level-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 10px 0 20px;
}

.level-btn {
    padding: 8px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #2c3e50;
}

.level-btn:hover {
    border-color: #9b59b6;
}

.level-btn.active {
    border-color: #9b59b6;
    background: #9b59b6;
    color: white;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 520px) {
    .quiz-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .quiz-timer {
        text-align: center;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .option-btn {
        font-size: 0.85rem;
        padding: 12px 14px;
    }
    
    .final-score {
        font-size: 2.2rem;
    }
    
    .nav-buttons {
        flex-direction: column;
    }
    
    .nav-btn {
        padding: 10px 20px;
    }
    
    .result-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .result-buttons button {
        width: 100%;
        max-width: 250px;
    }
    
    .level-selector {
        flex-wrap: wrap;
    }
}

@media (max-width: 400px) {
    .welcome-screen h1 {
        font-size: 1.5rem;
    }
    
    .start-quiz-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }
    
    .question-text {
        font-size: 0.9rem;
    }
    
    .option-btn {
        font-size: 0.8rem;
        padding: 10px 12px;
    }
}


/* ================================================================
   CORRECTION : FORCER LE BOUTON TTS À RESTER CLIQUABLE
   ================================================================ */

/* Le bouton "Écouter" doit toujours être cliquable */
#listenBtn,
.listen-btn {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Même avec la classe listening */
#listenBtn.listening,
.listen-btn.listening {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Même quand disabled (on ne l'utilise plus) */
#listenBtn:disabled,
.listen-btn:disabled {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Même avec l'attribut disabled */
#listenBtn[disabled],
.listen-btn[disabled] {
    pointer-events: auto !important;
    cursor: pointer !important;
    opacity: 1 !important;
}

/* Annuler le cursor not-allowed pour le bouton écouter */
#listenBtn:disabled,
.listen-btn:disabled {
    cursor: pointer !important;
}


/* ============================================================
   SYNOPSIS
   ============================================================ */
/* ============================================================
   SYNOPSIS
   ============================================================ */

.synopsis-container {
    background: #f0f4ff;
    border-radius: 16px;
    padding: 20px;
    margin: 15px 0 25px;
    border-left: 4px solid #667eea;
    text-align: left;
}

.synopsis-container p {
    margin: 0 0 15px 0;
    font-size: 0.95rem;
    color: #2c3e50;
    line-height: 1.6;
}

.listen-synopsis-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.listen-synopsis-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.listen-synopsis-btn.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulseListen 1.2s infinite;
}

/* ============================================================
   6 NIVEAUX AVEC STATUT
   ============================================================ */

.level-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.level-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    border-radius: 16px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    gap: 15px;
    flex-wrap: wrap;
}

body.dark .level-card {
    background: #2a2a3e;
    border-color: #444;
}

.level-info h3 {
    font-size: 1rem;
    margin: 0 0 4px 0;
    color: #2c3e50;
}

body.dark .level-info h3 {
    color: #eee;
}

.level-score {
    font-size: 0.8rem;
    color: #7f8c8d;
}

body.dark .level-score {
    color: #aaa;
}

.level-status {
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 2px;
}

.status-unlocked {
    color: #2196F3;
}

.status-locked {
    color: #e74c3c;
}

.status-completed {
    color: #4caf50;
}

.status-active {
    color: #ff9800;
}

.level-start-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.level-start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.level-start-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-start-btn.active {
    background: #4caf50;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 520px) {
    .level-card {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .level-start-btn {
        width: 100%;
    }
    
    .synopsis-container {
        padding: 15px;
    }
    
    .synopsis-container p {
        font-size: 0.85rem;
    }
}

/* ============================================================
   NIVEAUX EN GRILLE 2x2 (comme choix spécialités)
   ============================================================ */

.level-grid-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.level-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.level-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 50px;
}

body.dark .level-btn-small {
    background: #2a2a3e;
    border-color: #444;
    color: #eee;
}

.level-btn-small:hover:not(.completed) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.level-btn-small.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.level-btn-small.completed {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

body.dark .level-btn-small.completed {
    background: #1a3a2a;
    border-color: #4caf50;
    color: #81c784;
}

.level-emoji {
    font-size: 1rem;
}

.level-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.level-score-badge {
    font-size: 0.7rem;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

body.dark .level-score-badge {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 520px) {
    .level-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .level-btn-small {
        font-size: 0.75rem;
        padding: 10px 8px;
        min-height: 44px;
    }
    
    .level-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .level-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .level-btn-small {
        font-size: 0.65rem;
        padding: 8px 6px;
        min-height: 38px;
    }
}


/* ============================================================
   NIVEAUX EN GRILLE 2x2 (centrés)
   ============================================================ */

.level-grid-horizontal {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

.level-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.level-btn-small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: transparent;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
    min-height: 50px;
    text-align: center;
}

body.dark .level-btn-small {
    border-color: #444;
    color: #eee;
}

.level-btn-small:hover:not(.completed) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.level-btn-small.active {
    border-color: #4caf50;
    background: #4caf50;
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.level-btn-small.completed {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
}

body.dark .level-btn-small.completed {
    background: #1a3a2a;
    border-color: #4caf50;
    color: #81c784;
}

.level-label {
    font-size: 0.8rem;
    font-weight: 600;
}

.level-score-badge {
    font-size: 0.65rem;
    background: rgba(0, 0, 0, 0.08);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 700;
}

body.dark .level-score-badge {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================================
   BOUTON "Écouter l'histoire" centré
   ============================================================ */

.synopsis-container {
    text-align: center;
}

.listen-synopsis-btn {
    margin: 0 auto;
    display: inline-block;
}

/* ============================================================
   BOUTON "Commencer" centré
   ============================================================ */

.start-quiz-btn {
    display: block;
    margin: 0 auto;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 520px) {
    .level-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        max-width: 100%;
    }
    
    .level-btn-small {
        font-size: 0.75rem;
        padding: 10px 8px;
        min-height: 44px;
    }
    
    .level-label {
        font-size: 0.7rem;
    }
}

@media (max-width: 400px) {
    .level-row {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .level-btn-small {
        font-size: 0.65rem;
        padding: 8px 6px;
        min-height: 38px;
    }
}


/* ============================================================
   STYLES V1 POUR LE QUIZ - AJOUTS V2
   ============================================================ */

/* --- BOUTONS VOCAUX --- */
.voice-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    margin: 8px 0;
    transition: all 0.3s;
    min-width: 180px;
}

.voice-btn:hover:not(:disabled) {
    transform: scale(1.02);
    background: #5a6fd6;
}

.voice-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.voice-btn.feedback-btn-style { 
    background: #4caf50; 
}

.voice-btn.feedback-btn-style:hover:not(:disabled) { 
    background: #43a047; 
}

.voice-btn.explanation-btn-style { 
    background: #2196F3; 
}

.voice-btn.explanation-btn-style:hover:not(:disabled) { 
    background: #1976D2; 
}

.voice-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}

/* --- FEEDBACK CONTAINER --- */
.feedback-container {
    background: rgba(76, 175, 80, 0.1);
    border-radius: 15px;
    padding: 15px;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.feedback-container.wrong { 
    background: rgba(244, 67, 54, 0.1); 
}

.feedback-container .points-badge { 
    font-weight: bold; 
    margin-left: 10px; 
}

.feedback-container .points-badge.correct { 
    color: #4caf50; 
}

.feedback-container .points-badge.wrong { 
    color: #888; 
    font-size: 0.8rem; 
}

/* --- TIMER EN BAS --- */
.timer-bottom {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ff5722;
    margin: 15px 0;
    text-align: center;
}

/* --- TITRE DU QUIZ --- */
.quiz-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #667eea;
    text-align: center;
    margin-bottom: 15px;
}

/* --- BOUTONS TTS (style V1) --- */
.tts-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: bold;
    margin: 5px 0;
    transition: all 0.3s;
    min-width: 160px;
}

.tts-btn:hover:not(:disabled) {
    transform: scale(1.02);
    background: #5a6fd6;
}

.tts-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.tts-btn.listening {
    background: #ff5722;
    animation: pulse 1s infinite;
}

.tts-btn.tts-feedback-btn {
    background: #4caf50;
}

.tts-btn.tts-feedback-btn:hover:not(:disabled) {
    background: #43a047;
}

.tts-btn.tts-explanation-btn {
    background: #2196F3;
}

.tts-btn.tts-explanation-btn:hover:not(:disabled) {
    background: #1976D2;
}

.tts-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 8px 0;
}

/* --- ANIMATION PULSE --- */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}



/* ============================================================
   AJOUTS POUR CHOIX DES SPÉCIALITÉS (VERSION ENRICHIE)
   ============================================================ */

/* --- STATISTIQUES --- */
.specialties-stats {
    display: flex;
    justify-content: center;
    gap: 15px;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 8px;
    flex-wrap: wrap;
}

.stat-divider {
    color: #ddd;
}

/* --- FILTRES --- */
.filter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    background: transparent;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.filter-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

body.dark .filter-btn {
    color: #eee;
    border-color: #444;
}

body.dark .filter-btn.active {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* --- CARTES SPÉCIALITÉS AVEC BADGES --- */
.specialty-card {
    position: relative;
    padding: 14px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    text-align: center;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.specialty-card .specialty-name {
    display: block;
    margin-top: 4px;
}

.specialty-card .category-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.7rem;
    opacity: 0.5;
}

.specialty-card .last-visited-badge {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 0.55rem;
    background: rgba(102, 126, 234, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
    color: #667eea;
}

.specialty-card.last-visited {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

body.dark .specialty-card .last-visited-badge {
    background: rgba(102, 126, 234, 0.2);
    color: #8a9ada;
}

body.dark .specialty-card.last-visited {
    border-color: #7a8ada;
    background: rgba(102, 126, 234, 0.08);
}

/* --- RESPONSIVE --- */
@media (max-width: 520px) {
    .specialties-stats {
        font-size: 0.7rem;
        gap: 8px;
    }
    
    .filter-container {
        gap: 6px;
    }
    
    .filter-btn {
        font-size: 0.7rem;
        padding: 6px 12px;
    }
    
    .specialty-card .last-visited-badge {
        font-size: 0.5rem;
        padding: 1px 6px;
    }
}


/* ============================================================
   TABLEAU DE BORD (DASHBOARD)
   ============================================================ */

.dashboard-container {
    max-width: 900px;
}

/* --- EN-TÊTE --- */
.dashboard-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 30px;
    color: white;
    margin-bottom: 25px;
}

.user-greeting {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.greeting-emoji {
    margin-right: 10px;
}

.user-rank {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rank-badge {
    font-size: 2rem;
}

.rank-name {
    font-size: 1.2rem;
    font-weight: 700;
}

.rank-progress {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* --- STATISTIQUES --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #e8e8e8;
    transition: all 0.3s ease;
}

body.dark .stat-card {
    background: #1e1e2e;
    border-color: #333;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #2c3e50;
}

body.dark .stat-value {
    color: #eee;
}

.stat-label {
    font-size: 0.75rem;
    color: #888;
    margin-top: 4px;
}

/* --- PROGRESSION --- */
.progress-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
}

body.dark .progress-section {
    background: #1e1e2e;
    border-color: #333;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.progress-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

body.dark .progress-title {
    color: #eee;
}

.progress-percentage {
    font-weight: 700;
    font-size: 1.1rem;
    color: #667eea;
}

.progress-bar-large {
    width: 100%;
    height: 12px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

body.dark .progress-bar-large {
    background: #333;
}

.progress-fill-large {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
}

.progress-details {
    text-align: center;
    font-size: 0.85rem;
    color: #888;
    margin-top: 8px;
}

/* --- DÉFI DU JOUR --- */
.daily-challenge {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 5px solid #ffc107;
}

body.dark .daily-challenge {
    background: linear-gradient(135deg, #2a2515, #3d3520);
    border-left-color: #ffc107;
}

.challenge-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.challenge-icon {
    font-size: 1.5rem;
}

.challenge-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

body.dark .challenge-title {
    color: #eee;
}

.challenge-content p {
    margin: 0 0 8px 0;
    color: #555;
}

body.dark .challenge-content p {
    color: #bbb;
}

.challenge-progress {
    font-weight: 600;
    color: #ff9800;
}

/* --- DERNIÈRES SPÉCIALITÉS --- */
.recent-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
}

body.dark .recent-section {
    background: #1e1e2e;
    border-color: #333;
}

.recent-header {
    margin-bottom: 15px;
}

.recent-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

body.dark .recent-title {
    color: #eee;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark .recent-item {
    background: #2a2a3e;
}

.recent-item:hover {
    transform: translateX(4px);
    background: #e8edff;
}

body.dark .recent-item:hover {
    background: #33335a;
}

.recent-emoji {
    font-size: 1.2rem;
}

.recent-name {
    flex: 1;
    font-weight: 500;
    margin-left: 10px;
    color: #2c3e50;
}

body.dark .recent-name {
    color: #eee;
}

.recent-score {
    font-weight: 700;
    color: #667eea;
    margin-right: 10px;
}

.recent-status {
    font-size: 1rem;
}

/* --- RECOMMANDATION --- */
.recommendation-section {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border-left: 5px solid #4caf50;
}

body.dark .recommendation-section {
    background: linear-gradient(135deg, #1a2a1a, #2a3a2a);
    border-left-color: #4caf50;
}

.recommendation-header {
    margin-bottom: 8px;
}

.recommendation-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

body.dark .recommendation-title {
    color: #eee;
}

.recommendation-content p {
    margin: 0 0 10px 0;
    color: #555;
}

body.dark .recommendation-content p {
    color: #bbb;
}

.recommendation-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.recommendation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

/* --- BADGES --- */
.badges-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
}

body.dark .badges-section {
    background: #1e1e2e;
    border-color: #333;
}

.badges-header {
    margin-bottom: 15px;
}

.badges-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

body.dark .badges-title {
    color: #eee;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    border: 2px solid #e8e8e8;
    text-align: center;
    transition: all 0.3s ease;
}

body.dark .badge-item {
    border-color: #444;
}

.badge-item.unlocked {
    border-color: #4caf50;
    background: #e8f5e9;
}

body.dark .badge-item.unlocked {
    background: #1a3a2a;
    border-color: #4caf50;
}

.badge-item.locked {
    opacity: 0.5;
}

.badge-emoji {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.badge-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #2c3e50;
}

body.dark .badge-name {
    color: #eee;
}

.badge-status {
    font-size: 0.7rem;
    margin-top: 4px;
}

/* --- ACTIONS --- */
.dashboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.action-btn.secondary {
    background: #e8e8e8;
    color: #2c3e50;
}

body.dark .action-btn.secondary {
    background: #333;
    color: #eee;
}

.action-btn.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-header {
        padding: 20px;
    }
    
    .user-greeting {
        font-size: 1.2rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    
    .badges-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .dashboard-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .action-btn {
        width: 100%;
        max-width: 280px;
    }
}



/* ============================================================
   BOUTON TABLEAU DE BORD (INDEX)
   ============================================================ */

.dashboard-btn {
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.25);
    width: 100%;
    margin-top: 5px;
}

.dashboard-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(155, 89, 182, 0.35);
}

.dashboard-btn:active {
    transform: scale(0.95);
}


/* ============================================================
   BOUTON DASHBOARD DANS LA NAVIGATION
   ============================================================ */

.dashboard-nav-btn {
    padding: 8px 16px;
    border: 2px solid #9b59b6;
    border-radius: 30px;
    background: transparent;
    color: #9b59b6;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.dashboard-nav-btn:hover {
    background: #9b59b6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

body.dark .dashboard-nav-btn {
    border-color: #8a7ada;
    color: #8a7ada;
}

body.dark .dashboard-nav-btn:hover {
    background: #8a7ada;
    color: #1a1a2e;
}


/* ============================================================
   BOUTON "VOIR LES NIVEAUX" (RÉSULTATS)
   ============================================================ */

.btn-levels {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    margin: 10px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-levels:hover {
    background: linear-gradient(135deg, #f57c00, #e65100);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

/* ============================================================
   ÉCRAN DE FIN EXPERT 2 (CERTIFICATION)
   ============================================================ */

.expert-final-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    animation: expertFadeIn 0.8s ease;
}

@keyframes expertFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.expert-final-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    color: white;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.expert-final-header::before {
    content: "🏆";
    position: absolute;
    font-size: 8rem;
    right: -20px;
    top: -20px;
    opacity: 0.1;
}

.expert-final-badge {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.expert-final-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
}

.expert-final-title span {
    color: #ffd700;
}

.expert-final-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 5px;
}

.expert-final-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 25px;
}

.expert-stat-item {
    background: white;
    border-radius: 14px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .expert-stat-item {
    background: #1e1e2e;
    border-color: #333;
}

.expert-stat-icon {
    font-size: 1.5rem;
    display: block;
}

.expert-stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #2c3e50;
    display: block;
}

body.dark .expert-stat-value {
    color: #eee;
}

.expert-stat-label {
    font-size: 0.65rem;
    color: #888;
}

.expert-final-divider {
    text-align: center;
    margin: 25px 0;
    position: relative;
}

.expert-final-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #667eea, transparent);
}

.expert-final-divider span {
    background: #f5f5f5;
    padding: 0 20px;
    font-weight: 700;
    color: #667eea;
    position: relative;
    font-size: 0.9rem;
}

body.dark .expert-final-divider span {
    background: #1a1a2e;
}

.expert-certification-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    border: 2px solid #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    margin-bottom: 20px;
}

body.dark .expert-certification-section {
    background: #1a1a2e;
    border-color: #7a8ada;
}

.expert-cert-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.expert-certification-section h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

body.dark .expert-certification-section h2 {
    color: #eee;
}

.expert-certification-section > p {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.expert-cert-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    text-align: left;
    margin-bottom: 20px;
}

.expert-cert-detail {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #2c3e50;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

body.dark .expert-cert-detail {
    background: #2a2a3e;
    color: #ddd;
}

.detail-icon {
    font-size: 1.2rem;
}

.expert-cert-detail strong {
    color: #667eea;
}

.expert-final-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.expert-btn-primary {
    padding: 14px 35px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #f57c00, #e65100);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.expert-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 124, 0, 0.4);
}

.expert-btn-secondary {
    padding: 14px 35px;
    border: 2px solid #667eea;
    border-radius: 30px;
    background: transparent;
    color: #667eea;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.expert-btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-3px);
}

body.dark .expert-btn-secondary {
    color: #8a9ada;
    border-color: #8a9ada;
}

body.dark .expert-btn-secondary:hover {
    background: #8a9ada;
    color: #1a1a2e;
}

.expert-final-message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: #f0f4ff;
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 20px;
    border-left: 4px solid #667eea;
}

body.dark .expert-final-message {
    background: #1a1a3e;
    border-left-color: #7a8ada;
}

.expert-avatar {
    font-size: 2rem;
    flex-shrink: 0;
}

.expert-final-message p {
    margin: 0;
    font-size: 0.95rem;
    color: #2c3e50;
    line-height: 1.6;
}

body.dark .expert-final-message p {
    color: #ccddee;
}

.expert-final-message p span {
    color: #667eea;
    font-weight: 700;
}

.expert-final-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 10px;
}

.expert-btn-menu {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    background: #3498db;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expert-btn-menu:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.expert-btn-dashboard {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    background: #9b59b6;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.expert-btn-dashboard:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* --- EXAM --- */
.exam-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.exam-header {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    color: white;
    margin-bottom: 20px;
}

.exam-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.exam-header p {
    margin: 5px 0 10px 0;
    opacity: 0.9;
}

.exam-progress {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.exam-question {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 20px 0;
    color: #2c3e50;
}

body.dark .exam-question {
    color: #eee;
}

.exam-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.exam-options .option-btn {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
    padding: 14px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.3s ease;
}

body.dark .exam-options .option-btn {
    background: #2a2a3e;
    border-color: #444;
    color: #eee;
}

.exam-options .option-btn:hover:not(.disabled) {
    border-color: #667eea;
    background: #f0f4ff;
}

.exam-options .option-btn.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.exam-options .option-btn.wrong {
    border-color: #e74c3c;
    background: #ffebee;
}

.exam-options .option-btn.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.exam-feedback {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 15px;
    display: none;
}

.exam-feedback.correct {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.exam-feedback.wrong {
    background: #ffebee;
    border-left: 4px solid #e74c3c;
}

.exam-next-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.exam-next-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.exam-next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
    .expert-final-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .expert-cert-details {
        grid-template-columns: 1fr;
    }
    
    .expert-final-title {
        font-size: 1.4rem;
    }
    
    .expert-btn-primary,
    .expert-btn-secondary {
        min-width: 100%;
    }
    
    .expert-final-buttons {
        flex-direction: column;
    }
}


/* ============================================================
   ÉCRAN DE CHAPITRE
   ============================================================ */

.chapter-screen {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    animation: chapterFadeIn 0.8s ease;
}

@keyframes chapterFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.chapter-header {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 20px;
    color: white;
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.chapter-header::before {
    content: "📖";
    position: absolute;
    font-size: 6rem;
    right: -10px;
    top: -10px;
    opacity: 0.1;
}

.chapter-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 10px;
}

.chapter-level {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.chapter-header h2 {
    font-size: 1.6rem;
    margin: 0;
    font-weight: 700;
}

.chapter-content {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body.dark .chapter-content {
    background: #1e1e2e;
    border-color: #333;
}

.chapter-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #2c3e50;
    margin: 0;
}

body.dark .chapter-content p {
    color: #ddd;
}

.chapter-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.chapter-actions .listen-chapter-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #42a5f5, #1e88e5);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.chapter-actions .listen-chapter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.chapter-actions .listen-chapter-btn.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulseListen 1.2s infinite;
}

.chapter-actions .start-chapter-quiz-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #4caf50, #43a047);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.chapter-actions .start-chapter-quiz-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.3);
}

@keyframes pulseListen {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
    .chapter-header h2 {
        font-size: 1.2rem;
    }
    
    .chapter-content p {
        font-size: 0.95rem;
    }
    
    .chapter-actions {
        flex-direction: column;
    }
    
    .chapter-actions .listen-chapter-btn,
    .chapter-actions .start-chapter-quiz-btn {
        min-width: 100%;
    }
}



/* ============================================================
   QUIZ DU JOUR - ROULETTE & ABONNEMENT
   ============================================================ */

/* --- Bouton Lancer --- */
.roulette-spin-btn {
    padding: 14px 40px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #f57c00, #e65100);
    color: white;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(245, 124, 0, 0.3);
}

.roulette-spin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 8px 35px rgba(245, 124, 0, 0.4);
}

.roulette-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* --- Résultat du tirage --- */
.roulette-result {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 12px 18px;
    background: #f0f4ff;
    border-radius: 16px;
    border-left: 4px solid #667eea;
    margin: 10px 0;
    min-height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.roulette-result .highlight {
    color: #667eea;
    font-weight: 800;
}

/* --- Bouton Rejouer --- */
.roulette-replay-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
}

.roulette-replay-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.35);
}

/* --- Cartes d'abonnement --- */
.subscription-card {
    background: white;
    border-radius: 16px;
    padding: 18px 12px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subscription-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

body.dark .subscription-card {
    background: #1e1e2e;
    border-color: #444;
}

body.dark .subscription-card .subscribe-btn {
    background: #7a8ada;
}

/* --- Responsive --- */
@media (max-width: 520px) {
    .roulette-spin-btn {
        font-size: 1rem;
        padding: 12px 30px;
    }
    
    .roulette-result {
        font-size: 0.95rem;
        padding: 10px 14px;
    }
    
    .subscription-card {
        padding: 14px 10px;
    }
    
    .subscription-card .subscribe-btn {
        font-size: 0.75rem;
        padding: 6px 14px;
    }
}

@media (max-width: 400px) {
    #subscriptionScreen .subscription-card {
        padding: 10px 8px;
    }
    
    .roulette-spin-btn {
        font-size: 0.9rem;
        padding: 10px 24px;
    }
}




/* ============================================================
   BADGE HELP MODAL - INSTRUCTIONS DES BADGES
   ============================================================ */

/* --- Bouton "Instructions badges" --- */
.badge-help-btn {
    margin-left: auto;
    padding: 6px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-help-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* --- Overlay (fond sombre) --- */
.badge-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.badge-modal-overlay.active {
    display: flex;
}

/* --- Modale --- */
.badge-modal {
    background: white;
    border-radius: 24px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease;
}
body.dark .badge-modal {
    background: #1a1a2e;
    color: #eee;
}

/* --- En-tête --- */
.badge-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}
body.dark .badge-modal-header {
    border-bottom-color: #33335a;
}
.badge-modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}
.badge-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
    transition: all 0.3s ease;
    padding: 0 10px;
}
.badge-modal-close:hover {
    color: #e74c3c;
    transform: rotate(90deg);
}

/* --- Cartes des badges --- */
.badge-instruction-card {
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: #f8f9ff;
}
body.dark .badge-instruction-card {
    background: #2a2a4a;
}
.badge-instruction-card.unlocked {
    border-left-color: #4caf50;
    background: #e8f5e9;
}
body.dark .badge-instruction-card.unlocked {
    background: #1e3a2e;
}
.badge-instruction-card.locked {
    border-left-color: #e74c3c;
    background: #fef0ef;
}
body.dark .badge-instruction-card.locked {
    background: #3a1e1e;
}
.badge-instruction-icon {
    font-size: 2rem;
    flex-shrink: 0;
}
.badge-instruction-content {
    flex: 1;
}
.badge-instruction-name {
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.badge-instruction-status {
    font-size: 0.7rem;
    padding: 2px 12px;
    border-radius: 12px;
    font-weight: 600;
}
.badge-instruction-status.unlocked {
    background: #4caf50;
    color: white;
}
.badge-instruction-status.locked {
    background: #e74c3c;
    color: white;
}
.badge-instruction-desc {
    font-size: 0.9rem;
    color: #555;
    margin: 4px 0;
}
body.dark .badge-instruction-desc {
    color: #bbb;
}
.badge-instruction-tip {
    font-size: 0.8rem;
    color: #888;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
    display: inline-block;
    margin-top: 4px;
}
body.dark .badge-instruction-tip {
    background: rgba(102, 126, 234, 0.2);
}

/* --- Cadeau de fin --- */
.badge-modal-gift {
    background: linear-gradient(135deg, #fff8e1, #fff3cd);
    border: 2px dashed #ffc107;
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
    text-align: center;
}
body.dark .badge-modal-gift {
    background: #2a2410;
    border-color: #ffc107;
}
.badge-modal-gift-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #f57c00;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.badge-modal-gift-text {
    font-size: 0.95rem;
    color: #555;
    margin-top: 8px;
}
body.dark .badge-modal-gift-text {
    color: #ccc;
}

/* --- Boutons d'action --- */
.badge-modal-listen {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 12px;
    flex-wrap: wrap;
}
.badge-modal-listen-btn {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    border-radius: 30px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}
.badge-modal-listen-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.badge-modal-listen-btn.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    animation: pulseListen 1.2s infinite;
}

/* --- Animation d'ouverture --- */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- Responsive --- */
@media (max-width: 520px) {
    .badge-modal {
        padding: 20px;
        margin: 10px;
    }
    .badge-instruction-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .badge-modal-listen {
        flex-direction: column;
    }
    .badge-modal-listen-btn {
        width: 100%;
        justify-content: center;
    }
}



/* ============================================================
   BADGE UNLOCK - NOTIFICATION
   ============================================================ */

/* --- TOAST DE BADGE --- */
.badge-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 16px 28px;
    border-radius: 16px;
    font-size: 0.95rem;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUpBadge 0.5s ease;
    border-left: 5px solid #ffd700;
    max-width: 90%;
    text-align: center;
}

.badge-toast .badge-emoji {
    font-size: 1.8rem;
    margin-right: 10px;
}

.badge-toast .badge-name {
    font-weight: 700;
    color: #ffd700;
}

@keyframes slideUpBadge {
    from { opacity: 0; transform: translateX(-50%) translateY(30px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- MODALE DE BADGE DÉBLOQUÉ --- */
.badge-unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.badge-unlock-modal {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: bounceInModal 0.5s ease;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
}

body.dark .badge-unlock-modal {
    background: #1a1a2e;
    color: #eee;
}

@keyframes bounceInModal {
    0% { opacity: 0; transform: scale(0.7); }
    50% { transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.badge-unlock-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 10px;
}

.badge-unlock-modal h2 {
    font-size: 1.5rem;
    color: #667eea;
    margin: 10px 0;
}

body.dark .badge-unlock-modal h2 {
    color: #8a9ada;
}

.badge-unlock-modal p {
    color: #888;
    font-size: 0.95rem;
    margin: 8px 0;
}

body.dark .badge-unlock-modal p {
    color: #bbb;
}

.badge-unlock-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 16px;
    margin: 15px 0;
    border: 2px solid #667eea;
}

body.dark .badge-unlock-badge {
    background: #2a2a4a;
    border-color: #8a9ada;
}

.badge-unlock-badge .badge-emoji {
    font-size: 3rem;
}

.badge-unlock-badge .badge-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
}

body.dark .badge-unlock-badge .badge-name {
    color: #eee;
}

.badge-desc {
    color: #888;
    font-size: 0.95rem;
    margin: 10px 0;
}

.badge-unlock-btn {
    padding: 12px 40px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.badge-unlock-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}


/* ============================================================
   AVATAR UPLOAD
   ============================================================ */

.profile-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
    cursor: pointer;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-initials {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.avatar-upload-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 0;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.profile-avatar:hover .avatar-upload-overlay {
    opacity: 1;
}

.avatar-upload-label {
    color: white;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    display: block;
    letter-spacing: 0.5px;
}

.avatar-upload-label .icon {
    font-size: 0.8rem;
}


/* ============================================================
   CLASSEMENT PAGE - STYLES
   ============================================================ */

.classement-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

.classement-header {
    text-align: center;
    margin-bottom: 30px;
}

.classement-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

body.dark .classement-header h1 {
    color: #ecf0f1;
}

.classement-header p {
    color: #888;
    font-size: 1rem;
    margin-top: 5px;
}

/* ---- STATS ---- */
.ranking-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.ranking-stats .stat-item {
    background: white;
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .ranking-stats .stat-item {
    background: #1e1e2e;
    border-color: #333;
}

.ranking-stats .stat-item .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #667eea;
    display: block;
}

body.dark .ranking-stats .stat-item .number {
    color: #8a9ada;
}

.ranking-stats .stat-item .label {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* ---- RECHERCHE ---- */
.ranking-search {
    margin-bottom: 20px;
}

.ranking-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

body.dark .ranking-search-input {
    background: #2a2a3e;
    border-color: #444;
    color: #eee;
}

.ranking-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

/* ---- TABLEAU ---- */
.ranking-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .ranking-table-container {
    background: #1e1e2e;
    border-color: #333;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ranking-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e8e8e8;
}

body.dark .ranking-table thead {
    background: #2a2a3e;
    border-bottom-color: #444;
}

.ranking-table thead th {
    padding: 14px 12px;
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark .ranking-table thead th {
    color: #aaa;
}

.ranking-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

body.dark .ranking-table tbody tr {
    border-bottom-color: #333;
}

.ranking-table tbody tr:hover {
    background: #f8f9fa;
}

body.dark .ranking-table tbody tr:hover {
    background: #2a2a3e;
}

.ranking-table tbody tr.top-three {
    background: #f0f4ff;
}

body.dark .ranking-table tbody tr.top-three {
    background: #1a1a3e;
}

.ranking-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    text-align: center;
    font-size: 0.85rem;
}

/* ---- COLONNES ---- */
.rank-col {
    width: 50px;
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
}

body.dark .rank-col {
    color: #ddd;
}

.medal-col {
    width: 40px;
    text-align: center;
    font-size: 1.3rem;
}

.name-col {
    min-width: 150px;
    text-align: center;
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
}

body.dark .user-name {
    color: #eee;
}

.you-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    font-size: 0.6rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 600;
    margin-left: 8px;
}

.country-col {
    color: #555;
    text-align: center;
}

body.dark .country-col {
    color: #aaa;
}

.levels-col {
    color: #555;
    font-weight: 500;
    text-align: center;
}

body.dark .levels-col {
    color: #aaa;
}

.score-col {
    font-weight: 700;
    text-align: center;
}

.score-value {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 700;
    display: inline-block;
}

.score-value.excellent {
    background: #e8f5e9;
    color: #2e7d32;
}

body.dark .score-value.excellent {
    background: #1a3a2a;
    color: #81c784;
}

.score-value.good {
    background: #fff3e0;
    color: #e65100;
}

body.dark .score-value.good {
    background: #2a1a0a;
    color: #ffb74d;
}

.score-value.average {
    background: #f5f5f5;
    color: #888;
}

body.dark .score-value.average {
    background: #2a2a3e;
    color: #888;
}

.badges-col {
    text-align: center;
    color: #555;
}

body.dark .badges-col {
    color: #aaa;
}

/* ---- PAGINATION ---- */
.ranking-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    border-top: 1px solid #e8e8e8;
}

body.dark .ranking-pagination {
    border-top-color: #333;
}

.pagination-btn {
    padding: 8px 24px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    background: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: #2c3e50;
    transition: all 0.3s ease;
}

body.dark .pagination-btn {
    background: #2a2a3e;
    border-color: #444;
    color: #eee;
}

.pagination-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f0f4ff;
}

body.dark .pagination-btn:hover:not(:disabled) {
    border-color: #8a9ada;
    background: #2a2a4a;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: #888;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .ranking-table {
        font-size: 0.8rem;
    }
    .ranking-table thead th,
    .ranking-table tbody td {
        padding: 10px 8px;
    }
    .rank-col {
        width: 35px;
    }
    .medal-col {
        width: 30px;
        font-size: 1rem;
    }
    .name-col {
        min-width: 100px;
    }
    .you-badge {
        font-size: 0.5rem;
        padding: 1px 6px;
    }
    .ranking-pagination {
        flex-wrap: wrap;
        gap: 10px;
    }
    .pagination-btn {
        padding: 6px 16px;
        font-size: 0.75rem;
    }
}

@media (max-width: 520px) {
    .ranking-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .ranking-stats .stat-item .number {
        font-size: 1.4rem;
    }
    .ranking-table .country-col,
    .ranking-table .badges-col {
        display: none;
    }
    .ranking-table thead th.country-col,
    .ranking-table thead th.badges-col {
        display: none;
    }
}

/* ============================================================
   PROGRESSION PAGE - STYLES
   ============================================================ */

.progression-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

.progression-header {
    text-align: center;
    margin-bottom: 30px;
}

.progression-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

body.dark .progression-header h1 {
    color: #ecf0f1;
}

.progression-header p {
    color: #888;
    font-size: 1rem;
    margin-top: 5px;
}

/* ---- STATS PROGRESSION ---- */
.progression-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.progression-stats .stat-item {
    background: white;
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .progression-stats .stat-item {
    background: #1e1e2e;
    border-color: #333;
}

.progression-stats .stat-item .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #667eea;
    display: block;
}

body.dark .progression-stats .stat-item .number {
    color: #8a9ada;
}

.progression-stats .stat-item .label {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-top: 2px;
}

/* ---- BARRE DE PROGRESSION GLOBALE ---- */
.progression-global-bar {
    background: white;
    border-radius: 16px;
    padding: 20px 25px;
    margin-bottom: 25px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body.dark .progression-global-bar {
    background: #1e1e2e;
    border-color: #333;
}

.progression-global-bar .progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.progression-global-bar .progress-header .title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

body.dark .progression-global-bar .progress-header .title {
    color: #eee;
}

.progression-global-bar .progress-header .percent {
    font-weight: 700;
    color: #667eea;
    font-size: 1.1rem;
}

.progression-global-bar .progress-track {
    width: 100%;
    height: 12px;
    background: #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

body.dark .progression-global-bar .progress-track {
    background: #3a3a4e;
}

.progression-global-bar .progress-track .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 10px;
    transition: width 0.8s ease;
    width: 0%;
}

.progression-global-bar .progress-details {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #888;
}

/* ---- TABLEAU DES SPÉCIALITÉS ---- */
.progression-table-container {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .progression-table-container {
    background: #1e1e2e;
    border-color: #333;
}

.progression-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.progression-table thead {
    background: #f8f9fa;
    border-bottom: 2px solid #e8e8e8;
}

body.dark .progression-table thead {
    background: #2a2a3e;
    border-bottom-color: #444;
}

.progression-table thead th {
    padding: 12px 10px;
    text-align: center;
    font-weight: 700;
    color: #2c3e50;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.dark .progression-table thead th {
    color: #aaa;
}

.progression-table thead th.volet-col {
    text-align: left;
    padding-left: 15px;
}

.progression-table thead th.spec-col {
    text-align: left;
    padding-left: 10px;
}

.progression-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

body.dark .progression-table tbody tr {
    border-bottom-color: #333;
}

.progression-table tbody tr:hover {
    background: #f8f9fa;
}

body.dark .progression-table tbody tr:hover {
    background: #2a2a3e;
}

.progression-table tbody td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

.progression-table tbody td.volet-name {
    text-align: left;
    font-weight: 700;
    color: #667eea;
    padding-left: 15px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

body.dark .progression-table tbody td.volet-name {
    color: #8a9ada;
}

.progression-table tbody td.spec-name {
    text-align: left;
    padding-left: 10px;
    font-weight: 500;
    color: #2c3e50;
}

body.dark .progression-table tbody td.spec-name {
    color: #eee;
}

/* ---- STATUS DES NIVEAUX ---- */
.level-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.level-status.completed {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #4caf50;
}

body.dark .level-status.completed {
    background: #1a3a2a;
    border-color: #4caf50;
    color: #81c784;
}

.level-status.pending {
    background: #f5f5f5;
    color: #888;
    border: 2px solid #e0e0e0;
}

body.dark .level-status.pending {
    background: #2a2a3e;
    border-color: #444;
    color: #888;
}

.level-status.locked {
    background: #f5f5f5;
    color: #bbb;
    border: 2px solid #e0e0e0;
    font-size: 0.7rem;
}

body.dark .level-status.locked {
    background: #2a2a3e;
    border-color: #444;
    color: #666;
}

/* ---- CERTIFICATS ---- */
.certificate-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.certificate-btn.available {
    background: #4caf50;
    color: white;
}

.certificate-btn.available:hover {
    background: #43a047;
    transform: scale(1.05);
}

.certificate-btn.disabled {
    background: #e0e0e0;
    color: #888;
    cursor: not-allowed;
}

body.dark .certificate-btn.disabled {
    background: #3a3a4e;
    color: #666;
}

.certificate-btn.gold {
    background: #ffd700;
    color: #2c3e50;
}

.certificate-btn.gold:hover {
    background: #f5c400;
    transform: scale(1.05);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .progression-table {
        font-size: 0.75rem;
    }
    
    .progression-table thead th,
    .progression-table tbody td {
        padding: 8px 4px;
    }
    
    .level-status {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }
    
    .certificate-btn {
        font-size: 0.6rem;
        padding: 2px 8px;
    }
}

@media (max-width: 520px) {
    .progression-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .progression-stats .stat-item .number {
        font-size: 1.4rem;
    }
    
    .progression-table .volet-col,
    .progression-table .spec-col {
        min-width: 80px;
    }
    
    .level-status {
        width: 22px;
        height: 22px;
        font-size: 0.6rem;
    }
}


/* ============================================================
   PROGRESSION - ONGLETS ET CERTIFICATS
   ============================================================ */

.progression-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 2px solid #e8e8e8;
    padding-bottom: 10px;
}

body.dark .progression-tabs {
    border-bottom-color: #333;
}

.tab-btn {
    padding: 10px 25px;
    border: none;
    border-radius: 30px;
    background: transparent;
    font-weight: 600;
    font-size: 0.95rem;
    color: #888;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark .tab-btn {
    color: #888;
}

.tab-btn:hover {
    background: #f0f4ff;
    color: #2c3e50;
}

body.dark .tab-btn:hover {
    background: #2a2a3e;
    color: #eee;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.tab-btn.active:hover {
    background: #667eea;
    color: white;
}

/* ---- CERTIFICATS ---- */
.certificate-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.certificate-stats .stat-item {
    background: white;
    border-radius: 16px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border: 1px solid #e8e8e8;
}

body.dark .certificate-stats .stat-item {
    background: #1e1e2e;
    border-color: #333;
}

.certificate-stats .stat-item .number {
    font-size: 1.8rem;
    font-weight: 800;
    color: #667eea;
    display: block;
}

body.dark .certificate-stats .stat-item .number {
    color: #8a9ada;
}

.certificate-stats .stat-item .label {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-top: 2px;
}

.certificate-section {
    margin-bottom: 30px;
}

.certificate-section .section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

body.dark .certificate-section .section-title {
    color: #eee;
}

.certificate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.certificate-card {
    background: white;
    border-radius: 16px;
    padding: 20px 15px;
    text-align: center;
    border: 2px solid #e8e8e8;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

body.dark .certificate-card {
    background: #1e1e2e;
    border-color: #333;
}

.certificate-card.unlocked {
    border-color: #4caf50;
    background: #e8f5e9;
}

body.dark .certificate-card.unlocked {
    background: #1a3a2a;
    border-color: #4caf50;
}

.certificate-card.locked {
    opacity: 0.6;
}

.certificate-card .card-icon {
    font-size: 2rem;
    display: block;
}

.certificate-card .card-name {
    font-weight: 600;
    color: #2c3e50;
    margin: 8px 0 4px;
}

body.dark .certificate-card .card-name {
    color: #eee;
}

.certificate-card .card-status {
    font-size: 0.8rem;
    color: #888;
}

.certificate-card .card-score {
    font-size: 0.9rem;
    font-weight: 700;
    color: #667eea;
    margin: 6px 0;
}

.certificate-card .card-detail {
    font-size: 0.8rem;
    color: #888;
}

.certificate-card .card-progress {
    font-size: 0.8rem;
    color: #888;
    margin: 6px 0;
}

.cert-download-btn {
    padding: 8px 20px;
    border: none;
    border-radius: 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.cert-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.certificate-card.full-card {
    max-width: 400px;
    margin: 0 auto;
    padding: 30px;
}

.certificate-card.full-card.unlocked {
    border-color: #ffd700;
    background: #fff8e1;
}

body.dark .certificate-card.full-card.unlocked {
    background: #2a2410;
    border-color: #ffd700;
}


/* ============================================================
   BOUTONS D'IMPRESSION
   ============================================================ */

.cert-print-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 4px;
}

.cert-print-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.cert-print-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.card-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

@media (max-width: 520px) {
    .cert-print-btn {
        font-size: 0.65rem;
        padding: 4px 12px;
    }
    
    .card-actions {
        flex-direction: column;
        align-items: center;
    }
}



/* ============================================================
   IA CLASSEMENT (MODULAIRE)
   ============================================================ */

/* ============================================================
   IA CLASSEMENT (MODULAIRE)
   ============================================================ */

.ia-greeting {
    background: linear-gradient(135deg, #eef2ff, #e0e7ff, #d5e0f5);
    border-radius: 16px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    border-left: 4px solid #667eea;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.10);
}

.ia-greeting .ia-avatar {
    font-size: 2rem;
    flex-shrink: 0;
    animation: iaPulse 2s ease-in-out infinite;
}

.ia-greeting .ia-message {
    font-size: 0.92rem;
    line-height: 1.6;
    margin: 0;
    color: #0d47a1;
}

.ia-greeting .ia-message strong {
    color: #4a5fc1;
}

.ia-greeting .listen-btn-small {
    margin-top: 8px;
    padding: 4px 14px;
    font-size: 0.75rem;
    background: rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 20px;
    color: #4a5fc1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ia-greeting .listen-btn-small:hover {
    background: rgba(102, 126, 234, 0.25);
    transform: translateY(-2px);
}

.ia-greeting .listen-btn-small.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    color: white !important;
    border-color: #f57c00 !important;
    animation: pulseListen 1.2s infinite;
}
/* ============================================================
   TOP PAYS
   ============================================================ */

/* ============================================================
   TOP PAYS
   ============================================================ */

.top-countries-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.top-countries-grid > div {
    background: linear-gradient(135deg, #f8f9ff, #eef1ff);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #d0d7ff;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.08);
    transition: all 0.3s ease;
}

.top-countries-grid > div:hover {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.top-countries h3,
.top-countries-month h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    color: #2c3e50;
    border-bottom: 2px solid rgba(102, 126, 234, 0.15);
    padding-bottom: 8px;
}

.top-countries-month p {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

.top-countries-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 8px;
    background: white;
    transition: all 0.3s ease;
    border: 1px solid #e8ecf5;
}

.top-country-item:hover {
    background: #e8edff;
    transform: translateX(4px);
    border-color: #667eea;
}

.top-country-item.first {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    border-color: #ffc107;
}

.top-country-rank {
    font-size: 1.1rem;
    font-weight: 700;
    min-width: 30px;
}

.top-country-name {
    flex: 1;
    font-weight: 500;
    color: #2c3e50;
}

.top-country-count {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 768px) {
    .top-countries-grid {
        grid-template-columns: 1fr;
    }

    .top-country-item {
        flex-wrap: wrap;
        gap: 4px;
    }

    .top-country-count {
        font-size: 0.75rem;
    }
}

@media (max-width: 520px) {
    .top-country-item {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .top-countries-grid > div {
        padding: 14px;
    }
}

/* ============================================================
   PAGE CLASSEMENT - FOND
   ============================================================ */

.classement-container {
    background: linear-gradient(135deg, #f0f4ff, #e8edf5, #dce4f0);
    border-radius: 40px;
    padding: 30px 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
    max-width: 1100px;
    margin: 0 auto;
    min-height: 100vh;
}

/* ============================================================
   CLASSEMENT HEADER
   ============================================================ */

.classement-header {
    text-align: center;
    margin-bottom: 25px;
}

.classement-header h1 {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.classement-header p {
    color: #666;
    font-size: 1rem;
    margin-top: 5px;
}


/* ============================================================
   PROGRESSION - CENTRAGE IA ET ONGLETS
   ============================================================ */

/* Centrer le message IA */
.ia-greeting .ia-message {
    text-align: center;
}

/* Centrer l'avatar IA */
.ia-greeting .ia-avatar {
    display: inline-block;
}

/* Centrer le bouton Écouter */
.ia-greeting .listen-btn-small {
    margin: 8px auto 0;
    display: inline-block;
}

/* Centrer les onglets de progression */
.progression-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8e8e8;
    flex-wrap: wrap;
}

/* Centrer la navigation bas */
.nav-bottom {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 520px) {
    .progression-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .progression-tabs .tab-btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    .nav-bottom {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-bottom .back-btn {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
}


/* ============================================================
   PAGE ABONNEMENT (pricing)
   ============================================================ */

.pricing-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 30px;
}

.pricing-header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin: 0;
}

.pricing-header p {
    color: #888;
    font-size: 1rem;
    margin: 5px 0;
}

.pricing-header .specialty-name {
    color: #4c6ef5;
    font-weight: 700;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.pricing-card {
    background: white;
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}

.pricing-card.recommended {
    border-color: #ffd700;
    background: #fffdf5;
}

.pricing-card.recommended .badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background: #ffd700;
    color: #2c3e50;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card .icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.pricing-card .name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #2c3e50;
}

.pricing-card .price {
    font-size: 2rem;
    font-weight: 800;
    color: #2c3e50;
    margin: 8px 0 2px 0;
}

.pricing-card .price .currency {
    font-size: 1rem;
    font-weight: 400;
    color: #888;
}

.pricing-card .period {
    font-size: 0.8rem;
    color: #888;
}

.pricing-card .saving {
    font-size: 0.7rem;
    color: #4caf50;
    font-weight: 600;
    margin: 4px 0;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    text-align: left;
    font-size: 0.8rem;
    color: #555;
}

.pricing-card .features li {
    padding: 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pricing-card .features li .check {
    color: #4caf50;
    font-weight: 700;
}

.subscribe-btn-card {
    padding: 10px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    margin-top: 8px;
}

.subscribe-btn-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.subscribe-btn-card.recommended-btn {
    background: linear-gradient(135deg, #ffd700, #f57c00);
    color: #2c3e50;
}

.subscribe-btn-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.pricing-footer {
    text-align: center;
    color: #888;
    font-size: 0.8rem;
    margin-top: 20px;
}

.pricing-footer .back-link {
    color: #667eea;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
}

.pricing-footer .back-link:hover {
    text-decoration: underline;
}

/* IA GREETING */
.ia-greeting {
    background: linear-gradient(135deg, #e8eeff, #f0f4ff);
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    color: #0d47a1;
    border: 1px solid #d0d8f0;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    text-align: left;
    box-shadow: 0 2px 12px rgba(102, 126, 234, 0.08);
}

.ia-avatar {
    font-size: 2.5rem;
    flex-shrink: 0;
    animation: iaPulse 2s ease-in-out infinite;
}

@keyframes iaPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.ia-message {
    font-size: 0.92rem;
    line-height: 1.7;
    margin: 0;
    color: #2c3e50;
}

.ia-message strong {
    color: #4c6ef5;
}

.listen-btn-small {
    margin-top: 8px;
    padding: 4px 14px;
    font-size: 0.75rem;
    background: rgba(102, 126, 234, 0.15);
    border: none;
    border-radius: 20px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.listen-btn-small:hover {
    background: rgba(102, 126, 234, 0.25);
}

.listen-btn-small.listening {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
    color: white;
    animation: pulseListen 1.2s infinite;
}

@keyframes pulseListen {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

@media (max-width: 520px) {
    .pricing-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .pricing-card {
        padding: 16px 12px;
    }
    
    .pricing-card .price {
        font-size: 1.5rem;
    }
    
    .pricing-header h1 {
        font-size: 1.5rem;
    }
    
    .ia-greeting {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .ia-avatar {
        font-size: 2rem;
    }
    
    .ia-message {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}


/* ============================================================
   BOUTON GUIDE UTILISATEUR
   ============================================================ */

.guide-banner {
    text-align: center;
    margin: 20px auto;
    max-width: 400px;
}

.guide-btn {
    width: 100%;
    padding: 16px 30px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ff6b35);
    color: #2c3e50;
    font-weight: 800;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 25px rgba(255, 140, 0, 0.4);
    letter-spacing: 0.3px;
}

.guide-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 10px 35px rgba(255, 140, 0, 0.55);
}

.guide-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

/* ✅ ÉTAT GRISÉ (avant choix de langue) */
.guide-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #b0b0b0, #808080);
    box-shadow: none;
    transform: none;
}

.guide-btn span {
    display: inline-block;
    vertical-align: middle;
}