/* ═══════════════════════════════════════════════════════════
   The Perfect Constitution — Farsi Learning App
   Dark dashboard aesthetic matching MB
   ═══════════════════════════════════════════════════════════ */

:root {
    --bg-primary:    #0b0f14;
    --bg-secondary:  #0f1720;
    --bg-tertiary:   #151e2b;
    --bg-surface:    #111a27;
    --bg-elevated:   #1a2535;
    --bg-card:       #111a27;
    --bg-hover:      #1e293b;

    --accent:        #4cc9f0;
    --accent-dim:    rgba(76, 201, 240, 0.15);
    --accent-glow:   rgba(76, 201, 240, 0.25);
    --secondary:     #7c3aed;
    --secondary-dim: rgba(124, 58, 237, 0.15);

    --success:  #10b981;
    --warning:  #f59e0b;
    --danger:   #ef4444;
    --info:     #3b82f6;

    --text-primary:   #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted:     #64748b;

    --border:        #1e293b;
    --border-subtle: #2a3556;
    --border-accent: rgba(76, 201, 240, 0.3);

    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    --mono: 'Cascadia Code', 'Fira Code', Consolas, monospace;
    --farsi: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    --farsi-size:      1.25em;
    --farsi-weight:    700;

    --nav-height:      48px;
    --sidebar-width:   260px;
    --sidebar-collapsed: 0px;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
    --shadow-md:  0 4px 12px rgba(0,0,0,.4);
    --shadow-lg:  0 8px 30px rgba(0,0,0,.5);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP NAVBAR ── */
.top-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}
.nav-left, .nav-center, .nav-right { display: flex; align-items: center; gap: 6px; }
.brand {
    display: flex; align-items: center; gap: 8px;
    color: var(--accent); font-weight: 700; font-size: 15px;
    text-decoration: none;
}
.brand i { font-size: 18px; }
.brand-text { font-family: var(--farsi); }
.nav-link {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px; border-radius: var(--radius-sm);
    color: var(--text-secondary); font-size: 13px;
    text-decoration: none; transition: all .15s;
}
.nav-link:hover { color: var(--text-primary); background: var(--bg-hover); text-decoration: none; }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }
.version-pill {
    font-size: 11px; padding: 2px 8px;
    border-radius: 99px; background: var(--bg-elevated);
    color: var(--text-muted); border: 1px solid var(--border);
}

/* ── ICON BUTTONS ── */
.icon-btn {
    background: none; border: none; color: var(--text-secondary);
    cursor: pointer; padding: 6px 8px; border-radius: var(--radius-sm);
    font-size: 14px; transition: all .15s;
}
.icon-btn:hover { color: var(--accent); background: var(--accent-dim); }

/* ── LAYOUT ── */
.app-body {
    display: flex;
    margin-top: var(--nav-height);
    min-height: calc(100vh - var(--nav-height));
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 12px 0;
    flex-shrink: 0;
    transition: width .2s;
}
.sidebar.collapsed { width: 0; overflow: hidden; padding: 0; }
.sidebar-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 16px; margin-bottom: 4px;
}
.sidebar-title { font-weight: 700; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.section-count {
    font-size: 11px; background: var(--accent-dim); color: var(--accent);
    padding: 1px 7px; border-radius: 99px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px; color: var(--text-secondary);
    font-size: 13px; text-decoration: none; transition: all .15s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-link:hover { color: var(--text-primary); background: var(--bg-hover); text-decoration: none; }
.sidebar-link.active { color: var(--accent); background: var(--accent-dim); border-right: 2px solid var(--accent); }
.sidebar-link i { width: 18px; text-align: center; flex-shrink: 0; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 16px; }

/* ── MAIN CONTENT ── */
.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    max-width: 1100px;
}

/* ── PAGE HEADER ── */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.page-header h1 i { color: var(--accent); margin-right: 8px; }
.subtitle { color: var(--text-secondary); font-size: 14px; }
.subtitle-fa { color: var(--accent); font-family: var(--farsi); font-size: calc(var(--farsi-size) * 1.2); font-weight: var(--farsi-weight); direction: rtl; margin-bottom: 4px; }
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb i { font-size: 8px; }

/* ── HERO BANNER ── */
.hero-banner {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 32px;
    border: 1px solid var(--border);
}
.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(11, 15, 20, 0.3) 0%,
        rgba(11, 15, 20, 0.6) 50%,
        rgba(11, 15, 20, 0.92) 100%
    );
}
.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    text-align: center;
}
.hero-title {
    font-family: 'Pinyon Script', cursive;
    font-size: 92px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(200,200,200,0.8), 0 0 40px rgba(200,200,200,0.5);
    background: rgba(180, 180, 180, 0.35);
    display: inline-block;
    padding: 4px 24px;
    border-radius: 8px;
}
.hero-title-fa {
    font-family: var(--farsi);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent);
    direction: rtl;
    margin-bottom: 8px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}
.hero-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 18px;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 28px;
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    transition: background 0.2s, transform 0.15s;
}
.hero-cta:hover {
    background: #38b6dd;
    transform: translateY(-1px);
}

/* ── STATS ROW ── */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--accent-dim); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.stat-value { font-size: 22px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); }

/* ── SECTION HEADING ── */
.section-heading {
    font-size: 16px; font-weight: 600; margin: 28px 0 16px;
    color: var(--text-secondary);
}
.section-heading i { color: var(--accent); margin-right: 6px; }

/* ── CHAPTER GRID ── */
.chapter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 32px; }
.chapter-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
    text-decoration: none; color: var(--text-primary);
    transition: all .2s; display: flex; flex-direction: column;
}
.chapter-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.chapter-card-icon { font-size: 28px; color: var(--accent); margin-bottom: 12px; }
.chapter-number { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.chapter-card h3 { font-size: 16px; margin: 4px 0; }
.chapter-title-fa { color: var(--accent); font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); direction: rtl; }
.chapter-desc { color: var(--text-secondary); font-size: 12px; margin-top: 8px; flex: 1; }
.chapter-card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--text-muted);
}
.section-count-badge i, .progress-badge i { margin-right: 4px; }
.progress-badge { color: var(--success); }

/* ── QUICK LINKS ── */
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 32px; }
.quick-link-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 20px;
    text-decoration: none; color: var(--text-primary); transition: all .2s;
}
.quick-link-card:hover { border-color: var(--secondary); transform: translateY(-2px); text-decoration: none; }
.quick-link-card i { font-size: 24px; color: var(--secondary); margin-bottom: 10px; display: block; }
.quick-link-card span { font-size: 15px; font-weight: 600; display: block; margin-bottom: 4px; }
.quick-link-card p { font-size: 12px; color: var(--text-muted); }

/* ── CONTENT TABLE (chapter reading view) ── */
.content-table { margin-bottom: 20px; }
.content-table-header {
    display: grid; grid-template-columns: 1fr 1fr 1fr 50px;
    gap: 8px; padding: 10px 16px;
    background: var(--bg-elevated); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .5px;
}
.content-row {
    display: grid; grid-template-columns: 1fr 1fr 1fr 50px;
    gap: 8px; padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center; transition: background .1s;
}
.content-row:hover { background: var(--bg-hover); }
.col-fa { font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); color: var(--accent); line-height: 1.6; }
.col-phonetic { color: var(--text-secondary); font-style: italic; }
.context-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.context-note i { margin-right: 3px; }

/* ── SECTION TABS ── */
.section-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 20px; }
.section-tab {
    padding: 8px 16px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; font-size: 13px;
    transition: all .15s;
}
.section-tab:hover { color: var(--text-primary); border-color: var(--text-muted); }
.section-tab.active { color: var(--accent); background: var(--accent-dim); border-color: var(--accent); }
.section-panel { display: none; }
.section-panel.active { display: block; }
.section-header { margin-bottom: 16px; }
.section-header h2 { font-size: 18px; }
.section-title-fa { color: var(--accent); font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); direction: rtl; display: block; margin-top: 2px; }

/* ── BUTTONS ── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #0b0f14; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }

/* ── FLASHCARD ── */
.flashcard-container { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; }
.flashcard {
    width: 100%; max-width: 500px; height: 280px;
    perspective: 1000px; cursor: pointer; margin-bottom: 16px;
}
.flashcard-inner {
    width: 100%; height: 100%;
    transition: transform .5s;
    transform-style: preserve-3d; position: relative;
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 24px;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; }
.flashcard-word { font-size: 28px; font-weight: 700; }
.flashcard-word-fa { font-size: calc(var(--farsi-size) * 2); font-family: var(--farsi); font-weight: var(--farsi-weight); color: var(--accent); direction: rtl; }
.flashcard-phonetic { font-size: 16px; color: var(--text-secondary); font-style: italic; margin-top: 8px; }
.flashcard-hint { font-size: 12px; color: var(--text-muted); margin-top: 16px; }
.flashcard-controls { display: flex; align-items: center; gap: 16px; }
.fc-counter { font-size: 14px; color: var(--text-secondary); min-width: 60px; text-align: center; }
.flashcard-actions { margin-top: 12px; }

/* ── FILTER ROW ── */
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
    padding: 6px 14px; border-radius: 99px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; font-size: 13px;
    transition: all .15s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.filter-btn .badge {
    font-size: 11px; background: var(--bg-hover); padding: 1px 6px;
    border-radius: 99px; margin-left: 4px;
}

/* ── VOCAB CATEGORY ── */
.vocab-cat-title { font-size: 16px; margin: 20px 0 12px; }
.vocab-cat-fa { color: var(--accent); font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); margin-left: 8px; }

/* ── QUIZ ── */
.quiz-setup { max-width: 500px; margin: 0 auto; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.card h3 { margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.form-select {
    width: 100%; padding: 8px 12px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px;
}
.quiz-progress-bar { width: 100%; height: 4px; background: var(--bg-elevated); border-radius: 2px; margin-bottom: 16px; }
.quiz-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.quiz-counter { text-align: center; color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.quiz-question-card { max-width: 600px; margin: 0 auto; }
.quiz-prompt { color: var(--text-secondary); font-size: 14px; margin-bottom: 8px; }
.quiz-word { font-size: 28px; font-weight: 700; margin-bottom: 24px; color: var(--accent); }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quiz-choice-btn {
    padding: 16px; border-radius: var(--radius-md);
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text-primary); cursor: pointer; font-size: 18px;
    font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); transition: all .15s;
}
.quiz-choice-btn:hover { border-color: var(--accent); background: var(--accent-dim); }
.quiz-choice-btn.correct { border-color: var(--success); background: rgba(16,185,129,.15); color: var(--success); }
.quiz-choice-btn.wrong { border-color: var(--danger); background: rgba(239,68,68,.15); color: var(--danger); }
.quiz-feedback { margin-top: 16px; font-size: 14px; }
.feedback-correct { color: var(--success); }
.feedback-correct i { margin-right: 6px; }
.feedback-wrong { color: var(--danger); }
.feedback-wrong i { margin-right: 6px; }

/* Quiz Results */
.results-card { text-align: center; max-width: 500px; margin: 0 auto; }
.results-icon { font-size: 48px; color: var(--warning); margin-bottom: 16px; }
.results-score { margin: 16px 0; }
.score-big { font-size: 48px; font-weight: 700; color: var(--accent); }
.score-label { font-size: 16px; color: var(--text-secondary); }
.results-pct { font-size: 24px; font-weight: 700; color: var(--success); margin-bottom: 24px; }
.results-actions { display: flex; gap: 12px; justify-content: center; }

/* ── GRAMMAR ── */
.grammar-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); margin-bottom: 20px; overflow: hidden;
}
.grammar-card-header {
    padding: 16px 20px; background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.grammar-card-header h2 { font-size: 16px; }
.grammar-title-fa { color: var(--accent); font-family: var(--farsi); font-size: var(--farsi-size); font-weight: var(--farsi-weight); }
.chapter-badge { font-size: 11px; background: var(--secondary-dim); color: var(--secondary); padding: 2px 8px; border-radius: 99px; }
.grammar-card-body { padding: 20px; }
.grammar-card-body p { color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }
.grammar-examples { display: flex; flex-direction: column; gap: 8px; }
.grammar-example {
    padding: 10px 14px; background: var(--bg-elevated);
    border-radius: var(--radius-sm); border-left: 3px solid var(--accent);
}
.grammar-point { font-weight: 600; color: var(--accent); margin-right: 6px; }
.grammar-detail { color: var(--text-secondary); }

/* ── CONVERSATIONS / CHAT ── */
.persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 24px; }
.persona-card {
    display: flex; gap: 14px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); cursor: pointer;
    text-align: left; color: var(--text-primary);
    transition: all .15s;
}
.persona-card:hover { border-color: var(--accent); }
.persona-card.active { border-color: var(--accent); background: var(--accent-dim); }
.persona-icon { font-size: 28px; color: var(--accent); flex-shrink: 0; width: 40px; text-align: center; }
.persona-info h3 { font-size: 14px; margin-bottom: 2px; }
.persona-name-fa { font-size: var(--farsi-size); color: var(--accent); font-family: var(--farsi); font-weight: var(--farsi-weight); }
.persona-info p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.chat-container {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); overflow: hidden;
    display: flex; flex-direction: column; height: 500px;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; }
.chat-welcome { text-align: center; color: var(--text-muted); padding: 40px; }
.chat-welcome i { font-size: 32px; margin-bottom: 12px; display: block; color: var(--accent); }
.chat-message { display: flex; gap: 10px; margin-bottom: 16px; }
.chat-user { flex-direction: row-reverse; }
.chat-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--bg-elevated); display: flex;
    align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 14px; color: var(--text-muted);
}
.chat-user .chat-avatar { background: var(--accent-dim); color: var(--accent); }
.chat-bubble {
    max-width: 75%; padding: 12px 16px;
    background: var(--bg-elevated); border-radius: var(--radius-md);
    font-size: 14px; line-height: 1.6;
}
.chat-user .chat-bubble { background: var(--accent-dim); }
.chat-label { display: inline-block; margin-right: 4px; }
.chat-label-fa { color: var(--accent); }
.chat-label-ph { color: var(--text-muted); }
.chat-input-area {
    display: flex; gap: 8px; padding: 12px 16px;
    border-top: 1px solid var(--border); background: var(--bg-secondary);
}
.chat-input {
    flex: 1; padding: 10px 14px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-size: 14px; outline: none;
}
.chat-input:focus { border-color: var(--accent); }

/* ── CONVERSATION CONTROLS ── */
.convo-controls {
    display: flex; gap: 20px; flex-wrap: wrap;
    margin-bottom: 12px; padding: 14px 18px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md);
}
.control-group { display: flex; align-items: center; gap: 10px; }
.control-label {
    font-size: 12px; color: var(--text-muted); white-space: nowrap;
    text-transform: uppercase; letter-spacing: .5px; font-weight: 600;
}
.control-label i { margin-right: 4px; }
.control-options { display: flex; gap: 4px; }
.control-btn {
    padding: 6px 14px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; font-size: 13px;
    transition: all .15s;
}
.control-btn:hover { border-color: var(--accent); color: var(--accent); }
.control-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.control-btn i { margin-right: 4px; }

.difficulty-hint {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; margin-bottom: 12px;
    background: var(--accent-dim); border-radius: var(--radius-sm);
    font-size: 12px; color: var(--accent);
}
.difficulty-hint i { flex-shrink: 0; }

/* ── PROMPT CARD (easy mode) ── */
.prompt-card {
    padding: 14px 18px; margin: 0 16px 0;
    background: var(--secondary-dim); border: 1px solid rgba(124,58,237,.3);
    border-radius: var(--radius-md);
}
.prompt-label {
    font-size: 12px; color: var(--secondary); font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.prompt-farsi {
    font-family: var(--farsi); font-size: var(--farsi-size);
    font-weight: var(--farsi-weight); color: var(--accent);
    line-height: 1.8; margin-bottom: 4px;
}
.prompt-phonetic { font-size: 14px; color: var(--text-secondary); font-style: italic; }
.prompt-english { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.prompt-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* ── MICROPHONE ── */
.mic-btn {
    font-size: 16px; padding: 8px 12px;
    border-radius: var(--radius-sm); transition: all .15s;
}
.mic-btn.mic-active {
    color: var(--danger); background: rgba(239,68,68,.15);
    animation: mic-pulse 1s infinite;
}
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.3); }
    50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}
.mic-status {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 16px; font-size: 12px; color: var(--danger);
    background: var(--bg-secondary);
}

/* ── CHAT TTS BUTTON ── */
.chat-tts-btn {
    display: inline-flex; margin-top: 8px; font-size: 12px;
    padding: 3px 8px; opacity: .6; transition: opacity .15s;
}
.chat-tts-btn:hover { opacity: 1; }
.chat-label-suggest { color: var(--secondary); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 48px; color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h3 { font-size: 18px; color: var(--text-secondary); margin-bottom: 8px; }

/* ── MOBILE BOTTOM NAV ── */
.mobile-bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--bg-secondary); border-top: 1px solid var(--border);
    justify-content: space-around; padding: 6px 0;
    z-index: 1000;
}
.mbn-item {
    display: flex; flex-direction: column; align-items: center;
    font-size: 10px; color: var(--text-muted); text-decoration: none;
    padding: 4px 8px; gap: 2px;
}
.mbn-item i { font-size: 18px; }
.mbn-item.active { color: var(--accent); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar { position: fixed; left: 0; top: var(--nav-height); bottom: 0; z-index: 999; transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .main-content { padding: 16px; }
    .nav-center { display: none; }
    .mobile-bottom-nav { display: flex; }
    .content-table-header, .content-row { grid-template-columns: 1fr 1fr 40px; }
    .col-phonetic { display: none; }
    .chapter-grid { grid-template-columns: 1fr; }
    .quiz-choices { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: 1fr 1fr; }
}

/* ── FONT SIZE CLASSES ── */
.farsi-xs  { --farsi-size: 0.9em;  }
.farsi-sm  { --farsi-size: 1.0em;  }
.farsi-md  { --farsi-size: 1.25em; }
.farsi-lg  { --farsi-size: 1.5em;  }
.farsi-xl  { --farsi-size: 1.8em;  }
.farsi-xxl { --farsi-size: 2.2em;  }
.farsi-normal  { --farsi-weight: 400; }
.farsi-bold    { --farsi-weight: 700; }

/* ── SETTINGS PANEL ── */
.settings-toggle {
    position: relative;
}
.settings-panel {
    display: none;
    position: absolute; top: calc(var(--nav-height) - 4px); right: 0;
    width: 280px; padding: 16px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 1100;
}
.settings-panel.open { display: block; }
.settings-panel h4 {
    font-size: 13px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: .5px; margin-bottom: 12px;
}
.setting-group { margin-bottom: 16px; }
.setting-label {
    font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; display: block;
}
.setting-options { display: flex; gap: 4px; flex-wrap: wrap; }
.setting-btn {
    padding: 5px 12px; border-radius: var(--radius-sm);
    background: var(--bg-elevated); border: 1px solid var(--border);
    color: var(--text-secondary); cursor: pointer; font-size: 12px;
    transition: all .15s;
}
.setting-btn:hover { border-color: var(--accent); color: var(--accent); }
.setting-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.speed-slider-row {
    display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.speed-label { font-size: 16px; flex-shrink: 0; }
.speed-slider {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 4px; background: var(--bg-hover); border-radius: 2px; outline: none;
}
.speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px;
    border-radius: 50%; background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg-card);
}
.speed-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%; background: var(--accent); cursor: pointer;
    border: 2px solid var(--bg-card);
}
.speed-value {
    text-align: center; font-size: 13px; color: var(--accent);
    font-weight: 600; margin-top: 4px;
}
.setting-preview {
    padding: 10px 14px; background: var(--bg-elevated);
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    font-family: var(--farsi); font-size: var(--farsi-size);
    font-weight: var(--farsi-weight); color: var(--accent);
    direction: rtl; text-align: center; margin-top: 8px;
    line-height: 1.6;
}
