/* Color system and styling variables */
:root {
  --bg-main: #080c16;
  --bg-glass: rgba(15, 22, 42, 0.65);
  --bg-glass-heavy: rgba(15, 22, 42, 0.9);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(6, 182, 212, 0.35);
  --border-hover: rgba(255, 255, 255, 0.15);
  
  --primary: #06b6d4;       /* Teal/Cyan */
  --primary-rgb: 6, 182, 212;
  --primary-glow: rgba(6, 182, 212, 0.15);
  --secondary: #8b5cf6;     /* Purple */
  --secondary-rgb: 139, 92, 246;
  --secondary-glow: rgba(139, 92, 246, 0.15);
  --accent: #d946ef;        /* Violet/Magenta */
  --accent-rgb: 217, 70, 239;
  --accent-glow: rgba(217, 70, 239, 0.15);
  
  --success: #10b981;       /* Emerald */
  --success-rgb: 16, 185, 129;
  --warning: #f59e0b;       /* Amber */
  --warning-rgb: 245, 158, 11;
  --danger: #ef4444;        /* Crimson */
  --danger-rgb: 239, 68, 68;
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #626a7a;
  
  --font-display: 'Outfit', 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  --shadow-main: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
  --radius-card: 16px;
  --radius-btn: 10px;
}

/* Reset and Global Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  height: 100%;
}

/* Ambient Background Animations */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.glow-circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.22;
}

.glow-1 {
  top: -10%;
  right: 10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
  animation: float-slow 20s infinite alternate;
}

.glow-2 {
  bottom: -15%;
  left: 5%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  animation: float-slow 25s infinite alternate-reverse;
}

@keyframes float-slow {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, -50px) scale(1.15); }
}

/* Main Container Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Glassmorphic Panel Foundation */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-main);
  padding: 2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Button Foundations */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-btn);
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.primary {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
}

.btn.primary:hover {
  background: #22d3ee;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(6, 182, 212, 0.45);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.btn.accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(217, 70, 239, 0.3);
}

.btn.accent:hover {
  background: #f472b6;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(217, 70, 239, 0.45);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

/* Badge component */
.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 9999px;
  border: 1px solid rgba(6, 182, 212, 0.2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

/* Screens toggling logic */
.screen {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.screen.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------
   LANDING SCREEN STYLING
--------------------------------- */
.hero-section {
  text-align: center;
  margin-bottom: 3.5rem;
}

.gradient-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  background: linear-gradient(135deg, #fff 20%, #9ca3af 50%, var(--primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto;
}

/* Configuration Panel */
.config-panel {
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
  padding: 1.25rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.config-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.config-icon-wrapper {
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  color: var(--secondary);
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.config-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.config-text h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.1rem;
  color: var(--text-primary);
}

.config-text p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.config-right {
  flex-grow: 1;
  max-width: 240px;
  min-width: 180px;
}

#set-select {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.9rem;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
}

#set-select option {
  background: #0f162a;
  color: var(--text-primary);
}

#set-select:hover, #set-select:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

/* Mode grid items */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.mode-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 2.25rem 2rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-glow);
  box-shadow: 0 15px 35px -10px rgba(6, 182, 212, 0.15);
  background: rgba(15, 22, 42, 0.85);
}

.mode-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
}

.mode-card:hover .mode-icon {
  background: var(--primary-glow);
  border-color: rgba(6, 182, 212, 0.3);
  color: #22d3ee;
}

.mode-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.mode-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.mode-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-display);
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
}

.mode-card:hover .mode-meta {
  color: var(--text-secondary);
}

/* Info stats box */
.stats-overview-box {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: var(--radius-card);
  padding: 1.75rem 2rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.stats-overview-box h3 {
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.stats-overview-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------------------------------
   TEST SIMULATION SCREEN
--------------------------------- */
.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.test-title-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.test-title-info h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.timer-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-family: var(--font-display);
  font-weight: 700;
  transition: all 0.3s ease;
}

.timer-container.warning-state {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning);
  animation: pulse-border 1.5s infinite alternate;
}

.timer-container.urgent-state {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #ff6b6b;
  animation: alert-flash 0.5s infinite alternate;
}

@keyframes alert-flash {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes pulse-border {
  0% { border-color: rgba(245, 158, 11, 0.3); }
  100% { border-color: rgba(245, 158, 11, 0.7); }
}

.timer-icon {
  width: 18px;
  height: 18px;
}

/* Time indicator bar */
.time-progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.time-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  width: 100%;
  border-radius: 9999px;
  transition: width 1s linear, background-color 0.5s ease;
}

.time-progress-bar.warning-color {
  background: var(--warning);
}

.time-progress-bar.urgent-color {
  background: var(--danger);
}

/* Sidebar and Main grid layout */
.test-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

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

.test-sidebar {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

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

.sidebar-header h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
}

#answered-count-badge {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Question quick jump circles grid */
.question-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom scrollbar for grid */
.question-grid::-webkit-scrollbar {
  width: 5px;
}
.question-grid::-webkit-scrollbar-track {
  background: transparent;
}
.question-grid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 99px;
}

.nav-circle {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.nav-circle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(6, 182, 212, 0.05);
}

.nav-circle.current {
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  color: var(--primary);
  background: rgba(6, 182, 212, 0.1);
  font-weight: 700;
}

.nav-circle.answered {
  background: rgba(6, 182, 212, 0.8);
  color: #000;
  border-color: var(--primary);
}

.nav-circle.answered.current {
  border-color: #fff;
  box-shadow: 0 0 12px var(--primary);
}

.nav-circle.flagged::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background-color: var(--warning);
  border-radius: 50%;
  border: 1px solid var(--bg-main);
}

.legend {
  border-top: 1px solid var(--border-light);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

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

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.unanswered { border: 1px solid var(--border-light); background: rgba(255, 255, 255, 0.02); }
.legend-dot.answered { background: var(--primary); }
.legend-dot.flagged { background: var(--warning); }

/* Main Question Card styling */
.question-main-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.question-card {
  min-height: 380px;
  display: flex;
  flex-direction: column;
  position: relative;
}

.question-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.question-cat-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(139, 92, 246, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

#btn-flag.active-flag {
  color: var(--warning);
}

#btn-flag.active-flag svg {
  fill: var(--warning);
}

.question-text {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 2rem;
  color: var(--text-primary);
  white-space: pre-line;
}

/* Choices list */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  margin-top: auto;
}

.option-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-btn);
  padding: 1rem 1.25rem;
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.option-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-hover);
  transform: translateX(4px);
}

.option-prefix {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.option-btn:hover .option-prefix {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-secondary);
}

.option-btn.selected {
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.1);
}

.option-btn.selected .option-prefix {
  background: var(--primary);
  color: #000;
  border-color: var(--primary);
}

/* Practice immediate feedback panel */
.feedback-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
}

.feedback-panel.incorrect-feedback {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.feedback-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.feedback-panel:not(.incorrect-feedback) .feedback-status {
  color: var(--success);
}

.feedback-panel.incorrect-feedback .feedback-status {
  color: var(--danger);
}

.feedback-explanation {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Bottom Controls Row */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.center-controls {
  display: flex;
  justify-content: center;
  flex-grow: 1;
}

/* ---------------------------------
   RESULTS SCREEN STYLING
--------------------------------- */
.results-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.results-header p {
  color: var(--text-secondary);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}

/* Glowing scoreboard circular widget */
.score-card {
  display: flex;
  align-items: center;
  gap: 2rem;
}

@media (max-width: 500px) {
  .score-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1rem;
  }
}

.score-circle-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 8;
}

.score-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dasharray 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.score-max {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 600;
}

.score-text-details h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--primary);
}

.score-text-details p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Metric sidecard items */
.metrics-card {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 2rem 1rem;
}

.metric-box {
  text-align: center;
  flex: 1;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.metric-lbl {
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-divider {
  width: 1px;
  height: 80px;
  background-color: var(--border-light);
}

/* Domain bars container */
.category-breakdown-card {
  margin-bottom: 2rem;
}

.category-breakdown-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.category-bars {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cat-bar-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 600;
}

.cat-name {
  color: var(--text-primary);
  font-family: var(--font-display);
}

.cat-percentage {
  color: var(--primary);
}

.cat-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.cat-bar-fill {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Colors for specific domain bars */
.cat-bar-item:nth-child(1) .cat-bar-fill { background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.cat-bar-item:nth-child(2) .cat-bar-fill { background: linear-gradient(90deg, #8b5cf6, #d946ef); }
.cat-bar-item:nth-child(3) .cat-bar-fill { background: linear-gradient(90deg, #ec4899, #f43f5e); }

/* Review section details */
.review-panel {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.review-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.review-header-row h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.filter-group {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-light);
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.4rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--primary);
  border: 1px solid rgba(255, 255, 255, 0.02);
}

/* Accordion style review cards list */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.review-item-card {
  background: rgba(15, 22, 42, 0.4);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.25s ease;
}

.review-item-card:hover {
  border-color: rgba(255,255,255,0.12);
}

/* Correct/Incorrect card borders */
.review-item-card.correct { border-left: 4px solid var(--success); }
.review-item-card.incorrect { border-left: 4px solid var(--danger); }
.review-item-card.unanswered-review { border-left: 4px solid var(--text-muted); }

.review-card-header {
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 1.5rem;
}

.review-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-grow: 1;
}

.review-q-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.review-item-card.correct .review-q-num { background: rgba(16, 185, 129, 0.1); color: var(--success); border-color: rgba(16, 185, 129, 0.2); }
.review-item-card.incorrect .review-q-num { background: rgba(239, 68, 68, 0.1); color: var(--danger); border-color: rgba(239, 68, 68, 0.2); }

.review-q-preview {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.review-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.review-status-badge {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.review-item-card.correct .review-status-badge { background: rgba(16, 185, 129, 0.1); color: var(--success); }
.review-item-card.incorrect .review-status-badge { background: rgba(239, 68, 68, 0.1); color: var(--danger); }
.review-item-card.unanswered-review .review-status-badge { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.chevron-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: transform 0.25s ease;
}

.review-item-card.open .chevron-icon {
  transform: rotate(180deg);
}

/* Accordion body slide section */
.review-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(8, 12, 22, 0.4);
  border-top: 1px solid transparent;
}

.review-item-card.open .review-card-body {
  max-height: 500px;
  border-top-color: var(--border-light);
}

.review-body-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.review-full-text {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: pre-line;
}

.review-answers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.review-ans-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: rgba(255,255,255,0.01);
}

.review-ans-item.correct-ans {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
  color: #c6f6d5;
}

.review-ans-item.incorrect-ans {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
  color: #fed7d7;
}

.review-ans-badge {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.review-ans-item.correct-ans .review-ans-badge { background: var(--success); color: #000; }
.review-ans-item.incorrect-ans .review-ans-badge { background: var(--danger); color: #fff; }

.review-explanation-box {
  padding: 1rem 1.25rem;
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.review-explanation-box strong {
  color: var(--secondary);
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
}

/* Results action buttons row */
.results-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

/* ---------------------------------
   NATIVE DIALOG CONFIRM SUBMIT
--------------------------------- */
.confirm-dialog {
  margin: auto;
  border-radius: var(--radius-card);
  overflow: hidden;
  max-width: 440px;
  width: 90%;
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
  padding: 0;
  background: var(--bg-glass-heavy);
}

.dialog-content {
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dialog-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.dialog-content p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Animation triggers for Native Dialog open/close */
dialog[open] {
  opacity: 1;
  transform: scale(1);
  
  @starting-style {
    opacity: 0;
    transform: scale(0.9);
  }
}

dialog {
  opacity: 0;
  transform: scale(0.95);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.25s;
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-behavior: allow-discrete;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: 
    display 0.25s allow-discrete, 
    overlay 0.25s allow-discrete, 
    background-color 0.25s ease-out, 
    backdrop-filter 0.25s ease-out;
}

dialog[open]::backdrop {
  background-color: rgba(4, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  
  @starting-style {
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
}

/* Reduced motion considerations */
@media (prefers-reduced-motion: reduce) {
  .glow-circle {
    animation: none !important;
  }
  
  .screen, dialog, dialog::backdrop, .option-btn, .btn, .time-progress-bar, .score-fill {
    transition-duration: 0.05s !important;
    animation: none !important;
  }
  
  dialog[open] {
    transform: none !important;
    @starting-style {
      transform: none !important;
    }
  }
}
