/* Glassmorphism Design System for French Course */
:root {
    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-bg-hover: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --blur-intensity: blur(12px);
    
    --mesh-bg-1: #4158D0;
    --mesh-bg-2: #C850C0;
    --mesh-bg-3: #FFCC70;
}

body {
    background-color: #f3f4f6;
    /* Vibrant mesh gradient background */
    background-image: 
        radial-gradient(at 40% 20%, hsla(28,100%,74%,1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,1) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(340,100%,76%,1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(22,100%,77%,1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(242,100%,70%,1) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(343,100%,76%,1) 0px, transparent 50%);
    background-attachment: fixed;
    font-family: 'Inter', 'Montserrat', sans-serif;
    color: #1e293b;
    min-height: 100vh;
    margin: 0;
}

/* Glass Card Component */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-intensity);
    -webkit-backdrop-filter: var(--blur-intensity);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    background: var(--glass-bg-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px 0 rgba(31, 38, 135, 0.2);
}

/* Hero Section */
.glass-hero {
    text-align: center;
    margin-bottom: 3rem;
    color: #0f172a;
}

.glass-hero h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #e11d48, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    color: #334155;
    font-weight: 500;
}

/* Progress Bar */
.glass-progress-container {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 99px;
    height: 16px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.glass-progress-fill {
    background: linear-gradient(90deg, #10b981, #34d399);
    height: 100%;
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 99px;
}

/* Module Grid */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.module-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.module-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.module-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #1e293b;
}

.module-topics {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.module-topics li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #475569;
    font-weight: 500;
}

.module-topics li i {
    color: #10b981;
}

/* Locked State */
.module-card.locked {
    opacity: 0.8;
}

.locked-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #1e293b;
    font-weight: 800;
    font-size: 1.2rem;
    text-align: center;
    padding: 2rem;
    border-radius: 24px;
}

/* Glass Buttons */
.btn-glass {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,255,255,0.4));
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: 16px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #1e293b;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.btn-glass:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.btn-glass.primary {
    background: linear-gradient(135deg, #f43f5e, #be123c);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.4);
}

.btn-glass.primary:hover {
    background: linear-gradient(135deg, #fb7185, #e11d48);
    box-shadow: 0 8px 25px rgba(244, 63, 94, 0.6);
}

.btn-glass.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-glass.warning:hover {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

/* Hide legacy content elements */
.lesson-wrapper .lesson-navigation, .lesson-wrapper .module-header { display: none !important; }

/* Dark Mode Variables */
html.dark-mode {
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-bg-hover: rgba(30, 41, 59, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
}

html.dark-mode body {
    background-color: #020617;
    background-image: radial-gradient(at 40% 20%, hsla(242,100%,20%,1) 0px, transparent 50%), radial-gradient(at 80% 0%, hsla(189,100%,15%,1) 0px, transparent 50%);
    color: #f8fafc;
}

html.dark-mode .glass-card, 
html.dark-mode .op-navbar {
    background: var(--glass-bg) !important;
    color: #f8fafc;
}

html.dark-mode h1, html.dark-mode h2, html.dark-mode h3, 
html.dark-mode h4, html.dark-mode h5, html.dark-mode .module-title, 
html.dark-mode .vocab-fr {
    color: #f8fafc !important;
}

html.dark-mode p, html.dark-mode .vocab-en, html.dark-mode .lesson-content {
    color: #cbd5e1 !important;
}

html.dark-mode .search-input {
    background: rgba(0,0,0,0.5);
    color: white;
    border-color: rgba(255,255,255,0.2);
}

html.dark-mode .btn-glass {
    background: rgba(30,41,59,0.8);
    color: white;
    border-color: rgba(255,255,255,0.1);
}

html.dark-mode .btn-glass:hover {
    background: rgba(51,65,85,0.9);
}

/* Horizontal Scroll for Dashboard */
.modules-horizontal {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding-bottom: 2rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.modules-horizontal::-webkit-scrollbar {
    height: 12px;
}

.modules-horizontal::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.05);
    border-radius: 99px;
}

.modules-horizontal::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.2);
    border-radius: 99px;
}

html.dark-mode .modules-horizontal::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
}

.modules-horizontal .module-card {
    min-width: 350px;
    flex: 0 0 auto;
    scroll-snap-align: start;
}


/* Interactive Engines */
.draggable-item { background: rgba(255,255,255,0.9); border: 2px solid #3b82f6; padding: 0.5rem 1rem; border-radius: 8px; cursor: grab; display: inline-block; font-weight: 700; color: #1e293b; margin: 0.25rem; box-shadow: 0 4px 6px rgba(0,0,0,0.05); }
.draggable-item:active { cursor: grabbing; transform: scale(0.95); }
.drop-target { background: rgba(0,0,0,0.02); border: 2px dashed #94a3b8; border-radius: 8px; padding: 1rem; min-height: 60px; margin-bottom: 1rem; transition: all 0.3s; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: center; }
.drop-target.drag-over { background: rgba(59,130,246,0.1); border-color: #3b82f6; }
.drop-target.success { border-color: #10b981; background: rgba(16,185,129,0.1); }
.drop-target.success .draggable-item { border-color: #10b981; background: #10b981; color: white; cursor: default; }
.cloze-input { border: none; border-bottom: 2px solid #cbd5e1; background: transparent; padding: 0.2rem 0.5rem; text-align: center; font-weight: 700; color: #3b82f6; width: 100px; transition: all 0.3s; font-family: inherit; }
.cloze-input:focus { outline: none; border-color: #3b82f6; }
.cloze-input.correct { border-color: #10b981; color: #10b981; }
.cloze-input.incorrect { border-color: #ef4444; color: #ef4444; animation: shake 0.4s; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-5px);} 75%{transform:translateX(5px);} }
