/* ===== VARIABLES ===== */
:root {
  --red: #D80621;
  --red-light: #fef2f2;
  --red-dark: #a3051a;
  --blue: #1a3a5c;
  --blue-light: #eef3f8;
  --blue-dark: #0f2640;
  --yellow: #FECC02;
  --yellow-light: #fff8dc;
  --yellow-dark: #c9a000;
  --bg: #f5f5f0;
  --card-bg: #ffffff;
  --text: #1a2332;
  --text-secondary: #4a5568;
  --muted: #718096;
  --accent: #D80621;
  --accent-secondary: #1a3a5c;
  --success: #16a34a;
  --wrong: #dc2626;
  --border: #ddd8d0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
header {
  background: var(--blue);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-dark) 100%);
  z-index: 0;
}
header::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cpath d='M30,6 L32,14 L40,12 L35,20 L44,24 L36,28 L40,38 L33,34 L30,44 L27,34 L20,38 L24,28 L16,24 L25,20 L20,12 L28,14 Z' fill='%23ffffff'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 60px 60px;
}
header > * { position: relative; z-index: 1; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
}
.logo svg { flex-shrink: 0; }
.logo-text { text-align: left; }
.logo-text h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.logo-text p {
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

/* ===== NAV ===== */
nav {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.9rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
nav a:hover { color: var(--accent); }
nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== LAYOUT ===== */
.container { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ===== MODE SWITCHER ===== */
.mode-switcher {
  display: flex;
  background: #fff;
  border-radius: var(--radius);
  padding: 5px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.mode-btn {
  flex: 1;
  padding: 0.8rem 1.5rem;
  background: transparent;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.25s;
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(216,6,33,0.3);
}
.mode-btn:hover:not(.active) { color: var(--text); background: var(--blue-light); }
.mode-content { display: none; }
.mode-content.active { display: block; }

/* ===== EXAM INFO ===== */
.exam-info {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}
.info-item h3 { color: var(--yellow); font-size: 2rem; font-weight: 800; }
.info-item p { color: rgba(255,255,255,0.8); font-size: 0.82rem; margin-top: 0.15rem; }

/* ===== SECTIONS ===== */
section { margin-bottom: 2.5rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  padding-left: 1rem;
  border-bottom: 2px solid var(--border);
  border-left: 4px solid var(--accent);
}
.section-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

/* ===== TOPIC COLORS ===== */
.topic-facts .section-header { border-left-color: #D80621; }
.topic-facts .section-header h2 { color: #D80621; }
.topic-facts .facts-table th { background: #D80621; }

.topic-history .section-header { border-left-color: #8B5E3C; }
.topic-history .section-header h2 { color: #6B4226; }
.topic-history .card { border-top: 3px solid #f0e6dd; }
.topic-history .card:hover { border-top-color: #8B5E3C; }
.topic-history .card h3 { color: #8B5E3C; }
.topic-history .mnemonic { border-left-color: #8B5E3C; background: #faf5f0; }
.topic-history .mnemonic h4 { color: #8B5E3C; }

.topic-government .section-header { border-left-color: #1a3a5c; }
.topic-government .section-header h2 { color: #1a3a5c; }
.topic-government .card { border-top: 3px solid #dfe8f0; }
.topic-government .card:hover { border-top-color: #1a3a5c; }
.topic-government .card h3 { color: #1a3a5c; }
.topic-government .highlight-box { border-left-color: #1a3a5c; background: #eef3f8; }
.topic-government .highlight-box h4 { color: #1a3a5c; }

.topic-geography .section-header { border-left-color: #2d8659; }
.topic-geography .section-header h2 { color: #226b45; }
.topic-geography .card { border-top: 3px solid #ddf0e5; }
.topic-geography .card:hover { border-top-color: #2d8659; }
.topic-geography .card h3 { color: #2d8659; }
.topic-geography .mnemonic { border-left-color: #2d8659; }
.topic-geography .mnemonic h4 { color: #2d8659; }

.topic-rights .section-header { border-left-color: #7c3aed; }
.topic-rights .section-header h2 { color: #6d28d9; }
.topic-rights .card { border-top: 3px solid #ede9fe; }
.topic-rights .card:hover { border-top-color: #7c3aed; }
.topic-rights .card h3 { color: #7c3aed; }
.topic-rights .highlight-box { border-left-color: #7c3aed; background: #f5f3ff; }
.topic-rights .highlight-box h4 { color: #7c3aed; }

.topic-symbols .section-header { border-left-color: #d97706; }
.topic-symbols .section-header h2 { color: #b45309; }
.topic-symbols .card { border-top: 3px solid #fef3c7; }
.topic-symbols .card:hover { border-top-color: #d97706; }
.topic-symbols .card h3 { color: #d97706; }

.topic-economy .section-header { border-left-color: #0891b2; }
.topic-economy .section-header h2 { color: #0e7490; }
.topic-economy .card { border-top: 3px solid #dff5f9; }
.topic-economy .card:hover { border-top-color: #0891b2; }
.topic-economy .card h3 { color: #0891b2; }

.topic-flashcards .section-header { border-left-color: #D80621; }
.topic-flashcards .section-header h2 { color: #D80621; }

.topic-checklist .section-header { border-left-color: #16a34a; }
.topic-checklist .section-header h2 { color: #16a34a; }

/* Priority Badge */
.priority {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.priority.high { background: #fee2e2; color: #dc2626; }
.priority.medium { background: var(--yellow-light); color: var(--yellow-dark); }

/* ===== CARDS ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 1rem;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.4rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-top-color 0.25s;
  border-top: 3px solid transparent;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-top-color: var(--accent); }
.card h3 { color: var(--accent); margin-bottom: 0.6rem; font-size: 0.95rem; font-weight: 700; }
.card ul { padding-left: 1.1rem; }
.card li { margin-bottom: 0.3rem; color: var(--text-secondary); font-size: 0.88rem; }
.card li strong { color: var(--text); }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.facts-table { width: 100%; border-collapse: collapse; background: #fff; }
.facts-table th {
  background: var(--accent-secondary);
  color: #fff;
  padding: 0.75rem 1.2rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.facts-table td {
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}
.facts-table tr:nth-child(even) { background: #f8fafc; }
.facts-table tr:hover { background: var(--blue-light); }

/* ===== HIGHLIGHT / MNEMONIC ===== */
.highlight-box {
  background: var(--blue-light);
  border-left: 4px solid var(--accent);
  padding: 1.1rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}
.highlight-box h4 { color: var(--accent); margin-bottom: 0.3rem; font-size: 0.9rem; }
.highlight-box p { font-size: 0.88rem; color: var(--text-secondary); }
.highlight-box p strong { color: var(--text); }

.mnemonic {
  background: #f0fdf4;
  border-left: 4px solid var(--success);
  padding: 1rem 1.4rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1rem 0;
}
.mnemonic h4 { color: var(--success); margin-bottom: 0.2rem; font-size: 0.85rem; }
.mnemonic p { font-size: 0.88rem; color: var(--text-secondary); }

/* ===== QUIZ ===== */
.quiz-header {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.3rem 1.8rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.quiz-header h2 { font-size: 1.2rem; color: var(--text); }
.quiz-progress { display: flex; align-items: center; gap: 0.8rem; }
.progress-bar-bg { width: 180px; height: 8px; background: var(--border); border-radius: 10px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 10px; transition: width 0.4s ease; width: 0%; }
.progress-text { color: var(--muted); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

.quiz-question {
  background: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  border: 1px solid var(--border);
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.quiz-question .q-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.quiz-question h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1.4rem;
  line-height: 1.5;
}

.q-type-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.q-type-badge.mc { background: var(--blue-light); color: var(--accent); }
.q-type-badge.tf { background: #f0fdf4; color: var(--success); }
.q-type-badge.scenario { background: var(--yellow-light); color: var(--yellow-dark); }

.options { display: flex; flex-direction: column; gap: 0.5rem; }
.tf-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.tf-options .option { justify-content: center; font-weight: 600; font-size: 0.95rem; padding: 1.1rem; }
.option {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1.2rem;
  background: #f8fafc;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  width: 100%;
  font-family: inherit;
}
.option .option-letter {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.2s;
}
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--red-light); }
.option:hover:not(:disabled) .option-letter { background: var(--accent); color: #fff; }
.option.correct { border-color: var(--success) !important; background: #f0fdf4 !important; }
.option.correct .option-letter { background: var(--success); color: #fff; }
.option.wrong { border-color: var(--wrong) !important; background: #fef2f2 !important; }
.option.wrong .option-letter { background: var(--wrong); color: #fff; }
.option:disabled { cursor: default; }

.explanation {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: #f0fdf4;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--success);
  display: none;
  border: 1px solid #bbf7d0;
  line-height: 1.5;
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.btn {
  padding: 0.75rem 1.8rem;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-decoration: none;
  display: inline-block;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(216,6,33,0.25);
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: default; transform: none; }
.btn-secondary {
  background: #fff;
  color: var(--accent-secondary);
  border: 1px solid var(--accent-secondary);
}
.btn-secondary:hover { background: var(--blue-light); color: var(--accent-secondary); border-color: var(--accent-secondary); }
.btn-green {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 8px rgba(22,163,74,0.25);
}
.btn-green:hover { background: #15803d; transform: translateY(-1px); }

/* ===== RESULTS ===== */
.results-screen {
  text-align: center;
  padding: 2.5rem 2rem;
  animation: fadeIn 0.4s ease;
}
.results-circle {
  width: 150px; height: 150px;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 800;
  border: 6px solid;
}
.results-circle.pass { border-color: var(--success); color: var(--success); background: #f0fdf4; }
.results-circle.fail { border-color: var(--wrong); color: var(--wrong); background: #fef2f2; }
.results-circle small { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.05em; }
.results-message { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4rem; }
.results-sub { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.results-stats { display: flex; justify-content: center; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.results-stat { text-align: center; }
.results-stat .num { font-size: 1.4rem; font-weight: 700; }
.results-stat .label { font-size: 0.75rem; color: var(--muted); }
.results-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* Review list */
.review-list { margin-top: 2rem; text-align: left; }
.review-list h3 { color: var(--text); }
.review-item {
  background: #fff;
  border-radius: 12px;
  padding: 1.1rem;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
.review-item.review-correct { border-left: 4px solid var(--success); }
.review-item.review-wrong { border-left: 4px solid var(--wrong); }
.review-item h4 { font-size: 0.9rem; margin-bottom: 0.3rem; color: var(--text); }
.review-item .review-answer { font-size: 0.82rem; color: var(--muted); }
.review-item .review-answer strong { color: var(--success); }
.review-item .review-yours { color: var(--wrong); }

/* ===== FLASHCARDS ===== */
.flashcard-deck { display: flex; flex-direction: column; gap: 0.5rem; }
.flashcard {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  border: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}
.flashcard:hover { border-color: var(--accent); box-shadow: var(--shadow-md); }
.flashcard .fc-question { font-weight: 600; color: var(--text); font-size: 0.9rem; }
.flashcard .fc-answer {
  color: var(--success);
  margin-top: 0.6rem;
  display: none;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}
.flashcard.open .fc-answer { display: block; }
.flashcard.open .fc-hint { display: none; }
.fc-hint { color: var(--muted); font-size: 0.72rem; margin-top: 0.3rem; }

/* ===== CHECKLIST ===== */
.checklist label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
}
.checklist label:last-child { border-bottom: none; }
.checklist label:hover { color: var(--text); }
.checklist input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.checklist label.checked { color: var(--success); text-decoration: line-through; opacity: 0.6; }

/* ===== HISTORY DASHBOARD ===== */
.history-dashboard {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.history-dashboard h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.history-dashboard h3 .test-count { color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.history-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 110px;
  padding: 0.5rem 0;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.chart-bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 34px; flex: 1; max-width: 55px; }
.chart-bar { width: 100%; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 0.4s ease; }
.chart-bar.pass { background: var(--success); }
.chart-bar.fail { background: var(--wrong); }
.chart-bar-label { font-size: 0.65rem; color: var(--muted); white-space: nowrap; }
.chart-bar-pct { font-size: 0.65rem; font-weight: 700; }

.history-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.history-stat-card {
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.8rem;
  text-align: center;
  border: 1px solid var(--border);
}
.history-stat-card .val { font-size: 1.3rem; font-weight: 800; }
.history-stat-card .lbl { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }

/* ===== READINESS ===== */
.readiness-box {
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-bottom: 1.2rem;
  text-align: center;
  border: 2px solid;
  animation: fadeIn 0.5s ease;
}
.readiness-box.ready { background: #f0fdf4; border-color: var(--success); }
.readiness-box.not-ready { background: #fef2f2; border-color: var(--wrong); }
.readiness-box.almost { background: var(--yellow-light); border-color: var(--yellow-dark); }
.readiness-icon { font-size: 2.2rem; margin-bottom: 0.4rem; }
.readiness-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.3rem; }
.readiness-box.ready .readiness-title { color: var(--success); }
.readiness-box.not-ready .readiness-title { color: var(--wrong); }
.readiness-box.almost .readiness-title { color: var(--yellow-dark); }
.readiness-detail { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.6; }
.readiness-detail strong { color: var(--text); }
.weak-topics { margin-top: 0.8rem; text-align: left; display: inline-block; }
.weak-topics h4 { font-size: 0.85rem; color: var(--wrong); margin-bottom: 0.4rem; }
.weak-topics ul { padding-left: 1.1rem; }
.weak-topics li { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.2rem; }
.clear-history-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.clear-history-btn:hover { border-color: var(--wrong); color: var(--wrong); }

/* ===== FOOTER ===== */
footer {
  background: var(--accent-secondary);
  color: #fff;
  padding: 2.5rem 1.5rem 1.5rem;
  font-size: 0.85rem;
  line-height: 1.8;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}
footer h4 { font-size: 0.9rem; font-weight: 700; margin-bottom: 0.8rem; color: #fff; }
footer p { color: rgba(255,255,255,0.7); font-size: 0.82rem; line-height: 1.7; }
footer a.footer-link {
  display: block;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}
footer a.footer-link:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1.2rem;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 0.75rem;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px; height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(216,6,33,0.3);
  transition: opacity 0.3s;
  z-index: 99;
}
.back-to-top.visible { display: flex; }

/* ===== AD CONTAINER ===== */
.ad-container {
  background: #f5f5f0;
  border: 1px dashed #ddd8d0;
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  overflow: hidden;
  margin: 1.5rem 0;
}
.ad-container::before {
  content: 'Advertisement';
  font-size: 0.65rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 0.3rem;
}

/* ===== COOKIE CONSENT BANNER ===== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.1);
  z-index: 10000;
  display: none;
  border-top: 2px solid var(--border);
}
.cookie-banner-inner {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}
.cookie-banner p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.6;
}
.cookie-banner a {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 500;
}
.cookie-banner-buttons {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.8rem;
}
.cookie-btn-accept {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.cookie-btn-accept:hover { background: #15803d; }
.cookie-btn-essential {
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.cookie-btn-essential:hover { border-color: var(--text-secondary); color: var(--text); }

/* ===== CONTENT PAGES (about, contact, privacy, terms) ===== */
.content-page {
  background: #fff;
  border-radius: var(--radius);
  padding: 2.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}
.content-page h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}
.content-page .page-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}
.content-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.content-page p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}
.content-page ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.content-page li {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.7;
}
.content-page a {
  color: var(--accent);
  text-decoration: none;
}
.content-page a:hover {
  text-decoration: underline;
}

/* ===== CONTACT FORM ===== */
.contact-form {
  margin-top: 2rem;
}
.contact-form label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

/* ===== BLOG ===== */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.blog-card-body {
  padding: 1.2rem 1.4rem;
}
.blog-card-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}
.blog-card-body h3 a {
  color: inherit;
  text-decoration: none;
}
.blog-card-body h3 a:hover {
  color: var(--accent);
}
.blog-card-body p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  line-height: 1.6;
}
.blog-card-meta {
  font-size: 0.75rem;
  color: var(--muted);
}
.blog-card .read-more {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
}
.blog-card .read-more:hover { text-decoration: underline; }

/* Blog article page */
.blog-article {
  background: #fff;
  border-radius: var(--radius);
  padding: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 2rem;
}
.blog-article .hero-image {
  width: 100%;
  max-height: 350px;
  object-fit: cover;
  display: block;
}
.blog-article-body {
  padding: 2rem 2.5rem;
}
.blog-article-body h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.blog-article-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.blog-article-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-secondary);
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}
.blog-article-body p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.8;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; }

/* CTA block */
.cta-block {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-top: 2.5rem;
}
.cta-block h3 {
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.cta-block p {
  color: rgba(255,255,255,0.8);
  font-size: 0.9rem;
  margin-bottom: 1.2rem;
}

/* Blog sidebar ad (desktop only) */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 900px) {
  .blog-layout {
    grid-template-columns: 1fr 300px;
  }
}
.blog-sidebar .ad-container {
  position: sticky;
  top: 80px;
}

/* ===== LANDING PAGE FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.2rem;
  margin: 2rem 0;
}
.feature-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.feature-card .feature-icon { font-size: 2rem; margin-bottom: 0.8rem; }
.feature-card h3 { font-size: 1rem; font-weight: 700; color: var(--accent-secondary); margin-bottom: 0.4rem; }
.feature-card p { font-size: 0.82rem; color: var(--muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
  header { padding: 1.8rem 1rem 1.5rem; }
  .logo { flex-direction: column; gap: 0.5rem; }
  .logo-text { text-align: center; }
  .logo-text h1 { font-size: 1.4rem; }
  .container { padding: 1.5rem 1rem; }
  .exam-info { grid-template-columns: repeat(2, 1fr); gap: 0.7rem; padding: 1.2rem; }
  .info-item h3 { font-size: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  nav { overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav a { font-size: 0.78rem; padding: 0.7rem 0.8rem; flex-shrink: 0; }
  .quiz-header { flex-direction: column; text-align: center; }
  .progress-bar-bg { width: 100%; }
  .mode-switcher { gap: 0; }
  .mode-btn { padding: 0.7rem 0.6rem; font-size: 0.82rem; }
  .quiz-question { padding: 1.2rem; }
  .quiz-question h3 { font-size: 1rem; }
  .option { padding: 0.75rem 0.9rem; font-size: 0.85rem; gap: 0.6rem; }
  .option .option-letter { width: 28px; height: 28px; font-size: 0.72rem; }
  .tf-options { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .tf-options .option { padding: 0.9rem 0.6rem; font-size: 0.88rem; }
  .explanation { font-size: 0.82rem; padding: 0.8rem 1rem; }
  .results-screen { padding: 1.5rem 1rem; }
  .results-circle { width: 120px; height: 120px; font-size: 2rem; border-width: 5px; }
  .results-message { font-size: 1.05rem; }
  .results-stats { gap: 1.2rem; }
  .results-actions { flex-direction: column; }
  .results-actions .btn { width: 100%; }
  .review-item { padding: 0.9rem; }
  .review-item h4 { font-size: 0.84rem; }
  .quiz-nav { flex-wrap: wrap; }
  .quiz-nav .btn { flex: 1; min-width: 120px; text-align: center; padding: 0.7rem 1rem; font-size: 0.85rem; }
  .history-dashboard { padding: 1.2rem; }
  .history-dashboard h3 { font-size: 0.95rem; flex-wrap: wrap; gap: 0.4rem; }
  .history-stats-row { grid-template-columns: repeat(2, 1fr); }
  .history-stat-card .val { font-size: 1.1rem; }
  .history-chart { gap: 4px; height: 90px; }
  .chart-bar-wrap { min-width: 28px; }
  .chart-bar-pct { font-size: 0.58rem; }
  .chart-bar-label { font-size: 0.58rem; }
  .readiness-box { padding: 1.2rem; }
  .readiness-title { font-size: 1rem; }
  .readiness-detail { font-size: 0.82rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .section-header h2 { font-size: 1.15rem; }
  .highlight-box { padding: 0.9rem 1rem; }
  .mnemonic { padding: 0.8rem 1rem; }
  .flashcard { padding: 1rem 1.1rem; }
  .flashcard .fc-question { font-size: 0.85rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .back-to-top { bottom: 1rem; right: 1rem; width: 40px; height: 40px; font-size: 1rem; }
  .table-wrapper { margin: 0 -0.5rem; border-radius: 8px; }
  .facts-table th { padding: 0.6rem 0.8rem; font-size: 0.72rem; }
  .facts-table td { padding: 0.55rem 0.8rem; font-size: 0.82rem; }
  .ad-container { margin: 1rem 0; }
  .cookie-banner { padding: 0.8rem 1rem; }
  .cookie-banner p { font-size: 0.78rem; }
  .content-page { padding: 1.5rem; }
  .content-page h1 { font-size: 1.4rem; }
  .blog-article-body { padding: 1.5rem; }
  .blog-article-body h1 { font-size: 1.3rem; }
  .blog-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 380px) {
  .container { padding: 1rem 0.7rem; }
  .logo-text h1 { font-size: 1.2rem; }
  header { padding: 1.4rem 0.8rem 1.2rem; }
  .mode-btn { padding: 0.6rem 0.4rem; font-size: 0.75rem; }
  .quiz-question { padding: 1rem; }
  .quiz-question h3 { font-size: 0.92rem; line-height: 1.45; }
  .option { padding: 0.65rem 0.7rem; font-size: 0.8rem; }
  .option .option-letter { width: 24px; height: 24px; font-size: 0.68rem; }
  .exam-info { grid-template-columns: repeat(2, 1fr); padding: 0.9rem; gap: 0.5rem; }
  .info-item h3 { font-size: 1.3rem; }
  .info-item p { font-size: 0.72rem; }
  .results-circle { width: 100px; height: 100px; font-size: 1.7rem; }
  .btn { padding: 0.65rem 1rem; font-size: 0.82rem; }
  .history-stats-row { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .history-stat-card { padding: 0.6rem 0.4rem; }
  .history-stat-card .val { font-size: 1rem; }
  .history-stat-card .lbl { font-size: 0.62rem; }
  .features-grid { grid-template-columns: 1fr; }
}
