/* ============================================================
   QISAS AL-ANBIYA - Comprehensive Islamic Learning Platform
   Color Palette: Deep Green, Gold, Cream, Dark
   ============================================================ */

:root {
  --green-dark: #0d4a2a;
  --green-mid: #1a6b3c;
  --green-light: #2d9e5f;
  --green-pale: #e8f5ee;
  --gold: #c9a84c;
  --gold-light: #e8c96e;
  --gold-pale: #fdf6e3;
  --cream: #faf7f0;
  --dark: #1a1a1a;
  --dark-mid: #2d2d2d;
  --text: #333333;
  --text-light: #666666;
  --white: #ffffff;
  --border: #ddd0b8;
  --shadow: rgba(13, 74, 42, 0.12);
  --shadow-gold: rgba(201, 168, 76, 0.25);
  --red: #c0392b;
  --blue: #2471a3;
  --purple: #7d3c98;
  --orange: #d35400;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Segoe UI', 'Arial', sans-serif;
  background: var(--cream);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; font-family: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--cream); }
::-webkit-scrollbar-thumb { background: var(--green-mid); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-dark); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { font-weight: 700; line-height: 1.3; color: var(--green-dark); }
h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
p { margin-bottom: 1rem; }

.arabic { font-family: 'Traditional Arabic', 'Arial Unicode MS', serif; font-size: 1.3em; direction: rtl; }
.urdu-text { font-style: italic; color: var(--green-mid); }
.urdu-meaning { color: var(--text-light); font-size: 0.9em; }
.quran-ref { color: var(--gold); font-weight: 600; font-size: 0.85em; }

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.container-lg { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

.page { min-height: 100vh; padding-top: 70px; }

.section { padding: 3rem 0; }
.section-title {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}
.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--green-mid), var(--gold));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* ── Navigation ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--green-dark);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  height: 70px;
  display: flex;
  align-items: center;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--gold-light);
  font-size: 1.2rem;
  font-weight: 700;
}
.nav-logo .logo-icon {
  width: 40px; height: 40px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--green-dark);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.nav-links a {
  color: rgba(255,255,255,0.85);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active {
  background: var(--gold);
  color: var(--green-dark);
  font-weight: 600;
}
.nav-links a .nav-icon { margin-right: 0.3rem; }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 5px;
}
.hamburger span {
  display: block;
  width: 25px; height: 2px;
  background: var(--gold-light);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 50%, var(--green-dark) 100%);
  color: var(--white);
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a84c' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; }
.hero-bismillah {
  font-size: 2rem;
  color: var(--gold-light);
  margin-bottom: 1.5rem;
  font-family: 'Traditional Arabic', serif;
}
.hero h1 {
  color: var(--white);
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.hero h1 span { color: var(--gold-light); }
.hero-subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.hero-subtitle-urdu {
  color: var(--gold-light);
  font-size: 1rem;
  font-style: italic;
  margin-bottom: 2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 2.5rem; font-weight: 700; color: var(--gold-light); display: block; }
.hero-stat .label { font-size: 0.9rem; color: rgba(255,255,255,0.8); }
.hero-btns {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.8rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--gold);
  color: var(--green-dark);
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-gold);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline:hover {
  background: var(--white);
  color: var(--green-dark);
  transform: translateY(-2px);
}
.btn-green {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}
.btn-green:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.5rem; font-size: 1.1rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 15px var(--shadow);
  overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px var(--shadow);
}
.card-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
  padding: 1.5rem;
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  background: var(--green-pale);
  border-top: 1px solid var(--border);
}

/* ── Prophet Cards (Library) ── */
.prophets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
.prophet-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 15px var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.prophet-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 35px var(--shadow);
  border-color: var(--gold);
}
.prophet-card-header {
  background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
  padding: 1.5rem;
  text-align: center;
  position: relative;
}
.prophet-number {
  position: absolute;
  top: 10px; left: 15px;
  background: var(--gold);
  color: var(--green-dark);
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}
.prophet-arabic-name {
  font-size: 2rem;
  color: var(--gold-light);
  display: block;
  font-family: 'Traditional Arabic', serif;
  margin-bottom: 0.25rem;
}
.prophet-name {
  font-size: 1.3rem;
  color: var(--white);
  font-weight: 700;
}
.prophet-title-eng {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.25rem;
}
.prophet-card-body { padding: 1.25rem; }
.prophet-nation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}
.prophet-nation .icon { color: var(--gold); }
.prophet-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-green { background: var(--green-pale); color: var(--green-dark); }
.tag-gold { background: var(--gold-pale); color: var(--orange); }
.tag-blue { background: #eaf2fb; color: var(--blue); }
.prophet-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.prophet-card-footer {
  padding: 1rem 1.25rem;
  background: var(--green-pale);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.quran-mentions {
  font-size: 0.8rem;
  color: var(--text-light);
}
.quran-mentions strong { color: var(--green-mid); }

/* ── Study Mode Cards ── */
.study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}
.study-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 2px 15px var(--shadow);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.study-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 35px var(--shadow);
}
.study-card .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}
.study-card h3 { color: var(--green-dark); margin-bottom: 0.5rem; }
.study-card p { font-size: 0.9rem; color: var(--text-light); margin: 0; }
.study-card.green { border-top: 4px solid var(--green-mid); }
.study-card.gold { border-top: 4px solid var(--gold); }
.study-card.blue { border-top: 4px solid var(--blue); }
.study-card.red { border-top: 4px solid var(--red); }
.study-card.purple { border-top: 4px solid var(--purple); }
.study-card.orange { border-top: 4px solid var(--orange); }

/* ── Prophet Detail Page ── */
.prophet-hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
  padding: 3rem 0;
}
.prophet-hero-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2.5rem;
  align-items: start;
}
.prophet-info-box {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}
.prophet-info-box .arabic-name {
  font-size: 4rem;
  color: var(--gold-light);
  display: block;
  font-family: 'Traditional Arabic', serif;
  line-height: 1.2;
}
.prophet-info-box h1 {
  color: var(--white);
  font-size: 2rem;
  margin: 0.5rem 0;
}
.prophet-info-box .urdu-name {
  color: rgba(255,255,255,0.8);
  font-style: italic;
  margin-bottom: 1rem;
}
.info-table { width: 100%; font-size: 0.9rem; }
.info-table tr td {
  padding: 0.4rem 0;
  vertical-align: top;
}
.info-table tr td:first-child {
  color: var(--gold-light);
  font-weight: 600;
  width: 40%;
  padding-right: 0.75rem;
}
.info-table tr td:last-child { color: rgba(255,255,255,0.9); }
.prophet-hero-content h2 { color: var(--gold-light); margin-bottom: 1rem; }
.prophet-hero-content p {
  color: rgba(255,255,255,0.9);
  margin-bottom: 0;
  font-size: 1.05rem;
  line-height: 1.8;
}

/* ── Tabs ── */
.tabs-nav {
  display: flex;
  gap: 0.25rem;
  background: var(--green-pale);
  padding: 0.5rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.tab-btn {
  flex: 1;
  min-width: 120px;
  padding: 0.6rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  font-weight: 500;
}
.tab-btn:hover { background: rgba(29, 107, 60, 0.1); color: var(--green-dark); }
.tab-btn.active {
  background: var(--green-mid);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--shadow);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
  content: '';
  position: absolute;
  left: 0.75rem;
  top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--green-mid), var(--gold));
}
.timeline-item {
  position: relative;
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.4rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 2px solid var(--green-dark);
}
.timeline-item h4 { color: var(--green-dark); margin-bottom: 0.25rem; }
.timeline-item .urdu { color: var(--green-mid); font-style: italic; font-size: 0.9rem; }
.timeline-item p { font-size: 0.95rem; color: var(--text); margin: 0.25rem 0; }
.timeline-item .ref { font-size: 0.8rem; color: var(--gold); font-weight: 600; margin-top: 0.25rem; }

/* ── Quran Verses ── */
.verse-card {
  background: var(--gold-pale);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.verse-arabic {
  font-family: 'Traditional Arabic', 'Scheherazade New', serif;
  font-size: 1.5rem;
  direction: rtl;
  color: var(--green-dark);
  margin-bottom: 0.75rem;
  line-height: 2;
  text-align: right;
}
.verse-translation { font-size: 0.95rem; color: var(--text); margin-bottom: 0.5rem; font-style: italic; }
.verse-ref { font-size: 0.8rem; color: var(--gold); font-weight: 700; }

/* ── Miracle Cards ── */
.miracles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.miracle-card {
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-align: center;
}
.miracle-card .miracle-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }
.miracle-card h4 { color: var(--green-dark); font-size: 1rem; margin-bottom: 0.5rem; }
.miracle-card p { font-size: 0.85rem; color: var(--text-light); margin: 0; }
.miracle-card .urdu { font-style: italic; color: var(--green-mid); font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Flashcards ── */
.flashcard-container {
  perspective: 1200px;
  max-width: 650px;
  margin: 0 auto;
  height: 380px;
}
.flashcard {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(.4,2,.6,1);
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border-radius: var(--radius);
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 40px var(--shadow);
}
.flashcard-front {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  color: var(--white);
}
.flashcard-back {
  background: linear-gradient(135deg, var(--gold-pale), var(--cream));
  color: var(--text);
  transform: rotateY(180deg);
  border: 2px solid var(--gold);
}
.flashcard-front .card-type {
  position: absolute;
  top: 1rem; right: 1rem;
  background: var(--gold);
  color: var(--green-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.flashcard-front .question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.flashcard-front .question-urdu {
  font-size: 0.95rem;
  color: var(--gold-light);
  font-style: italic;
}
.flashcard-front .hint {
  position: absolute;
  bottom: 1rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
}
.flashcard-back .answer-label {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
}
.flashcard-back .answer {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.flashcard-back .answer-urdu {
  font-size: 0.9rem;
  color: var(--green-mid);
  font-style: italic;
  margin-bottom: 0.75rem;
}
.flashcard-back .answer-detail {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
}

.flashcard-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.flashcard-progress {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 0.9rem;
}
.progress-bar-wrap {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  margin-top: 0.5rem;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--green-mid), var(--gold));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── Quiz ── */
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.quiz-timer {
  background: var(--green-dark);
  color: var(--gold-light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.quiz-timer.warning { background: var(--red); color: var(--white); animation: pulse 1s infinite; }
.quiz-score-display {
  background: var(--gold-pale);
  color: var(--green-dark);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.quiz-question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 15px var(--shadow);
  border: 1px solid var(--border);
}
.question-number {
  font-size: 0.8rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
}
.question-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.question-urdu {
  font-size: 0.95rem;
  color: var(--green-mid);
  font-style: italic;
  margin-bottom: 1.5rem;
}
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.option-btn {
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  text-align: left;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  line-height: 1.5;
}
.option-btn:hover:not(:disabled) {
  border-color: var(--green-mid);
  background: var(--green-pale);
  color: var(--green-dark);
}
.option-btn.correct {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1a5c35;
}
.option-btn.wrong {
  border-color: var(--red);
  background: #fdf0ef;
  color: var(--red);
}
.option-btn .option-letter {
  display: inline-block;
  width: 24px; height: 24px;
  background: var(--green-pale);
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-weight: 700;
  margin-right: 0.5rem;
  font-size: 0.8rem;
  flex-shrink: 0;
}
.option-btn.correct .option-letter { background: #27ae60; color: white; }
.option-btn.wrong .option-letter { background: var(--red); color: white; }
.quiz-explanation {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-mid);
  font-size: 0.9rem;
}
.quiz-explanation strong { color: var(--green-dark); }

/* ── Match the Following ── */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1.5rem;
}
.match-column h3 {
  margin-bottom: 1rem;
  color: var(--green-dark);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.match-item {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  user-select: none;
}
.match-item:hover { border-color: var(--green-mid); background: var(--green-pale); }
.match-item.selected {
  border-color: var(--gold);
  background: var(--gold-pale);
  font-weight: 600;
}
.match-item.matched-correct {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1a5c35;
  cursor: default;
}
.match-item.matched-wrong {
  border-color: var(--red);
  background: #fdf0ef;
  animation: shake 0.4s;
}
.match-item .match-letter {
  display: inline-block;
  width: 26px; height: 26px;
  background: var(--green-pale);
  border-radius: 50%;
  text-align: center;
  line-height: 26px;
  font-weight: 700;
  font-size: 0.8rem;
  margin-right: 0.5rem;
}

/* ── Fill in the Blanks ── */
.fib-sentence {
  font-size: 1.15rem;
  line-height: 2.5;
  color: var(--text);
  margin-bottom: 1.5rem;
}
.fib-input {
  display: inline-block;
  width: 150px;
  border: none;
  border-bottom: 2px solid var(--green-mid);
  background: transparent;
  font-size: 1rem;
  color: var(--green-dark);
  font-weight: 600;
  text-align: center;
  padding: 0 0.5rem;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}
.fib-input:focus { border-bottom-color: var(--gold); }
.fib-input.correct { border-bottom-color: #27ae60; color: #27ae60; }
.fib-input.wrong { border-bottom-color: var(--red); color: var(--red); }

/* ── Results Screen ── */
.results-screen {
  text-align: center;
  padding: 3rem 1.5rem;
}
.results-score-circle {
  width: 160px; height: 160px;
  border-radius: 50%;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}
.results-score-circle.excellent { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.results-score-circle.good { background: linear-gradient(135deg, var(--gold), var(--gold-light)); }
.results-score-circle.fair { background: linear-gradient(135deg, var(--orange), #e67e22); }
.results-score-circle.poor { background: linear-gradient(135deg, var(--red), #e74c3c); }
.results-score-circle .percentage {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  display: block;
}
.results-score-circle .fraction {
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
}
.results-message { font-size: 1.4rem; font-weight: 700; color: var(--green-dark); margin-bottom: 0.5rem; }
.results-sub { color: var(--text-light); margin-bottom: 2rem; }
.results-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.result-stat {
  text-align: center;
  padding: 1rem 1.5rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 10px var(--shadow);
  min-width: 100px;
}
.result-stat .num { font-size: 2rem; font-weight: 700; }
.result-stat .num.green { color: #27ae60; }
.result-stat .num.red { color: var(--red); }
.result-stat .num.blue { color: var(--blue); }
.result-stat label { font-size: 0.8rem; color: var(--text-light); display: block; }

/* ── Tree Page ── */
.tree-page { background: var(--cream); }
.tree-tabs {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px var(--shadow);
}
.tree-tab-btn {
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: 25px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-light);
}
.tree-tab-btn.active {
  background: var(--green-mid);
  border-color: var(--green-mid);
  color: var(--white);
}

/* Family Tree */
.family-tree-wrap {
  overflow-x: auto;
  padding: 1rem 0 2rem;
}
.tree-node {
  display: inline-block;
  text-align: center;
  position: relative;
}
.tree-node-content {
  display: inline-block;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 2px solid var(--green-mid);
  border-radius: var(--radius-sm);
  min-width: 120px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.tree-node-content:hover {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-dark);
  transform: scale(1.05);
}
.tree-node-content.highlight {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--green-dark);
}
.tree-node-content .node-arabic { display: block; font-size: 1.1rem; color: var(--gold); font-family: 'Traditional Arabic', serif; }
.tree-node-content:hover .node-arabic { color: var(--gold-light); }
.tree-node-content .node-name { font-weight: 700; font-size: 0.9rem; color: var(--green-dark); display: block; }
.tree-node-content:hover .node-name { color: var(--white); }
.tree-node-content .node-num { font-size: 0.7rem; color: var(--text-light); }

.tree-level {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  position: relative;
  flex-wrap: wrap;
}
.tree-level::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: var(--green-mid);
}
.tree-section { margin-bottom: 2rem; text-align: center; }
.tree-connector {
  width: 2px;
  height: 20px;
  background: var(--green-mid);
  margin: 0 auto;
}
.tree-horizontal-line {
  height: 2px;
  background: var(--green-mid);
  margin: 0 auto 0;
  position: relative;
}

/* Thematic Tree */
.thematic-tree { padding: 1rem; }
.theme-branch {
  background: var(--white);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 10px var(--shadow);
  overflow: hidden;
}
.theme-branch-header {
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--white);
}
.theme-branch-header .icon { font-size: 1.5rem; }
.theme-branch-header h3 { margin: 0; color: var(--white); font-size: 1.1rem; }
.theme-branch-header .toggle { margin-left: auto; font-size: 1.2rem; transition: var(--transition); }
.theme-branch-header.open .toggle { transform: rotate(180deg); }
.theme-branch-body { padding: 1.5rem; display: none; }
.theme-branch-body.open { display: block; }
.theme-prophets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.theme-prophet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  background: var(--green-pale);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}
.theme-prophet-chip:hover {
  background: var(--green-mid);
  color: var(--white);
  border-color: var(--green-mid);
}

/* Timeline Tree */
.timeline-tree { position: relative; padding: 1rem 0; }
.timeline-era {
  margin-bottom: 2.5rem;
}
.era-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.era-badge {
  background: var(--green-dark);
  color: var(--gold-light);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.era-line { flex: 1; height: 2px; background: var(--border); }
.era-prophets {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-left: 1rem;
}
.era-prophet-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  min-width: 160px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  border-left: 3px solid var(--gold);
}
.era-prophet-card:hover {
  background: var(--green-pale);
  border-color: var(--green-mid);
  border-left-color: var(--green-mid);
  transform: translateX(4px);
}
.era-prophet-card .arabic { font-size: 1.3rem; color: var(--gold); }
.era-prophet-card .name { font-weight: 700; font-size: 0.9rem; color: var(--green-dark); display: block; }
.era-prophet-card .nation { font-size: 0.75rem; color: var(--text-light); }

/* ── Progress Page ── */
.progress-overview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}
.progress-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: 0 2px 10px var(--shadow);
  border-top: 3px solid var(--green-mid);
}
.progress-stat-card .big-num {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--green-dark);
  display: block;
}
.progress-stat-card label { font-size: 0.85rem; color: var(--text-light); }
.prophet-progress-list { }
.prophet-progress-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 5px var(--shadow);
}
.prophet-progress-item .name { flex: 1; font-weight: 600; color: var(--green-dark); }
.prophet-progress-item .score { font-size: 0.85rem; color: var(--text-light); }
.mini-bar {
  width: 120px;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-mid), var(--gold));
  border-radius: 4px;
  transition: width 1s ease;
}

/* ── Filter & Search ── */
.filter-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  align-items: center;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 0.75rem center;
  outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--green-mid); box-shadow: 0 0 0 3px rgba(29,107,60,0.15); }
.filter-select {
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--white);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text);
}
.filter-select:focus { border-color: var(--green-mid); }

/* ── Alerts / Info Boxes ── */
.info-box {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.info-box.green { background: var(--green-pale); border-left: 3px solid var(--green-mid); }
.info-box.gold { background: var(--gold-pale); border-left: 3px solid var(--gold); }
.info-box.blue { background: #eaf2fb; border-left: 3px solid var(--blue); }
.info-box .icon { flex-shrink: 0; font-size: 1.1rem; }
.info-box p { margin: 0; font-size: 0.9rem; }

/* ── Loading / Empty ── */
.loading-spin {
  width: 40px; height: 40px;
  border: 4px solid var(--green-pale);
  border-top-color: var(--green-mid);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; display: block; margin-bottom: 1rem; }

/* ── Badge / Streak ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge-gold { background: var(--gold-pale); color: var(--orange); border: 1px solid var(--gold); }
.badge-green { background: var(--green-pale); color: var(--green-dark); border: 1px solid var(--green-mid); }

/* ── Lesson Cards ── */
.lessons-list { display: flex; flex-direction: column; gap: 0.75rem; }
.lesson-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  align-items: flex-start;
}
.lesson-item .num {
  width: 30px; height: 30px;
  background: var(--green-mid);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.lesson-item .content h4 { color: var(--green-dark); margin-bottom: 0.25rem; font-size: 1rem; }
.lesson-item .content p { font-size: 0.9rem; color: var(--text-light); margin: 0; }

/* ── Footer ── */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 2rem;
  margin-top: 4rem;
  font-size: 0.9rem;
}
.footer a { color: var(--gold-light); }
.footer .footer-arabic {
  font-family: 'Traditional Arabic', serif;
  font-size: 1.5rem;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.5rem;
}

/* ── Animations ── */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.7; } }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes confetti {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}
.animate-in { animation: fadeInUp 0.5s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .prophet-hero-inner { grid-template-columns: 1fr; }
  .options-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.6rem; }
  .hero h1 { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .nav-links { display: none; flex-direction: column; position: fixed; top: 70px; left: 0; right: 0; background: var(--green-dark); padding: 1rem; z-index: 999; }
  .nav-links.open { display: flex; }
  .hamburger { display: flex; }
  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero-stats { gap: 1.5rem; }
  .flashcard-container { height: 320px; }
  .flashcard-front .question { font-size: 1.05rem; }
}

/* ── Utility ── */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.text-green { color: var(--green-mid); }
.text-light { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
