/* ==========================================
   BASE & RESET
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --blue: #002395;
    --red: #ed2939;
    --white: #ffffff;
    --bg: #f5f4f0;
    --text: #1a1a2e;
    --muted: #666;
    --border: #e8e5df;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.10);
    --shadow-lg: 0 20px 60px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-lg: 20px;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* ==========================================
   NAVBAR
   ========================================== */
.navbar {
    background-color: var(--blue);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid var(--red);
    box-shadow: 0 4px 20px rgba(0,35,149,0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-fr {
    background: var(--red);
    color: white;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 1px;
}

.logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    height: 100%;
}

.nav-links li {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.nav-links a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.nav-links a:hover, .nav-links a.active {
    color: white;
    background-color: rgba(255,255,255,0.12);
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 150px;
    box-shadow: var(--shadow-md);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
    border-top: 3px solid var(--red);
}

.dropdown-content a {
    color: var(--text) !important;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    height: auto;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f5f4f0 !important;
    color: var(--blue) !important;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* ==========================================
   LAYOUT
   ========================================== */
.content-container {
    max-width: 980px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeUp 0.4s ease;
}

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

/* ==========================================
   HERO
   ========================================== */
.hero {
    background: linear-gradient(135deg, var(--blue) 0%, #0035cc 50%, #1a4aed 100%);
    border-radius: var(--radius-lg);
    padding: 3.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 3rem;
}

.hero::before {
    content: 'FRANCE';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%) rotate(-10deg);
    font-family: 'Playfair Display', serif;
    font-size: 8rem;
    font-weight: 900;
    color: rgba(255,255,255,0.04);
    letter-spacing: -4px;
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: 60px;
    width: 200px;
    height: 200px;
    background: var(--red);
    border-radius: 50%;
    opacity: 0.15;
    pointer-events: none;
}

.hero-text {
    max-width: 500px;
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.5rem;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    color: white;
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
    line-height: 1.7;
    margin-bottom: 2rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 2.5rem;
    position: relative;
    z-index: 1;
}

.stat-card {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
}

.stat-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.65);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn-primary {
    background: var(--red);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-primary:hover {
    background: #c91a28;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(237,41,57,0.35);
}

.btn-secondary {
    background: rgba(255,255,255,0.15);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.25);
}

/* ==========================================
   SECTION TITLES
   ========================================== */
.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

h1, h2 {
    font-family: 'Playfair Display', serif;
    color: var(--blue);
    margin-bottom: 1rem;
}

p {
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* ==========================================
   NEWS SECTION
   ========================================== */
.news-section {
    margin-bottom: 3rem;
}

.news-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0.4rem;
}

.news-badge {
    background: var(--red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    padding: 3px 8px;
    border-radius: 4px;
    animation: pulse 2s infinite;
}

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

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.news-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.25s;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--blue);
}

.news-card-cat {
    background: var(--blue);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 14px;
}

.news-card-body {
    padding: 1rem 1.2rem;
}

.news-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-card p {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0;
    line-height: 1.5;
}

.news-card-footer {
    padding: 0.6rem 1.2rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.news-card-date {
    font-size: 0.75rem;
    color: #999;
}

.news-card-link {
    font-size: 0.78rem;
    color: var(--blue);
    font-weight: 600;
    text-decoration: none;
}

.news-loading {
    grid-column: 1/-1;
    text-align: center;
    color: var(--muted);
    padding: 2rem;
    font-style: italic;
}

/* ==========================================
   LEVEL CARDS (HOME)
   ========================================== */
.quick-start {
    margin-bottom: 2rem;
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.2rem;
}

.level-card {
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.level-card.a1 { background: linear-gradient(135deg, #e8f4fd, #c8e6fa); border: 1px solid #b3d9f7; }
.level-card.a2 { background: linear-gradient(135deg, #e8fdf0, #c8f5dc); border: 1px solid #a8ecc4; }
.level-card.b1 { background: linear-gradient(135deg, #fdf8e8, #faefc8); border: 1px solid #f5e0a8; }
.level-card.b2 { background: linear-gradient(135deg, #fde8e8, #fac8c8); border: 1px solid #f7b0b0; }

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.level-badge {
    display: inline-block;
    background: var(--blue);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 0.7rem;
}

.level-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.level-card p {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 0;
}

.level-arrow {
    position: absolute;
    bottom: 1rem;
    right: 1.2rem;
    font-size: 1.2rem;
    color: var(--blue);
    font-weight: bold;
    transition: transform 0.2s;
}

.level-card:hover .level-arrow {
    transform: translateX(4px);
}

/* ==========================================
   LISTENING / QUIZ
   ========================================== */
.listening-level-selector {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.level-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted);
}

.level-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.level-btn.active {
    background: var(--blue);
    border-color: var(--blue);
    color: white;
}

.listening-placeholder {
    background: white;
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    text-align: center;
    color: var(--muted);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.listening-placeholder p {
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

/* ==========================================
   LISTENING EXERCISE AREA
   ========================================== */
.exercise-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.exercise-header {
    background: var(--blue);
    color: white;
    padding: 1.2rem 1.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.exercise-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: white;
    margin: 0;
}

.exercise-level-tag {
    background: var(--red);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
}

.exercise-body {
    padding: 1.8rem;
}

.article-text {
    background: #f9f8f5;
    border-left: 4px solid var(--blue);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.4rem 1.6rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text);
}

.tts-controls {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.tts-btn {
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tts-btn:hover { background: #001a7a; }
.tts-btn.stop { background: #555; }

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.speed-control input[type="range"] {
    width: 100px;
    accent-color: var(--blue);
}

/* Questions */
.questions-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--blue);
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0.5rem;
}

.question-item {
    background: #fafaf8;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.question-item p {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.option-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
    color: var(--text);
}

.option-btn:hover { border-color: var(--blue); color: var(--blue); }
.option-btn.correct { border-color: #28a745; background: #e8f5e9; color: #1a6b2a; }
.option-btn.wrong { border-color: var(--red); background: #fdecea; color: #b71c1c; }
.option-btn.reveal { border-color: #28a745; background: #e8f5e9; color: #1a6b2a; opacity: 0.7; }

.fill-blank-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s;
}

.fill-blank-input:focus { outline: none; border-color: var(--blue); }
.fill-blank-input.correct { border-color: #28a745; background: #e8f5e9; }
.fill-blank-input.wrong { border-color: var(--red); background: #fdecea; }

.check-btn {
    background: var(--blue);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.check-btn:hover { background: #001a7a; }

.feedback {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    display: none;
}

.feedback.show { display: block; }
.feedback.correct { background: #e8f5e9; color: #1a6b2a; }
.feedback.wrong { background: #fdecea; color: #b71c1c; }

.true-false-btns {
    display: flex;
    gap: 0.7rem;
}

.tf-btn {
    flex: 1;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.tf-btn:hover { border-color: var(--blue); color: var(--blue); }
.tf-btn.correct { border-color: #28a745; background: #e8f5e9; color: #1a6b2a; }
.tf-btn.wrong { border-color: var(--red); background: #fdecea; color: #b71c1c; }

/* Score */
.score-section {
    background: linear-gradient(135deg, var(--blue), #0035cc);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    color: white;
    margin-top: 1.5rem;
}

.score-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.3rem;
}

.score-section p { color: rgba(255,255,255,0.8); margin: 0; }

/* Loading state */
.ai-loading {
    text-align: center;
    padding: 3rem;
    color: var(--muted);
}

.ai-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Quiz Config */
.quiz-config {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.config-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.config-group .listening-level-selector {
    margin-bottom: 0;
}

/* Order questions */
.order-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 2px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: grab;
    transition: all 0.2s;
    user-select: none;
}

.order-item:hover {
    border-color: var(--blue);
    box-shadow: var(--shadow-sm);
}

.order-num {
    background: var(--blue);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.order-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.order-arrows {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-arrows button {
    background: #f1f4f9;
    border: 1px solid var(--border);
    border-radius: 4px;
    width: 24px;
    height: 20px;
    font-size: 0.65rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    color: var(--blue);
}

.order-arrows button:hover { background: var(--blue); color: white; }
.order-arrows button:disabled { opacity: 0.4; cursor: default; }
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--blue);
        border-top: 2px solid var(--red);
        height: auto;
        padding: 1rem 0;
        box-shadow: var(--shadow-md);
    }

    .nav-links.open { display: flex; }

    .nav-links li { height: auto; width: 100%; }
    .nav-links a { height: auto; padding: 12px 1.5rem; }

    .dropdown-content {
        position: static;
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        background: rgba(0,0,0,0.15);
    }
    .dropdown-content a { color: rgba(255,255,255,0.85) !important; }
    .dropdown-content a:hover { color: white !important; background: rgba(255,255,255,0.1) !important; }
    .dropdown:hover .dropdown-content { display: block; }

    .hero { padding: 2rem; }
    .hero-title { font-size: 2.5rem; }
    .hero-stats { flex-wrap: wrap; }

    .content-container { padding: 1.5rem 1rem; }
    .options-grid { grid-template-columns: 1fr; }

    .quiz-config { flex-direction: column; gap: 1rem; }
}

/* ==========================================
   EXTERNAL LINK (kept from original)
   ========================================== */
.external-link {
    display: inline-block;
    padding: 10px 18px;
    background: var(--red);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.external-link:hover { background: #c91a28; transform: translateY(-2px); }
