@import url("thema-base.css");

:root {
    --primary-color: #1e3a8a;
    --accent-color: #10b981;
    --bg-light: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
}

.header-theme {
    background: linear-gradient(135deg, #047857 0%, #10b981 100%);
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 10px 25px rgba(4, 120, 87, 0.1);
    position: relative;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
    transition: background 0.2s;
}

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

.theme-badge {
    background: #10b981;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 15px;
}

.header-theme p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.step-card:hover {
    transform: translateY(-3px);
    border-color: #10b981;
    box-shadow: 0 10px 25px rgba(16,185,129,0.06);
}

.step-number {
    background: #ecfdf5;
    color: #059669;
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
    color: #1e3a8a;
}

.arrow-icon {
    color: #10b981;
    font-weight: 800;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

/* PAGES STAP (t3-stap*.html) */

.section-title { color: #1e3a8a; margin-bottom: 15px; border-bottom: 2px solid #10b981; padding-bottom: 5px; }

.quiz-question { font-weight: 700; color: #1e3a8a; margin-bottom: 12px; margin-top: 15px; }

.quiz-option:hover { background: #f1f5f9; border-color: #cbd5e1; }

.check-btn { background-color: #10b981; color: white; border: none; padding: 10px 20px; border-radius: 10px; cursor: pointer; font-weight: 700; margin-top: 15px; transition: background 0.2s; }

.check-btn:hover { background-color: #059669; }

/* --- Bulles de Dialogue (Stap 1) --- */

.dialogue-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.chat-bubble {
    padding: 15px 20px;
    border-radius: 20px;
    max-width: 75%;
    line-height: 1.5;
    position: relative;
    font-size: 1.05rem;
}

.chat-wout {
    background-color: #ecfdf5;
    color: #064e3b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-emilie {
    background-color: #eff6ff;
    color: #1e3a8a;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.speaker-name {
    font-weight: 800;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
    letter-spacing: 0.5px;
}

.chat-wout .speaker-name { color: #059669; }

.chat-emilie .speaker-name { color: #3b82f6; }

/* --- Zone de Questions de repérage --- */

.quiz-box {
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-top: 25px;
}

.quiz-question {
    margin-bottom: 20px;
}

.quiz-question p {
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 10px;
}

.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 12px 18px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s;
}

.option-btn:hover {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.option-btn.correct {
    background-color: #dcfce7;
    border-color: #22c55e;
    color: #166534;
}

.option-btn.wrong {
    background-color: #fee2e2;
    border-color: #ef4444;
    color: #991b1b;
}

/* --- Zone Exercice d'Association --- */

.matching-container {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    margin-top: 20px;
    position: relative;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 45%;
}

.match-item {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    color: #475569;
    transition: all 0.2s;
    user-select: none;
}

.match-item:hover {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.match-item.selected {
    border-color: #10b981;
    background-color: #10b981;
    color: white;
}

.match-item.matched {
    border-color: #10b981;
    background-color: #dcfce7;
    color: #166534;
    cursor: default;
    pointer-events: none;
}

@media (max-width: 600px) {
    .matching-container { flex-direction: column; gap: 20px; }
    .matching-column { width: 100%; }
}

/* --- Vocabulaire interactif --- */

.vocab-category h3 { color: #047857; font-size: 1.1rem; margin-bottom: 10px; background: #ecfdf5; padding: 6px 12px; border-radius: 8px; display: inline-block; }

.vocab-btn { background-color: #1e293b; color: white; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: 0.85rem; font-family: 'Plus Jakarta Sans'; }

.vocab-table tr:hover { background-color: #f8fafc; }

.exercise-box h4 { color: #1e3a8a; font-size: 1.1rem; margin-bottom: 10px; }

.match-container { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }

.match-row { display: flex; align-items: center; gap: 15px; }

.match-word { background: white; border: 2px solid #cbd5e1; padding: 8px 12px; border-radius: 8px; width: 45%; font-weight: 700; }

.match-select { padding: 8px; border-radius: 8px; border: 2px solid #cbd5e1; width: 45%; font-family: 'Plus Jakarta Sans'; }

.fill-input { padding: 6px 10px; border: 2px solid #cbd5e1; border-radius: 6px; font-family: 'Plus Jakarta Sans'; font-weight: 700; text-align: center; color: #047857; }

.intruder-group { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; }

.intruder-label { font-weight: 700; min-width: 140px; color: #475569; }

.intruder-option { background: white; border: 2px solid #cbd5e1; padding: 6px 12px; border-radius: 8px; cursor: pointer; transition: 0.2s; }

.intruder-option:hover { background: #f1f5f9; }

.score-zone { margin-top: 15px; font-weight: 700; color: #1e3a8a; background: #ecfdf5; padding: 10px; border-radius: 8px; display: inline-block; }

/* --- Module Flashcards / Vocabulaire (Stap 2) --- */

.flashcards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.category-subtitle {
    color: #10b981;
    margin: 35px 0 15px 0;
    font-size: 1.4rem;
    font-weight: 700;
    border-left: 4px solid #10b981;
    padding-left: 10px;
}

.flashcard {
    background: transparent;
    perspective: 1000px;
    height: 180px;
    cursor: pointer;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 16px;
}

.flashcard.flipped .flashcard-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 16px;
}

.card-front {
    background-color: white;
    color: #1e3a8a;
    border: 2px solid #e2e8f0;
}

.card-emoji {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.card-front h4 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}

.card-back {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    transform: rotateY(180deg);
    font-size: 1.1rem;
    font-weight: 700;
}

/* --- Grammaire --- */

.hidden-text { background-color: #1e293b; color: #1e293b; border-radius: 4px; cursor: pointer; user-select: none; padding: 2px 6px; transition: background 0.2s; }

.hidden-text.revealed { background-color: transparent; color: inherit; }

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

.grammar-box {
    background-color: #f8fafc;
    border-left: 5px solid #10b981;
    padding: 20px;
    border-radius: 0 16px 16px 0;
}

.grammar-box.orange {
    border-left-color: #f97316;
}

.grammar-box h3 {
    color: #1e3a8a;
    margin-top: 0;
    margin-bottom: 12px;
    font-weight: 800;
}

.example-sentence {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 8px 0;
    border: 1px solid #e2e8f0;
    font-family: monospace;
    font-size: 0.95rem;
}

.example-sentence strong {
    color: #ef4444;
}

/* Zone d'exercice de complétion */

.fill-exercise {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.exercise-line {
    font-size: 1.1rem;
    color: #334155;
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.input-blank {
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 700;
    color: #1e3a8a;
    width: 140px;
    text-align: center;
    transition: all 0.2s;
}

.input-blank:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.input-blank.correct {
    border-color: #22c55e;
    background-color: #dcfce7;
    color: #15803d;
}

.input-blank.wrong {
    border-color: #ef4444;
    background-color: #fee2e2;
    color: #b91c1c;
}

.validate-btn {
    background-color: #10b981;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.2s;
}

.validate-btn:hover {
    background-color: #059669;
}

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

.grammar-block { background: #ecfdf5; border-left: 6px solid #10b981; padding: 20px; border-radius: 0 14px 14px 0; margin-bottom: 20px; }

.grammar-block.variant { border-left-color: #facc15; background: #fefce8; }

.syntax-box { font-family: monospace; font-size: 1.1rem; background: #1e293b; color: white; padding: 10px 15px; border-radius: 8px; display: inline-block; margin: 10px 0; }

.compl { color: #fb923c; font-weight: bold; }

.reorder-container { background: #f1f5f9; padding: 20px; border-radius: 12px; margin-bottom: 20px; border: 1px solid #e2e8f0; }

.word-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; min-height: 45px; padding: 10px; background: white; border-radius: 8px; border: 2px dashed #cbd5e1; }

.word-card { background: #1e293b; color: white; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: 700; user-select: none; transition: background 0.2s; }

.word-card:hover { background: #334155; }

.word-card.used { opacity: 0.4; pointer-events: none; }

.answer-zone { min-height: 45px; padding: 10px; background: #e2e8f0; border-radius: 8px; border: 2px solid #cbd5e1; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; font-weight: 700; color: #1e293b; }

.btn-small { background: #64748b; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: bold; margin-right: 5px; }

.btn-small:hover { background: #475569; }

.final-score-zone { background: #ecfdf5; color: #047857; padding: 15px; border-radius: 10px; font-weight: bold; text-align: center; margin-top: 20px; display: none; }

/* --- Audio --- */

/* --- Projet final / Lesrooster --- */

.input-group input, .input-group select, .input-group textarea { width: 100%; padding: 10px; border: 2px solid #e2e8f0; border-radius: 8px; font-family: inherit; font-size: 0.95rem; outline: none; transition: border-color 0.2s; box-sizing: border-box; }

.input-group input:focus, .input-group select:focus, .input-group textarea:focus { border-color: #10b981; }

.progress-bar { width: 0%; height: 100%; background: #10b981; transition: width 0.3s ease; }

.oral-zone { background: #ecfdf5; border: 2px solid #a7f3d0; padding: 20px; border-radius: 12px; margin-top: 25px; }

.timer-display { font-size: 2.5rem; font-weight: 800; color: #047857; font-family: monospace; margin: 10px 0; }

.btn-action { background: #10b981; color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; }

.btn-action:hover { background: #059669; }

.print-btn { background: #10b981; color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: bold; cursor: pointer; width: 100%; margin-top: 15px; }

/* Grille horaire */

.rooster-table { width: 100%; border-collapse: collapse; margin-top: 15px; font-size: 0.88rem; }

.rooster-table th { background: #047857; color: white; padding: 8px 6px; text-align: center; font-weight: 700; }

.rooster-table td { border: 1px solid #d1fae5; padding: 4px; text-align: center; }

.rooster-table td:first-child { background: #ecfdf5; font-weight: 700; color: #047857; padding: 8px; }

.rooster-table select { width: 100%; border: none; background: transparent; font-family: 'Plus Jakarta Sans'; font-size: 0.82rem; color: #1e293b; cursor: pointer; }

.rooster-table tr:hover td { background: #f0fdf4; }

.rooster-table tr:hover td:first-child { background: #d1fae5; }

/* Preview table */

.preview-rooster { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

.preview-rooster th { background: #10b981; color: white; padding: 8px; text-align: center; font-weight: 700; }

.preview-rooster td { border: 1px solid #a7f3d0; padding: 6px 8px; text-align: center; font-size: 0.82rem; }

.preview-rooster td:first-child { background: #ecfdf5; font-weight: 700; color: #047857; }

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

@media print {
    .main-content > a,
    .lesson-section:not(.print-section),
    .progress-container,
    .form-side,
    .print-btn,
    .btn-action,
    .oral-zone,
    .input-group { display: none !important; }

    html, body { height: 100%; margin: 0 !important; padding: 0 !important; background: white; }

    .main-content, .lesson-section, .project-grid, .preview-side {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        background: transparent !important;
    }

    .preview-side {
        display: block !important;
        width: 100%;
    }
}
