/* ==========================================================================
   BPSC TRE 4.0 Computer Science — Practice Sets (40) Exam Engine Styles
   Eye-care warm palette, real-exam palette, responsive mobile & desktop
   ========================================================================== */

/* Top Navigation Tab Highlight Badge */
.tab-red-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
  margin-left: 0.45rem;
  vertical-align: middle;
  line-height: 1.2;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

[data-theme="dark"] .tab-red-pill {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

.nav-tab-btn.active .tab-red-pill {
  background: #ffffff;
  border-color: #ffffff;
  color: #dc2626;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Red Bullet Elements */
.red-bullet {
  color: #ef4444;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
}

/* Red Marked Text for Tabs & Cards */
.tab-red-mark {
  color: #dc2626 !important;
  font-weight: 800;
  display: inline;
}

[data-theme="dark"] .tab-red-mark {
  color: #ef4444 !important;
}

.red-bullet-pulse {
  color: #ef4444;
  font-size: 1.15rem;
  line-height: 1;
  display: inline-block;
  animation: redBulletPulse 1.6s infinite ease-in-out;
}

@keyframes redBulletPulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.75; }
  100% { transform: scale(1); opacity: 1; }
}

/* Top Highlight Banner in Practice Sets Hub */
.practice-top-highlight {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  padding: 0.45rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  margin-bottom: 1.15rem;
  box-shadow: 0 2px 10px rgba(220, 38, 38, 0.15);
}

[data-theme="dark"] .practice-top-highlight {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}

/* --------------------------------------------------------------------------
   Practice Hub View
   -------------------------------------------------------------------------- */
.practice-hub {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.practice-header {
  text-align: center;
  margin-bottom: 2rem;
}

.practice-title {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.practice-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 720px;
  margin: 0 auto 1.5rem;
  line-height: 1.5;
}

/* Practice Stats Summary Banner */
.practice-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.practice-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.practice-stat-icon {
  font-size: 1.8rem;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.practice-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.practice-stat-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Hub Filter Bar */
.practice-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.practice-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-practice-filter {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-practice-filter:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-practice-filter.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* Practice Sets Card Grid */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.practice-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

.practice-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-highlight);
}

.practice-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.practice-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.practice-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.badge-not-started {
  background: var(--bg-tertiary);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.badge-in-progress {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.badge-completed {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.practice-card-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.practice-sections-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.section-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 600;
}

.practice-card-score-row {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.practice-score-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.practice-score-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.practice-card-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-practice-act {
  flex: 1;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-practice-start {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-practice-start:hover {
  background: var(--accent-primary-hover);
}

.btn-practice-resume {
  background: #d97706;
  color: #ffffff;
}

.btn-practice-resume:hover {
  background: #b45309;
}

.btn-practice-result {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-practice-result:hover {
  background: var(--border-color);
}

/* --------------------------------------------------------------------------
   Instructions View
   -------------------------------------------------------------------------- */
.practice-instructions-wrap {
  max-width: 820px;
  margin: 1.5rem auto 3rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.instruct-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.instruct-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.instruct-badge {
  background: var(--accent-glow);
  color: var(--accent-primary);
  border: 1px solid var(--border-highlight);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
}

.instruct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.instruct-item {
  background: var(--bg-tertiary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-primary);
}

.instruct-item-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.instruct-item-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.instruct-sections-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
}

.instruct-sections-table th,
.instruct-sections-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.instruct-sections-table th {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 700;
}

.instruct-rules-list {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  padding-left: 1.25rem;
}

.instruct-rules-list li {
  margin-bottom: 0.4rem;
}

.instruct-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   Real-Exam Mode Interface
   -------------------------------------------------------------------------- */
.exam-stage {
  max-width: 1350px;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
}

/* Exam Top Bar */
.exam-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 10px;
  z-index: 40;
}

.exam-info-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.exam-info-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Countdown Timer */
.exam-timer-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.exam-timer-wrap.warning {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  animation: pulseTimer 1.2s infinite;
}

@keyframes pulseTimer {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.exam-quick-stats {
  display: flex;
  gap: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
}

.stat-chip-ans {
  color: #059669;
}

.stat-chip-rem {
  color: #d97706;
}

.stat-chip-mark {
  color: #7c3aed;
}

/* Exam Main Layout: Question Area (left) + Palette Sidebar (right) */
.exam-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 980px) {
  .exam-layout {
    grid-template-columns: 1fr;
  }
}

/* Section Switcher Tabs */
.exam-sections-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-exam-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-exam-section:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.btn-exam-section.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* Question Box Container */
.exam-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  min-height: 480px;
}

.exam-q-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.exam-q-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.exam-q-topic {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
}

.exam-q-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* 5 Options Styling */
.exam-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.exam-option-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.exam-option-item:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card);
}

.exam-option-item.selected {
  background: var(--accent-glow);
  border-color: var(--accent-primary);
  font-weight: 700;
  color: var(--accent-primary);
}

.exam-option-radio {
  margin-top: 0.2rem;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

/* Exam Action Toolbar */
.exam-actions-toolbar {
  margin-top: auto;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.exam-left-actions,
.exam-right-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn-exam-ctrl {
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-ctrl-prev {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.btn-ctrl-clear {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-ctrl-clear:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-ctrl-review {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #ddd6fe;
}

.btn-ctrl-review:hover {
  background: #ddd6fe;
}

.btn-ctrl-next {
  background: var(--accent-primary);
  color: #ffffff;
}

.btn-ctrl-next:hover {
  background: var(--accent-primary-hover);
}

/* --------------------------------------------------------------------------
   Question Palette (NTA / BPSC Real Exam Format)
   -------------------------------------------------------------------------- */
.exam-palette-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
}

.palette-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Palette Legend */
.palette-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  padding: 0.5rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* Swatch & Button States */
.state-not-visited {
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.state-not-answered {
  background: #f87171;
  color: #ffffff;
  border: 1px solid #ef4444;
}

.state-answered {
  background: #10b981;
  color: #ffffff;
  border: 1px solid #059669;
}

.state-marked {
  background: #8b5cf6;
  color: #ffffff;
  border: 1px solid #7c3aed;
}

.state-marked-answered {
  background: #8b5cf6;
  color: #ffffff;
  border: 2px solid #10b981;
  position: relative;
}

.state-marked-answered::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #10b981;
}

/* Palette Button Grid */
.palette-grid-scroll {
  overflow-y: auto;
  max-height: 380px;
  padding-right: 0.25rem;
  margin-bottom: 1rem;
}

.palette-buttons-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
}

.btn-palette-q {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s ease;
  user-select: none;
}

.btn-palette-q:hover {
  transform: scale(1.08);
}

.btn-palette-q.current {
  box-shadow: 0 0 0 2px var(--text-primary);
  font-weight: 900;
}

.palette-submit-wrap {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
}

.btn-exam-submit {
  width: 100%;
  padding: 0.65rem 1rem;
  background: #059669;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-exam-submit:hover {
  background: #047857;
}

/* --------------------------------------------------------------------------
   Submit Confirmation Modal
   -------------------------------------------------------------------------- */
.exam-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
}

.exam-modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-md);
  animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.exam-modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.exam-modal-summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
}

.exam-modal-summary-table td {
  padding: 0.45rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.exam-modal-summary-table td:last-child {
  text-align: right;
  font-weight: 800;
}

.exam-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Result View
   -------------------------------------------------------------------------- */
.practice-result-wrap {
  max-width: 1050px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.result-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 1.5rem;
  text-align: center;
}

.result-set-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.result-score-circle {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  margin: 1.25rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 6px solid var(--accent-primary);
  background: var(--bg-tertiary);
}

.result-score-big {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent-primary);
  line-height: 1;
}

.result-score-denom {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}

.result-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.result-metric-box {
  background: var(--bg-tertiary);
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.result-metric-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
}

.result-metric-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Section Scores Cards */
.result-sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-sec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.result-sec-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

/* Topic Breakdown & Feedback Grid */
.result-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 820px) {
  .result-analytics-grid {
    grid-template-columns: 1fr;
  }
}

.result-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.result-panel-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-bar-row {
  margin-bottom: 0.75rem;
}

.topic-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.topic-bar-bg {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow: hidden;
}

.topic-bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent-primary);
  transition: width 0.4s ease;
}

.feedback-section {
  margin-bottom: 1rem;
}

.feedback-tag {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0.2rem;
}

.tag-strong {
  background: #d1fae5;
  color: #065f46;
}

.tag-weak {
  background: #fee2e2;
  color: #991b1b;
}

.recommendations-box {
  background: var(--bg-tertiary);
  border-left: 3px solid var(--accent-primary);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.result-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   Review Answers View
   -------------------------------------------------------------------------- */
.practice-review-wrap {
  max-width: 1050px;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.review-header {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.review-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.review-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.review-card.correct {
  border-left: 4px solid #10b981;
}

.review-card.wrong {
  border-left: 4px solid #ef4444;
}

.review-card.unattempted {
  border-left: 4px solid #94a3b8;
}

.review-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.review-badge-status {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.review-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.review-opt-item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.4;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
}

.review-opt-item.user-wrong {
  background: #fee2e2;
  border-color: #f87171;
  color: #991b1b;
  font-weight: 700;
}

.review-opt-item.is-correct {
  background: #d1fae5;
  border-color: #34d399;
  color: #065f46;
  font-weight: 700;
}

.review-explanation-box {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
