/* === CSS Variables & Reset === */
:root {
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;
  --primary-subtle: #dbeafe;
  --accent: #dc2626;
  --accent-light: #fef2f2;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --max-width: 960px;
  --header-height: 64px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

/* === Header === */
.header {
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 2px;
}

.nav a {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
}

.nav a:hover {
  background: var(--border-light);
  color: var(--text);
}

.nav a.active {
  background: var(--primary-light);
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle {
  background: var(--border-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s var(--ease);
}

.lang-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4rem;
  padding: 4px;
}

/* === Main Content === */
#app {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px 40px;
  width: 100%;
}

/* === Footer === */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  text-align: center;
  padding: 24px;
  font-size: 0.8rem;
  margin-top: auto;
}

.footer p + p { margin-top: 4px; }

/* === Home Page === */
.hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 28px;
}

.hero-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(29,78,216,0.85) 0%, rgba(15,23,42,0.7) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  color: #fff;
}

.hero-overlay h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero-overlay p {
  font-size: 1rem;
  opacity: 0.9;
  font-weight: 400;
  max-width: 500px;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  border: 1px solid var(--border);
  transition: all 0.2s var(--ease);
}

.stat:hover {
  border-color: var(--primary-subtle);
  box-shadow: var(--shadow-md);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.cta-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.cta-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: 1px solid var(--border);
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: var(--text);
}

.cta-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-subtle);
}

.cta-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius);
}

.cta-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.cta-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === Exam Page === */
.exam-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}

.exam-timer {
  font-size: 1.1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  background: var(--primary-light);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.exam-timer.warning {
  color: var(--accent);
  background: var(--accent-light);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.exam-progress {
  width: 100%;
  height: 4px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  margin-bottom: 24px;
  overflow: hidden;
}

.exam-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #6366f1);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease);
}

.question-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  transition: box-shadow 0.2s var(--ease);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.question-category {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text);
}

.question-image {
  margin-bottom: 20px;
  text-align: center;
}

.question-image img {
  max-height: 200px;
  border-radius: var(--radius);
}

.options-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  text-align: left;
  transition: all 0.2s var(--ease);
  cursor: pointer;
  color: var(--text);
}

.option-btn:hover:not(.disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateX(4px);
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  font-weight: 600;
}

.option-btn.correct {
  border-color: var(--success);
  background: var(--success-light);
}

.option-btn.incorrect {
  border-color: var(--accent);
  background: var(--accent-light);
}

.option-btn.disabled {
  cursor: default;
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all 0.2s var(--ease);
}

.option-btn.selected .option-letter {
  background: var(--primary);
  color: #fff;
}

.option-btn.correct .option-letter {
  background: var(--success);
  color: #fff;
}

.option-btn.incorrect .option-letter {
  background: var(--accent);
  color: #fff;
}

.explanation {
  background: var(--success-light);
  border-left: 3px solid var(--success);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 16px;
  font-size: 0.9rem;
  color: #166534;
  line-height: 1.6;
}

.explanation.incorrect-explanation {
  background: var(--accent-light);
  border-left-color: var(--accent);
  color: #991b1b;
}

.exam-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

.btn {
  padding: 11px 22px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s var(--ease);
  letter-spacing: -0.01em;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(29,78,216,0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(29,78,216,0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--accent);
  color: #fff;
}

.btn-danger:hover { background: #b91c1c; }

.btn-hard {
  background: var(--warning-light);
  border: 1.5px solid var(--warning);
  color: #92400e;
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  transition: all 0.2s var(--ease);
}

.btn-hard.active {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}

/* === Results === */
.results-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 40px 28px;
  border: 1px solid var(--border);
  text-align: center;
  margin-bottom: 24px;
}

.results-score {
  font-size: 4rem;
  font-weight: 800;
  margin: 12px 0;
  letter-spacing: -0.04em;
}

.results-score.pass { color: var(--success); }
.results-score.fail { color: var(--accent); }

.results-badge {
  display: inline-block;
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.results-badge.pass {
  background: var(--success-light);
  color: var(--success);
}

.results-badge.fail {
  background: var(--accent-light);
  color: var(--accent);
}

.results-details {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* === Question Bank === */
.category-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 20px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-pills::-webkit-scrollbar {
  display: none;
}

.category-pill {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
  color: var(--text-secondary);
}

.category-pill:hover {
  border-color: var(--primary-subtle);
  background: var(--primary-light);
  color: var(--primary);
}

.category-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(29,78,216,0.3);
}

.bank-progress {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-weight: 500;
}

/* === Hard Questions === */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 700;
}

.empty-state p {
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.6;
}

/* === Resources === */
.resource-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.resource-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  border: 1px solid var(--border);
  display: block;
  transition: all 0.25s var(--ease);
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-subtle);
}

.resource-card h3 {
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.resource-card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.resource-steps {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  margin-top: 20px;
}

.resource-steps h2 {
  margin-bottom: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.resource-steps ol {
  padding-left: 24px;
}

.resource-steps li {
  margin-bottom: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* === Exam Start === */
.exam-start {
  text-align: center;
  padding: 32px;
}

.exam-start h2 {
  margin-bottom: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.4rem;
}

.exam-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
  text-align: left;
}

.exam-info-item {
  background: var(--bg);
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.exam-info-item strong {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

/* === Section Title === */
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* === Study Guide === */
.study-topics-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.study-topic-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.25s var(--ease);
  cursor: pointer;
  border: 1.5px solid var(--border);
  width: 100%;
  text-align: left;
  font-size: 1rem;
  color: var(--text);
}

.study-topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-subtle);
}

.study-topic-card.read {
  border-color: #bbf7d0;
  background: linear-gradient(135deg, var(--surface) 0%, var(--success-light) 100%);
}

.study-topic-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-light);
  border-radius: var(--radius);
}

.study-topic-card.read .study-topic-icon {
  background: var(--success-light);
}

.study-topic-info {
  flex: 1;
}

.study-topic-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}

.study-topic-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.study-topic-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--border-light);
}

.study-topic-card.read .study-topic-status {
  color: var(--success);
  background: var(--success-light);
}

.study-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--border-light);
  border-radius: var(--radius-full);
  margin-bottom: 20px;
  overflow: hidden;
}

.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #4ade80);
  border-radius: var(--radius-full);
  transition: width 0.4s var(--ease);
}

/* === Study Content === */
.study-header {
  margin-bottom: 20px;
}

.study-content {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  border: 1px solid var(--border);
  margin-bottom: 24px;
}

.study-section {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-light);
}

.study-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.study-section h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 16px;
}

.study-section h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), #6366f1);
}

.study-section p {
  margin-bottom: 14px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.study-section ul, .study-section ol {
  padding-left: 24px;
  margin-bottom: 14px;
}

.study-section li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.study-image {
  display: block;
  max-width: 100%;
  max-height: 300px;
  margin: 20px auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.study-fact {
  background: linear-gradient(135deg, var(--primary-light) 0%, #ede9fe 100%);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 20px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.study-timeline {
  margin: 20px 0;
  padding-left: 20px;
  border-left: 2px solid var(--primary-subtle);
}

.timeline-item {
  padding: 10px 0 10px 20px;
  position: relative;
  line-height: 1.6;
  color: var(--text-secondary);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--primary);
  border: 3px solid var(--primary-light);
}

.timeline-date {
  font-weight: 700;
  color: var(--primary);
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
}

.study-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 20px 0;
  font-size: 0.9rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.study-table th, .study-table td {
  padding: 12px 16px;
  text-align: left;
}

.study-table th {
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.study-table td {
  border-top: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.study-table tr:nth-child(even) td {
  background: var(--bg);
}

.study-table tr:hover td {
  background: var(--primary-light);
}

.study-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* === Mobile Responsive === */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 12px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }

  .nav.open {
    display: flex;
  }

  .nav a {
    padding: 14px 16px;
    border-radius: var(--radius);
  }

  .nav a.active {
    background: var(--primary-light);
  }

  .menu-toggle {
    display: block;
  }

  #app {
    padding: 20px 16px 32px;
  }

  .hero-overlay h1 {
    font-size: 1.4rem;
  }

  .hero-img {
    height: 200px;
  }

  .hero-overlay {
    padding: 20px;
  }

  .exam-info-grid {
    grid-template-columns: 1fr;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .stat {
    padding: 12px 10px;
  }

  .stat-number {
    font-size: 1.2rem;
  }

  .question-card {
    padding: 20px;
  }

  .study-content {
    padding: 24px 20px;
  }

  .study-section h3 {
    font-size: 1.1rem;
  }

  .results-score {
    font-size: 3rem;
  }
}

@media (min-width: 600px) {
  .cta-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .resource-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .study-topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .cta-cards {
    grid-template-columns: repeat(3, 1fr);
  }

  .cta-card {
    flex-direction: column;
    text-align: center;
    padding: 24px 20px;
  }

  .cta-card .cta-icon {
    margin: 0 auto;
  }

  .study-topics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* === Mode Badge === */
.mode-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.mode-badge.study {
  background: #ede9fe;
  color: #7c3aed;
}

.mode-buttons {
  margin-top: 16px;
}

/* === Learn More Section === */
.learn-more {
  margin-top: 12px;
  padding: 14px 18px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.learn-more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 3px 4px 3px 0;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  transition: all 0.2s var(--ease);
  text-decoration: none;
}

.learn-more-link.study-link {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-subtle);
}

.learn-more-link.study-link:hover {
  background: var(--primary);
  color: #fff;
}

.learn-more-link.external-link {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.learn-more-link.external-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
}

.learn-more-external {
  margin-top: 8px;
}

.learn-more-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* === Study Hint (expandable) === */
.study-hint {
  margin-top: 16px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.study-hint summary {
  padding: 12px 18px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.study-hint summary::-webkit-details-marker { display: none; }

.study-hint summary::before {
  content: '💡';
}

.study-hint summary:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.study-hint[open] summary {
  border-bottom: 1px solid var(--border-light);
}

/* === Review Badges === */
.review-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.review-badge.hard {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid var(--warning);
}

.review-badge.failed {
  background: var(--accent-light);
  color: #991b1b;
  border: 1px solid var(--accent);
}

.question-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* === Study Page Specific === */
.study-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.study-external-links {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
}

.study-external-links h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.study-external-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin: 3px 4px 3px 0;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.study-external-links a:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-subtle);
}

/* === Study Topic Card as link === */
a.study-topic-card {
  text-decoration: none;
  color: var(--text);
}

/* === Utility === */
.hidden { display: none !important; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.text-center { text-align: center; }

/* === Infographics === */
:root {
  --purple: #7c3aed;
  --purple-light: #f5f3ff;
}

.infographic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 600px) {
  .infographic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.info-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  transition: box-shadow 0.2s var(--ease);
}

.info-card:hover {
  box-shadow: var(--shadow-md);
}

.info-card[data-color="blue"]  { border-left-color: var(--primary); }
.info-card[data-color="red"]   { border-left-color: var(--accent); }
.info-card[data-color="green"] { border-left-color: var(--success); }
.info-card[data-color="amber"] { border-left-color: var(--warning); }
.info-card[data-color="purple"]{ border-left-color: var(--purple); }

.info-card--wide {
  grid-column: 1 / -1;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.info-card-icon {
  font-size: 1.4rem;
}

.info-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.info-card-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* Stats grid (Card 1) */
.info-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-stat {
  text-align: center;
  padding: 10px 6px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.info-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

@media (max-width: 599px) {
  .info-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Columns (Card 2 — Branches) */
.info-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) {
  .info-columns {
    grid-template-columns: repeat(4, 1fr);
  }
}

.info-column {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-column-icon {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.info-column-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.info-column-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Flag stripes (Card 3) */
.info-flag {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 10px;
}

.info-flag-stripe {
  padding: 8px 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.info-flag-stripe span {
  font-weight: 700;
  min-width: 50px;
}

.info-flag-stripe small {
  font-size: 0.75rem;
  opacity: 0.9;
}

.info-flag-stripe--double {
  padding: 14px 16px;
}

.info-flag-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
}

/* Timeline (Card 4) */
.info-timeline {
  position: relative;
  padding-left: 20px;
}

.info-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--accent);
  opacity: 0.3;
  border-radius: 1px;
}

.info-timeline-item {
  position: relative;
  padding: 6px 0 6px 16px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.info-timeline-dot {
  position: absolute;
  left: -19px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--accent-light);
}

.info-timeline-year {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--accent);
  min-width: 42px;
  font-variant-numeric: tabular-nums;
}

.info-timeline-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Figures list (Card 5) */
.info-figures {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-figure {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-figure-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.info-figure-name {
  font-size: 0.88rem;
  font-weight: 700;
}

.info-figure-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Compass layout (Card 6) */
.info-compass {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 8px;
  text-align: center;
  padding: 8px;
}

.info-compass-n { grid-column: 2; }
.info-compass-w { grid-column: 1; grid-row: 2; }
.info-compass-center { grid-column: 2; grid-row: 2; }
.info-compass-e { grid-column: 3; grid-row: 2; }
.info-compass-s { grid-column: 2; grid-row: 3; }

.info-compass-n,
.info-compass-s,
.info-compass-e,
.info-compass-w {
  font-size: 0.78rem;
  color: var(--text-secondary);
  padding: 10px 6px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-compass-center {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--success);
  padding: 16px 6px;
  background: var(--success-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-compass-dir {
  display: block;
  font-weight: 800;
  font-size: 1rem;
  color: var(--success);
  margin-bottom: 2px;
}

/* Symbol grid (Card 7) */
.info-symbol-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 400px) {
  .info-symbol-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.info-symbol {
  text-align: center;
  padding: 12px 6px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-symbol-icon {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.info-symbol-name {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.info-symbol-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Bar chart (Card 8) */
.info-bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-bar-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--purple);
}

.info-bar-track {
  height: 24px;
  background: var(--bg);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.info-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #a78bfa);
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
}

.info-bar-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Exam stats (Card 9) */
.info-exam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.info-exam-stat {
  text-align: center;
  padding: 14px 8px;
  background: var(--bg);
  border-radius: var(--radius);
}

.info-exam-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--purple);
  letter-spacing: -0.02em;
}

.info-exam-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 2px 0;
}

.info-exam-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Province grid (Card 10) */
.info-province-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 500px) {
  .info-province-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 768px) {
  .info-province-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.info-province {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--bg);
  border-left: 3px solid var(--prov-color, var(--primary));
}

.info-province-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--prov-color, var(--text));
}

.info-province-cap {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Study link inside cards */
.info-card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.2s var(--ease);
}

.info-card-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* Image attribution caption */
.img-attribution {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.img-attribution a {
  color: var(--text-muted);
  text-decoration: underline;
}

.img-attribution a:hover {
  color: var(--primary);
}
