/* ─────────────────────────────────────────────────────────
   English Learn Platform — Professional CSS
   Dark Navy + Gold theme · RTL · Mobile-first
   ───────────────────────────────────────────────────────── */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Raleway:wght@400;600;700;800&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'IBM Plex Sans Arabic', 'Raleway', system-ui, sans-serif;
  background: #0a0f1e;
  color: #e8eaf6;
  direction: rtl;
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── CSS Variables ── */
:root {
  --navy-900: #060b18;
  --navy-800: #0a0f1e;
  --navy-700: #0f1829;
  --navy-600: #162035;
  --navy-500: #1e2d47;
  --navy-400: #2a3d5c;
  --navy-300: #3d5577;

  --gold:      #f5a623;
  --gold-light:#ffc65c;
  --gold-dim:  rgba(245,166,35,0.15);
  --gold-dim2: rgba(245,166,35,0.08);

  --text-100: #ffffff;
  --text-200: #e8eaf6;
  --text-300: #b0b8d1;
  --text-400: #7a88a8;
  --text-500: #4a5568;

  --border:   rgba(255,255,255,0.07);
  --border-2: rgba(255,255,255,0.13);
  --border-gold: rgba(245,166,35,0.35);

  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  22px;
  --radius-full:9999px;

  --shadow-sm:  0 2px 8px rgba(0,0,0,0.35);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.45);
  --shadow-glow:0 0 24px rgba(245,166,35,0.22);

  --transition: 0.2s ease;

  /* Level colors */
  --a1: #1565C0; --a2: #2E7D32; --b1: #E65100;
  --b2: #AD1457; --c1: #6A1B9A; --c2: #00695C;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--navy-700); }
::-webkit-scrollbar-thumb { background: var(--navy-400); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-300); }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 16px; }
.page-content { padding-top: 70px; min-height: 100vh; }

/* ── Navbar ── */
.navbar {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  background: rgba(6,11,24,0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 62px;
  display: flex; align-items: center;
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px;
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text-100);
}
.nav-logo {
  width: 34px; height: 34px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--gold) 0%, #e8891a 100%);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 14px;
  color: #060b18; letter-spacing: -0.5px; flex-shrink: 0;
}
.nav-title { font-size: 15px; font-weight: 600; letter-spacing: 0.3px; }
.nav-sub   { font-size: 11px; color: var(--text-400); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-300); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-radius: var(--radius-sm);
  transition: var(--transition); white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { color: var(--gold); background: var(--gold-dim2); }
.nav-links .btn-tutor {
  background: var(--gold); color: #060b18; font-weight: 600;
  padding: 7px 16px; border-radius: var(--radius-md);
}
.nav-links .btn-tutor:hover { background: var(--gold-light); color: #060b18; }
.nav-hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: var(--text-200); padding: 6px;
}
.nav-hamburger svg { width: 22px; height: 22px; }

/* ── Mobile Menu ── */
.mobile-menu {
  display: none; position: fixed; top: 62px; right: 0; left: 0; z-index: 999;
  background: rgba(6,11,24,0.98); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  flex-direction: column; padding: 12px 16px 16px;
  gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  color: var(--text-300); text-decoration: none; font-size: 14px;
  padding: 10px 14px; border-radius: var(--radius-md);
  transition: var(--transition);
}
.mobile-menu a:hover { color: var(--gold); background: var(--gold-dim2); }
.mobile-menu .btn-tutor {
  background: var(--gold); color: #060b18; font-weight: 600;
  text-align: center; margin-top: 6px;
}

/* ── Hero ── */
.hero {
  background: linear-gradient(160deg, var(--navy-600) 0%, var(--navy-800) 60%);
  border-bottom: 1px solid var(--border);
  padding: 48px 16px 40px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -60px; left: -60px;
  width: 300px; height: 300px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,166,35,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner { max-width: 1100px; margin: 0 auto; }
.hero-label {
  display: inline-block; padding: 4px 12px;
  background: var(--gold-dim); border: 1px solid var(--border-gold);
  border-radius: var(--radius-full); font-size: 11px; color: var(--gold);
  font-weight: 600; letter-spacing: 0.8px; text-transform: uppercase; margin-bottom: 14px;
}
.hero-title {
  font-family: 'Raleway', sans-serif; font-size: clamp(24px, 5vw, 40px);
  font-weight: 800; color: var(--text-100); line-height: 1.2; margin-bottom: 10px;
}
.hero-title span { color: var(--gold); }
.hero-sub { font-size: 15px; color: var(--text-300); margin-bottom: 24px; max-width: 540px; }
.hero-stats {
  display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 24px;
}
.hero-stat {
  text-align: center; padding: 10px 20px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.hero-stat-num { font-size: 22px; font-weight: 700; color: var(--gold); display: block; }
.hero-stat-lbl { font-size: 11px; color: var(--text-400); }
.progress-bar-wrap {
  background: rgba(255,255,255,0.06); border-radius: var(--radius-full);
  height: 8px; overflow: hidden; margin-bottom: 6px; max-width: 360px;
}
.progress-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: var(--radius-full); transition: width 0.6s ease;
}
.progress-label { font-size: 12px; color: var(--text-400); }

/* ── Cards & Sections ── */
.section { padding: 32px 16px; max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 18px; font-weight: 700; color: var(--text-100); margin-bottom: 20px; }
.section-title span { color: var(--gold); }

/* ── Level Cards ── */
.levels-grid { display: flex; flex-direction: column; gap: 12px; }
.level-card {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  cursor: pointer; transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  text-decoration: none; display: block;
}
.level-card:hover {
  transform: translateY(-2px); border-color: var(--border-2);
  box-shadow: var(--shadow-md);
}
.level-card-inner { display: flex; align-items: center; gap: 14px; padding: 16px; }
.level-badge {
  width: 52px; height: 52px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-family: 'Raleway', sans-serif; font-weight: 800; font-size: 14px;
  color: #fff; flex-shrink: 0;
}
.level-info { flex: 1; min-width: 0; }
.level-name { font-size: 16px; font-weight: 600; color: var(--text-100); margin-bottom: 2px; }
.level-desc { font-size: 12px; color: var(--text-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.level-progress-wrap {
  flex: 1; height: 3px; background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full); overflow: hidden;
}
.level-progress-fill {
  height: 100%; border-radius: var(--radius-full); transition: width 0.6s ease;
}
.level-count { font-size: 11px; color: var(--text-500); white-space: nowrap; }
.level-arrow { color: var(--text-500); flex-shrink: 0; }

/* ── Module List ── */
.module-list { display: flex; flex-direction: column; gap: 10px; }
.module-item {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-decoration: none;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}
.module-item:hover { border-color: var(--border-2); background: var(--navy-500); transform: translateX(-2px); }
.module-icon {
  width: 42px; height: 42px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
  border: 1px solid;
}
.module-icon.done { background: rgba(46,125,50,0.15); border-color: rgba(46,125,50,0.4); color: #4caf50; }
.module-text { flex: 1; min-width: 0; }
.module-name { font-size: 14px; font-weight: 600; color: var(--text-200); margin-bottom: 2px; }
.module-arname { font-size: 12px; color: var(--text-400); }
.module-tag {
  font-size: 11px; padding: 3px 10px; border-radius: var(--radius-full);
  font-weight: 600; white-space: nowrap; flex-shrink: 0;
}
.tag-vocab   { background: rgba(21,101,192,0.2);  color: #64b5f6; }
.tag-grammar { background: rgba(46,125,50,0.2);   color: #81c784; }
.tag-quiz    { background: rgba(230,81,0,0.2);    color: #ffb74d; }
.tag-reading { background: rgba(173,20,87,0.2);   color: #f48fb1; }
.tag-alphabet{ background: rgba(0,105,92,0.2);    color: #4db6ac; }
.tag-ai      { background: rgba(106,27,154,0.2);  color: #ce93d8; }

/* ── Lesson Header ── */
.lesson-header {
  padding: 20px 16px 18px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.lesson-header .back-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 7px 12px;
  color: var(--text-300); font-size: 13px; cursor: pointer;
  text-decoration: none; transition: var(--transition); flex-shrink: 0;
}
.lesson-header .back-btn:hover { background: rgba(255,255,255,0.1); color: var(--text-100); }
.lesson-header-text { flex: 1; min-width: 0; }
.lesson-header-title { font-size: 16px; font-weight: 600; color: var(--text-100); }
.lesson-header-sub   { font-size: 12px; color: var(--text-400); }

/* ── Alphabet Grid ── */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-tab {
  background: var(--navy-500); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 6px 14px; font-size: 12px;
  color: var(--text-400); cursor: pointer; transition: var(--transition);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.filter-tab.active, .filter-tab:hover { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold); }

.alpha-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px;
  margin-bottom: 16px;
}
.alpha-card {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 8px; text-align: center;
  cursor: pointer; transition: var(--transition);
}
.alpha-card:hover, .alpha-card.selected { border-color: var(--border-gold); background: var(--gold-dim2); }
.alpha-card.vowel .alpha-big { color: var(--gold); }
.alpha-big  { font-size: 26px; font-weight: 700; color: var(--text-100); line-height: 1; }
.alpha-small{ font-size: 18px; color: var(--text-300); }
.alpha-ipa  { font-size: 11px; color: var(--text-500); margin-top: 4px; }

.alpha-detail {
  background: var(--navy-600); border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
}
.alpha-detail-letter { font-size: 64px; font-weight: 700; color: var(--text-100); line-height: 1; min-width: 70px; }
.alpha-detail-info { flex: 1; min-width: 180px; }
.alpha-ipa-big { font-size: 20px; color: var(--gold); margin-bottom: 6px; }
.alpha-example { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.alpha-similar { font-size: 14px; color: var(--text-300); margin-bottom: 6px; }
.alpha-tip { font-size: 13px; color: var(--text-400); background: var(--gold-dim2); padding: 8px 12px; border-radius: var(--radius-sm); border-right: 3px solid var(--gold); }

.vowel-note {
  background: var(--navy-500); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 13px; color: var(--text-300); margin-bottom: 16px;
}
.vowel-note strong { color: var(--gold); }

/* ── Vocab Flashcard ── */
.vocab-progress {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.vocab-progress-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.vocab-progress-fill { height: 100%; background: linear-gradient(90deg, #4caf50, #81c784); border-radius: 3px; transition: width 0.4s; }
.vocab-progress-text { font-size: 12px; color: var(--text-400); white-space: nowrap; }

.flashcard {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-xl); min-height: 220px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 28px 20px; margin-bottom: 14px;
  cursor: pointer; transition: border-color var(--transition), transform var(--transition);
  position: relative;
}
.flashcard:hover { border-color: var(--border-2); transform: scale(1.01); }
.flashcard.flipped { border-color: var(--border-gold); }
.card-done-badge {
  position: absolute; top: 12px; right: 12px;
  background: rgba(76,175,80,0.2); border: 1px solid rgba(76,175,80,0.4);
  color: #81c784; font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full);
}
.card-word   { font-size: 40px; font-weight: 700; color: var(--text-100); margin-bottom: 6px; }
.card-pron   { font-size: 15px; color: var(--text-400); margin-bottom: 12px; }
.card-trans  { font-size: 26px; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.card-ex     { font-size: 13px; font-style: italic; color: var(--text-400); margin-bottom: 4px; }
.card-ex-ar  { font-size: 13px; color: var(--text-500); }
.card-hint   { font-size: 12px; color: var(--text-500); }

.flashcard-nav { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.word-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; margin-bottom: 16px; }
.word-dot {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--navy-500); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-500); border: 1px solid var(--border);
  transition: var(--transition);
}
.word-dot:hover { border-color: var(--border-2); }
.word-dot.done  { background: rgba(76,175,80,0.25); border-color: rgba(76,175,80,0.5); color: #81c784; }
.word-dot.current { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold); }

/* ── Grammar ── */
.grammar-tabs { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; }
.grammar-tab {
  background: var(--navy-500); border: 1px solid var(--border);
  border-radius: var(--radius-full); padding: 7px 16px; font-size: 13px;
  color: var(--text-400); cursor: pointer; transition: var(--transition);
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.grammar-tab.active { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold); }
.grammar-tab:hover:not(.active) { border-color: var(--border-2); color: var(--text-200); }

.theory-box {
  background: var(--navy-700); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.theory-title { font-size: 14px; font-weight: 600; color: var(--gold); margin-bottom: 12px; }
.theory-intro { font-size: 14px; color: var(--text-300); margin-bottom: 16px; line-height: 1.7; }

.rules-table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
.rules-table th {
  background: var(--navy-500); padding: 10px 12px; font-size: 12px; font-weight: 600;
  color: var(--text-400); text-align: right; border: 1px solid var(--border);
}
.rules-table td {
  padding: 10px 12px; font-size: 13px; color: var(--text-200); border: 1px solid var(--border);
  background: var(--navy-600);
}
.rules-table td.verb-cell { font-family: 'Raleway', 'Courier New', monospace; color: var(--gold); }

.badge-rule {
  display: inline-block; background: rgba(255,255,255,0.07); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 4px 10px; font-size: 12px;
  color: var(--text-300); margin: 3px;
}
.badge-rule.neg { background: rgba(229,57,53,0.1); border-color: rgba(229,57,53,0.3); color: #ef9a9a; }
.badge-rule.q   { background: rgba(25,118,210,0.1); border-color: rgba(25,118,210,0.3); color: #90caf9; }

.examples-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.example-row {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.ex-en { flex: 1; min-width: 180px; font-weight: 500; color: var(--text-200); direction: ltr; text-align: left; }
.ex-ar { flex: 1; min-width: 120px; color: var(--text-400); font-size: 13px; text-align: right; }

.irregular-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 16px; }
.irregular-card {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px; text-align: center;
}
.irr-base { font-size: 13px; color: var(--text-400); }
.irr-arrow { color: var(--text-500); font-size: 11px; }
.irr-past { font-size: 15px; font-weight: 600; color: var(--gold); }

/* ── Exercises ── */
.exercise-card {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
}
.ex-question { font-size: 15px; color: var(--text-200); margin-bottom: 12px; font-weight: 500; }
.ex-question em { color: var(--gold); font-style: normal; }
.ex-options { display: flex; gap: 8px; flex-wrap: wrap; }
.ex-opt {
  background: var(--navy-500); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 8px 16px;
  font-size: 13px; color: var(--text-300); cursor: pointer;
  transition: var(--transition); font-family: 'IBM Plex Sans Arabic', sans-serif;
  white-space: nowrap;
}
.ex-opt:hover:not(:disabled) { border-color: var(--border-gold); color: var(--gold); background: var(--gold-dim2); }
.ex-opt.correct  { background: rgba(76,175,80,0.15); border-color: rgba(76,175,80,0.5); color: #81c784; }
.ex-opt.wrong    { background: rgba(229,57,53,0.12); border-color: rgba(229,57,53,0.4); color: #ef9a9a; }
.ex-opt.selected { background: var(--gold-dim); border-color: var(--border-gold); color: var(--gold); }
.ex-feedback { font-size: 12px; margin-top: 8px; color: #ef9a9a; }
.ex-feedback.ok { color: #81c784; }

/* ── Quiz ── */
.quiz-progress { display: flex; gap: 4px; margin-bottom: 20px; }
.quiz-prog-seg { flex: 1; height: 4px; border-radius: 2px; background: var(--navy-400); transition: var(--transition); }
.quiz-prog-seg.done   { background: #4caf50; }
.quiz-prog-seg.active { background: var(--gold); }
.quiz-question-num { font-size: 12px; color: var(--text-500); margin-bottom: 10px; }
.quiz-question {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 16px;
  font-size: 16px; font-weight: 600; color: var(--text-100); margin-bottom: 16px;
  min-height: 64px; display: flex; align-items: center;
}
.quiz-opts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.quiz-opt {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  font-size: 14px; color: var(--text-300); cursor: pointer;
  transition: var(--transition); text-align: right; direction: rtl;
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--border-2); color: var(--text-100); background: var(--navy-500); }
.quiz-opt.correct  { background: rgba(76,175,80,0.15); border-color: rgba(76,175,80,0.5); color: #81c784; }
.quiz-opt.wrong    { background: rgba(229,57,53,0.1);  border-color: rgba(229,57,53,0.4); color: #ef9a9a; }
.quiz-opt.selected { background: var(--gold-dim);       border-color: var(--border-gold);  color: var(--gold); }

.quiz-result {
  text-align: center; padding: 32px 16px;
  background: var(--navy-600); border: 1px solid var(--border); border-radius: var(--radius-xl);
}
.result-emoji { font-size: 56px; margin-bottom: 12px; display: block; }
.result-pct   { font-size: 40px; font-weight: 800; color: var(--gold); display: block; margin-bottom: 4px; }
.result-score { font-size: 15px; color: var(--text-300); margin-bottom: 10px; }
.result-msg   { font-size: 14px; font-weight: 600; margin-bottom: 20px; }
.result-msg.excellent { color: #81c784; }
.result-msg.good      { color: var(--gold); }
.result-msg.retry     { color: #ef9a9a; }

.result-review { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; text-align: right; }
.result-review-item {
  background: var(--navy-700); border-radius: var(--radius-md);
  padding: 10px 12px; font-size: 12px; border-right: 3px solid;
}
.result-review-item.ok    { border-color: #4caf50; }
.result-review-item.wrong { border-color: #ef5350; }
.result-review-q { color: var(--text-400); margin-bottom: 3px; }
.result-review-a { color: var(--text-200); }
.result-review-correct { color: #81c784; }

/* ── Reading ── */
.reading-text {
  background: var(--navy-700); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  font-size: 15px; line-height: 2; color: var(--text-200);
  direction: ltr; text-align: left; white-space: pre-line;
  margin-bottom: 16px;
}
.reading-note {
  background: var(--gold-dim2); border: 1px solid var(--border-gold);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 13px; color: var(--gold); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── AI Tutor ── */
.chat-wrap { display: flex; flex-direction: column; height: 560px; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 8px 0; display: flex;
  flex-direction: column; gap: 10px; margin-bottom: 12px;
}
.chat-msg { display: flex; }
.chat-msg.user  { justify-content: flex-end; }
.chat-msg.bot   { justify-content: flex-start; }
.chat-bubble {
  max-width: 82%; padding: 11px 15px;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap;
  border-radius: var(--radius-lg);
}
.chat-msg.user  .chat-bubble { background: var(--gold); color: #060b18; border-bottom-right-radius: 4px; font-weight: 500; }
.chat-msg.bot   .chat-bubble { background: var(--navy-500); border: 1px solid var(--border); color: var(--text-200); border-bottom-left-radius: 4px; direction: rtl; text-align: right; }
.chat-typing    .chat-bubble { color: var(--text-500); font-style: italic; }

.chat-suggestions { margin-bottom: 10px; display: flex; flex-direction: column; gap: 5px; }
.chat-sug-item {
  background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 8px 12px; font-size: 12px;
  color: var(--text-400); cursor: pointer; text-align: right; direction: rtl;
  transition: var(--transition); font-family: 'IBM Plex Sans Arabic', sans-serif;
}
.chat-sug-item:hover { border-color: var(--border-gold); color: var(--gold); background: var(--gold-dim2); }

.chat-input-row {
  display: flex; gap: 8px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1; background: var(--navy-600); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 14px;
  font-size: 14px; color: var(--text-200); outline: none;
  font-family: 'IBM Plex Sans Arabic', sans-serif; direction: rtl;
  transition: border-color var(--transition);
}
.chat-input::placeholder { color: var(--text-500); }
.chat-input:focus { border-color: var(--border-gold); }

/* ── Buttons ── */
.btn {
  background: var(--navy-500); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 9px 18px; font-size: 13px;
  color: var(--text-300); cursor: pointer; transition: var(--transition);
  font-family: 'IBM Plex Sans Arabic', sans-serif; display: inline-flex;
  align-items: center; gap: 6px; white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--border-2); color: var(--text-100); background: var(--navy-400); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--gold); border: none; color: #060b18;
  font-weight: 600; border-radius: var(--radius-md); padding: 10px 22px;
  font-size: 14px; cursor: pointer; transition: var(--transition);
  font-family: 'IBM Plex Sans Arabic', sans-serif; display: inline-flex;
  align-items: center; gap: 6px;
}
.btn-primary:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-1px); box-shadow: var(--shadow-glow); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-success {
  background: rgba(76,175,80,0.15); border: 1px solid rgba(76,175,80,0.4);
  color: #81c784; border-radius: var(--radius-md); padding: 10px 22px;
  font-size: 14px; cursor: pointer; font-family: 'IBM Plex Sans Arabic', sans-serif;
  transition: var(--transition); display: inline-flex; align-items: center; gap: 6px;
}
.btn-success:hover { background: rgba(76,175,80,0.25); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ── Misc ── */
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.text-gold  { color: var(--gold); }
.text-muted { color: var(--text-400); }
.text-sm    { font-size: 12px; }

.complete-banner {
  background: rgba(76,175,80,0.1); border: 1px solid rgba(76,175,80,0.4);
  border-radius: var(--radius-lg); padding: 16px 20px;
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.complete-banner-icon { font-size: 24px; }
.complete-banner-text { font-size: 14px; color: #81c784; font-weight: 500; }

/* ── Footer ── */
.footer {
  background: var(--navy-900); border-top: 1px solid var(--border);
  padding: 20px 16px; text-align: center;
  font-size: 12px; color: var(--text-500); margin-top: 40px;
}
.footer a { color: var(--text-400); text-decoration: none; }
.footer a:hover { color: var(--gold); }

/* ── Responsive ── */
@media (min-width: 640px) {
  .levels-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
  .alpha-grid  { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}
@media (min-width: 900px) {
  .levels-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 639px) {
  .nav-links   { display: none; }
  .nav-hamburger { display: flex; }
  .hero        { padding: 36px 16px 30px; }
  .hero-stats  { gap: 10px; }
  .hero-stat   { padding: 8px 12px; }
  .ex-options  { flex-direction: column; }
  .example-row { flex-direction: column; gap: 4px; }
  .ex-en       { text-align: right; direction: rtl; }
  .alpha-detail{ flex-direction: column; }
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.35s ease forwards; }

@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.5; }
}
.pulsing { animation: pulse 1.2s infinite; }
