/* =====================================================================
   English Master — Shared Design System  (المصدر الموحّد للتصميم)
   ---------------------------------------------------------------------
   كل المتغيرات والمكوّنات المشتركة بين قسم القواعد وقسم الكلمات.
   مستخرَج من النموذج المرجعي english-present-simple-lesson.html بنفس
   القيم بالظبط، عشان أي صفحة جديدة تطلع مطابقة 100%.
   أي تعديل تصميمي يتعمل هنا فيأثّر على المنصة كلها.
   ===================================================================== */

/* ------------------------------------------------------------------ */
/* DESIGN TOKENS                                                       */
/* ------------------------------------------------------------------ */
:root {
  /* الألوان (Colors) */
  --paper: #fffef7;
  --paper-line: #c5d8e8;
  --paper-margin: #f4a8a8;
  --ink-blue: #1e3a8a;
  --ink-blue-light: #2563eb;
  --ink-red: #dc2626;
  --ink-pink: #db2777;
  --ink-green: #15803d;
  --ink-purple: #7c3aed;
  --ink-orange: #ea580c;
  --ink-teal: #0d9488;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(30,58,138,0.08);
  --shadow-lg: 0 20px 60px rgba(0,0,0,0.08);
  --radius: 16px;

  /* الخطوط (Fonts) — أسماء موحّدة بدل تكرار العائلات في كل مكان */
  --font-heading: 'Aref Ruqaa', serif;
  --font-body: 'Cairo', sans-serif;
  --font-english: 'Poppins', sans-serif;
  --font-hand: 'Caveat', cursive;

  /* ارتفاع شريط التنقّل السفلي (يُستخدم لإزاحة المحتوى) */
  --bottom-nav-h: 64px;
}

/* ------------------------------------------------------------------ */
/* BASE                                                                */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: radial-gradient(ellipse at top, #e8d5b7 0%, #d4b896 100%);
  min-height: 100vh;
  padding: 20px 10px;
  /* مساحة سفلية عشان المحتوى ما يختفيش ورا الشريط الثابت */
  padding-bottom: calc(var(--bottom-nav-h) + 24px + env(safe-area-inset-bottom, 0px));
  color: var(--text);
  line-height: 1.8;
}

/* ------------------------------------------------------------------ */
/* ICONS  (الأيقونات الموحّدة — SVG، تتلوّن بـ currentColor)             */
/* ------------------------------------------------------------------ */
.em-icon { width: 1em; height: 1em; display: block; flex: none; }

/* أيقونة سطرية تتحاذى مع النص اللي جنبها */
.ico-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: -0.16em;
  font-size: 1.06em;
  line-height: 0;
}

/* ------------------------------------------------------------------ */
/* BOTTOM NAVIGATION  (شريط التنقّل الموحّد — جديد)                      */
/* ------------------------------------------------------------------ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(30,58,138,0.10);
  z-index: 150;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--bottom-nav-h);
  padding: 7px 4px 9px;
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.2s, transform 0.2s;
}

.bottom-nav .nav-ico { font-size: 1.5rem; line-height: 0; display: flex; align-items: center; justify-content: center; }
.bottom-nav .nav-item:hover { color: var(--ink-blue); }
.bottom-nav .nav-item.active { color: var(--ink-blue); }
.bottom-nav .nav-item.active .nav-ico { transform: translateY(-2px) scale(1.08); }
.bottom-nav .nav-item.active .nav-label { font-weight: 700; }

/* ------------------------------------------------------------------ */
/* TOP BAR                                                             */
/* ------------------------------------------------------------------ */
.top-bar {
  max-width: 1050px;
  margin: 0 auto 16px;
  background: white;
  border-radius: var(--radius);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
  gap: 10px;
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.crumbs a { color: var(--ink-blue); text-decoration: none; font-weight: 600; }
.crumbs .sep { color: var(--border); }
.crumbs .current { color: var(--text); font-weight: 700; }

.progress-mini {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.progress-bar-mini {
  width: 100px;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill-mini {
  height: 100%;
  background: linear-gradient(90deg, var(--ink-blue), var(--ink-green));
  width: 0%;
  transition: width 0.4s ease;
}

/* ------------------------------------------------------------------ */
/* NOTEBOOK SHELL  (قشرة الكشكول — لأي صفحة درس)                        */
/* ------------------------------------------------------------------ */
.notebook {
  max-width: 1050px;
  margin: 0 auto;
  background: var(--paper);
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px);
  background-size: 100% 32px;
  background-position: 0 90px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  padding: 30px 40px 40px 60px;
}

.notebook::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  right: 50px;
  width: 2px;
  background: var(--paper-margin);
  opacity: 0.6;
}

.notebook::after {
  content: '';
  position: absolute;
  left: 18px;
  top: 0; bottom: 0;
  width: 14px;
  background-image: radial-gradient(circle at center, #d4b896 0%, #d4b896 50%, transparent 51%);
  background-size: 14px 14px;
  background-repeat: repeat-y;
  background-position: center 90px;
}

/* ------------------------------------------------------------------ */
/* NOTEBOOK HEADER                                                     */
/* ------------------------------------------------------------------ */
.notebook-header {
  text-align: center;
  padding: 20px 0 30px;
  border-bottom: 2px dashed var(--ink-blue);
  margin-bottom: 30px;
}

.lesson-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: white;
  border: 2px solid var(--ink-orange);
  color: var(--ink-orange);
  padding: 5px 14px;
  border-radius: 20px;
  font-family: var(--font-hand);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 12px;
  transform: rotate(-2deg);
}

.notebook-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  color: var(--ink-blue);
  font-weight: 700;
  display: inline-block;
  text-decoration: underline;
  text-decoration-color: var(--ink-red);
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
  margin-bottom: 12px;
}

.en-title {
  font-family: var(--font-english);
  color: var(--ink-pink);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  direction: ltr;
  display: block;
  margin-top: 6px;
}

.sparkle {
  color: var(--ink-red);
  font-size: 1.2rem;
  margin: 0 8px;
  display: inline-block;
  animation: twinkle 2s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1) rotate(0deg); }
  50% { opacity: 0.6; transform: scale(1.2) rotate(20deg); }
}

.lesson-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-family: var(--font-hand);
  font-size: 1.15rem;
  color: var(--ink-purple);
}

/* ------------------------------------------------------------------ */
/* TABLE OF CONTENTS                                                   */
/* ------------------------------------------------------------------ */
.toc-card {
  background: rgba(30, 58, 138, 0.05);
  border: 2px solid var(--ink-blue);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 30px;
}

.toc-card h2 {
  font-family: var(--font-heading);
  color: var(--ink-blue);
  margin-bottom: 12px;
  text-align: center;
  font-size: 1.2rem;
}

.toc-card ol {
  padding-right: 25px;
  columns: 2;
  column-gap: 25px;
}

.toc-card li { padding: 4px 0; font-size: 0.95rem; break-inside: avoid; }

.toc-card a {
  color: var(--ink-blue);
  text-decoration: none;
  border-bottom: 1px dotted var(--ink-blue);
  transition: all 0.2s;
}

.toc-card a:hover { color: var(--ink-red); border-color: var(--ink-red); }

@media (max-width: 700px) {
  .toc-card ol { columns: 1; }
}

/* ------------------------------------------------------------------ */
/* SECTION                                                             */
/* ------------------------------------------------------------------ */
.section {
  margin-bottom: 45px;
  scroll-margin-top: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  color: var(--ink-blue);
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-title .num {
  color: var(--ink-red);
  font-family: var(--font-hand);
  font-size: 1.9rem;
  font-weight: 700;
}

.section-title .en {
  font-family: var(--font-english);
  color: var(--ink-pink);
  font-size: 1.1rem;
  font-weight: 500;
  margin-right: auto;
  direction: ltr;
}

/* ------------------------------------------------------------------ */
/* CONTENT                                                             */
/* ------------------------------------------------------------------ */
.content {
  padding-right: 15px;
  font-size: 1.05rem;
  line-height: 1.95;
}

.content p { margin-bottom: 14px; }
.content strong { color: var(--ink-red); font-weight: 700; }

.content em {
  color: var(--ink-green);
  font-style: normal;
  font-weight: 600;
  background: rgba(21, 128, 61, 0.08);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.92em;
}

.en-word {
  font-family: var(--font-english);
  color: var(--ink-blue);
  font-weight: 600;
  direction: ltr;
  display: inline-block;
}

.content ul { list-style: none; padding: 0; margin: 14px 0; }
.content ul li { position: relative; padding-right: 22px; margin-bottom: 10px; line-height: 1.9; }
.content ul li::before { content: '◆'; position: absolute; right: 0; color: var(--ink-red); font-size: 0.7rem; top: 10px; }

.content ol { padding-right: 25px; margin: 14px 0; }
.content ol li { padding: 4px 0; line-height: 1.9; padding-right: 5px; }

/* ------------------------------------------------------------------ */
/* SUBHEADERS                                                          */
/* ------------------------------------------------------------------ */
.sub-header {
  font-family: var(--font-heading);
  color: var(--ink-red);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 22px 0 12px;
  border-right: 4px solid var(--ink-red);
  padding-right: 14px;
}

.mini-header {
  font-family: var(--font-hand);
  color: var(--ink-purple);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 18px 0 10px;
}

/* ------------------------------------------------------------------ */
/* ANALOGY                                                             */
/* ------------------------------------------------------------------ */
.analogy {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 20px 0;
}

.analogy-title {
  font-family: var(--font-heading);
  color: #92400e;
  font-weight: 700;
  margin-bottom: 8px;
}

/* ------------------------------------------------------------------ */
/* SENTENCE BOX  (صندوق الجملة — عنصر أساسي)                            */
/* ------------------------------------------------------------------ */
.sentence-box {
  background: white;
  border-right: 4px solid var(--ink-blue);
  padding: 14px 18px;
  margin: 12px 0;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.sentence-en {
  font-family: var(--font-english);
  color: var(--ink-blue);
  font-size: 1.1rem;
  font-weight: 600;
  direction: ltr;
  text-align: left;
  margin-bottom: 6px;
}

.sentence-ar {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.sentence-ar::before { content: '⟵ '; color: var(--text-muted); }

.sentence-note {
  font-family: var(--font-hand);
  color: var(--ink-purple);
  font-size: 1.05rem;
  margin-top: 6px;
  display: block;
}

/* ------------------------------------------------------------------ */
/* FORMULA BOX  (صندوق الصيغة — عنصر أساسي)                             */
/* ------------------------------------------------------------------ */
.formula-box {
  background: linear-gradient(135deg, var(--ink-blue), var(--ink-blue-light));
  color: white;
  border-radius: var(--radius);
  padding: 20px;
  margin: 18px 0;
  text-align: center;
  box-shadow: 0 6px 20px rgba(30,58,138,0.25);
}

.formula-label {
  font-family: var(--font-hand);
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 8px;
}

.formula {
  font-family: var(--font-english);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  direction: ltr;
}

.formula .var { color: #fbbf24; }
.formula .plus { color: #94a3b8; margin: 0 6px; }

/* ------------------------------------------------------------------ */
/* ALERT BOXES                                                         */
/* ------------------------------------------------------------------ */
.warning-box, .tip-box, .note-box, .info-box, .success-box {
  border-radius: 10px;
  padding: 14px 18px;
  margin: 14px 0;
  font-size: 0.98rem;
  position: relative;
  padding-right: 50px;
}

.warning-box::before, .tip-box::before, .note-box::before, .info-box::before, .success-box::before {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 1.3rem;
}

.warning-box { background: #fee2e2; border-right: 4px solid var(--ink-red); }
.warning-box::before { content: '⚠️'; }
.tip-box { background: #dbeafe; border-right: 4px solid var(--ink-blue); }
.tip-box::before { content: '💡'; }
.note-box { background: #fef9c3; border-right: 4px solid #facc15; }
.note-box::before { content: '📌'; }
.info-box { background: #e0f2fe; border-right: 4px solid var(--ink-teal); }
.info-box::before { content: 'ℹ️'; }
.success-box { background: #f0fdf4; border-right: 4px solid var(--ink-green); }
.success-box::before { content: '✅'; }

/* ------------------------------------------------------------------ */
/* TABLE                                                               */
/* ------------------------------------------------------------------ */
.cool-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  font-size: 0.95rem;
}

.cool-table thead { background: linear-gradient(135deg, var(--ink-blue), var(--ink-blue-light)); color: white; }
.cool-table th { padding: 12px 14px; text-align: right; font-family: var(--font-heading); font-weight: 600; }
.cool-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); }
.cool-table td:last-child { border-left: none; }
.cool-table tbody tr:hover { background: #f9fafb; }

.cool-table .en-cell {
  font-family: var(--font-english);
  color: var(--ink-blue);
  font-weight: 600;
  direction: ltr;
  text-align: left;
}

/* ------------------------------------------------------------------ */
/* TIME EXPRESSIONS                                                    */
/* ------------------------------------------------------------------ */
.time-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.time-chip {
  background: white;
  border: 2px solid var(--ink-teal);
  color: var(--ink-teal);
  padding: 6px 14px;
  border-radius: 20px;
  font-family: var(--font-english);
  font-size: 0.88rem;
  font-weight: 600;
  direction: ltr;
}

/* ------------------------------------------------------------------ */
/* EXERCISE                                                            */
/* ------------------------------------------------------------------ */
.exercise {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px dashed var(--ink-orange);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 20px 0;
}

.exercise-title {
  font-family: var(--font-heading);
  color: var(--ink-orange);
  font-weight: 700;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.exercise-q {
  background: rgba(255,255,255,0.6);
  padding: 10px 14px;
  border-radius: 8px;
  margin: 8px 0;
  font-family: var(--font-english);
  direction: ltr;
  text-align: left;
  color: var(--text);
  font-size: 1rem;
}

.exercise-q .blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px dashed var(--ink-red);
  color: transparent;
}

.solution-toggle {
  background: var(--ink-green);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 10px;
  font-weight: 600;
  transition: all 0.2s;
}

.solution-toggle:hover { background: #166534; transform: translateY(-2px); }

.solution {
  display: none;
  margin-top: 12px;
  padding: 14px 16px;
  background: rgba(21, 128, 61, 0.08);
  border-radius: 8px;
  border-right: 3px solid var(--ink-green);
}

.solution.show { display: block; animation: slideDown 0.3s ease-out; }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.solution-label {
  font-family: var(--font-hand);
  color: var(--ink-green);
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 8px;
  display: block;
}

.solution-item {
  font-family: var(--font-english);
  direction: ltr;
  text-align: left;
  padding: 4px 0;
}

.solution-item .ans {
  background: #dcfce7;
  color: var(--ink-green);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* INTERACTIVE + AUDIO  (النطق الصوتي + التمارين التفاعلية)              */
/* ------------------------------------------------------------------ */

/* زر النطق على الجمل الإنجليزية (يتحطّ تلقائياً من lesson.js) */
.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  margin-left: 8px;
  vertical-align: -5px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--ink-blue);
  background: white;
  color: var(--ink-blue);
  cursor: pointer;
  flex: none;
  transition: all 0.15s;
}
.speak-btn:hover { background: var(--ink-blue); color: white; transform: scale(1.08); }
.speak-btn.speaking { background: var(--ink-blue); color: white; animation: speakPulse 0.9s ease-in-out infinite; }
.speak-btn .em-icon { width: 0.82em; height: 0.82em; }

@keyframes speakPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(30,58,138,0.35); }
  50% { box-shadow: 0 0 0 5px rgba(30,58,138,0); }
}

/* خانة الإجابة التفاعلية */
.blank-input {
  font-family: var(--font-english);
  direction: ltr;
  text-align: center;
  border: none;
  border-bottom: 2px dashed var(--ink-red);
  background: rgba(255,255,255,0.75);
  border-radius: 5px 5px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-blue);
  padding: 3px 8px;
  min-width: 90px;
  transition: all 0.2s;
}
.blank-input:focus { outline: none; border-bottom-color: var(--ink-blue); background: white; }
.blank-input.correct { border-bottom-color: var(--ink-green); background: #dcfce7; color: var(--ink-green); }
.blank-input.incorrect { border-bottom-color: var(--ink-red); background: #fee2e2; color: var(--ink-red); }

/* زر التحقّق + رسالة النتيجة */
.check-btn {
  background: var(--ink-blue);
  color: white;
  border: none;
  padding: 9px 22px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}
.check-btn:hover { background: var(--ink-blue-light); transform: translateY(-2px); }

.exercise-feedback {
  display: none;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  background: #fee2e2;
  color: var(--ink-red);
  border-right: 3px solid var(--ink-red);
}
.exercise-feedback.show { display: block; animation: slideDown 0.3s; }
.exercise-feedback.all-correct { background: #f0fdf4; color: var(--ink-green); border-right-color: var(--ink-green); }

/* ------------------------------------------------------------------ */
/* QUICK SUMMARY  (الملخص السريع — خرائط بصرية، فيروزي)                  */
/* ------------------------------------------------------------------ */
.quick-summary {
  background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
  border: 2px solid var(--ink-teal);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
}
.quick-summary .qs-title {
  font-family: var(--font-heading);
  color: var(--ink-teal);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.quick-summary ul { list-style: none; padding: 0; margin: 0; }
.quick-summary li { position: relative; padding-right: 26px; margin-bottom: 8px; line-height: 1.75; }
.quick-summary li::before { content: '✦'; position: absolute; right: 0; top: 3px; color: var(--ink-teal); font-size: 0.8rem; }
.quick-summary .en-word { color: var(--ink-blue); }

/* خريطة تدفّق بصرية (S → V → O) */
.map-flow {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px; margin: 16px 0;
}
.map-node {
  background: white; border: 2px solid var(--ink-teal); color: var(--ink-teal);
  border-radius: 12px; padding: 8px 16px;
  font-family: var(--font-english); font-weight: 700; direction: ltr;
  box-shadow: 0 2px 8px rgba(13,148,136,0.12);
}
.map-node small { display: block; font-family: var(--font-body); font-size: 0.7rem; color: var(--text-muted); }
.map-arrow { color: var(--ink-teal); font-size: 1.4rem; font-weight: 700; }

/* ------------------------------------------------------------------ */
/* TRAPS  (الفخاخ الشهيرة — أحمر، أهم قسم)                              */
/* ------------------------------------------------------------------ */
.traps-title {
  font-family: var(--font-heading);
  color: var(--ink-red);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 26px 0 14px;
  display: flex; align-items: center; gap: 8px;
}
.trap {
  background: #fef2f2;
  border: 2px solid var(--ink-red);
  border-right-width: 6px;
  border-radius: 12px;
  padding: 14px 18px;
  margin: 12px 0;
}
.trap .trap-q { font-weight: 700; color: var(--text); margin-bottom: 8px; }
.trap .trap-q .en-word { color: var(--ink-blue); }
.trap .trap-right {
  color: var(--ink-green); font-weight: 600; margin-bottom: 4px;
  font-family: var(--font-english); direction: ltr;
}
.trap .trap-wrong {
  color: var(--ink-red); font-weight: 600; margin-bottom: 8px;
  font-family: var(--font-english); direction: ltr; text-decoration: line-through;
}
.trap .trap-warn {
  background: rgba(220,38,38,0.08);
  border-radius: 8px; padding: 8px 12px;
  font-size: 0.92rem; color: #991b1b; line-height: 1.7;
}
.trap .trap-warn strong { color: var(--ink-red); }

/* ------------------------------------------------------------------ */
/* INTERACTIVE QUESTION BANK  (بنك الأسئلة التفاعلي — بنفسجي)           */
/* ------------------------------------------------------------------ */
.qbank { margin: 22px 0; }

.qbank-title {
  font-family: var(--font-heading);
  color: var(--ink-purple);
  font-size: 1.5rem; font-weight: 700;
  margin-bottom: 6px;
  display: flex; align-items: center; gap: 8px;
}
.qbank-intro { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 14px; }

.qb-scorebar {
  position: sticky; top: 8px; z-index: 30;
  background: white;
  border: 2px solid var(--ink-purple);
  border-radius: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow);
}
.qb-score-label { font-weight: 700; color: var(--ink-purple); white-space: nowrap; font-size: 0.95rem; }
.qb-score-label strong { font-family: var(--font-english); }
.qb-progress-track { flex: 1; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.qb-progress-fill { height: 100%; width: 0%; border-radius: 5px; background: linear-gradient(90deg, var(--ink-purple), var(--ink-pink)); transition: width 0.4s ease; }

.qb-q {
  background: white; border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.qb-q .qb-num {
  display: inline-block; background: var(--ink-purple); color: white;
  width: 26px; height: 26px; border-radius: 50%; text-align: center; line-height: 26px;
  font-weight: 700; margin-left: 8px; font-size: 0.85rem; font-family: var(--font-english);
}
.qb-text { font-weight: 600; font-size: 1rem; margin-bottom: 12px; }
.qb-text .en-word { color: var(--ink-blue); }
.qb-opts { display: flex; flex-direction: column; gap: 8px; }
.qb-opt {
  padding: 11px 16px; background: #f8fafc; border: 2px solid var(--border);
  border-radius: 10px; cursor: pointer; text-align: right;
  font-family: var(--font-body); font-size: 0.95rem; width: 100%; transition: all 0.2s;
}
.qb-opt.en-opt { font-family: var(--font-english); direction: ltr; text-align: left; }
.qb-opt:hover:not(:disabled) { border-color: var(--ink-purple); background: white; }
.qb-opt:disabled { cursor: default; }
.qb-opt.correct { border-color: var(--ink-green); background: #f0fdf4; color: var(--ink-green); font-weight: 700; }
.qb-opt.wrong { border-color: var(--ink-red); background: #fee2e2; color: var(--ink-red); }

.qb-explain {
  display: none; margin-top: 12px; padding: 12px 14px; border-radius: 8px;
  background: #faf5ff; border-right: 3px solid var(--ink-purple);
  font-size: 0.92rem; line-height: 1.75;
}
.qb-explain.show { display: block; animation: slideDown 0.3s; }
.qb-explain .why-right { color: var(--ink-green); font-weight: 700; }
.qb-explain .why-wrong { color: var(--ink-red); font-weight: 700; }
.qb-explain .en-word { color: var(--ink-blue); }

/* خلايا جدول ملوّنة (أخضر = اعمل / أحمر = تجنّب) */
.cool-table td.cell-do { color: var(--ink-green); font-weight: 700; }
.cool-table td.cell-dont { color: var(--ink-red); font-weight: 700; }

/* ------------------------------------------------------------------ */
/* QUIZ                                                                */
/* ------------------------------------------------------------------ */
.quiz-container {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border: 3px solid var(--ink-purple);
  border-radius: var(--radius);
  padding: 24px;
  margin: 30px 0;
  position: relative;
}

.quiz-container::before {
  content: '🎯 اختبر فهمك';
  position: absolute;
  top: -18px;
  right: 30px;
  background: var(--ink-purple);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
}

.quiz-intro {
  text-align: center;
  margin-bottom: 20px;
  margin-top: 10px;
  font-size: 0.95rem;
}

.quiz-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.qt-tab {
  background: white;
  border: 2px solid var(--ink-purple);
  color: var(--ink-purple);
  padding: 8px 18px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.qt-tab.active { background: var(--ink-purple); color: white; }

.quiz-section { display: none; }
.quiz-section.active { display: block; }

.quiz-question {
  background: white;
  padding: 16px 18px;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.q-num {
  display: inline-block;
  background: var(--ink-purple);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  margin-left: 10px;
  font-size: 0.9rem;
}

.q-text {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 14px;
}

.q-text-en {
  font-family: var(--font-english);
  direction: ltr;
  text-align: left;
  display: block;
  margin-top: 6px;
  color: var(--ink-blue);
  font-size: 1rem;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.q-opt {
  padding: 11px 16px;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.95rem;
  text-align: right;
  font-family: var(--font-body);
  width: 100%;
}

.q-opt.en-opt {
  font-family: var(--font-english);
  direction: ltr;
  text-align: left;
}

.q-opt:hover { border-color: var(--ink-purple); background: white; }
.q-opt.selected { border-color: var(--ink-purple); background: #ede9fe; }
.q-opt.correct { border-color: var(--ink-green); background: #f0fdf4; color: var(--ink-green); font-weight: 700; }
.q-opt.wrong { border-color: var(--ink-red); background: #fee2e2; color: var(--ink-red); }

.q-feedback {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  display: none;
  line-height: 1.7;
}

.q-feedback.show { display: block; animation: slideDown 0.3s; }
.q-feedback.correct { background: #f0fdf4; color: var(--ink-green); border-right: 3px solid var(--ink-green); }
.q-feedback.wrong { background: #fee2e2; color: var(--ink-red); border-right: 3px solid var(--ink-red); }

.quiz-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--ink-purple), #a78bfa);
  color: white;
  border: none;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  transition: all 0.2s;
}

.quiz-submit:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4); }

.quiz-result {
  display: none;
  background: white;
  padding: 24px;
  border-radius: 12px;
  margin-top: 16px;
  text-align: center;
}

.quiz-result.show { display: block; animation: slideDown 0.4s; }

.result-score {
  font-family: var(--font-english);
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--ink-purple);
  line-height: 1;
}

.result-label { font-size: 1rem; color: var(--text-muted); margin: 6px 0 16px; }

.result-message {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.result-message.excellent { color: var(--ink-green); }
.result-message.good { color: var(--ink-blue); }
.result-message.try-again { color: var(--ink-orange); }

.retry-btn {
  background: var(--ink-purple);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
}

/* ------------------------------------------------------------------ */
/* LESSON NAVIGATION                                                   */
/* ------------------------------------------------------------------ */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px dashed var(--ink-blue);
  gap: 12px;
  flex-wrap: wrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border: 2px solid var(--ink-blue);
  border-radius: 10px;
  color: var(--ink-blue);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-btn:hover { background: var(--ink-blue); color: white; transform: translateY(-2px); }
.nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.complete-btn {
  background: var(--ink-green);
  color: white;
  border-color: var(--ink-green);
  flex: 1;
  justify-content: center;
  max-width: 300px;
}

.complete-btn:hover { background: #166534; border-color: #166534; }
.complete-btn.completed { background: var(--ink-purple); border-color: var(--ink-purple); }

/* ------------------------------------------------------------------ */
/* NOTEBOOK FOOTER                                                     */
/* ------------------------------------------------------------------ */
.notebook-footer {
  text-align: center;
  margin-top: 30px;
  padding: 22px 25px;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border: 2px solid var(--ink-pink);
  border-radius: var(--radius);
}

.notebook-footer h3 { font-family: var(--font-heading); color: var(--ink-pink); font-size: 1.3rem; margin-bottom: 8px; }
.notebook-footer p { font-family: var(--font-hand); color: var(--ink-purple); font-size: 1.2rem; line-height: 1.7; }

/* ------------------------------------------------------------------ */
/* DASHBOARD WIDGETS  (ودجات لوحة التقدّم — موحّدة، جديدة)               */
/* ------------------------------------------------------------------ */
.dashboard-widget {
  background: white;
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.dashboard-widget .widget-title {
  font-family: var(--font-heading);
  color: var(--ink-blue);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* عدّاد السلسلة اليومية */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 2px solid var(--ink-orange);
  border-radius: 30px;
  padding: 8px 18px;
  margin-bottom: 18px;
}

.streak-badge .streak-fire { font-size: 1.7rem; line-height: 0; display: flex; color: var(--ink-orange); }
.streak-badge .streak-num {
  font-family: var(--font-english);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--ink-orange);
  line-height: 1;
}
.streak-badge .streak-text { font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }
.streak-badge.is-zero { filter: grayscale(0.6); opacity: 0.85; }

/* صف تقدّم (عنوان + شريط + نسبة) */
.progress-row { margin: 14px 0; }

.progress-row .pr-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

.progress-row .pr-label { display: flex; align-items: center; gap: 7px; color: var(--text); }
.progress-row .pr-label [data-icon="grammar"] { color: var(--ink-blue); }
.progress-row .pr-label [data-icon="vocab"] { color: var(--ink-teal); }
.progress-row .pr-pct { font-family: var(--font-english); font-weight: 700; color: var(--ink-blue); }

.progress-track {
  height: 12px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-fill.grammar { background: linear-gradient(90deg, var(--ink-blue), var(--ink-blue-light)); }
.progress-fill.vocab { background: linear-gradient(90deg, var(--ink-teal), var(--ink-green)); }
.progress-fill.overall { background: linear-gradient(90deg, var(--ink-purple), var(--ink-pink)); }

/* صفّ إحصائي صغير (رقم + وصف) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.stat-cell {
  text-align: center;
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 10px;
}

.stat-cell .stat-num {
  font-family: var(--font-english);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--ink-blue);
  line-height: 1;
}

.stat-cell .stat-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 5px; }

/* ------------------------------------------------------------------ */
/* TOAST + SCROLL TOP                                                  */
/* ------------------------------------------------------------------ */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.scroll-top {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 20px);
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--ink-blue);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 100;
}

.scroll-top.show { display: block; }

/* ------------------------------------------------------------------ */
/* MOBILE                                                              */
/* ------------------------------------------------------------------ */
@media (max-width: 700px) {
  .notebook { padding: 20px 18px 25px 32px; }
  .notebook::before { right: 26px; }
  .notebook::after { left: 9px; width: 10px; background-size: 10px 10px; }
  .notebook-header h1 { font-size: 1.4rem; }
  .section-title { font-size: 1.25rem; }
  .crumbs { font-size: 0.78rem; }
}
