/* ==========================================================================
   OUTILS.CSS — Lexique & Grammaire (sous-pages référence)
   NL met Cyn
   ========================================================================== */

:root {
    --bg-main: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --font-site: 'Plus Jakarta Sans', system-ui, sans-serif;

    /* Lexique = vert */
    --lexique-primary: #059669;
    --lexique-dark: #047857;
    --lexique-light: #ecfdf5;
    --lexique-border: #a7f3d0;

    /* Grammaire = bleu marine */
    --gram-primary: #3b82f6;
    --gram-dark: #1e3a8a;
    --gram-light: #eff6ff;
    --gram-border: #bfdbfe;

    /* Culture = rose/violet */
    --culture-primary: #db2777;
    --culture-dark: #9d174d;
    --culture-light: #fce7f3;
    --culture-border: #fbcfe8;
}

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

body {
    font-family: var(--font-site);
    background-color: var(--bg-main);
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
    padding-bottom: 60px;
}

/* ---- HEADER PAGES OUTILS ---- */
.header-outil {
    color: white;
    padding: 40px 20px;
    text-align: center;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.header-outil.lexique { background: linear-gradient(135deg, #047857 0%, #10b981 100%); }
.header-outil.grammaire { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%); }
.header-outil.culture { background: linear-gradient(135deg, #9d174d 0%, #db2777 100%); }

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

.header-outil .outil-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}
.header-outil.lexique .outil-badge { background: rgba(255,255,255,0.25); color: white; }
.header-outil.grammaire .outil-badge { background: rgba(255,255,255,0.25); color: white; }
.header-outil.culture .outil-badge { background: rgba(255,255,255,0.25); color: white; }

.header-outil h1 { font-size: 2.4rem; font-weight: 800; margin-bottom: 8px; }
.header-outil p { font-size: 1.05rem; opacity: 0.88; max-width: 580px; margin: 0 auto; }

/* ---- CONTAINER ---- */
.outil-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ---- GRILLES DE NAVIGATION (hub pages) ---- */
.outil-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.outil-nav-card {
    background: var(--white);
    border-radius: 16px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    border: 2px solid transparent;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.outil-nav-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.07);
}
.outil-nav-card.lexique-card { border-color: var(--lexique-border); }
.outil-nav-card.lexique-card:hover { border-color: var(--lexique-primary); }
.outil-nav-card.gram-card { border-color: var(--gram-border); }
.outil-nav-card.gram-card:hover { border-color: var(--gram-primary); }
.outil-nav-card.culture-card { border-color: var(--culture-border); }
.outil-nav-card.culture-card:hover { border-color: var(--culture-primary); }

.outil-nav-icon { font-size: 1.8rem; flex-shrink: 0; }

.outil-nav-body { flex-grow: 1; }
.outil-nav-body .num {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 4px;
    display: block;
}
.lexique-card .num { color: var(--lexique-primary); }
.gram-card .num { color: var(--gram-primary); }
.culture-card .num { color: var(--culture-primary); }

.outil-nav-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.outil-nav-body p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

/* Groupe grammatical (pour grammaire.html) */
.gram-group {
    margin-bottom: 40px;
}
.gram-group-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gram-dark);
    background: var(--gram-light);
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    border-left: 5px solid var(--gram-primary);
}
.gram-group-title.culture {
    color: var(--culture-dark);
    background: var(--culture-light);
    border-left-color: var(--culture-primary);
}

/* ---- SOUS-PAGES CONTENU ---- */

/* En-tête de sous-page */
.page-header {
    background: var(--white);
    border-radius: 18px;
    padding: 28px 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-left: 6px solid var(--lexique-primary);
}
.page-header.gram { border-left-color: var(--gram-primary); }
.page-header.culture { border-left-color: var(--culture-primary); }
.page-header .page-num {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    display: block;
}
.page-header.lex .page-num { color: var(--lexique-primary); }
.page-header.gram .page-num { color: var(--gram-primary); }
.page-header.culture .page-num { color: var(--culture-primary); }
.page-header h2 { font-size: 1.7rem; font-weight: 800; color: var(--text-dark); margin-bottom: 6px; }
.page-header p { color: var(--text-muted); font-size: 1rem; }

/* ---- MASQUAGE BIDIRECTIONNEL NL ↔ FR ---- */

/* Span NL — identique visuellement à hidden-text (FR), visible par défaut */
.hidden-text-nl {
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    padding: 2px 6px;
    transition: background 0.2s, color 0.2s;
}

/* Quand la section passe en mode nl-hidden : les spans NL se masquent */
.content-section.nl-hidden .hidden-text-nl:not(.shown) {
    background-color: #1e293b;
    color: #1e293b;
}
.content-section.nl-hidden .hidden-text-nl:not(.shown):hover {
    background-color: #334155;
    color: #334155;
}
/* Un clic individuel sur un span NL le révèle (même style que .revealed pour FR) */
.content-section.nl-hidden .hidden-text-nl.shown {
    background-color: transparent;
    color: inherit;
}

/* Bouton actif (NL caché) — orange pour signaler l'état */
.vocab-btn.active-hide {
    background-color: #ff6b4a;
}
.vocab-btn.active-hide:hover {
    background-color: #e55a39;
}

/* Section de contenu */
.content-section {
    background: var(--white);
    border-radius: 18px;
    padding: 28px 30px;
    margin-bottom: 22px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}
.content-section h3 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}
.content-section.lex h3 { color: var(--lexique-dark); border-color: var(--lexique-border); }
.content-section.gram h3 { color: var(--gram-dark); border-color: var(--gram-border); }
.content-section.culture h3 { color: var(--culture-dark); border-color: var(--culture-border); }
.content-section.culture .hidden-text.revealed { color: var(--culture-primary); font-weight: 600; }

/* Photo d'artiste / personnalité (pages culture) */
.page-header.culture.with-photo {
    display: flex;
    align-items: center;
    gap: 24px;
}
.page-header.culture.with-photo .page-header-text {
    flex-grow: 1;
}
.artist-photo-wrap {
    flex-shrink: 0;
}
.artist-photo {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border: 3px solid var(--culture-border);
    display: block;
}
.artist-photo-credit {
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
}
@media (max-width: 600px) {
    .page-header.culture.with-photo { flex-direction: column; text-align: center; }
}

/* Photos de monuments dans les tableaux (pages villes) */
.monu-thumb {
    width: 90px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    margin-bottom: 6px;
    border: 2px solid var(--culture-border);
}

/* Photos cliquables (lightbox) */
.artist-photo, .monu-thumb {
    cursor: zoom-in;
}

/* ---- LIGHTBOX ---- */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

/* Tableau vocabulaire */
.vocab-controls { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.vocab-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    font-family: var(--font-site);
    transition: background 0.2s;
}
.vocab-btn:hover { background: #334155; }

.vocab-table { width: 100%; border-collapse: collapse; }
.vocab-table th {
    text-align: left;
    padding: 9px 12px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 800;
    background: #f1f5f9;
    color: var(--text-muted);
}
.vocab-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; vertical-align: middle; }
.vocab-table tr:last-child td { border-bottom: none; }
.vocab-table tr:hover td { background: #f8fafc; }
.vocab-table td:first-child { font-weight: 700; }

.hidden-text {
    background: #1e293b;
    color: #1e293b;
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
    padding: 2px 8px;
    transition: background 0.2s, color 0.2s;
    font-size: 0.9rem;
}
.hidden-text.revealed { background: transparent; color: inherit; }

/* Exemple phrase en NL */
.example-nl {
    background: #f8fafc;
    border-left: 4px solid var(--lexique-primary);
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
    margin: 8px 0;
    font-size: 0.95rem;
}
.example-nl.gram { border-left-color: var(--gram-primary); }
.example-nl em { color: var(--text-muted); font-size: 0.88rem; display: block; margin-top: 3px; }

/* Blocs théorie grammaire */
.theory-block {
    background: var(--gram-light);
    border-left: 5px solid var(--gram-primary);
    padding: 18px 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 18px;
}
.theory-block h4 { color: var(--gram-dark); font-weight: 800; margin-bottom: 10px; font-size: 1rem; }
.theory-block.warning { background: #fef3c7; border-left-color: #f59e0b; }
.theory-block.warning h4 { color: #92400e; }
.theory-block.tip { background: #ecfdf5; border-left-color: #10b981; }
.theory-block.tip h4 { color: #047857; }

/* Tableau conjugaison */
.conj-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 0.92rem; }
.conj-table th { background: #1e293b; color: white; padding: 8px 12px; text-align: left; font-size: 0.78rem; text-transform: uppercase; }
.conj-table td { padding: 8px 12px; border-bottom: 1px solid #e2e8f0; }
.conj-table tr:nth-child(even) td { background: #f8fafc; }
.conj-table .highlight { color: var(--gram-primary); font-weight: 800; }

/* Syntax coloring */
.s { color: #38bdf8; font-weight: 700; }
.v { color: #f43f5e; font-weight: 700; }
.o { color: #facc15; font-weight: 700; }
.c { color: #fb923c; font-weight: 700; }

/* Exercices */
.exercise-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px;
    margin-top: 22px;
}
.exercise-section h4 { color: #1e3a8a; font-weight: 800; margin-bottom: 14px; font-size: 1rem; }

.quiz-container { margin-bottom: 18px; }
.quiz-question { font-weight: 700; color: #1e3a8a; margin-bottom: 10px; font-size: 0.95rem; }
.quiz-option {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 9px;
    margin-bottom: 7px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.92rem;
}
.quiz-option:hover { background: #f1f5f9; border-color: #cbd5e1; }
.quiz-option.selected-opt { background: #dbeafe; border-color: #3b82f6; color: #1e3a8a; font-weight: 600; }
.correct { background: #d1fae5 !important; border-color: #10b981 !important; color: #065f46 !important; font-weight: 700; }
.wrong { background: #fee2e2 !important; border-color: #ef4444 !important; color: #991b1b; }



.fill-line { margin-bottom: 12px; line-height: 1.8; font-size: 0.95rem; }
.fill-input {
    padding: 5px 10px;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    font-family: var(--font-site);
    font-weight: 700;
    color: #1d4ed8;
    font-size: 0.9rem;
}
.fill-input.short { width: 130px; }
.fill-input.medium { width: 200px; }
.fill-input.long { width: 300px; }
.correct-input { border-color: #10b981 !important; background: #d1fae5 !important; color: #065f46 !important; }
.wrong-input { border-color: #ef4444 !important; background: #fee2e2 !important; }

.check-btn {
    background: #1e3a8a;
    color: white;
    border: none;
    padding: 9px 20px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.88rem;
    margin-top: 12px;
    transition: background 0.2s;
    font-family: var(--font-site);
}
.check-btn:hover { background: #1e40af; }
.check-btn.green { background: var(--lexique-primary); }
.check-btn.green:hover { background: var(--lexique-dark); }

.score-zone {
    display: inline-block;
    margin-top: 12px;
    font-weight: 700;
    color: #1e3a8a;
    background: #e0f2fe;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* Footer */
.main-footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.88rem;
    border-top: 1px solid #e2e8f0;
}

/* Navigation bas de page */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    gap: 15px;
}
.page-nav a {
    background: white;
    color: var(--text-dark);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s, background 0.2s;
}
.page-nav a:hover { border-color: #94a3b8; background: #f8fafc; }
.page-nav .nav-next { margin-left: auto; }

/* Responsive */
@media (max-width: 600px) {
    .header-outil h1 { font-size: 1.8rem; }
    .outil-grid { grid-template-columns: 1fr; }
    .content-section { padding: 20px; }
    .page-nav { flex-direction: column; }
}
