/* ================================
   GLOBAL RESET & VARS
   ================================ */
:root {
  --primary: #2F5496;
  --primary-light: #4472C4;
  --primary-dark: #1B3A6B;
  --accent: #F5A623;
  --accent-hover: #E6951A;
  --success: #27AE60;
  --success-bg: #E8F8F0;
  --danger: #E74C3C;
  --danger-bg: #FDE8E8;
  --warning: #F39C12;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --white: #FFFFFF;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.15);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================================
   SCREENS
   ================================ */
.screen {
  display: none;
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}
.screen.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes ringFill {
  to { stroke-dashoffset: var(--target-offset); }
}

/* ================================
   HOME SCREEN
   ================================ */
.home-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.home-header {
  text-align: center;
  margin-bottom: 36px;
}

.home-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 12px rgba(47, 84, 150, 0.25));
  animation: scaleIn 0.5s ease;
}

.home-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.3;
  margin-bottom: 8px;
}
.home-title span {
  color: var(--primary);
  font-weight: 700;
}

.home-subtitle {
  color: var(--gray-500);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Search */
.home-search {
  max-width: 420px;
  margin: 0 auto 24px;
  position: relative;
}

/* ================================
   TAB BAR
   ================================ */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 4px;
  max-width: 420px;
  margin: 0 auto 28px;
}

.tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-500);
  cursor: pointer;
  transition: var(--transition);
}

.tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab:hover:not(.active) {
  color: var(--gray-700);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

/* ================================
   CATEGORY GROUPS
   ================================ */
.category-group {
  margin-bottom: 16px;
  animation: slideUp 0.4s ease both;
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 20px;
  cursor: pointer;
  border: 2px solid var(--gray-100);
  transition: var(--transition);
}

.category-header:hover {
  border-color: var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.category-header.expanded {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}

.category-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.category-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.category-icon.chung { background: linear-gradient(135deg, #F3E8FF, #E9D5FF); }
.category-icon.noi { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.category-icon.ngoai { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.category-icon.atld { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }

.category-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.category-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 2px;
}

.category-chevron {
  color: var(--gray-400);
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.category-header.expanded .category-chevron {
  transform: rotate(180deg);
}

.section-list {
  background: var(--white);
  border: 2px solid var(--gray-100);
  border-top: none;
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  max-height: 1000px;
  opacity: 1;
}

.section-list.collapsed {
  max-height: 0;
  opacity: 0;
  border: none;
}

.section-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px 12px 28px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--gray-50);
}

.section-item:last-child {
  border-bottom: none;
}

.section-item:hover {
  background: var(--gray-50);
}

.section-item .section-name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
}

.section-item .section-badge {
  font-size: 0.73rem;
}

.section-item .section-arrow {
  color: var(--gray-300);
  flex-shrink: 0;
  transition: var(--transition);
}

.section-item:hover .section-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

.section-item-all {
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100) !important;
}

.section-item-all .section-name {
  font-weight: 600;
  color: var(--primary);
}

/* ================================
   EXAM CONFIG
   ================================ */
.exam-config-card {
  max-width: 500px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  animation: scaleIn 0.3s ease;
}

.exam-config-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 8px;
}

.config-desc {
  font-size: 0.85rem;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.config-field {
  margin-bottom: 18px;
}

.config-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.config-field select,
.config-field input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  background: var(--white);
  color: var(--gray-800);
}

.config-field select:focus,
.config-field input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(47, 84, 150, 0.1);
}

/* Question section tag */
.q-section-tag {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
  vertical-align: middle;
}

/* Timer warning */
.timer-warning {
  color: var(--danger) !important;
  font-weight: 700 !important;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-400);
}

.home-search input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid var(--gray-200);
  border-radius: 50px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.home-search input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(47, 84, 150, 0.1);
}
.home-search input::placeholder { color: var(--gray-400); }

/* Section Grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.section-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  border: 2px solid var(--gray-100);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideUp 0.4s ease both;
}

.section-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-card:active {
  transform: translateY(0);
}

.section-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.section-icon.noi { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.section-icon.ngoai { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.section-icon.atld { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }

.section-info { flex: 1; min-width: 0; }

.section-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
  line-height: 1.4;
}

.section-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-100);
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--primary);
}

.section-arrow {
  color: var(--gray-300);
  transition: var(--transition);
  flex-shrink: 0;
}
.section-card:hover .section-arrow { color: var(--primary); transform: translateX(3px); }

/* ================================
   INFO SCREEN
   ================================ */
.info-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 4px;
  margin-bottom: 16px;
  transition: var(--transition);
}
.btn-back:hover { color: var(--primary); }

.info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  text-align: center;
  animation: scaleIn 0.3s ease;
}

.info-logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
  margin-bottom: 16px;
}

.info-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 24px;
}

.info-details {
  text-align: left;
  margin-bottom: 24px;
}

.info-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.info-row:last-child { border-bottom: none; }

.info-icon {
  font-size: 1.1rem;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.info-label {
  flex: 1;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.info-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-800);
}

.info-name-input {
  text-align: left;
  margin-bottom: 24px;
}

.info-name-input label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 6px;
}

.info-name-input input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}
.info-name-input input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(47, 84, 150, 0.1);
}

.btn-start {
  width: 100%;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(245, 166, 35, 0.35);
}
.btn-start:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 166, 35, 0.45);
}
.btn-start:active { transform: translateY(0); }

/* ================================
   EXAM SCREEN
   ================================ */
.exam-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.exam-student {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exam-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exam-timer {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}

.btn-toggle-nav {
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  transition: var(--transition);
}
.btn-toggle-nav:hover { background: var(--gray-200); color: var(--primary); }

.btn-submit {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.btn-submit:hover { background: var(--primary-dark); }

/* Exam body */
.exam-body {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 60px;
  gap: 24px;
}

.exam-questions {
  flex: 1;
  min-width: 0;
}

.question-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: var(--transition);
}
.question-card:hover { box-shadow: var(--shadow-md); }

.question-header {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.question-text {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 16px;
  line-height: 1.6;
}

.question-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  font-size: 0.75rem;
  color: var(--gray-400);
  font-weight: 500;
}
.question-divider::before,
.question-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.answer-list { list-style: none; }

.answer-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid var(--gray-100);
}
.answer-item:hover { background: var(--gray-50); border-color: var(--gray-200); }
.answer-item.selected {
  background: #EFF4FB;
  border-color: var(--primary-light);
}

.answer-label {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  background: var(--gray-100);
  color: var(--gray-600);
  transition: var(--transition);
}
.answer-item.selected .answer-label {
  background: var(--accent);
  color: var(--white);
}

.answer-text {
  flex: 1;
  padding-top: 5px;
  font-size: 0.9rem;
  color: var(--gray-700);
  line-height: 1.5;
}

/* Review styling */
.answer-item.review-correct {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
}
.answer-item.review-correct .answer-label {
  background: var(--success) !important;
  color: var(--white) !important;
}

.answer-item.review-wrong {
  background: var(--danger-bg) !important;
  border-color: var(--danger) !important;
}
.answer-item.review-wrong .answer-label {
  background: var(--danger) !important;
  color: var(--white) !important;
}

/* Nav sidebar */
.exam-nav {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 72px;
  align-self: flex-start;
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.nav-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gray-700);
}

.btn-close-nav {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 4px;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.nav-btn {
  aspect-ratio: 1;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 0.75rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav-btn:hover { border-color: var(--primary-light); color: var(--primary); }

.nav-btn.answered {
  background: var(--primary-light);
  color: var(--white);
  border-color: var(--primary-light);
}

.nav-btn.current {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.3);
}

.nav-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  color: var(--gray-500);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dot-answered { background: var(--primary-light); }
.dot-current { border: 2px solid var(--accent); background: transparent; }
.dot-unanswered { background: var(--gray-200); }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}
.nav-overlay.active { display: block; }

/* ================================
   RESULT SCREEN
   ================================ */
.result-container {
  max-width: 560px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.result-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: scaleIn 0.4s ease;
}

.result-header {
  margin-bottom: 24px;
}

.result-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 12px;
}

.result-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-800);
}

.result-score-circle {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
}

.result-score-circle svg {
  width: 100%;
  height: 100%;
}

.score-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.score-total {
  font-size: 0.9rem;
  color: var(--gray-400);
  font-weight: 600;
}

.result-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 28px;
}

.stat {
  text-align: center;
}

.stat-num {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}
.stat.correct .stat-num { color: var(--success); }
.stat.wrong .stat-num { color: var(--danger); }
.stat.skipped .stat-num { color: var(--gray-400); }

.stat-label {
  font-size: 0.75rem;
  color: var(--gray-500);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-review, .btn-retry, .btn-home {
  width: 100%;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-review {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-review:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-retry {
  background: var(--white);
  color: var(--accent);
  border-color: var(--accent);
}
.btn-retry:hover { background: rgba(245, 166, 35, 0.05); }

.btn-home {
  background: var(--gray-100);
  color: var(--gray-600);
}
.btn-home:hover { background: var(--gray-200); }

/* ================================
   REVIEW SCREEN
   ================================ */
.review-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.review-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-700);
}

.review-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
  .home-container { padding: 28px 16px 48px; }
  .home-logo { width: 64px; height: 64px; }
  .home-title { font-size: 1.4rem; }
  
  .section-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .section-card { padding: 16px 18px; }
  .section-icon { width: 44px; height: 44px; font-size: 1.3rem; }
  
  /* Exam nav → mobile drawer */
  .exam-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    z-index: 300;
    transition: right 0.3s ease;
    box-shadow: var(--shadow-xl);
  }
  .exam-nav.open { right: 0; }
  .btn-close-nav { display: block; }
  
  .exam-body { padding: 12px 12px 60px; }
  
  .question-card { padding: 18px 16px; margin-bottom: 14px; }
  .question-text { font-size: 0.9rem; }
  .answer-item { padding: 8px 10px; gap: 10px; }
  .answer-label { width: 30px; height: 30px; font-size: 0.8rem; }
  .answer-text { font-size: 0.85rem; padding-top: 4px; }
  
  .hide-mobile { display: none; }
  
  .btn-submit {
    padding: 8px 10px;
    font-size: 0.75rem;
  }
  .btn-submit svg { width: 14px; height: 14px; }
  
  .result-stats { gap: 20px; }
  .stat-num { font-size: 1.3rem; }
  
  .info-card { padding: 24px 20px; }
}

@media (max-width: 360px) {
  html { font-size: 14px; }
  .home-title { font-size: 1.25rem; }
  .nav-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 769px) {
  .btn-toggle-nav { display: none; }
  .nav-overlay { display: none !important; }
}

/* Scroll bar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* Custom checkbox animation */
@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.answer-item.selected .answer-label {
  animation: pop 0.25s ease;
}
