/* Reset et Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --primary-color: #3a4dff;
    --primary-dark: #4d50ff;
    --primary-light: #5b76ff;
    --primary-lighter: #6e8bff;
    --secondary-color: #00ff4c;
    --accent-color: #ffb700;
    --background: linear-gradient(135deg, #171c27 0%, #272d36 100%);
    --background-solid: #1d222c;
    --surface: #1e293b;
    --surface-elevated: rgba(30, 41, 59, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    --shadow-2xl: 0 30px 60px -12px rgba(129, 140, 248, 0.3);
    --error-color: #ff1f1f;
    --success-color: #29ffb1;
    --warning-color: #ffb700;
    --border-radius: 16px;
    --border-radius-sm: 12px;
    --border-radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --bg-primary: var(--background-solid);
    --bg-secondary: var(--surface);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background-solid);
    background-image: 
        radial-gradient(at 0% 0%, rgba(129, 140, 248, 0.1) 0%, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 191, 36, 0.08) 0%, transparent 50%),
        var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Page de chargement */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-solid);
    background-image: 
        radial-gradient(at 0% 0%, rgba(129, 140, 248, 0.15) 0%, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 191, 36, 0.12) 0%, transparent 50%),
        var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.8s ease-out, visibility 0.8s ease-out;
    visibility: visible;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    opacity: 1;
    transform: scale(1);
}

.loading-screen.hidden .loading-content {
    opacity: 0;
    transform: scale(0.95);
}

.loading-logo {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoPulse 2s ease-in-out infinite;
}

.loading-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 20px rgba(129, 140, 248, 0.4));
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(129, 140, 248, 0.2);
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    display: inline-block;
    animation: dotBounce 1.4s ease-in-out infinite;
    font-size: 1.5rem;
    line-height: 1;
}

.loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Styles responsives pour la page de chargement */
@media (max-width: 768px) {
    .loading-logo {
        width: 100px;
        height: 100px;
    }
    
    .loading-spinner-large {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .loading-logo {
        width: 80px;
        height: 80px;
    }
    
    .loading-spinner-large {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
    
    .loading-content {
        gap: 24px;
    }
    
    .loading-text {
        font-size: 0.9rem;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(129, 140, 248, 0.03) 2px, rgba(129, 140, 248, 0.03) 4px);
    pointer-events: none;
    z-index: 0;
}

@supports (backdrop-filter: blur(10px)) {
    body {
        background-attachment: fixed;
    }
}

/* Page de sélection de profil */
.profile-selector-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    position: relative;
    overflow: hidden;
}

.profile-selector-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(129, 140, 248, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(251, 191, 36, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 50% 20%, rgba(129, 140, 248, 0.1) 0%, transparent 40%);
    pointer-events: none;
    animation: pulse 8s ease-in-out infinite;
}

.profile-selector-container::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    top: -250px;
    right: -250px;
    animation: float 20s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

@keyframes mascotteFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Classe pour toutes les mascottes */
.mascotte-image {
    animation: mascotteFloat 3s ease-in-out infinite;
}

.profile-selector-content {
    background: var(--surface-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 50px 40px;
    box-shadow: var(--shadow-xl);
    max-width: 650px;
    width: 100%;
    text-align: center;
    position: relative;
    border: none;
    animation: fadeInUp 0.6s ease-out;
}

.logo-container {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeInUp 0.8s ease-out;
}

.main-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    transition: var(--transition);
}

.main-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.3));
}

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

.main-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 50px;
    font-size: 1.15rem;
    font-weight: 500;
}

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

.profile-card {
    background: var(--surface);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 25px 20px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
}

.profile-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.profile-card:hover::before {
    left: 100%;
}

.profile-card:hover::after {
    opacity: 1;
}

.profile-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-10px) scale(1.03);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-xl);
    position: relative;
    transition: var(--transition);
    border: none;
}

.profile-avatar::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.1));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}

.profile-card:hover .profile-avatar::before {
    opacity: 1;
}

.profile-card:hover .profile-avatar {
    transform: scale(1.12) rotate(8deg);
    box-shadow: var(--shadow-2xl);
    border-color: rgba(255, 255, 255, 0.5);
}

.profile-avatar.anna {
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 50%, #818cf8 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.profile-avatar.alex {
    background: linear-gradient(135deg, #f472b6 0%, #ec4899 50%, #f472b6 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

.profile-card h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.profile-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background-solid);
    position: relative;
    z-index: 1;
    overflow-x: hidden; /* Prévenir le scroll horizontal */
    width: 100%;
}

.app-container > * {
    position: relative;
    z-index: 1;
}

/* Exception : la navigation mobile ne doit pas avoir position: relative */
@media (max-width: 480px) {
    .app-container > .mode-navigation {
        position: fixed !important;
    }
}

/* Exception pour la navigation mobile qui doit être fixed */
@media (max-width: 480px) {
    .app-container {
        overflow-x: hidden;
        overflow-y: auto;
        padding-bottom: 80px; /* Espace pour la nav fixe en bas */
    }
    
    /* Le header reste normal en haut */
    .app-container .app-header {
        position: relative;
        flex-shrink: 0;
    }
    
    /* La navigation est complètement sortie du flux flexbox et fixée en bas */
    .app-container .mode-navigation,
    .app-container nav.mode-navigation,
    body .mode-navigation,
    body nav.mode-navigation {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: auto !important;
        max-height: 70px !important;
        z-index: 1000 !important;
        flex: none !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        align-self: auto !important;
        order: 999 !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        transform: none !important;
    }
    
    /* Le main content doit avoir un padding en bas pour éviter le chevauchement */
    .app-container .main-content {
        padding-bottom: 80px !important;
    }
}

/* Header */
.app-header {
    display: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.header-logo {
    height: 40px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    transition: var(--transition);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(129, 140, 248, 0.4));
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-profile-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    border: none;
}

.current-profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    font-size: 2rem;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    box-shadow: var(--shadow-lg);
    border: none;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.profile-picture-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(51, 65, 85, 0.5) 100%);
    border-radius: var(--border-radius-lg);
    border: none;
}

.profile-picture-preview {
    display: flex;
    justify-content: center;
}

.profile-picture-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.profile-picture-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    margin: 0;
}

.profile-picture-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.profile-picture-loading p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.current-profile-avatar {
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: var(--shadow-md);
    border: none;
}

.current-profile-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.change-profile-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 11px 24px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.change-profile-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.change-profile-btn:hover::before {
    width: 300px;
    height: 300px;
}

.change-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.change-profile-btn:active {
    transform: translateY(0);
}

/* Navigation */
.mode-navigation {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: none;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 6px;
    overflow-x: auto;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: auto;
    min-height: auto;
    max-height: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(129, 140, 248, 0.3) transparent;
    position: relative;
    z-index: 100;
    top: auto;
    bottom: auto;
}

/* Sur mobile, la navigation doit être fixée en bas - Règle très spécifique */
@media (max-width: 480px) {
    body .mode-navigation,
    body nav.mode-navigation,
    html body .mode-navigation,
    html body nav.mode-navigation {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
    }
}

/* Sur desktop, la navigation est fixée en haut */
@media (min-width: 769px) {
    .mode-navigation {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: auto !important;
        border-top: none;
        border-bottom: none;
        z-index: 1000;
    }

    /* Ajouter un padding-top au contenu principal pour compenser la navbar fixée */
    .main-content {
        padding-top: 60px !important;
    }

    .nav-text {
        display: inline;
    }

    .nav-btn-menu {
        position: relative;
        flex: 0 0 auto;
        width: auto;
        height: auto;
        min-height: auto;
        max-width: none;
        border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
        background: none;
        box-shadow: none;
        margin-top: 0;
        padding: 12px 18px;
    }

    .nav-btn-menu .nav-icon {
        font-size: 1.1rem;
        color: white !important;
        filter: none;
    }

    .nav-btn-menu.active .nav-icon {
        color: white !important;
    }
}

.mode-navigation::-webkit-scrollbar {
    height: 6px;
}

.mode-navigation::-webkit-scrollbar-track {
    background: transparent;
}

.mode-navigation::-webkit-scrollbar-thumb {
    background: rgba(129, 140, 248, 0.3);
    border-radius: 3px;
}

.mode-navigation::-webkit-scrollbar-thumb:hover {
    background: rgba(129, 140, 248, 0.5);
}


.nav-btn {
    background: none;
    border: none;
    padding: 12px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    position: relative;
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

.nav-btn .nav-icon,
.nav-btn .nav-icon i,
.nav-btn .nav-icon * {
    color: white !important;
}

.nav-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    color: var(--primary-light);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.nav-btn:hover .nav-icon,
.nav-btn:hover .nav-icon i {
    color: white !important;
}

.nav-btn.active {
    color: var(--primary-light);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
}

.nav-btn.active .nav-icon,
.nav-btn.active .nav-icon i {
    color: white !important;
}

/* Exclure le bouton menu des backgrounds transparents */
.nav-btn-menu:hover,
.nav-btn-menu.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.nav-btn-menu.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
}

.nav-btn.active::before {
    transform: scaleX(1);
}

.nav-icon {
    font-size: 1.1rem;
    transition: var(--transition-fast);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white !important;
}

.nav-icon .current-profile-avatar {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.7rem;
    border: none;
    box-shadow: none;
    min-width: 1.4rem;
    min-height: 1.4rem;
}

.nav-icon i {
    font-size: inherit;
    color: white !important;
}

.nav-btn:hover .nav-icon {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 4px 8px rgba(129, 140, 248, 0.5));
    color: white !important;
}

.nav-btn.active .nav-icon {
    filter: drop-shadow(0 2px 6px rgba(129, 140, 248, 0.6));
    color: white !important;
}

/* Classe pour le texte de navigation (caché sur mobile) */
.nav-text {
    display: inline;
}

/* Main Content */
.main-content {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 24px;
    padding-top: 60px;
    overflow-x: hidden; /* Prévenir le scroll horizontal */
}

/* Theme Suggestions */
.theme-suggestions {
    margin-bottom: 40px;
    position: relative;
}

.theme-suggestions h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-suggestions h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

.theme-boxes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.theme-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    transition: var(--transition);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.theme-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.theme-box::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.theme-box:hover::before {
    opacity: 1;
}

.theme-box:hover::after {
    opacity: 1;
}

.theme-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.98) 0%, rgba(30, 41, 59, 0.98) 100%);
}

.theme-box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 12px;
}

.theme-box-header h4 {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.theme-level {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 8px rgba(129, 140, 248, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
    min-height: 48px;
}

.theme-box-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.theme-box-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.theme-box-btn:hover::before {
    left: 100%;
}

.theme-box-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.theme-box-btn:active {
    transform: translateY(0);
}

.theme-box-btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.theme-box-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* User Themes Section */
.user-themes-section {
    margin-bottom: 40px;
    margin-top: 40px;
}

.user-themes-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-themes-section h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 2px;
}

/* Theme Item Box (style similaire aux leçons) */
.theme-item-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.theme-item-box:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.theme-item-box:hover .theme-item-arrow i {
    transform: translateX(4px);
    color: var(--primary-color);
}

.theme-item-header {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0; /* Permet au contenu de se rétrécir si nécessaire */
    max-width: 100%;
    overflow: hidden;
}

.theme-item-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0; /* Permet au texte de se rétrécir */
    overflow: hidden;
    position: relative;
}

.theme-item-content::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, transparent, rgba(30, 41, 59, 0.95));
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.theme-item-content.has-overflow::after {
    opacity: 1;
}

.theme-item-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: clip;
    position: relative;
    max-width: 100%;
    flex: 1;
    min-width: 0;
}

.theme-item-progress {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.progress-circle {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-background {
    transition: stroke 0.3s ease;
}

.progress-ring-fill {
    transition: stroke-dashoffset 0.5s ease, stroke 0.3s ease;
    stroke-linecap: round;
}

.progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.85rem;
    font-weight: 700;
    transition: color 0.3s ease;
}

.theme-item-count {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-right: 8px;
}

.theme-item-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    align-self: center; /* Force l'alignement vertical au centre */
}

.theme-item-box:hover .theme-item-arrow {
    transform: translateX(4px);
}

/* Theme Detail View */
.theme-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.theme-detail-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.back-btn {
    background: var(--surface);
    border: none;
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--primary-color);
    color: var(--primary-light);
}

.theme-detail-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.theme-detail-info h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.theme-detail-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(129, 140, 248, 0.15);
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    border: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .theme-boxes {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .theme-suggestions h3 {
        font-size: 1.3rem;
    }
    
    .theme-box {
        padding: 24px;
    }
    
    .theme-box-header h4 {
        font-size: 1.1rem;
    }
    
    .theme-item-box {
        flex-direction: row;
        align-items: center;
    }
    
    .theme-item-arrow {
        align-self: center;
    }
    
    .theme-item-progress {
        margin: 0 4px;
    }
    
    .progress-circle {
        width: 50px;
        height: 50px;
    }
    
    .progress-ring {
        width: 50px;
        height: 50px;
    }
    
    .progress-percentage {
        font-size: 0.75rem;
    }
    
    .theme-item-actions {
        width: 100%;
    }
    
    .theme-item-btn {
        width: 100%;
        justify-content: center;
    }
    
    .theme-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .theme-detail-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .theme-detail-actions .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .theme-detail-count {
        font-size: 0.95rem;
        padding: 5px 12px;
    }
}

/* Debug Theme IDs Box */
.debug-theme-ids-box {
    background: linear-gradient(135deg, rgba(59, 30, 30, 0.95) 0%, rgba(85, 51, 51, 0.95) 100%);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.debug-theme-ids-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debug-theme-ids-title {
    color: #ff6b6b;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.debug-theme-ids-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.debug-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.debug-value {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 8px;
    padding: 12px;
    color: #ffd93d;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

/* Review Suggestion Box */
.review-suggestion-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 12px 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-suggestion-box:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.review-suggestion-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    overflow: hidden;
    width: 100%;
}

.review-suggestion-image {
    width: 450px;
    height: 450px;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.review-suggestion-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.review-suggestion-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.review-suggestion-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.review-suggestion-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.review-suggestion-btn:active {
    transform: translateY(0);
}
.review-suggestion-box {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 12px 24px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    overflow: hidden;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-suggestion-box:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.review-suggestion-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    overflow: hidden;
    width: 100%;
}

.review-suggestion-image {
    width: 450px;
    height: 450px;
    object-fit: cover;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.review-suggestion-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.review-suggestion-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
}

.review-suggestion-btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    white-space: nowrap;
}

.review-suggestion-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.review-suggestion-btn:active {
    transform: translateY(0);
}

.mode-section {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.mode-section.active {
    display: block !important;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 1.05rem;
    line-height: 1.5;
}

/* Vocabulaire */
.vocab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 36px;
    margin-top: 48px;
    flex-wrap: wrap;
    gap: 20px;
}

.vocab-title-container {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
    flex: 1;
}

.vocab-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    margin: 0;
}

.vocab-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(129, 140, 248, 0.15);
    padding: 6px 14px;
    border-radius: var(--border-radius-sm);
    border: none;
    white-space: nowrap;
}

/* En-têtes Cours, Discussion et Statistiques */
.course-header,
.discussion-header,
.stats-header {
    margin-bottom: 32px;
    margin-top: 18px;
    position: relative;
}

.vocal-back-btn-fullwidth {
    width: 100%;
    margin-bottom: 24px;
}

.vocal-header {
    display: flex;
    align-items: center;
    gap: 24px;
}

.vocal-header-content {
    flex: 1;
}

.discussion-header {
    display: flex;
    align-items: center;
    gap: 24px;
    justify-content: space-between;
}

.discussion-header-left {
    flex: 1;
    max-width: 50%;
}

.discussion-vocal-btn {
    padding: 14px 28px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: var(--border-radius-sm);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    flex: 1;
    max-width: 50%;
    justify-content: center;
    align-self: flex-start;
    margin-top: 80px;
}

.discussion-vocal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
}

.discussion-vocal-btn i {
    font-size: 1.1rem;
}

.leaderboard-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1) 0%, rgba(99, 102, 241, 0.1) 100%);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 20px;
}

.leaderboard-back-btn:hover {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(99, 102, 241, 0.2) 100%);
    transform: translateX(-2px);
}

.leaderboard-back-btn:active {
    transform: translateX(0);
}

.leaderboard-back-btn i {
    font-size: 0.9rem;
}

/* Correction pour éviter que le h2 soit coupé dans statistiques */
#statistiques-section {
    padding-top: 35px;
}

.course-header h2,
.vocal-header-content h2,
.discussion-header-left h2,
.stats-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-top: 48px;
    background-clip: text;
    margin-bottom: 2px;
    position: relative;
}

.course-header::after,
.discussion-header-left::after,
.stats-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
    animation: expandWidth 1s ease-out;
}

@keyframes expandWidth {
    from { width: 0; }
    to { width: 60px; }
}

#vocabLeconBox {
    width: 100%;
    flex: 1 1 100%;
}

.vocab-actions {
    display: flex;
    gap: 12px;
}

.action-btn i {
    margin-right: 6px;
}

.action-btn {
    padding: 13px 26px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    font-weight: 600;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: inline-block;
    text-align: center;
}

a.action-btn {
    text-decoration: none;
    color: inherit;
}

.action-btn i {
    margin-right: 6px;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn.primary:active {
    transform: translateY(0);
}

.action-btn.secondary {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    color: var(--primary-light);
    border: none;
    position: relative;
    overflow: hidden;
}

.action-btn.secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.action-btn.secondary:hover::before {
    width: 300px;
    height: 300px;
}

.action-btn.secondary:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.word-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.word-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.word-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: shimmer 2s infinite;
}

.word-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
}

.word-card:hover::before {
    transform: scaleX(1);
    animation-play-state: paused;
}

.word-card:hover::after {
    opacity: 1;
}

.word-card:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary-light);
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.word-card-front {
    text-align: center;
    position: relative;
}

.word-card-content {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.word-french {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    position: relative;
    display: inline-block;
}

.word-french::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.word-card:hover .word-french::after {
    width: 100%;
}

.word-italian {
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
    font-style: italic;
    position: relative;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.1));
    border-radius: 8px;
    display: inline-block;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.word-card {
    cursor: pointer;
}

.word-french.hidden,
.word-italian.hidden {
    display: none;
}

.word-card-content {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-word-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    font-weight: 700;
    line-height: 1;
}

.delete-word-btn:hover {
    transform: scale(1.15) rotate(90deg);
    box-shadow: var(--shadow-lg);
}

/* Mode Révision */
.vocab-mode {
    display: block;
}

.vocab-mode.hidden {
    display: none;
}

.review-controls {
    text-align: center;
    margin-bottom: 30px;
}

.review-controls h3 {
    margin-bottom: 24px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.review-direction-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.direction-btn {
    padding: 14px 32px;
    border: none;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.direction-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.direction-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

.review-card-container {
    max-width: 500px;
    margin: 0 auto;
}

.review-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.review-back-btn {
    padding: 12px 24px;
    background: rgba(30, 41, 59, 0.8);
    border: none;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 500;
}

.review-back-btn:hover {
    background: rgba(51, 65, 85, 0.9);
    border-color: var(--primary-color);
    transform: translateX(-2px);
}

.review-back-btn i {
    font-size: 0.9rem;
}

.review-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    height: 380px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xl);
    margin-bottom: 32px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    perspective: 1000px;
    overflow: hidden;
}

.review-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s;
    animation: rotate 20s linear infinite;
}

.review-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-lg);
    padding: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s;
    animation: gradientShift 3s ease infinite;
}

.review-card:hover::before {
    opacity: 1;
}

.review-card:hover::after {
    opacity: 0.3;
}

.review-card:hover {
    box-shadow: var(--shadow-2xl);
    transform: scale(1.03);
    border-color: var(--primary-light);
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.review-card-front,
.review-card-back {
    width: 100%;
    height: 100%;
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.review-word,
.review-translation {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 20px;
    overflow-wrap: break-word;
    hyphens: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    gap: 0;
    margin: 0;
}

.review-word {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Styles pour la carte de résultat - Desktop */
.review-card .review-word h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    margin-top: 0;
    order: 1;
}

.review-card .review-word > div[style*="font-size: 1rem"] {
    order: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.review-card .review-word p[style*="1.2rem"] {
    order: 3;
    margin-top: 10px;
    margin-bottom: 0;
}

.review-card .review-word p[style*="0.95rem"] {
    order: 4;
    margin-top: 20px;
    margin-bottom: 0;
}

.review-card .review-word div[style*="flex"] {
    order: 5;
    margin-top: 30px;
}

.review-translation {
    color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(99, 102, 241, 0.12));
    border-radius: 12px;
    padding: 20px 30px;
    display: inline-block;
}

.review-card-back {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
}

.review-card-back.hidden {
    display: none !important;
}

.review-card-front {
    position: relative;
    z-index: 2;
}

.review-card-back {
    z-index: 1;
}

.review-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.review-action-btn {
    padding: 16px 36px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.review-action-btn i {
    margin-right: 6px;
}

.review-action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.review-action-btn:hover::before {
    width: 300px;
    height: 300px;
}

.review-action-btn.wrong {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    color: white;
}

.review-action-btn.correct {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    color: white;
}

.review-action-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

.review-action-btn:active {
    transform: translateY(-1px) scale(1.02);
}

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

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(51, 65, 85, 0.8);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    animation: progressShimmer 2s infinite;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressSweep 1.5s infinite;
}

@keyframes progressShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes progressSweep {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Chat Interface */
.chat-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    height: calc(90vh - 380px);
    min-height: 300px;
    max-height: 600px;
    border: none;
    overflow: hidden;
    position: relative;
}

.chat-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    animation: shimmer 3s infinite;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(to bottom, rgba(129, 140, 248, 0.05) 0%, transparent 100%);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.8);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.9);
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 80%;
    animation: fadeIn 0.3s ease;
}

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

.message.user-message {
    align-self: flex-end;
    flex-direction: row;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.message-avatar-assistant {
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
    color: var(--primary-light);
    /* L'image sera appliquée via inline style, mais on garde le background par défaut au cas où */
}

.message.user-message .message-avatar {
    order: 2;
    margin-left: 8px;
}

.message.user-message .message-content {
    order: 1;
}

.message-content {
    background: var(--surface);
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    word-wrap: break-word;
    box-shadow: var(--shadow-sm);
    border: none;
    position: relative;
    overflow: hidden;
}

.message-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.assistant-message .message-content::before {
    opacity: 1;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.user-message .message-content::before {
    display: none;
}

.assistant-message .message-content {
    background: var(--surface);
    color: var(--text-primary);
    border: none;
    padding-left: 16px;
    background: linear-gradient(135deg, rgba(51, 65, 85, 0.8) 0%, rgba(30, 41, 59, 0.8) 100%);
}

.message-content p {
    margin: 0;
    line-height: 1.25;
}

.error-correction {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.15) 0%, rgba(248, 113, 113, 0.08) 100%);
    border-left: 4px solid var(--error-color);
    padding: 6px 10px;
    margin-top: 6px;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    position: relative;
    animation: slideInError 0.4s ease-out;
}

.error-correction::before {
    content: '⚠️';
    position: absolute;
    left: -30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

.error-correction strong {
    color: var(--error-color);
    font-weight: 700;
    display: block;
    margin-bottom: 6px;
}

@keyframes slideInError {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chat-input-container {
    border-top: none;
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    background: var(--surface-elevated);
    backdrop-filter: blur(10px);
}

.chat-input {
    flex: 1;
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.chat-input:focus {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.send-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.send-btn:hover::before {
    width: 300px;
    height: 300px;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    height: 100vh;
    max-height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--surface-elevated);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    max-width: 520px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-2xl);
    border: none;
    animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
    margin: auto;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    border-radius: 50%;
    background: var(--background-solid);
    transition: background 0.3s ease;
    box-sizing: border-box;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.modal-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: transform 0.3s ease, stroke 0.3s ease;
    transform-origin: center center;
    will-change: transform;
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--surface);
}

.modal-close:hover svg {
    stroke: var(--text-primary);
    transform: rotate(90deg);
}

.modal-content h3 {
    margin-bottom: 24px;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-form-group {
    margin-bottom: 20px;
}

.modal-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.modal-input {
    width: 100%;
    padding: 14px 18px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    margin-bottom: 0;
    outline: none;
    transition: var(--transition);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
}

.modal-input:focus {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    background: rgba(15, 23, 42, 0.9);
}

.modal-loading {
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    background: rgba(129, 140, 248, 0.1);
    border-radius: var(--border-radius-sm);
}

.modal-loading p {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-weight: 500;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: none;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
    transform-origin: center center;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.vocab-loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    display: block;
}

.vocab-loading.hidden {
    display: none;
}

.vocab-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    border: none;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spinVocab 1s linear infinite;
    margin-top: -30px;
    transform-origin: center center;
}

.vocab-loading::after {
    content: 'Chargement des mots';
    display: block;
    margin-top: 30px;
}

@keyframes spinVocab {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Responsive - Écrans moyens (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .main-content {
        padding: 24px 20px;
    }

    .word-cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .theme-boxes {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-btn span:not(.nav-icon) {
        display: inline;
        font-size: 0.8rem;
    }

    .current-profile-name {
        max-width: 150px;
    }

    /* Box Leçon Dashboard - Tablette */
    #dashboardLeconCard {
        flex-direction: row !important;
        align-items: center !important;
        padding: 20px 24px;
        gap: 16px;
    }

    #dashboardLeconCard .lecon-item-header {
        flex: 1;
        gap: 16px;
    }

    #dashboardLeconCard .lecon-item-number {
        width: 55px;
        height: 55px;
        min-width: 55px;
        font-size: 1.4rem;
    }

    #dashboardLeconCard .lecon-item-title {
        font-size: 1.15rem;
    }

    #dashboardLeconCard .lecon-item-actions {
        flex-shrink: 0;
        width: auto;
    }

    #dashboardLeconCard .lecon-item-btn {
        width: auto;
        min-width: 140px;
        padding: 12px 20px;
    }
}

/* Responsive - Tablette */
@media (max-width: 768px) {
    .main-content {
        padding: 24px 16px;
    }

    .main-title {
        font-size: 2rem;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }

    .vocab-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .vocab-title-container {
        justify-content: flex-start;
        width: 100%;
    }

    .vocab-header h2 {
        font-size: 2rem;
    }

    .vocab-actions {
        width: 100%;
    }

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .word-cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .word-card {
        padding: 24px 20px;
    }

    .review-suggestion-content {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 16px;
    }

    .review-suggestion-box {
        height: auto;
        min-height: 140px;
        padding: 16px;
    }

    .review-suggestion-image {
        width: 180px;
        height: 180px;
        max-width: 100%;
    }

    .review-suggestion-text {
        flex-direction: column;
        gap: 16px;
        width: 100%;
    }

    .review-suggestion-label {
        min-width: auto;
        font-size: 1rem;
    }

    .review-suggestion-btn {
        width: 100%;
        padding: 14px 24px;
    }

    .message {
        max-width: 85%;
    }

    .chat-container {
        height: calc(100vh - 240px);
        min-height: 400px;
        max-height: calc(100vh - 240px);
    }

    .app-header {
        padding: 12px 16px;
    }

    .header-content {
        flex-direction: row;
        gap: 12px;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    .header-left {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .header-logo {
        height: 32px;
        max-width: 90px;
        flex-shrink: 0;
    }

    .current-profile-name {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .current-profile-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
        flex-shrink: 0;
    }

    .change-profile-btn {
        flex-shrink: 0;
        padding: 10px 18px;
        font-size: 0.85rem;
    }

    .main-logo {
        max-width: 150px;
    }

    /* Navigation mobile - En bas de l'écran - Complètement indépendante */
    nav.mode-navigation,
    .mode-navigation {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: auto !important;
        max-height: 70px !important;
        padding: 8px 4px 12px 4px;
        gap: 0;
        justify-content: space-around;
        align-items: center;
        border-top: none;
        border-bottom: none;
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        max-width: 100vw !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        z-index: 1000 !important;
        overflow-x: visible;
        flex: none !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        align-self: auto !important;
        transform: none !important;
    }

    .nav-btn {
        padding: 8px;
        font-size: 0.75rem;
        gap: 0;
        min-width: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-bottom: none;
        border-radius: var(--border-radius-sm);
        position: relative;
        min-height: 56px;
        max-width: 60px;
    }

    .nav-btn::before {
        display: none;
    }

    .nav-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
        color: white !important;
    }
    
    .nav-icon i {
        color: white !important;
    }
    
    .nav-icon .current-profile-avatar {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
        min-width: 1.6rem;
        min-height: 1.6rem;
    }

    .nav-text {
        display: none !important;
    }

    /* Bouton Menu spécial - Bulle ronde centrée */
    .nav-btn-menu {
        position: relative;
        flex: 0 0 auto;
        width: 56px;
        height: 56px;
        min-height: 56px;
        max-width: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
        box-shadow: 0 4px 16px rgba(129, 140, 248, 0.4), 0 -2px 8px rgba(129, 140, 248, 0.2);
        margin-top: -18px;
        margin-left: 3px;
        margin-right: 3px;
        z-index: 1001;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
    }
    
    .nav-btn-menu.active,
    .nav-btn-menu:hover {
        opacity: 1 !important;
    }

    .nav-btn-menu .nav-icon {
        font-size: 1.4rem;
        color: white !important;
        opacity: 1 !important;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
    }
    
    .nav-btn-menu .nav-icon i,
    .nav-btn-menu .nav-icon i.fa-home,
    .nav-btn-menu .nav-icon i.fas,
    .nav-btn-menu .nav-icon i.fa,
    .nav-btn-menu span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
        text-fill-color: white !important;
    }
    
    .nav-btn-menu.active .nav-icon,
    .nav-btn-menu.active .nav-icon i,
    .nav-btn-menu.active span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
    }
    
    .nav-btn-menu:hover .nav-icon,
    .nav-btn-menu:hover .nav-icon i,
    .nav-btn-menu:hover span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
    }
    
    /* Surcharger toutes les règles possibles pour l'icône du menu */
    .nav-btn-menu * {
        opacity: 1 !important;
    }
    
    .nav-btn-menu .nav-icon * {
        color: white !important;
        opacity: 1 !important;
    }
    
    /* Forcer la couleur blanche sur tous les éléments enfants */
    .nav-btn-menu,
    .nav-btn-menu *,
    .nav-btn-menu .nav-icon,
    .nav-btn-menu .nav-icon * {
        color: white !important;
    }
    
    /* S'assurer que le bouton menu n'hérite pas de la couleur des autres boutons */
    .nav-btn-menu {
        color: white !important;
    }
    
    /* Surcharger la règle de base .nav-btn pour le menu */
    .nav-btn-menu.nav-btn {
        color: white !important;
    }
    
    .nav-btn-menu.nav-btn .nav-icon {
        color: white !important;
        opacity: 1 !important;
    }

    .nav-btn-menu.active {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
        box-shadow: 0 6px 20px rgba(129, 140, 248, 0.6), 0 -2px 8px rgba(129, 140, 248, 0.3);
        transform: translateY(-2px);
    }

    .nav-btn-menu:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(129, 140, 248, 0.7), 0 -2px 8px rgba(129, 140, 248, 0.3);
    }

    .nav-btn:not(.nav-btn-menu) {
        color: var(--text-secondary);
    }

    .nav-btn:not(.nav-btn-menu).active {
        color: var(--primary-light);
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
    }

    .nav-btn:not(.nav-btn-menu):hover {
        color: var(--primary-light);
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    }

    /* Espacement pour le contenu principal (éviter que la nav cache le contenu) */
    .main-content {
        padding-bottom: 80px !important;
    }

    .theme-boxes {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .theme-box {
        padding: 20px;
    }

    .modal {
        padding: 20px 10px;
        align-items: center;
        justify-content: center;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 28px 20px;
        margin: auto;
        max-height: 85vh;
        overflow-y: auto;
    }

    .modal-content h3 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    /* Box Leçon Dashboard - Tablette (768px) */
    #dashboardLeconCard {
        flex-direction: row !important;
        align-items: center !important;
        padding: 20px 24px;
        gap: 20px;
    }

    #dashboardLeconCard .lecon-item-header {
        flex: 1;
        gap: 16px;
        min-width: 0;
    }

    #dashboardLeconCard .lecon-item-number {
        width: 55px;
        height: 55px;
        min-width: 55px;
        font-size: 1.4rem;
    }

    #dashboardLeconCard .lecon-item-title {
        font-size: 1.2rem;
        -webkit-line-clamp: 2;
    }

    #dashboardLeconCard .lecon-item-actions {
        flex-shrink: 0;
        width: auto;
        margin-left: 0;
    }

    #dashboardLeconCard .lecon-item-btn {
        width: auto;
        min-width: 140px;
        padding: 12px 24px;
        white-space: nowrap;
    }

    /* Box Streak - Tablette */
    .dashboard-card-streak .streak-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .dashboard-card-streak .streak-icon i {
        font-size: 2.4rem;
    }

    .dashboard-card-streak .streak-value {
        font-size: 3rem;
    }

    .dashboard-card-streak .streak-label {
        font-size: 0.95rem;
    }

    /* Box XP - Tablette */
    .dashboard-card-xp {
        padding: 24px;
    }

    .xp-icon {
        width: 75px;
        height: 75px;
    }

    .xp-icon i {
        font-size: 2.2rem;
    }

    .xp-title {
        font-size: 1.4rem;
    }

    .course-header h2,
    .discussion-header-left h2,
    .stats-header h2,
    .vocab-header h2 {
        font-size: 1.8rem;
    }

    .section-description {
        font-size: 0.95rem;
    }

    .lecon-content-header {
        flex-direction: column;
        gap: 16px;
        padding: 20px;
    }

    .lecon-content-header h2 {
        font-size: 1.5rem;
        text-align: center;
    }

    .lecon-back-btn,
    .lecon-question-btn {
        width: 100%;
        justify-content: center;
    }

    .lecon-content-container {
        padding: 24px 20px;
    }

    .lecon-question-chat {
        width: 100%;
        max-width: 100%;
        right: 0;
        left: 0;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }
}

/* Responsive - Mobile (petits écrans) */
@media (max-width: 480px) {
    .main-content {
        padding: 16px 12px;
        padding-top: 40px;
    }

    .app-header {
        padding: 10px 12px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .header-content {
        gap: 8px;
    }

    .header-logo {
        height: 28px;
        max-width: 70px;
    }

    .header-left {
        gap: 8px;
        min-width: 0;
    }

    .current-profile-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .current-profile-name {
        font-size: 0.9rem;
        max-width: 100px;
    }

    .change-profile-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Navigation mobile - En bas de l'écran - Complètement indépendante */
    nav.mode-navigation,
    .mode-navigation {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        width: 100vw !important;
        height: auto !important;
        min-height: auto !important;
        max-height: 70px !important;
        padding: 8px 4px 12px 4px;
        gap: 0;
        justify-content: space-around;
        align-items: center;
        border-top: none;
        border-bottom: none;
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
        max-width: 100vw !important;
        margin: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        z-index: 1000 !important;
        overflow-x: visible;
        flex: none !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        align-self: auto !important;
        transform: none !important;
    }

    .nav-btn {
        padding: 8px;
        font-size: 0.75rem;
        gap: 0;
        min-width: auto;
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-bottom: none;
        border-radius: var(--border-radius-sm);
        position: relative;
        min-height: 56px;
        max-width: 60px;
    }

    .nav-btn::before {
        display: none;
    }

    .nav-icon {
        font-size: 1.3rem;
        margin-bottom: 0;
        color: white !important;
    }
    
    .nav-icon i {
        color: white !important;
    }
    
    .nav-icon .current-profile-avatar {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
        min-width: 1.6rem;
        min-height: 1.6rem;
    }

    .nav-text {
        display: none !important;
    }

    /* Bouton Menu spécial - Bulle ronde centrée */
    .nav-btn-menu {
        position: relative;
        flex: 0 0 auto;
        width: 56px;
        height: 56px;
        min-height: 56px;
        max-width: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
        box-shadow: 0 4px 16px rgba(129, 140, 248, 0.4), 0 -2px 8px rgba(129, 140, 248, 0.2);
        margin-top: -18px;
        margin-left: 3px;
        margin-right: 3px;
        z-index: 1001;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 1 !important;
    }
    
    .nav-btn-menu.active,
    .nav-btn-menu:hover {
        opacity: 1 !important;
    }

    .nav-btn-menu .nav-icon {
        font-size: 1.4rem;
        color: white !important;
        opacity: 1 !important;
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) !important;
    }
    
    .nav-btn-menu .nav-icon i,
    .nav-btn-menu .nav-icon i.fa-home,
    .nav-btn-menu .nav-icon i.fas,
    .nav-btn-menu .nav-icon i.fa,
    .nav-btn-menu span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
        text-fill-color: white !important;
    }
    
    .nav-btn-menu.active .nav-icon,
    .nav-btn-menu.active .nav-icon i,
    .nav-btn-menu.active span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
    }
    
    .nav-btn-menu:hover .nav-icon,
    .nav-btn-menu:hover .nav-icon i,
    .nav-btn-menu:hover span.nav-icon i {
        color: white !important;
        opacity: 1 !important;
        -webkit-text-fill-color: white !important;
    }
    
    /* Surcharger toutes les règles possibles pour l'icône du menu */
    .nav-btn-menu * {
        opacity: 1 !important;
    }
    
    .nav-btn-menu .nav-icon * {
        color: white !important;
        opacity: 1 !important;
    }
    
    /* Forcer la couleur blanche sur tous les éléments enfants */
    .nav-btn-menu,
    .nav-btn-menu *,
    .nav-btn-menu .nav-icon,
    .nav-btn-menu .nav-icon * {
        color: white !important;
    }
    
    /* S'assurer que le bouton menu n'hérite pas de la couleur des autres boutons */
    .nav-btn-menu {
        color: white !important;
    }
    
    /* Surcharger la règle de base .nav-btn pour le menu */
    .nav-btn-menu.nav-btn {
        color: white !important;
    }
    
    .nav-btn-menu.nav-btn .nav-icon {
        color: white !important;
        opacity: 1 !important;
    }

    .nav-btn-menu.active {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
        box-shadow: 0 6px 20px rgba(129, 140, 248, 0.6), 0 -2px 8px rgba(129, 140, 248, 0.3);
        transform: translateY(-2px);
    }

    .nav-btn-menu:hover {
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
        transform: translateY(-4px);
        box-shadow: 0 8px 24px rgba(129, 140, 248, 0.7), 0 -2px 8px rgba(129, 140, 248, 0.3);
    }

    .nav-btn:not(.nav-btn-menu) {
        color: var(--text-secondary);
    }

    .nav-btn:not(.nav-btn-menu).active {
        color: var(--primary-light);
        background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%) !important;
    }

    .nav-btn:not(.nav-btn-menu):hover {
        color: var(--primary-light);
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
    }

    /* Espacement pour le contenu principal (éviter que la nav cache le contenu) */
    .main-content {
        padding-bottom: 80px !important;
    }

    /* S'assurer que le body a assez d'espace en bas */
    body {
        padding-bottom: 0;
    }

    /* Ajuster le conteneur de l'app pour la nav en bas */
    .app-container {
        padding-bottom: 0;
    }

    .profile-selector-content {
        padding: 24px 20px;
        margin: 16px;
    }

    .main-title {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    /* Vocabulaire/Verbes */
    .vocab-header h2 {
        font-size: 1.6rem;
    }

    .vocab-count {
        font-size: 0.95rem;
        padding: 5px 12px;
    }

    .word-card {
        padding: 20px 16px;
    }

    .word-french {
        font-size: 1.3rem;
    }

    .word-italian {
        font-size: 1.1rem;
    }

    .theme-suggestions h3 {
        font-size: 1.2rem;
        margin-bottom: 16px;
    }

    .theme-box {
        padding: 18px;
    }

    .theme-box-header h4 {
        font-size: 1rem;
    }

    .theme-description {
        font-size: 0.9rem;
        min-height: auto;
    }

    .theme-box-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    .review-suggestion-box {
        padding: 12px;
        min-height: 120px;
    }

    .review-suggestion-image {
        width: 150px;
        height: 150px;
    }

    .review-suggestion-label {
        font-size: 0.95rem;
    }

    .review-suggestion-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }

    /* Révision */
    .review-controls {
        margin-bottom: 20px;
    }

    .review-controls h3 {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .review-direction-buttons {
        gap: 10px;
        flex-direction: column;
    }

    .direction-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
    }

    .review-card-container {
        max-width: 100%;
        padding: 0;
    }

    .review-card {
        height: 280px;
        margin-bottom: 20px;
        border-width: 0;
    }

    .review-card-front,
    .review-card-back {
        padding: 24px 16px;
    }

    .review-word,
    .review-translation {
        font-size: 1.8rem;
        padding: 16px;
        line-height: 1.4;
        word-break: break-word;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .review-translation {
        padding: 14px 20px;
        font-size: 1.6rem;
    }

    .review-actions {
        gap: 10px;
        margin-bottom: 16px;
        flex-wrap: wrap;
    }

    .review-action-btn {
        padding: 14px 24px;
        font-size: 0.9rem;
        flex: 1;
        min-width: calc(50% - 5px);
    }

    .review-progress {
        margin-top: 12px;
    }

    .progress-bar {
        height: 10px;
        margin-bottom: 10px;
    }

    #reviewProgressText,
    #verbesReviewProgressText {
        font-size: 0.85rem;
    }

    /* Chat */
    .chat-container {
        height: calc(100vh - 200px);
        min-height: calc(100vh - 200px);
        max-height: calc(100vh - 200px);
        border-radius: var(--border-radius);
    }

    .chat-messages {
        padding: 12px 10px;
        gap: 10px;
    }

    .message {
        max-width: 85%;
        font-size: 0.9rem;
    }

    .message-content {
        padding: 8px 12px;
        border-radius: var(--border-radius-sm);
    }

    .message-content p {
        line-height: 1.4;
        font-size: 0.9rem;
    }

    .assistant-message .message-content {
        padding-left: 14px;
    }

    .error-correction {
        padding: 8px 12px;
        margin-top: 6px;
        font-size: 0.85rem;
    }

    .chat-input-container {
        padding: 12px;
        gap: 10px;
    }

    .chat-input {
        font-size: 0.9rem;
        padding: 12px 14px;
        min-height: 44px;
        max-height: 120px;
    }

    .send-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    /* Dashboard */
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
        margin-top: 16px;
    }

    /* Réinitialiser les positions des boxes sur mobile */
    .dashboard-card-square,
    .dashboard-card-square:first-of-type,
    .dashboard-card-square:nth-of-type(2),
    .dashboard-card-square:nth-of-type(3) {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    #dashboardReviewBox {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    .dashboard-card-horizontal {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    .dashboard-card-xp {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    .dashboard-card {
        padding: 20px;
    }

    .dashboard-card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }

    .dashboard-card-icon i {
        font-size: 2rem;
    }

    .dashboard-card-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .dashboard-card-value {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    .dashboard-card-label {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .dashboard-card-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* Box Streak - Mobile */
    .dashboard-card-streak {
        padding: 20px;
    }

    .dashboard-card-streak .streak-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }

    .dashboard-card-streak .streak-icon i {
        font-size: 2rem;
    }

    .dashboard-card-streak .streak-value {
        font-size: 2.5rem;
        margin-bottom: 8px;
    }

    .dashboard-card-streak .streak-label {
        font-size: 0.85rem;
        margin-bottom: 0;
        line-height: 1.4;
    }

    /* Box XP - Mobile */
    .dashboard-card-xp {
        padding: 20px;
        margin-bottom: 0;
    }

    .xp-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .xp-icon-container {
        margin: 0 auto;
    }

    .xp-icon {
        width: 70px;
        height: 70px;
    }

    .xp-icon i {
        font-size: 2rem;
    }

    .xp-level-badge {
        width: 32px;
        height: 32px;
        bottom: -6px;
        right: -6px;
    }

    .xp-level-badge span {
        font-size: 0.9rem;
    }

    .xp-title {
        font-size: 1.3rem;
        margin-bottom: 12px;
    }

    .xp-bar {
        height: 14px;
    }

    .xp-text {
        font-size: 0.85rem;
    }

    /* Box Leçon Dashboard - Mobile */
    #dashboardLeconCard,
    #dashboardLeconCard.dashboard-card {
        flex-direction: column !important;
        align-items: stretch;
        justify-content: flex-start;
        gap: 20px;
        padding: 20px;
        height: auto;
        min-height: auto;
        max-height: none;
        text-align: left;
        position: relative;
        display: flex;
    }

    #dashboardLeconCard:hover {
        transform: translateY(-2px);
    }

    #dashboardLeconCard .lecon-item-header {
        width: 100%;
        gap: 12px;
        margin-bottom: 0;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        flex-wrap: nowrap;
        order: 1;
        flex: 0 0 auto;
        flex-shrink: 0;
        flex-grow: 0;
        min-width: 0;
        min-height: 60px;
        max-height: none;
        overflow: visible;
        display: flex;
        position: relative;
        z-index: 1;
        align-self: stretch;
    }

    #dashboardLeconCard .lecon-item-number {
        width: 50px;
        height: 50px;
        min-width: 50px;
        font-size: 1.3rem;
        flex-shrink: 0;
    }

    #dashboardLeconCard .lecon-item-content {
        flex: 1 1 auto;
        min-width: 100px;
        display: flex;
        align-items: center;
        overflow: visible;
        width: auto;
        max-width: 100%;
    }

    #dashboardLeconCard .lecon-item-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        -webkit-text-fill-color: var(--text-primary);
        background: none;
        -webkit-background-clip: unset;
        background-clip: unset;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        line-height: 1.4;
        margin: 0;
        padding: 0;
        overflow: visible;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        word-break: break-word;
        width: 100%;
        min-width: 100px;
        max-width: 100%;
        flex: 1 1 auto;
        visibility: visible;
        opacity: 1;
    }

    #dashboardLeconCard .lecon-item-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 0;
        margin-bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        order: 2;
        flex: 0 0 auto;
        flex-shrink: 0;
        flex-grow: 0;
        position: relative;
        z-index: 1;
        clear: both;
        align-self: stretch;
    }

    #dashboardLeconCard .lecon-item-btn {
        width: auto;
        min-width: 200px;
        max-width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        justify-content: center;
        white-space: nowrap;
        min-height: 48px;
        display: flex;
        align-items: center;
        gap: 8px;
        position: relative;
        z-index: 1;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    #dashboardLeconCard .lecon-item-btn i {
        font-size: 1.1rem;
    }

    /* Leçons */
    .course-header,
    .discussion-header,
    .stats-header {
        margin-bottom: 20px;
        margin-top: 28px;
    }

    .course-header h2,
    .discussion-header-left h2,
    .stats-header h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .section-description {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .lecon-container {
        padding: 16px 0;
    }

    .lecon-item {
        padding: 20px;
    }

    .lecon-item-header {
        gap: 12px;
        margin-bottom: 12px;
    }

    .lecon-item-number {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .lecon-item-title {
        font-size: 1.1rem;
    }

    .lecon-item-actions {
        margin-top: 12px;
        flex-direction: column;
        gap: 10px;
    }

    .lecon-item-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 0.95rem;
        justify-content: center;
    }

    .lecon-content-header {
        padding: 16px;
        gap: 12px;
    }

    .lecon-content-header h2 {
        font-size: 1.3rem;
    }

    .lecon-back-btn,
    .lecon-question-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .lecon-content-container {
        padding: 20px 16px;
        min-height: 300px;
    }

    .lecon-content-body {
        font-size: 1rem;
        line-height: 1.7;
    }

    .lecon-content-body h3 {
        font-size: 1.3rem;
        margin-top: 32px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .lecon-content-body h4 {
        font-size: 1.1rem;
        margin-top: 24px;
        margin-bottom: 12px;
    }

    .lecon-content-body p:first-of-type {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .lecon-content-body ul,
    .lecon-content-body ol {
        padding-left: 24px;
    }

    .lecon-question-chat {
        max-height: 85vh;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }

    .lecon-question-chat-header {
        padding: 16px 20px;
    }

    .lecon-question-chat-header h3 {
        font-size: 1.1rem;
    }

    .lecon-question-chat .chat-messages {
        padding: 16px;
        max-height: calc(85vh - 160px);
        min-height: 150px;
    }

    .lecon-question-chat .chat-input-container {
        padding: 16px;
    }

    .lecon-question-chat .chat-input {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    .lecon-question-chat .send-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Statistiques */
    .stats-header {
        margin-bottom: 16px;
    }

    .stats-container {
        gap: 20px;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 18px;
        gap: 14px;
        flex-direction: row;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-title {
        font-size: 0.85rem;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1.8rem;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stats-chart-container {
        padding: 20px;
    }

    .chart-title {
        font-size: 1.1rem;
        margin-bottom: 16px;
    }

    .activity-list {
        gap: 10px;
        max-height: 300px;
    }

    .activity-item {
        padding: 12px;
        gap: 10px;
    }

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

    .activity-description {
        font-size: 0.85rem;
    }

    .activity-date {
        font-size: 0.75rem;
    }

    .stats-language-level {
        padding: 20px;
    }

    .language-level-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .language-level-selector label {
        width: 100%;
    }

    .language-level-select {
        width: 100%;
        min-width: 100%;
        padding: 12px 40px 12px 16px;
    }

    .language-level-info {
        font-size: 0.85rem;
        margin-top: 12px;
    }

    /* Modals - Plein écran sur mobile */
    .modal {
        align-items: center;
        padding: 20px 10px;
    }

    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 24px 20px;
        margin: auto;
        border-radius: var(--border-radius-lg);
        max-height: 90vh;
        overflow-y: auto;
        animation: modalSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .modal-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
    }

    .modal-close svg {
        width: 16px;
        height: 16px;
    }

    .modal-content h3 {
        font-size: 1.4rem;
        margin-bottom: 20px;
        padding-right: 40px;
    }

    .modal-form-group {
        margin-bottom: 18px;
    }

    .modal-label {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .modal-input {
        padding: 12px 16px;
        font-size: 0.95rem;
    }

    .modal-loading {
        padding: 16px;
        margin: 16px 0;
    }

    .modal-loading p {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

    .action-btn {
        width: 100%;
        padding: 14px 24px;
        font-size: 0.95rem;
        justify-content: center;
    }

    /* Améliorations générales */
    .main-content {
        padding-bottom: 80px; /* Espace pour la navigation en bas si nécessaire */
    }

    /* Touch targets plus grands - Accessibilité tactile */
    button,
    .nav-btn,
    .action-btn,
    .review-action-btn,
    .send-btn,
    .direction-btn,
    .theme-box-btn,
    .dashboard-card-btn,
    .lecon-item-btn {
        min-height: 44px; /* Taille minimale recommandée pour le touch */
        -webkit-tap-highlight-color: rgba(129, 140, 248, 0.3);
    }

    /* Amélioration de l'interaction tactile */
    .word-card,
    .theme-box,
    .lecon-item,
    .stat-card,
    .dashboard-card {
        -webkit-tap-highlight-color: rgba(129, 140, 248, 0.2);
    }

    /* Désactiver les animations lourdes sur mobile pour améliorer les performances */
    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }

    /* Amélioration du scroll */
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Optimisation des images */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Espacement amélioré */
    .vocab-loading {
        padding: 40px 20px;
        font-size: 1rem;
    }

    .lecon-loading {
        padding: 40px 20px;
    }

    .lecon-loading p {
        font-size: 0.95rem;
    }
}

/* Statistiques */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.stat-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.stat-icon {
    font-size: 3rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-icon i {
    font-size: inherit;
}

.stat-content {
    flex: 1;
}

.stat-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: 4px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.stats-language-level {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.language-level-selector {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.language-level-selector label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.language-level-select {
    padding: 14px 48px 14px 20px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.9) 100%);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    min-width: 280px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5b4fc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.language-level-select:hover,
.language-level-select:focus {
    color: var(--primary-light) !important;
}

.language-level-select:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(51, 65, 85, 0.15) 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5b4fc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
    box-shadow: var(--shadow);
    transform: translateY(-1px);
    color: var(--primary-light) !important;
}

.language-level-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2), var(--shadow);
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.2) 0%, rgba(51, 65, 85, 0.2) 100%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a5b4fc' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.language-level-select option {
    background: var(--surface);
    color: var(--text-primary);
    padding: 12px;
    font-weight: 600;
}

.language-level-select option:hover {
    background: var(--primary-color);
    color: var(--primary-light);
}

.language-level-info {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Styles pour les options du select (pour certains navigateurs) */
.language-level-select::-ms-expand {
    display: none;
}

.language-level-select option:checked {
    background: var(--primary-color);
    color: white;
}

.language-level-select option:first-child {
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

@media (max-width: 768px) {
    .language-level-select {
        min-width: 100%;
        width: 100%;
    }
    
    .language-level-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .language-level-selector label {
        width: 100%;
    }
}

.stats-chart-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.9) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.activity-list::-webkit-scrollbar {
    width: 8px;
}

.activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.8);
    border-radius: 4px;
}

.activity-list::-webkit-scrollbar-thumb:hover {
    background: rgba(71, 85, 105, 0.9);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--border-radius-sm);
    border-left: 3px solid var(--primary-color);
    transition: var(--transition);
}

.activity-item:hover {
    background: rgba(15, 23, 42, 0.7);
    transform: translateX(5px);
}

.activity-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
}

.activity-description {
    color: var(--text-primary);
    font-size: 0.95rem;
    margin-bottom: 4px;
    font-weight: 500;
}

.activity-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0;
}

.no-activity {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
    font-style: italic;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 32px;
    padding: 0 4px;
}

/* Box XP - Première ligne, pleine largeur */
#xpCard {
    grid-row: 1;
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.dashboard-card-square {
    grid-column: span 1;
}

.dashboard-card-square:first-of-type {
    grid-row: 2;
    grid-column: 1;
}

.dashboard-card-square:nth-of-type(2) {
    grid-row: 2;
    grid-column: 2;
}

/* Box XP du jour - même largeur que la box Niveau */
.dashboard-card-square.dashboard-card-xp {
    grid-row: 3;
    grid-column: 1 / -1;
}

#dashboardReviewBox {
    grid-row: 4;
    grid-column: 1 / -1;
    margin-bottom: 0;
}

.dashboard-card-horizontal {
    grid-row: 4;
    margin-top: 0;
}

#dashboardLeconCard {
    margin-top: 0;
}

.dashboard-card-horizontal {
    grid-column: 1 / -1;
}

.dashboard-card-horizontal:not(#dashboardLeconCard) {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
}

.dashboard-card-horizontal:not(#dashboardLeconCard):hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.dashboard-card-horizontal .review-suggestion-box {
    margin-bottom: 0;
}

#dashboardLeconCard {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-md);
    padding: 24px 32px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 100px;
    align-content: center;
}

#dashboardLeconCard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#dashboardLeconCard::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#dashboardLeconCard:hover::before {
    opacity: 1;
}

#dashboardLeconCard:hover::after {
    opacity: 1;
}

#dashboardLeconCard:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

#dashboardLeconCard .lecon-item-header {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 0;
    align-self: center;
}

#dashboardLeconCard .lecon-item-number {
    width: 60px;
    height: 60px;
    min-width: 60px;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#dashboardLeconCard:hover .lecon-item-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: var(--shadow-2xl);
}

#dashboardLeconCard .lecon-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
}

#dashboardLeconCard .lecon-item-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    align-self: center;
}

#dashboardLeconCard .lecon-item-actions {
    flex-shrink: 0;
    margin-left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

#dashboardLeconCard .lecon-item-btn {
    padding: 12px 24px;
    font-size: 1rem;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    margin: 0;
    line-height: 1.5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
}

#dashboardLeconCard .lecon-item-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

#dashboardLeconCard .lecon-item-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-card-horizontal-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}

.dashboard-card-horizontal-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.dashboard-card-icon-small {
    width: 60px;
    height: 60px;
    margin-bottom: 0;
}

.dashboard-card-icon-small i {
    font-size: 1.8rem;
}

.dashboard-card-horizontal-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dashboard-card-horizontal-text .dashboard-card-title {
    margin-bottom: 0;
    font-size: 1.3rem;
}

.dashboard-card-horizontal-text .dashboard-card-label {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.dashboard-card-btn-inline {
    width: auto;
    min-width: 160px;
    padding: 14px 24px;
    white-space: nowrap;
}

.dashboard-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#dashboardLeconCard.dashboard-card {
    flex-direction: row;
    align-items: center;
    text-align: left;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.dashboard-card:hover::before {
    opacity: 1;
}

.dashboard-card:hover::after {
    opacity: 1;
}

.dashboard-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.dashboard-card-icon {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    transition: var(--transition);
}

.dashboard-card-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientShift 3s ease infinite;
}

.dashboard-card:hover .dashboard-card-icon::before {
    opacity: 0.6;
}

.dashboard-card:hover .dashboard-card-icon {
    transform: scale(1.08) rotate(5deg);
    box-shadow: var(--shadow-2xl);
}

.dashboard-card-icon i {
    font-size: 2.8rem;
    color: white;
    z-index: 1;
    position: relative;
}

.dashboard-card-content {
    width: 100%;
}

.dashboard-card-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.dashboard-card-value {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1;
    text-shadow: 0 2px 20px rgba(129, 140, 248, 0.3);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-card-label {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-weight: 500;
}

.dashboard-card-btn {
    width: 100%;
    padding: 16px 28px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.dashboard-card-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.dashboard-card-btn:hover:not(:disabled)::before {
    left: 100%;
}

.dashboard-card-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.dashboard-card-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

/* Box de suivi d'avancement (Streak) avec touches de jaune */
.dashboard-card-streak {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: 2px solid rgba(251, 191, 36, 0.4);
    position: relative;
    overflow: hidden;
}

.dashboard-card-streak::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #fbbf24);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    opacity: 0.6;
    z-index: 1;
}

.dashboard-card-streak::after {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.15) 0%, transparent 70%);
}

.dashboard-card-streak:hover {
    border-color: rgba(251, 191, 36, 0.7);
    box-shadow: 0 6px 20px rgba(251, 191, 36, 0.25), var(--shadow-md);
}

.dashboard-card-streak .streak-icon {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3), var(--shadow-md);
}

.dashboard-card-streak .streak-icon::before {
    background: linear-gradient(135deg, #fbbf24, #fcd34d, #fbbf24);
    opacity: 0.8;
}

.dashboard-card-streak:hover .streak-icon {
    transform: scale(1.12) rotate(8deg);
    box-shadow: 0 6px 18px rgba(251, 191, 36, 0.4), var(--shadow-lg);
}

.dashboard-card-streak .streak-value {
    color: #fbbf24;
    text-shadow: 0 2px 20px rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, #fbbf24 0%, #fcd34d 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dashboard-card-streak .streak-label {
    color: rgba(251, 191, 36, 0.9);
    font-weight: 600;
    font-size: 1.05rem;
    text-shadow: 0 1px 8px rgba(251, 191, 36, 0.3);
}

/* Box XP */
.dashboard-card-xp {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: 2px solid rgba(129, 140, 248, 0.4);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.dashboard-card-xp::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    opacity: 0.6;
    z-index: 1;
}

.dashboard-card-xp:hover {
    border-color: rgba(129, 140, 248, 0.7);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.25), var(--shadow-md);
    transform: translateY(-2px);
}

.xp-icon {
    color: var(--primary-color);
}

.xp-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 4px 0;
}

.xp-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.xp-progress-bar-container {
    width: 100%;
    margin-top: 12px;
}

.xp-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(100, 116, 139, 0.2);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #3b82f6);
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.xp-header {
    display: flex;
    align-items: center;
    gap: 24px;
}

.xp-icon-container {
    position: relative;
    flex-shrink: 0;
}

.xp-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(129, 140, 248, 0.4), var(--shadow-lg);
    position: relative;
}

.xp-icon i {
    font-size: 2.5rem;
    color: white;
    z-index: 1;
}

.xp-level-badge {
    position: absolute;
    bottom: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.5);
    border: 3px solid var(--surface);
    z-index: 2;
}

.xp-level-badge span {
    font-size: 1rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.xp-info {
    flex: 1;
    min-width: 0;
}

.xp-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

.xp-title span {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.xp-bar-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xp-bar {
    width: 100%;
    height: 16px;
    background: rgba(51, 65, 85, 0.8);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
    position: relative;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-light) 50%, var(--primary-color) 100%);
    background-size: 200% 100%;
    border-radius: 10px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 2px 8px rgba(129, 140, 248, 0.4);
    animation: progressShimmer 2s infinite;
    position: relative;
    overflow: hidden;
}

.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressSweep 1.5s infinite;
}

.xp-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
}

.xp-text span:first-child {
    color: var(--primary-color);
    font-weight: 700;
}

.xp-leaderboard-btn {
    margin-top: 16px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.xp-leaderboard-btn:hover {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(251, 191, 36, 0.5);
}

.xp-leaderboard-btn:active {
    transform: translateY(0);
}

.xp-leaderboard-btn i {
    font-size: 1rem;
}

/* Leaderboard */
.leaderboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.leaderboard-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
    border-color: var(--primary-color);
}

.leaderboard-rank {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: center;
}

.leaderboard-item.rank-1 .leaderboard-rank,
.leaderboard-item.rank-2 .leaderboard-rank,
.leaderboard-item.rank-3 .leaderboard-rank {
    color: var(--text-primary);
    font-size: 1.8rem;
}

.leaderboard-avatar-container {
    position: relative;
    flex-shrink: 0;
}

.leaderboard-flag {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--background-solid);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.leaderboard-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-md);
    position: relative;
    border: 3px solid var(--primary-color);
    overflow: hidden;
    /* Permettre l'affichage d'image de fond */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Couronnes pour les 3 premiers */
.leaderboard-item.rank-1 .leaderboard-avatar {
    border: 4px solid #fbbf24;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6), var(--shadow-lg);
    position: relative;
}

.leaderboard-item.rank-1 .leaderboard-avatar::before {
    content: '👑';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    z-index: 2;
}

.leaderboard-item.rank-1 .leaderboard-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #fbbf24, #fcd34d, #fbbf24);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientShift 3s ease infinite;
    z-index: 1;
}

.leaderboard-item.rank-2 .leaderboard-avatar {
    border: 4px solid #c0c0c0;
    box-shadow: 0 0 20px rgba(192, 192, 192, 0.6), var(--shadow-lg);
}

.leaderboard-item.rank-2 .leaderboard-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #c0c0c0, #e5e5e5, #c0c0c0);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientShift 3s ease infinite;
    z-index: 1;
}

.leaderboard-item.rank-3 .leaderboard-avatar {
    border: 4px solid #cd7f32;
    box-shadow: 0 0 20px rgba(205, 127, 50, 0.6), var(--shadow-lg);
}

.leaderboard-item.rank-3 .leaderboard-avatar::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, #cd7f32, #e6a85c, #cd7f32);
    background-size: 200% 200%;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: gradientShift 3s ease infinite;
    z-index: 1;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-stats {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.leaderboard-xp {
    color: var(--primary-color);
    font-weight: 600;
}

.leaderboard-level {
    color: #fbbf24;
    font-weight: 600;
}

.leaderboard-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.leaderboard-loading p {
    margin-top: 20px;
    font-size: 1rem;
}

.leaderboard-separator {
    margin: 20px 0;
    padding: 16px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    border-top: none;
    border-bottom: none;
}

.dashboard-card-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-muted);
    box-shadow: none;
}

.dashboard-card-btn i {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.dashboard-card-btn:hover:not(:disabled) i {
    transform: translateX(5px);
}

/* Section Leçon */
.lecon-container {
    padding: 20px 0;
}

.lecon-list {
    max-width: 1000px;
    margin: 0 auto;
}

.lecon-loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
}

.lecon-level-group {
    margin-bottom: 40px;
}

.lecon-level-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: none;
    letter-spacing: -0.01em;
}

.lecon-level-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.lecon-item {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.lecon-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.lecon-item:hover::before {
    transform: scaleY(1);
}

.lecon-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.lecon-item.completed {
    border-color: var(--success-color);
    opacity: 0.85;
}

.lecon-item.completed::before {
    background: var(--success-color);
}

.lecon-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.lecon-item.next {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
    animation: pulse 2s ease-in-out infinite;
}

.lecon-item-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.lecon-item-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: var(--shadow-md);
}

.lecon-item.completed .lecon-item-number {
    background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
}

.lecon-item-content {
    flex: 1;
}

.lecon-item-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.lecon-item-check,
.lecon-item-lock {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lecon-item-check {
    background: rgba(52, 211, 153, 0.2);
    color: var(--success-color);
    font-size: 1.5rem;
}

.lecon-item-lock {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.lecon-item-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.lecon-item-btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.lecon-item-btn.primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.lecon-item-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.lecon-item-btn.secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: none;
}

.lecon-item-btn.secondary:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.lecon-item.locked .lecon-item-btn {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Vue contenu de la leçon */
#lecon-list-view.hidden,
#lecon-content-view.hidden {
    display: none;
}

.lecon-content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    margin-top: 48px;
    gap: 24px;
    flex-wrap: wrap;
    padding: 24px;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(51, 65, 85, 0.6) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.lecon-content-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex: 1;
    margin-top: 24px;
    margin: 0;
    text-align: center;
    line-height: 1.2;
}

.lecon-back-btn,
.lecon-question-btn {
    padding: 14px 28px;
    border: none;
    background: var(--surface);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.lecon-back-btn::before,
.lecon-question-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.lecon-back-btn:hover::before,
.lecon-question-btn:hover::before {
    left: 100%;
}

.lecon-back-btn:hover,
.lecon-question-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--surface-elevated);
}

.lecon-back-btn i,
.lecon-question-btn i {
    font-size: 1.1rem;
    transition: var(--transition);
}

.lecon-back-btn:hover i {
    transform: translateX(-3px);
}

.lecon-question-btn {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
}

.lecon-question-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.6);
    transform: translateY(-2px) scale(1.02);
}

.lecon-question-btn:hover i {
    transform: rotate(15deg) scale(1.1);
}

.lecon-content-container {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(51, 65, 85, 0.95) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-xl);
    margin-bottom: 32px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lecon-content-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.lecon-content-body {
    color: var(--text-primary);
    line-height: 1.9;
    font-size: 1.05rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.lecon-content-body h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 40px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: none;
    position: relative;
    padding-left: 16px;
}

.lecon-content-body h3:first-child {
    margin-top: 0;
}

.lecon-content-body h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-light));
    border-radius: 2px;
}

.lecon-content-body h4 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-top: 32px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lecon-content-body h4::before {
    content: '▸';
    color: var(--primary-light);
    font-size: 1.2rem;
}

.lecon-content-body p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-align: justify;
}

.lecon-content-body p:first-of-type {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.lecon-content-body ul,
.lecon-content-body ol {
    margin: 20px 0;
    padding-left: 32px;
    color: var(--text-secondary);
}

.lecon-content-body li {
    margin-bottom: 12px;
    position: relative;
    padding-left: 8px;
}

.lecon-content-body ul li::marker {
    color: var(--primary-color);
}

.lecon-content-body ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

.lecon-content-body strong {
    color: var(--text-primary);
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lecon-content-body em {
    color: var(--primary-light);
    font-style: italic;
    font-weight: 500;
}

.lecon-content-body code {
    background: rgba(15, 23, 42, 0.9);
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', 'Consolas', monospace;
    color: var(--primary-light);
    font-size: 0.95em;
    border: none;
    box-shadow: var(--shadow-sm);
}

.lecon-content-body pre {
    background: rgba(15, 23, 42, 0.95);
    padding: 20px;
    border-radius: var(--border-radius-sm);
    border: none;
    overflow-x: auto;
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

.lecon-content-body pre code {
    background: transparent;
    padding: 0;
    border: none;
    color: var(--text-primary);
    font-size: 0.9em;
}

.lecon-content-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 20px 24px;
    margin: 24px 0;
    color: var(--text-secondary);
    font-style: italic;
    background: rgba(129, 140, 248, 0.05);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    position: relative;
}

.lecon-content-body blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    color: var(--primary-color);
    opacity: 0.3;
    font-family: serif;
}

.lecon-content-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    background: rgba(15, 23, 42, 0.5);
    border-radius: var(--border-radius-sm);
    overflow: hidden;
}

.lecon-content-body table th,
.lecon-content-body table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: none;
}

.lecon-content-body table th {
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

.lecon-content-body table tr:hover {
    background: rgba(129, 140, 248, 0.05);
}

.lecon-content-body a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.lecon-content-body a:hover {
    border-bottom-color: var(--primary-color);
    color: var(--primary-light);
}

.lecon-content-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-sm);
    margin: 24px 0;
    box-shadow: var(--shadow-md);
}

/* Chat pour les questions de leçon */
.lecon-question-chat {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 420px;
    max-width: calc(100vw - 20px);
    max-height: 70vh;
    background: var(--surface-elevated);
    border: none;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    box-shadow: var(--shadow-2xl);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideUp 0.3s ease-out;
    overflow: hidden;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lecon-question-chat.hidden {
    display: none;
}

.lecon-question-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: none;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
    position: relative;
}

.lecon-question-chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.lecon-question-chat-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lecon-question-chat-header h3::before {
    content: '💬';
    font-size: 1.5rem;
}

.lecon-question-chat .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    max-height: calc(70vh - 180px);
    min-height: 200px;
    scroll-behavior: smooth;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: linear-gradient(to bottom, rgba(129, 140, 248, 0.03) 0%, transparent 100%);
}

.lecon-question-chat .chat-messages::-webkit-scrollbar {
    width: 8px;
}

.lecon-question-chat .chat-messages::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 4px;
}

.lecon-question-chat .chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.lecon-question-chat .chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.lecon-question-chat .message {
    display: flex;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}

.lecon-question-chat .message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.lecon-question-chat .message-content {
    background: var(--surface);
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    word-wrap: break-word;
    box-shadow: var(--shadow-md);
    border: none;
    position: relative;
    overflow: hidden;
    line-height: 1.6;
}

.lecon-question-chat .user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: var(--primary-color);
}

.lecon-question-chat .assistant-message .message-content {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.lecon-question-chat .message-content p {
    margin: 0;
    color: inherit;
}

.lecon-question-chat .message-content p:not(:last-child) {
    margin-bottom: 8px;
}

.lecon-question-chat .chat-input-container {
    border-top: none;
    padding: 20px 24px;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lecon-question-chat .chat-input {
    background: rgba(15, 23, 42, 0.8);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 1rem;
    resize: none;
    transition: var(--transition);
    width: 100%;
    margin-bottom: 12px;
}

.lecon-question-chat .chat-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.lecon-question-chat .send-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.4);
}

.lecon-question-chat .send-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(129, 140, 248, 0.6);
}

.lecon-question-chat .send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive pour les statistiques */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-icon {
        font-size: 2.5rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .stat-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .stat-icon {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.8rem;
    }

    /* Optimisation pour la page de révision sur téléphone */
    .review-controls {
        margin-bottom: 12px;
        padding: 0 10px;
    }

    .review-controls h3 {
        font-size: 1rem;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .review-direction-buttons {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .direction-btn {
        padding: 10px 14px;
        font-size: 0.85rem;
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
    }

    .review-header {
        margin-bottom: 12px;
        padding: 0 10px;
    }

    .review-back-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    .review-card-container {
        max-width: 100%;
        padding: 0 10px;
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .review-card {
        height: 250px;
        margin-bottom: 12px;
        border-width: 0;
        flex-shrink: 0;
    }

    .review-card-front,
    .review-card-back {
        padding: 16px 12px;
    }

    .review-word,
    .review-translation {
        font-size: 1.5rem;
        padding: 12px 8px;
        line-height: 1.4;
        word-break: break-word;
        hyphens: auto;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    .review-translation {
        padding: 12px 16px;
        font-size: 1.4rem;
    }

    .review-actions {
        gap: 8px;
        margin-bottom: 10px;
        flex-wrap: wrap;
        padding: 0 10px;
    }

    .review-action-btn {
        padding: 14px 20px;
        font-size: 0.9rem;
        flex: 1;
        min-width: calc(50% - 4px);
        min-height: 48px;
    }

    .review-action-btn i {
        margin-right: 6px;
    }

    .review-progress {
        margin-top: 8px;
        padding: 0 10px;
    }

    .progress-bar {
        height: 8px;
        margin-bottom: 8px;
    }

    #reviewProgressText {
        font-size: 0.85rem;
    }

    #restartReviewBtn {
        margin-top: 12px !important;
        padding: 12px 20px;
        font-size: 0.9rem;
        min-height: 48px;
    }

    /* Section de révision avec hauteur optimisée */
    #vocab-review-mode,
    #verbes-review-mode {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 160px);
        max-height: calc(100vh - 160px);
        overflow-y: auto;
        padding: 12px 0;
        -webkit-overflow-scrolling: touch;
    }

    #vocab-review-mode .review-card-container,
    #verbes-review-mode .review-card-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        justify-content: center;
    }

    #vocab-review-mode .review-controls,
    #verbes-review-mode .review-controls {
        flex-shrink: 0;
        padding: 0 10px;
    }

    #vocab-review-mode .review-header,
    #verbes-review-mode .review-header {
        flex-shrink: 0;
        padding: 0 10px;
    }

    /* Carte de résultat de révision - Responsive mobile */
    .review-card .review-word {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        gap: 0 !important;
    }

    .review-card .review-word h2 {
        font-size: 1.3rem !important;
        margin-bottom: 15px !important;
        margin-top: 0 !important;
        line-height: 1.3;
        order: 1;
    }

    .review-card .review-word > div[style*="font-size: 1rem"] {
        font-size: 0.9rem !important;
        margin: 15px 0 !important;
        order: 2;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }

    .review-card .review-word > div[style*="font-size: 1rem"] p {
        margin: 0 !important;
    }

    .review-card .review-word p[style*="1.2rem"] {
        font-size: 1.1rem !important;
        margin-top: 8px !important;
        margin-bottom: 0 !important;
        order: 3;
    }

    .review-card .review-word p[style*="0.95rem"] {
        font-size: 0.85rem !important;
        margin-top: 15px !important;
        margin-bottom: 0 !important;
        line-height: 1.4;
        order: 4;
    }

    .review-card .review-word div[style*="flex"] {
        flex-direction: column !important;
        gap: 10px !important;
        margin-top: 20px !important;
        width: 100% !important;
        order: 5;
    }

    .review-card .review-word button.action-btn {
        width: 100% !important;
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        min-height: 48px;
        box-sizing: border-box;
    }

    /* Optimisation pour les sections vocabulaire/verbes */
    .vocab-mode {
        padding-bottom: 20px;
    }

    /* Amélioration de la navigation pour mobile */
    .mode-navigation {
        position: sticky;
        top: 0;
        z-index: 99;
        background: linear-gradient(135deg, rgba(30, 41, 59, 0.98) 0%, rgba(51, 65, 85, 0.98) 100%);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }

    /* Optimisation pour la page Cours/Discussion sur téléphone */
    .course-header,
    .discussion-header {
        margin-bottom: 15px;
        margin-top: 23px;
    }

    .course-header h2,
    .discussion-header-left h2 {
        font-size: 1.5rem;
        margin-bottom: 0px;
    }

    .section-description {
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .chat-container {
        height: calc(100vh - 200px);
        min-height: calc(100vh - 200px);
        max-height: calc(100vh - 200px);
    }

    .chat-messages {
        padding: 12px 10px;
        gap: 8px;
    }

    .message {
        max-width: 85%;
        font-size: 0.9rem;
    }

    .message-content {
        padding: 5px 9px;
    }

    .message-content p {
        line-height: 1.2;
        font-size: 0.9rem;
    }

    .assistant-message .message-content {
        padding-left: 13px;
    }

    .error-correction {
        padding: 5px 9px;
        margin-top: 5px;
    }

    .chat-input-container {
        padding: 12px;
    }

    .chat-input {
        font-size: 0.9rem;
        padding: 10px 12px;
        min-height: 40px;
    }

    .send-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    /* Optimisation pour la page Statistiques sur téléphone */
    #parametres-section {
        display: flex;
        flex-direction: column;
        min-height: calc(100vh - 200px);
        overflow-y: auto;
        padding: 16px 0;
    }

    #parametres-section .stats-header {
        flex-shrink: 0;
        margin-bottom: 20px;
    }

    #parametres-section .stats-container {
        flex: 1;
        min-height: 0;
    }

    .stats-header {
        margin-bottom: 15px;
        flex-shrink: 0;
    }

    .stats-header h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .stats-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow-y: auto;
    }

    .stats-grid {
        gap: 12px;
        margin-bottom: 15px;
    }

    .stat-card {
        padding: 16px;
        gap: 12px;
    }

    .stat-icon {
        font-size: 1.8rem;
    }

    .stat-title {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }

    .stat-value {
        font-size: 1.5rem;
        margin-bottom: 4px;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .stats-chart-container {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
    }

    /* Dashboard Grid - Responsive */
    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 16px;
        margin-top: 20px;
    }

    /* Réinitialiser les positions des boxes sur mobile */
    .dashboard-card-square,
    .dashboard-card-square:first-of-type,
    .dashboard-card-square:nth-of-type(2),
    .dashboard-card-square:nth-of-type(3) {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    #dashboardReviewBox {
        grid-row: auto !important;
        grid-column: 1 !important;
    }
    
    .dashboard-card-horizontal {
        grid-row: auto !important;
        grid-column: 1 !important;
    }
    
    .dashboard-card-xp {
        grid-row: auto !important;
        grid-column: 1 !important;
    }

    /* Leaderboard responsive */
    .leaderboard-container {
        padding: 12px;
    }
    
    .leaderboard-item {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .leaderboard-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .leaderboard-rank {
        font-size: 1.2rem;
        min-width: 30px;
    }

    .leaderboard-item.rank-1 .leaderboard-rank,
    .leaderboard-item.rank-2 .leaderboard-rank,
    .leaderboard-item.rank-3 .leaderboard-rank {
        font-size: 1.4rem;
    }

    .leaderboard-name {
        font-size: 1rem;
    }

    .leaderboard-stats {
        font-size: 0.85rem;
        gap: 12px;
    }

    .leaderboard-flag {
        width: 20px;
        height: 20px;
        font-size: 12px;
        bottom: -2px;
        right: -2px;
        border-width: 0;
    }

    .xp-leaderboard-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .leaderboard-back-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .dashboard-card {
        padding: 24px;
    }

    .dashboard-card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 16px;
    }
    
    .dashboard-card-horizontal {
        padding: 24px;
    }
    
    /* Suppression des règles dupliquées - déjà gérées plus haut */

    .dashboard-card-icon i {
        font-size: 2rem;
    }

    .dashboard-card-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }

    .dashboard-card-value {
        font-size: 2.5rem;
        margin-bottom: 6px;
    }

    .dashboard-card-label {
        font-size: 0.85rem;
        margin-bottom: 16px;
    }

    .dashboard-card-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    /* Leçon contenu responsive - très petits écrans */
    .lecon-content-header h2 {
        font-size: 1.5rem;
    }

    .lecon-content-container {
        padding: 20px 16px;
    }

    .lecon-content-body h3 {
        font-size: 1.3rem;
    }

    .lecon-content-body h4 {
        font-size: 1.1rem;
    }

    .lecon-content-body p:first-of-type {
        font-size: 1rem;
    }

    .lecon-question-chat {
        max-height: 85vh;
        width: 100%;
        left: 0;
        right: 0;
    }

    .lecon-question-chat .chat-messages {
        max-height: calc(85vh - 160px);
        min-height: 150px;
    }

    /* Amélioration de l'affichage des mots sur mobile */
    .word-card-front {
        padding: 0;
    }

    .word-card-content {
        min-height: 60px;
    }

    /* Amélioration des thèmes suggérés */
    .theme-suggestions {
        margin-bottom: 24px;
    }

    /* Amélioration du header pour mobile */
    .app-header {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Amélioration de la navigation pour mobile */
    .nav-btn.active {
        background: rgba(129, 140, 248, 0.25);
    }

    /* Amélioration des boutons d'action */
    .action-btn.secondary {
        border-width: 0;
    }

    /* Amélioration des cartes de révision */
    .review-card {
        border-radius: var(--border-radius);
    }

    /* Amélioration du conteneur principal */
    .app-container {
        overflow-x: hidden;
    }

    /* Prévention du zoom sur les inputs iOS */
    @supports (-webkit-touch-callout: none) {
        .modal-input,
        .chat-input,
        .lecon-question-chat .chat-input,
        input[type="text"],
        input[type="password"],
        input[type="number"],
        textarea {
            font-size: 16px; /* Prévention du zoom sur iOS */
        }
    }

    /* Amélioration de la lisibilité sur mobile */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Optimisation du scroll pour mobile */
    .main-content,
    .chat-messages,
    .lecon-content-container,
    .modal-content {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }

    /* Amélioration de l'espacement vertical sur mobile */
    .mode-section {
        padding-bottom: 20px;
    }

    /* Optimisation des images de mascotte */
    .mascotte-image {
        max-width: 100%;
        height: auto;
    }

    /* Amélioration de la boîte de révision sur mobile */
    .review-suggestion-box {
        border-radius: var(--border-radius);
    }

    /* Amélioration de l'affichage des statistiques */
    .stats-header img.mascotte-image {
        max-width: 100px;
    }

    /* Amélioration de l'affichage du contenu de leçon */
    .lecon-content-body img {
        max-width: 100%;
        height: auto;
        border-radius: var(--border-radius-sm);
    }

    /* Amélioration de la navigation sticky */
    .app-header,
    .mode-navigation {
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .mode-navigation {
        z-index: 99;
    }

    .chart-title {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .activity-item {
        padding: 10px;
        gap: 10px;
    }

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

    .activity-description {
        font-size: 0.85rem;
    }

    .activity-date {
        font-size: 0.75rem;
    }
}

.hidden {
    display: none !important;
}

/* Box de debug pour word_reviews */
.debug-box {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: none;
}

.debug-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.debug-box button {
    margin-bottom: 15px;
}

#wordReviewsDebugLogs {
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-primary);
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
}

#wordReviewsDebugLogs div {
    margin-bottom: 5px;
    line-height: 1.4;
}

/* ========== MODE VOCAL ========== */
.vocal-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 10px;
    gap: 10px;
}

.vocal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 15px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Avatar Section */
.vocal-avatar-section {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

.vocal-avatar-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
    animation: mascotteFloat 3s ease-in-out infinite;
}

.vocal-avatar-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.vocal-avatar-body,
.vocal-avatar-eyes,
.vocal-avatar-mouth {
    position: absolute;
    object-fit: contain;
    transition: opacity 0.2s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* Body - Image principale (base) */
.vocal-avatar-body {
    width: 110%;
    height: 110%;
    top: -5%;
    left: -5%;
    z-index: 1;
}

/* Eyes - Positionnés en haut du visage */
.vocal-avatar-eyes {
    width: 65%;
    height: 28%;
    top: 23%;
    left: 45%;
    transform: translateX(-50%);
    z-index: 2;
}

/* Mouth - Positionné en bas du visage */
.vocal-avatar-mouth {
    width: 40%;
    height: 20%;
    bottom: 31%;
    left: 43%;
    transform: translateX(-50%);
    z-index: 3;
}

.vocal-avatar-section.listening .vocal-avatar-container {
    animation: pulse-avatar 2s ease-in-out infinite;
}

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

/* Status Section */
.vocal-status-section {
    width: 100%;
    text-align: center;
    flex-shrink: 0;
}

.vocal-status {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    padding: 8px 16px;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    display: inline-block;
    box-shadow: var(--shadow-sm);
    border: none;
}

.vocal-transcript {
    min-height: 60px;
    max-height: 100px;
    overflow-y: auto;
    padding: 10px;
    background: var(--surface);
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.vocal-user-text {
    margin-bottom: 8px;
    color: var(--primary-light);
    font-weight: 500;
}

.vocal-assistant-text {
    color: var(--text-primary);
}

.vocal-error {
    color: var(--error-color);
    font-weight: 500;
}

/* Controls */
.vocal-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px 0;
    flex-shrink: 0;
}

.vocal-mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vocal-mic-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

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

.vocal-mic-btn.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-mic 1.5s ease-in-out infinite;
}

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

@keyframes pulse-mic {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(239, 68, 68, 0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .vocal-avatar-wrapper {
        width: 320px;
        height: 320px;
    }
    
    .vocal-status {
        font-size: 1rem;
        padding: 10px 20px;
    }
    
    .vocal-mic-btn {
        width: 70px;
        height: 70px;
        font-size: 1.75rem;
    }
}

/* =====================================================
   Styles pour les abonnements
   ===================================================== */

/* Box abonnement dans les paramètres */
.subscription-box {
    margin-top: 20px;
}

.subscription-status {
    margin-bottom: 0;
}

/* Page d'abonnement */
.subscription-page {
    max-width: 100%;
}

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

.subscription-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Section code promo */
.promo-code-section {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: none;
}

.promo-code-section h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.promo-code-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.promo-code-form input {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    transition: var(--transition);
}

.promo-code-form input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.1);
}

/* Carte plan d'abonnement */
.subscription-plan-card {
    padding: 40px;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.plan-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.plan-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    line-height: 1;
}

.price-currency {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-left: 5px;
}

.plan-features {
    margin-top: 30px;
}

.plan-features h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--text-secondary);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li i {
    color: var(--success-color);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Responsive pour la page d'abonnement */
@media (max-width: 768px) {
    .subscription-header h2 {
        font-size: 1.5rem;
    }
    
    .subscription-plan-card {
        padding: 25px;
    }
    
    .subscription-page {
        padding: 20px 15px;
    }
    
    .subscription-header {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }
    
    .subscription-header p {
        font-size: 0.9rem;
    }
    
    .plan-header h3 {
        font-size: 1.2rem;
        margin-bottom: 15px;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .price-currency {
        font-size: 1.2rem;
    }
    
    .features-list li {
        font-size: 0.9rem;
        padding: 10px 0;
    }
    
    .promo-code-section {
        padding: 18px;
        margin-bottom: 20px;
    }
    
    .promo-code-form {
        flex-direction: column;
        gap: 12px;
    }
    
    .promo-code-form input {
        width: 100%;
    }
    
    .promo-code-form button {
        width: 100%;
        margin-left: 0;
        margin-top: 0;
    }
    
    .cgv-checkbox-container {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .cgv-checkbox-container label {
        font-size: 0.88rem;
        line-height: 1.5;
    }
}

/* Petit mobile (≤ 480px) */
@media (max-width: 480px) {
    .subscription-page {
        padding: 15px 12px;
    }
    
    .subscription-header {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .subscription-header h2 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }
    
    .subscription-header p {
        font-size: 0.85rem;
    }
    
    .subscription-plan-card {
        padding: 18px;
        margin-bottom: 18px;
    }
    
    .plan-header h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .price-amount {
        font-size: 1.8rem;
    }
    
    .price-currency {
        font-size: 1rem;
    }
    
    .features-list li {
        font-size: 0.88rem;
        padding: 8px 0;
    }
    
    .features-list li i {
        font-size: 0.85rem;
    }
    
    .promo-code-section {
        padding: 15px;
        margin-bottom: 18px;
    }
    
    .promo-code-section h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    .promo-code-form input {
        font-size: 0.95rem;
        padding: 12px;
    }
    
    .promo-code-form button {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .cgv-checkbox-container {
        padding: 12px;
        margin-bottom: 18px;
    }
    
    .cgv-checkbox-container label {
        font-size: 0.85rem;
    }
}

/* Très petit mobile (≤ 360px) */
@media (max-width: 360px) {
    .subscription-page {
        padding: 12px 10px;
    }
    
    .subscription-header h2 {
        font-size: 1.15rem;
    }
    
    .subscription-plan-card {
        padding: 15px;
    }
    
    .price-amount {
        font-size: 1.6rem;
    }
    
    .price-amount {
        font-size: 2.5rem;
    }
    
    .promo-code-form {
        flex-direction: column;
    }
    
    .promo-code-form button {
        margin-left: 0;
        margin-top: 10px;
    }
}

/* =====================================================
   Styles pour la page de paiement
   ===================================================== */

.payment-page {
    max-width: 100%;
}

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

.payment-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-summary {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 30px;
    border: none;
}

.payment-summary h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    color: var(--text-secondary);
}

.summary-item span:last-child {
    color: var(--text-primary);
    font-weight: 600;
}

/* =====================================================
   DESIGN STRIPE ELEMENTS - REFAIT DE ZÉRO
   ===================================================== */

.payment-form-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 35px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.payment-form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--primary-color));
    background-size: 200% 100%;
    animation: gradientShift 3s ease infinite;
}

/* Header du formulaire */
.payment-form-header {
    margin-bottom: 30px;
    text-align: center;
}

.payment-form-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.payment-form-header h3 i {
    color: var(--accent-color);
    font-size: 1.3rem;
}

.payment-form-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

/* Formulaire Stripe */
.stripe-payment-form {
    margin-bottom: 25px;
}

/* Label */
.stripe-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.card-icons i {
    font-size: 1.3rem;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: opacity 0.2s;
}

.card-icons i:hover {
    opacity: 1;
}

/* Wrapper pour le champ de carte */
.stripe-card-wrapper {
    position: relative;
    margin-bottom: 8px;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.stripe-card-wrapper::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.stripe-card-wrapper.focused::before {
    opacity: 1;
}

.stripe-card-wrapper.focused {
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(255, 183, 0, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stripe-card-wrapper.complete {
    border-color: var(--success-color);
}

.stripe-card-wrapper.complete::before {
    background: linear-gradient(135deg, var(--success-color), #10b981);
    opacity: 0.3;
}

.stripe-card-wrapper.invalid,
.stripe-card-wrapper.has-error {
    border-color: var(--error-color);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Conteneur des champs Stripe séparés */
.stripe-fields-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 8px;
}

.stripe-fields-row {
    display: flex;
    gap: 15px;
}

.stripe-field-wrapper {
    position: relative;
    width: 100%;
}

.stripe-field-wrapper.stripe-field-half {
    flex: 1;
}

.stripe-field-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stripe-field-element {
    position: relative;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    min-height: 48px;
    height: 48px;
    padding: 0;
    display: table;
    width: 100%;
    table-layout: fixed;
}

.stripe-field-element::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: -1;
}

.stripe-field-wrapper.focused .stripe-field-element::before {
    opacity: 1;
}

.stripe-field-wrapper.focused .stripe-field-element {
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(255, 183, 0, 0.15),
                0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.stripe-field-wrapper.complete .stripe-field-element {
    border-color: var(--success-color);
}

.stripe-field-wrapper.invalid .stripe-field-element {
    border-color: var(--error-color);
    animation: shake 0.4s ease;
}

/* Conteneur interne pour le centrage */
.stripe-field-element > div {
    display: table-cell !important;
    vertical-align: middle !important;
    width: 100% !important;
    height: 48px !important;
    text-align: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.stripe-field-element .StripeElement {
    width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    position: relative !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    line-height: 48px !important;
}

.stripe-field-element iframe {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    max-height: 48px !important;
    border: none !important;
    display: inline-block !important;
    vertical-align: middle !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 48px !important;
}

/* Forcer la taille et le centrage de TOUS les conteneurs Stripe */
.stripe-field-element div {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 48px !important;
    height: 48px !important;
    display: inline-block !important;
    vertical-align: middle !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    text-align: center !important;
}

/* Élément Stripe (ancien style - gardé pour compatibilité) */
.stripe-card-element {
    position: relative;
    padding: 12px 50px 12px 12px;
    min-height: 48px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: transparent;
    z-index: 10;
    pointer-events: auto;
    width: 100%;
}

.stripe-card-element .StripeElement {
    width: 100% !important;
    position: relative;
    z-index: 10;
    min-height: 48px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

/* Centrer le contenu dans l'iframe Stripe */
.stripe-card-element .StripeElement > div {
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
}

/* Forcer l'iframe Stripe à avoir la bonne taille */
.stripe-card-element iframe {
    position: relative !important;
    z-index: 10 !important;
    pointer-events: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    border: none !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* S'assurer que le conteneur StripeElement a la bonne taille */
.stripe-card-element > div,
.stripe-card-element > div > div {
    width: 100% !important;
    min-width: 100% !important;
    min-height: 48px !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
}

/* Forcer la couleur du texte dans Stripe Elements */
.stripe-card-element,
.stripe-card-element * {
    color: #f1f5f9 !important;
}

/* Styles pour les iframes Stripe */
.stripe-card-element iframe {
    color: #f1f5f9 !important;
}

/* Forcer la visibilité du texte dans tous les éléments Stripe */
.stripe-card-element .StripeElement,
.stripe-card-element .StripeElement input,
.stripe-card-element .StripeElement--focus,
.stripe-card-element .StripeElement--complete,
.stripe-card-element .StripeElement--invalid,
.stripe-card-element .StripeElement--empty {
    color: #f1f5f9 !important;
    background: transparent !important;
}

/* Placeholder visible */
.stripe-card-element .StripeElement input::placeholder,
.stripe-card-element .StripeElement--empty input::placeholder {
    color: #94a3b8 !important;
    opacity: 0.7 !important;
}

/* État invalid */
.stripe-card-element .StripeElement--invalid,
.stripe-card-element .StripeElement--invalid input {
    color: #ef4444 !important;
}

/* État complete */
.stripe-card-element .StripeElement--complete,
.stripe-card-element .StripeElement--complete input {
    color: #10b981 !important;
}

/* Icône de carte */
.stripe-card-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.3rem;
    opacity: 0.3;
    transition: all 0.3s;
    z-index: 1;
    pointer-events: none;
}

.stripe-card-wrapper.focused .stripe-card-icon {
    opacity: 0.6;
    color: var(--accent-color);
}

.stripe-card-wrapper.complete .stripe-card-icon {
    opacity: 0.8;
    color: var(--success-color);
}

/* Messages d'erreur */
.stripe-error-message {
    min-height: 20px;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.stripe-error-message::before {
    content: '⚠';
    font-size: 1rem;
}

.stripe-error-message.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Bouton de paiement */
.stripe-submit-btn {
    width: 100%;
    margin-top: 25px;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.stripe-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.stripe-submit-btn:hover::before {
    opacity: 1;
}

.stripe-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.stripe-submit-btn:active {
    transform: translateY(0);
}

.stripe-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.btn-content i {
    font-size: 1rem;
}

.btn-text strong {
    font-weight: 700;
}

.btn-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Section sécurité */
.payment-security {
    margin-top: 30px;
    padding-top: 25px;
    border-top: none;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
}

.security-badge i {
    font-size: 1.5rem;
    color: var(--success-color);
    flex-shrink: 0;
}

.security-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.security-text strong {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
}

.security-text span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.payment-methods {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.methods-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.methods-icons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.methods-icons i {
    font-size: 1.5rem;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: all 0.2s;
}

.methods-icons i:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Styles spécifiques pour le modal de succès de paiement */
#paymentSuccessModal {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    height: 100vh !important;
    max-height: 100vh !important;
    position: fixed !important;
}

#paymentSuccessModal .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive pour Stripe Elements */
@media (max-width: 768px) {
    .payment-form-container {
        padding: 25px 20px;
    }
    
    .payment-form-header h3 {
        font-size: 1.2rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .payment-form-subtitle {
        font-size: 0.9rem;
    }
    
    .stripe-fields-container {
        gap: 15px;
    }
    
    .stripe-fields-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .stripe-field-wrapper.stripe-field-half {
        width: 100%;
    }
    
    .stripe-field-element {
        min-height: 44px;
        padding: 10px 14px;
    }
    
    .stripe-field-element .StripeElement {
        min-height: 44px;
        height: 44px;
    }
    
    .stripe-field-element iframe {
        min-height: 44px !important;
        height: 44px !important;
    }
    
    .stripe-card-element {
        padding: 10px 40px 10px 10px;
        min-height: 44px;
        height: 44px;
    }
    
    .stripe-card-element iframe {
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
    }
    
    .stripe-card-icon {
        right: 12px;
        font-size: 1.1rem;
    }
    
    .stripe-submit-btn {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .security-badge {
        padding: 12px;
        flex-direction: column;
        text-align: center;
    }
    
    .payment-methods {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .payment-form-container {
        padding: 20px 15px;
        border-radius: 12px;
    }
    
    .payment-form-header h3 {
        font-size: 1.1rem;
    }
    
    .stripe-label {
        font-size: 0.9rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .stripe-card-element {
        padding: 10px 35px 10px 10px;
        min-height: 42px;
        height: 42px;
    }
    
    .stripe-card-element iframe {
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
    }
    
    .stripe-card-icon {
        right: 10px;
        font-size: 1rem;
    }
    
    .stripe-error-message {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
    
    .stripe-submit-btn {
        padding: 14px 18px;
        font-size: 0.95rem;
    }
    
    .security-badge {
        padding: 10px;
    }
    
    .security-text strong {
        font-size: 0.9rem;
    }
    
    .security-text span {
        font-size: 0.8rem;
    }
    
    .methods-icons i {
        font-size: 1.3rem;
    }
}

/* =====================================================
   RESPONSIVE POUR LA PAGE DE PAIEMENT STRIPE
   ===================================================== */

/* Base - Desktop */
.payment-page {
    width: 100%;
    max-width: 100%;
}

.payment-main-content {
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Header payment */
.payment-header-custom {
    position: relative;
    width: 100%;
}

.payment-header-custom > div {
    width: 100%;
}

.payment-header-back {
    transition: opacity 0.2s;
}

.payment-header-back:hover {
    opacity: 0.8;
}

/* Tablette (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .payment-main-content {
        max-width: 650px;
        padding: 0 30px;
    }
    
    .payment-summary,
    .payment-form-container {
        padding: 28px;
    }
    
    .payment-header h2 {
        font-size: 1.8rem;
    }
}

/* Mobile (≤ 768px) */
@media (max-width: 768px) {
    /* Header */
    .payment-header-custom {
        position: sticky;
        top: 0;
        z-index: 100;
        padding: 15px 10px !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .payment-header-custom > div {
        gap: 8px;
    }
    
    .payment-header-custom h1 {
        font-size: 1.3rem !important;
    }
    
    .payment-header-custom img {
        width: 35px !important;
        height: 35px !important;
    }
    
    .payment-header-back {
        font-size: 0.9rem;
    }
    
    .payment-back-text {
        display: none;
    }
    
    /* Main content */
    .payment-main-content {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .payment-page {
        margin-top: 0;
    }
    
    /* Masquer le bouton retour dupliqué */
    .payment-back-button {
        display: block;
    }
    
    /* Header section */
    .payment-header {
        margin-bottom: 25px;
        text-align: center;
    }
    
    .payment-header h2 {
        font-size: 1.4rem;
        line-height: 1.3;
        margin-bottom: 10px;
    }
    
    .payment-header .section-description {
        font-size: 0.9rem;
        padding: 0 5px;
        line-height: 1.5;
    }
    
    /* Résumé et formulaire */
    .payment-summary,
    .payment-form-container {
        padding: 18px;
        margin-bottom: 20px;
        border-radius: 12px;
    }
    
    .payment-summary h3,
    .payment-form-container h3 {
        font-size: 1.05rem;
        margin-bottom: 15px;
    }
    
    .summary-item {
        font-size: 0.92rem;
        padding: 10px 0;
    }
    
    .summary-item span:last-child {
        font-size: 0.98rem;
    }
    
    /* Stripe Elements */
    .stripe-card-element {
        padding: 14px 12px;
        min-height: 52px;
        font-size: 16px; /* Évite le zoom sur iOS */
        border-radius: 8px;
    }
    
    #card-errors {
        font-size: 0.88rem;
        margin-top: 10px;
        min-height: 18px;
        line-height: 1.4;
    }
    
    /* Bouton de paiement */
    #submit-payment-btn {
        padding: 15px;
        font-size: 1rem;
        margin-top: 25px;
        border-radius: 10px;
    }
    
    /* Sécurité */
    .payment-security {
        margin-top: 18px;
        padding-top: 15px;
        font-size: 0.82rem;
    }
}

/* Petit mobile (≤ 480px) */
@media (max-width: 480px) {
    /* Header encore plus compact */
    .payment-header-custom {
        padding: 12px 8px !important;
    }
    
    .payment-header-custom h1 {
        font-size: 1.15rem !important;
    }
    
    .payment-header-custom img {
        width: 30px !important;
        height: 30px !important;
    }
    
    .payment-header-custom > div > div:first-child {
        gap: 10px;
    }
    
    /* Main content */
    .payment-main-content {
        margin: 15px auto;
        padding: 0 12px;
    }
    
    /* Header section */
    .payment-header {
        margin-bottom: 20px;
    }
    
    .payment-header h2 {
        font-size: 1.25rem;
        margin-bottom: 8px;
    }
    
    .payment-header .section-description {
        font-size: 0.85rem;
        padding: 0;
    }
    
    /* Résumé et formulaire */
    .payment-summary,
    .payment-form-container {
        padding: 15px;
        margin-bottom: 18px;
        border-radius: 10px;
    }
    
    .payment-summary h3,
    .payment-form-container h3 {
        font-size: 1rem;
        margin-bottom: 12px;
    }
    
    /* Résumé en colonne sur très petit écran */
    .summary-item {
        font-size: 0.88rem;
        padding: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .summary-item span:first-child {
        color: var(--text-secondary);
    }
    
    .summary-item span:last-child {
        font-size: 1.15rem;
        font-weight: 700;
        color: var(--text-primary);
    }
    
    /* Total en plus grand */
    .summary-item:last-child {
        padding-top: 12px;
        margin-top: 12px;
        border-top: 2px solid var(--border-color);
    }
    
    .summary-item:last-child span:last-child {
        font-size: 1.3rem;
    }
    
    /* Stripe Elements */
    .stripe-card-element {
        padding: 12px 10px;
        min-height: 50px;
        font-size: 16px;
    }
    
    #card-errors {
        font-size: 0.85rem;
        margin-top: 8px;
    }
    
    /* Bouton de paiement */
    #submit-payment-btn {
        padding: 14px 16px;
        font-size: 0.95rem;
        margin-top: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        white-space: nowrap;
    }
    
    #submit-payment-btn i {
        font-size: 0.9rem;
    }
    
    /* Sécurité */
    .payment-security {
        margin-top: 15px;
        padding-top: 12px;
        font-size: 0.78rem;
    }
    
    .payment-security i {
        font-size: 0.75rem;
    }
}

/* Très petit mobile (≤ 360px) */
@media (max-width: 360px) {
    .payment-main-content {
        padding: 0 10px;
    }
    
    .payment-header h2 {
        font-size: 1.15rem;
    }
    
    .payment-summary,
    .payment-form-container {
        padding: 12px;
    }
    
    #submit-payment-btn {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* Amélioration de l'affichage Stripe Elements */
.stripe-card-element {
    min-height: 48px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.stripe-card-element .StripeElement {
    width: 100%;
}

.stripe-card-element:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 183, 0, 0.1);
}

/* Focus amélioré sur mobile */
@media (max-width: 768px) {
    .stripe-card-element:focus-within {
        box-shadow: 0 0 0 2px rgba(255, 183, 0, 0.15);
    }
}

/* =====================================================
   Styles pour la page CGV
   ===================================================== */

.cgv-container {
    max-width: 100%;
}

.cgv-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.cgv-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cgv-date {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.cgv-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 40px;
    border: 2px solid var(--border-color);
}

.cgv-section {
    margin-bottom: 40px;
}

.cgv-section:last-child {
    margin-bottom: 0;
}

.cgv-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.cgv-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.cgv-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 15px;
}

.cgv-section ul {
    margin-left: 20px;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.cgv-section li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.cgv-section a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: var(--transition);
}

.cgv-section a:hover {
    color: var(--primary-color);
}

.cgv-section strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Case à cocher CGV */
.cgv-checkbox-container {
    transition: var(--transition);
}

.cgv-checkbox-container:hover {
    border-color: var(--accent-color);
}

.cgv-checkbox-container label {
    user-select: none;
}

.cgv-checkbox-container input[type="checkbox"] {
    flex-shrink: 0;
}

.cgv-checkbox-container a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: var(--transition);
}

.cgv-checkbox-container a:hover {
    color: var(--primary-color);
}

/* Responsive pour la page CGV */
@media (max-width: 768px) {
    .cgv-header h1 {
        font-size: 1.8rem;
    }
    
    .cgv-content {
        padding: 25px;
    }
    
    .cgv-section h2 {
        font-size: 1.3rem;
    }
    
    .cgv-section h3 {
        font-size: 1.1rem;
    }
    
    .cgv-section p,
    .cgv-section li {
        font-size: 0.95rem;
    }
    
    .cgv-checkbox-container {
        padding: 15px;
    }
    
    .cgv-checkbox-container label {
        font-size: 0.9rem;
    }
}

/* ========== TUTORIEL ========== */
.tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
}

.tutorial-overlay:not(.hidden) {
    pointer-events: all;
}

.tutorial-tooltip {
    position: absolute;
    background: var(--surface-elevated);
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 24px;
    max-width: 400px;
    z-index: 10002;
    pointer-events: all;
    animation: tutorialFadeIn 0.3s ease-out;
}

/* Pointe vers le haut (bulle en dessous de l'élément) */
.tutorial-bubble-top::before {
    content: '';
    position: absolute;
    top: -12px;
    left: var(--pointer-offset, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid var(--primary-color);
}

.tutorial-bubble-top::after {
    content: '';
    position: absolute;
    top: -10px;
    left: var(--pointer-offset, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--surface-elevated);
}

/* Pointe vers le bas (bulle au-dessus de l'élément) */
.tutorial-bubble-bottom::before {
    content: '';
    position: absolute;
    bottom: -12px;
    left: var(--pointer-offset, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--primary-color);
}

.tutorial-bubble-bottom::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: var(--pointer-offset, 50%);
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--surface-elevated);
}

/* Pointe vers la gauche (bulle à droite de l'élément) */
.tutorial-bubble-left::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 12px solid var(--primary-color);
}

.tutorial-bubble-left::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid var(--surface-elevated);
}

/* Pointe vers la droite (bulle à gauche de l'élément) */
.tutorial-bubble-right::before {
    content: '';
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-left: 12px solid var(--primary-color);
}

.tutorial-bubble-right::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 10px solid var(--surface-elevated);
}

.tutorial-tooltip-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tutorial-text {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin: 0;
}

.tutorial-next-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    align-self: flex-end;
}

.tutorial-next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tutorial-next-btn:active {
    transform: translateY(0);
}

@keyframes tutorialFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

