/* =============================================
   assets/css/style.css
   English Immersion App — Dark Premium Theme
   ============================================= */

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

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

:root {
    --bg:          #080C14;
    --bg2:         #0D1120;
    --bg3:         #111827;
    --bg4:         #161D2E;
    --border:      #1C2333;
    --border-mid:  #232D42;

    --blue:        #4F9CF9;
    --blue-dim:    rgba(79,156,249,0.10);
    --blue-border: rgba(79,156,249,0.22);
    --blue-glow:   rgba(79,156,249,0.06);

    --green:       #34D399;
    --orange:      #F59E0B;
    --red:         #F87171;
    --purple:      #A78BFA;
    --teal:        #2DD4BF;

    --text:        #F1F5F9;
    --text-soft:   #CBD5E1;
    --muted:       #64748B;
    --dim:         #3D4F68;
    --very-dim:    #253044;

    --radius:      10px;
    --radius-lg:   14px;
    --radius-xl:   20px;

    --shadow:      0 1px 3px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.03);
    --shadow-lg:   0 8px 32px rgba(0,0,0,.5);
}

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Hero ─────────────────────────────────── */
.hero {
    background:
        linear-gradient(to bottom, rgba(8,12,20,.72) 0%, rgba(8,12,20,.88) 100%),
        url('../images/cheveux_woman-a9ed0935.webp') center/cover no-repeat;
    border-bottom: 1px solid var(--border);
    padding: 60px 24px 48px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: -80px; right: -60px;
    width: 360px; height: 360px;
    background: radial-gradient(circle, rgba(79,156,249,.12) 0%, transparent 65%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -40px; left: 10%;
    width: 240px; height: 240px;
    background: radial-gradient(circle, rgba(167,139,250,.06) 0%, transparent 65%);
    pointer-events: none;
}

.hero-accent { display: none; }

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--blue);
    font-weight: 700;
    margin: 0 auto 14px;
    background: var(--blue-dim);
    border: 1px solid var(--blue-border);
    padding: 4px 12px;
    border-radius: 20px;
}

.eyebrow::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--blue);
    display: inline-block;
    box-shadow: 0 0 8px var(--blue);
}

.hero h1 {
    font-size: clamp(28px, 6vw, 40px);
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: -.8px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #F1F5F9 0%, #94A3B8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 14px;
    color: var(--muted);
    max-width: 400px;
    line-height: 1.6;
    margin: 0 auto;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-mid);
    border-radius: 20px;
    padding: 5px 14px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    margin-top: 16px;
}

/* ── Nav ──────────────────────────────────── */
.main-nav {
    display: flex;
    justify-content: center;
    background: rgba(8,12,20,.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    scrollbar-width: none;
    padding: 0 4px;
}

.main-nav::-webkit-scrollbar { display: none; }

.nav-btn {
    padding: 15px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
    letter-spacing: .01em;
}

.nav-btn:hover  { color: var(--text-soft); }
.nav-btn.active {
    color: var(--blue);
    border-bottom-color: var(--blue);
    font-weight: 700;
}

/* ── Main content ─────────────────────────── */
.content {
    max-width: 680px;
    margin: 0 auto;
    padding: 28px 16px 80px;
}

/* ── Section title ────────────────────────── */
.section-title {
    font-size: 10px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--dim);
    font-weight: 700;
    margin-bottom: 18px;
}

/* ── Cards ────────────────────────────────── */
.card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    margin-bottom: 8px;
    transition: border-color .2s, transform .15s, box-shadow .2s;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--border-mid);
    box-shadow: 0 4px 16px rgba(0,0,0,.3);
}

.card.clickable {
    cursor: pointer;
}

.card.clickable:hover {
    transform: translateY(-1px);
    border-color: var(--blue-border);
    box-shadow: 0 4px 20px rgba(0,0,0,.35), 0 0 0 1px var(--blue-border);
}

/* ── Tags / badges ────────────────────────── */
.tag {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 8px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tag-Social    { background: rgba(79,156,249,.14); color: #7AB8FB; border: 1px solid rgba(79,156,249,.2); }
.tag-Travail   { background: rgba(52,211,153,.12); color: #5EDDB0; border: 1px solid rgba(52,211,153,.2); }
.tag-Voyage    { background: rgba(245,158,11,.12); color: #FBC04C; border: 1px solid rgba(245,158,11,.2); }
.tag-Universel { background: rgba(167,139,250,.12); color: #BBA8FC; border: 1px solid rgba(167,139,250,.2); }

/* ── Phrases ──────────────────────────────── */
.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.phrase-en {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-top: 10px;
    line-height: 1.45;
}

.phrase-fr {
    font-size: 13px;
    color: var(--blue);
    font-style: italic;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    display: none;
}

.phrase-fr.visible { display: block; }

.reveal-hint {
    font-size: 10px;
    color: var(--very-dim);
    font-style: italic;
    margin-top: 6px;
}

.toggle-icon {
    font-size: 10px;
    color: var(--dim);
    white-space: nowrap;
    margin-top: 2px;
}

/* ── Sub-tabs ─────────────────────────────── */
.sub-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 7px 16px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg2);
    color: var(--muted);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all .15s;
    letter-spacing: .01em;
}

.sub-tab:hover  { color: var(--text-soft); border-color: var(--border-mid); }
.sub-tab.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    box-shadow: 0 2px 12px rgba(79,156,249,.35);
}

/* ── Vocab ────────────────────────────────── */
.word-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.word-def   { font-size: 12px; color: var(--blue); font-style: italic; margin-bottom: 10px; margin-top: 2px; }
.word-ex    {
    font-size: 13px;
    color: var(--muted);
    border-left: 2px solid var(--blue-border);
    padding-left: 12px;
    line-height: 1.55;
}

/* ── Grammar ──────────────────────────────── */
.grammar-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
    box-shadow: var(--shadow);
}

.grammar-card.open {
    border-color: var(--blue-border);
    box-shadow: 0 0 0 1px var(--blue-border), 0 4px 20px rgba(0,0,0,.3);
}

.grammar-header {
    padding: 16px 18px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: background .15s;
}

.grammar-header:hover { background: rgba(255,255,255,.02); }

.grammar-num   { color: var(--blue); font-size: 11px; font-weight: 700; margin-right: 10px; letter-spacing: .04em; }
.grammar-title { font-size: 14px; font-weight: 700; color: var(--text); }
.grammar-chevron { color: var(--dim); transition: transform .25s; font-size: 12px; }
.grammar-card.open .grammar-chevron { transform: rotate(180deg); color: var(--blue); }

.grammar-body { padding: 0 18px 18px; display: none; }
.grammar-card.open .grammar-body { display: block; }

.rule-box {
    font-size: 13px;
    color: var(--text-soft);
    background: var(--bg-blue-dim, rgba(79,156,249,.05));
    border-left: 3px solid var(--blue);
    border-radius: 0 8px 8px 0;
    padding: 12px 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}

.example-row {
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 11px 14px;
    margin-bottom: 6px;
    transition: border-color .15s;
}

.example-row:hover { border-color: var(--border-mid); }
.example-sentence { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.example-note     { font-size: 11px; color: var(--muted); font-style: italic; }

/* ── Scripts ──────────────────────────────── */
.day-selector {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.day-selector::-webkit-scrollbar { display: none; }

.day-btn {
    padding: 7px 14px;
    border-radius: var(--radius-xl);
    font-size: 12px;
    font-weight: 600;
    background: var(--bg2);
    color: var(--muted);
    border: 1px solid var(--border);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all .15s;
}

.day-btn:hover  { color: var(--text-soft); border-color: var(--border-mid); }
.day-btn.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
    box-shadow: 0 2px 12px rgba(79,156,249,.35);
}

.script-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.script-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--bg3) 0%, var(--bg4) 100%);
    border-bottom: 1px solid var(--border);
}

.script-title   { font-size: 16px; font-weight: 800; margin-bottom: 4px; color: var(--text); }
.script-context { font-size: 12px; color: var(--muted); line-height: 1.5; }

.script-line {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(28,35,51,.8);
    display: flex;
    gap: 14px;
    transition: background .15s;
}

.script-line:last-of-type { border-bottom: none; }
.script-line:hover { background: rgba(255,255,255,.015); }
.script-line.you  { background: rgba(79,156,249,.04); }
.script-line.you:hover { background: rgba(79,156,249,.07); }

.script-role {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--dim);
    width: 56px;
    flex-shrink: 0;
    padding-top: 3px;
}

.script-line.you .script-role { color: var(--blue); }
.script-text { font-size: 14px; color: var(--muted); line-height: 1.55; }
.script-line.you .script-text { color: var(--text-soft); font-weight: 500; }

.script-tip {
    padding: 14px 20px;
    background: rgba(79,156,249,.05);
    border-top: 1px solid var(--blue-border);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* ── Quiz ─────────────────────────────────── */
.quiz-q {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    line-height: 1.45;
}

.quiz-num { color: var(--blue); margin-right: 6px; font-weight: 800; }

.quiz-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    font-size: 13px;
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--muted);
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    line-height: 1.4;
}

.quiz-option:hover         { border-color: var(--border-mid); color: var(--text-soft); background: var(--bg4); }
.quiz-option.selected      { background: var(--blue-dim); border-color: var(--blue-border); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--blue-border); }
.quiz-option.correct       { background: rgba(52,211,153,.12); border-color: rgba(52,211,153,.35); color: var(--green); font-weight: 700; }
.quiz-option.wrong         { background: rgba(248,113,113,.10); border-color: rgba(248,113,113,.3); color: var(--red); }
.quiz-option.neutral       { color: var(--very-dim); cursor: default; opacity: .6; }

.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--blue);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    letter-spacing: .02em;
    transition: opacity .15s, transform .1s, box-shadow .15s;
    box-shadow: 0 2px 12px rgba(79,156,249,.3);
}

.btn-submit:hover    { opacity: .92; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(79,156,249,.4); }
.btn-submit:active   { transform: translateY(0); }
.btn-submit:disabled { opacity: .3; cursor: not-allowed; transform: none; box-shadow: none; }

.score-box {
    background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-xl);
    padding: 32px 20px;
    text-align: center;
    margin-bottom: 22px;
    box-shadow: var(--shadow-lg);
}

.score-big    { font-size: 60px; font-weight: 900; line-height: 1; margin-bottom: 8px; letter-spacing: -2px; }
.score-msg    { font-size: 14px; color: var(--muted); }
.score-green  { color: var(--green); text-shadow: 0 0 30px rgba(52,211,153,.3); }
.score-orange { color: var(--orange); text-shadow: 0 0 30px rgba(245,158,11,.3); }
.score-red    { color: var(--red);    text-shadow: 0 0 30px rgba(248,113,113,.3); }

.quiz-note { font-size: 11px; color: var(--dim); text-align: center; margin-top: 8px; }

/* ── History table ────────────────────────── */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.history-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--dim);
    border-bottom: 1px solid var(--border);
    font-weight: 700;
}

.history-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
}

.history-table tr:last-child td { border-bottom: none; }
.history-table tr:hover td { background: rgba(255,255,255,.015); }

/* ── Footer ───────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    font-size: 11px;
    color: var(--very-dim);
    letter-spacing: .04em;
}

/* ── Utilities ────────────────────────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
