/* ----------------------------------------------------
   SoftechEducate Student App — Enterprise Stylesheet
   Palette: Deep Tech Blue, Solar Orange, Radiant Teal
   ---------------------------------------------------- */

:root {
  --primary-blue: #1A365D;
  --primary-navy: #0F172A;
  --accent-orange: #FF6B35;
  --accent-teal: #00B4D8;
  --accent-green: #10B981;
  --accent-purple: #6366F1;
  --accent-yellow: #FFD166;
  --danger-red: #EF4444;

  --bg-gradient: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  --surface-card: #FFFFFF;
  --surface-subtle: #F8FAFC;
  --surface-glass: rgba(255, 255, 255, 0.85);

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-active: #FF6B35;

  --shadow-subtle: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 10px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.08);
  --shadow-glow-orange: 0 8px 20px rgba(255, 107, 53, 0.35);
  --shadow-glow-blue: 0 8px 25px rgba(26, 54, 93, 0.3);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-full: 9999px;
  
  --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-main);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* --- Top Control Navigation Bar --- */
.top-nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
  z-index: 100;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.brand-icon {
  font-size: 20px;
}

.region-pill {
  font-size: 11px;
  background: rgba(255, 107, 53, 0.2);
  color: #FFA07A;
  border: 1px solid rgba(255, 107, 53, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.nav-actions {
  display: flex;
  gap: 12px;
}

.mode-toggle-btn, .sound-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-toggle-btn:hover, .sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* --- App Viewport & Device Chassis (Mobile / Fullscreen Switch) --- */
.app-viewport {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Mobile Simulation Chassis (Default can toggle) */
.device-chassis {
  width: 100%;
  max-width: 520px;
  height: 92vh;
  max-height: 940px;
  background: #FFFFFF;
  border-radius: 36px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.5), 0 0 0 10px #1E293B;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: max-width 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
}

.device-chassis.fullscreen-mode {
  max-width: 960px;
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

/* --- Screen Transitions --- */
.app-screen {
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: #F8FAFC;
  animation: fadeInSlide 0.3s ease forwards;
}

.app-screen.active {
  display: flex;
}

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

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--primary-blue);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.15);
  position: sticky;
  top: 0;
  z-index: 20;
}

.screen-header h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.screen-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

/* --- Screen 1: Student Onboarding Flow --- */
#screen-onboarding {
  background: linear-gradient(180deg, #1A365D 0%, #0F172A 100%);
  color: #FFFFFF;
  justify-content: center;
  padding: 24px;
}

.onboarding-card {
  background: #FFFFFF;
  color: var(--text-primary);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  max-width: 460px;
  margin: auto;
}

.logo-hero {
  text-align: center;
  margin-bottom: 22px;
}

.logo-circle {
  width: 60px;
  height: 60px;
  background: rgba(255, 107, 53, 0.12);
  border: 2px solid var(--accent-orange);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: var(--shadow-glow-orange);
}

.logo-emoji {
  font-size: 30px;
}

.app-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary-blue);
  letter-spacing: -0.5px;
}

.app-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.board-badges-preview {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.mini-badge {
  font-size: 10px;
  background: #E2E8F0;
  color: #334155;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
}

/* Form Controls */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.half-width {
  flex: 1;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.field-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  pointer-events: none;
}

.input-wrapper input, .input-wrapper select {
  width: 100%;
  padding: 12px 14px 12px 38px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 14px;
  background: #FFFFFF;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.input-wrapper select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 32px;
}

.input-wrapper input:focus, .input-wrapper select:focus {
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

.primary-cta-btn {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #E0531E 100%);
  color: #FFFFFF;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow-orange);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.primary-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 107, 53, 0.45);
}

.primary-cta-btn:active {
  transform: translateY(0);
}

/* --- Screen 2: Student Learning Hub --- */
.user-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-ring {
  width: 44px;
  height: 44px;
  background: var(--accent-orange);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  border: 2px solid #FFFFFF;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.user-welcome-text {
  font-size: 16px;
  font-weight: 700;
}

.user-meta-sub {
  font-size: 12px;
  color: #CBD5E1;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.hero-banner-card {
  background: linear-gradient(135deg, #1A365D 0%, #2563EB 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-glow-blue);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.hero-banner-card::after {
  content: '🎯';
  position: absolute;
  right: -10px;
  bottom: -15px;
  font-size: 80px;
  opacity: 0.15;
  pointer-events: none;
}

.sparkle-tag {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 4px;
}

.hero-banner-card h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}

.hero-banner-card p {
  font-size: 12px;
  color: #E2E8F0;
}

.banner-cta {
  align-self: flex-start;
  background: var(--accent-orange);
  color: #FFFFFF;
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-glow-orange);
}

.banner-cta:hover {
  transform: translateY(-2px);
  background: #FF5514;
}

/* Modules Grid */
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title-row h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-blue);
}

.pill-count {
  font-size: 11px;
  background: #E2E8F0;
  color: var(--text-secondary);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.modules-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.module-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: all 0.2s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: #CBD5E1;
}

.module-icon {
  font-size: 28px;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F1F5F9;
  flex-shrink: 0;
}

.card-teal .module-icon {
  background: rgba(0, 180, 216, 0.12);
}

.card-orange .module-icon {
  background: rgba(255, 107, 53, 0.12);
}

.card-purple .module-icon {
  background: rgba(99, 102, 241, 0.12);
}

.module-content {
  flex: 1;
}

.module-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.card-teal .module-badge { color: var(--accent-teal); }
.card-orange .module-badge { color: var(--accent-orange); }
.card-purple .module-badge { color: var(--accent-purple); }

.module-content h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.module-content p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
}

.arrow-indicator {
  color: #94A3B8;
  font-size: 18px;
  font-weight: bold;
}

/* Recent Stats Mini Row */
.recent-stats-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.recent-stats-card h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.stats-mini-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.mini-stat {
  display: flex;
  flex-direction: column;
}

.stat-num {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-blue);
}

.stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* --- AdMob Test Banner Container --- */
.admob-banner-container {
  height: 52px;
  background: #FFFBEB;
  border-top: 1px solid #FCD34D;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 11px;
  color: #92400E;
  position: relative;
  z-index: 10;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

.admob-label-tag {
  background: #D97706;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admob-ad-text {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admob-info-icon {
  font-size: 12px;
  opacity: 0.7;
}

/* --- Screen 3: Chapter Practice Engine --- */
.back-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.practice-intro-card {
  background: #FFFFFF;
  border-left: 4px solid var(--accent-teal);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  box-shadow: var(--shadow-subtle);
}

.practice-intro-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-blue);
}

.practice-intro-card p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.config-section {
  margin-bottom: 20px;
}

.config-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  margin-bottom: 10px;
}

.subject-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subject-chip {
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.subject-chip:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.subject-chip.active {
  background: #EFF6FF;
  border-color: #2563EB;
  color: #1D4ED8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Tier Cards */
.tier-cards-row {
  display: flex;
  gap: 10px;
}

.tier-card {
  flex: 1;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tier-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-subtle);
}

.tier-card.active {
  border-color: var(--accent-orange);
  background: #FFF7ED;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.tier-icon {
  font-size: 22px;
  margin-bottom: 6px;
}

.tier-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.tier-desc {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.problem-types-banner {
  background: #F1F5F9;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 22px;
}

.action-buttons-row {
  display: flex;
  gap: 12px;
}

.secondary-action-btn {
  flex: 1;
  background: #FFFFFF;
  border: 2px solid var(--accent-teal);
  color: var(--accent-teal);
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.secondary-action-btn:hover {
  background: #F0FDFA;
}

.action-buttons-row .primary-cta-btn {
  flex: 1.2;
  margin-top: 0;
}

/* --- Screen 4: Time-Based Quiz Engine --- */
.quiz-active-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: var(--primary-blue);
  color: #FFFFFF;
}

.danger-icon-btn {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #FCA5A5;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.danger-icon-btn:hover {
  background: rgba(239, 68, 68, 0.4);
  color: #FFFFFF;
}

.quiz-timer-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-orange);
  color: #FFFFFF;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 16px;
  box-shadow: var(--shadow-glow-orange);
  letter-spacing: 0.5px;
}

.quiz-timer-badge.urgent-alert {
  background: var(--danger-red);
  animation: pulseTimer 1s infinite alternate;
}

@keyframes pulseTimer {
  from { transform: scale(1); }
  to { transform: scale(1.08); box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
}

.quiz-mode-pill {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.quiz-progress-track {
  width: 100%;
  height: 6px;
  background: #E2E8F0;
}

.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-orange) 0%, #FF8C38 100%);
  transition: width 0.3s ease;
}

.quiz-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.question-counter-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-blue);
}

.tier-badge {
  font-size: 11px;
  background: #FEF3C7;
  color: #B45309;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.question-container {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.question-subject-tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-teal);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.question-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.question-type-indicator {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.option-item:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
}

.option-item.selected {
  border-color: var(--primary-blue);
  background: #EFF6FF;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.15);
}

.option-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #CBD5E1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.option-item.selected .option-radio {
  border-color: var(--primary-blue);
  background: var(--primary-blue);
}

.option-item.selected .option-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  background: #FFFFFF;
  border-radius: 50%;
}

.option-label {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  line-height: 1.35;
}

.option-item.selected .option-label {
  font-weight: 700;
  color: var(--primary-blue);
}

/* Quick Question Matrix Drawer */
.quick-nav-drawer {
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
}

.quick-nav-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
}

.matrix-bubble {
  aspect-ratio: 1;
  border-radius: 6px;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.matrix-bubble.active-bubble {
  border-color: var(--accent-orange);
  background: #FFF7ED;
  color: var(--accent-orange);
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.4);
}

.matrix-bubble.answered-bubble {
  background: #10B981;
  border-color: #059669;
  color: #FFFFFF;
}

.matrix-bubble.flagged-bubble {
  background: #F59E0B;
  border-color: #D97706;
  color: #FFFFFF;
}

/* Bottom Bar */
.quiz-bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #FFFFFF;
  border-top: 1px solid var(--border-light);
}

.nav-arrow-btn {
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-arrow-btn.primary-step {
  background: var(--primary-blue);
  border-color: var(--primary-blue);
  color: #FFFFFF;
}

.nav-arrow-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.flag-question-btn {
  background: #FEF3C7;
  border: 1px solid #FCD34D;
  color: #B45309;
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.submit-exam-btn {
  background: var(--accent-green);
  color: #FFFFFF;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  animation: pulseSubmit 1.5s infinite alternate;
}

@keyframes pulseSubmit {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

/* --- Screen 5: Results & Explanations Analytics Dashboard --- */
.score-hero-banner {
  background: linear-gradient(135deg, #0F766E 0%, #10B981 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.25);
  margin-bottom: 20px;
  position: relative;
}

.score-hero-banner.needs-practice {
  background: linear-gradient(135deg, #BE123C 0%, #F97316 100%);
  box-shadow: 0 10px 25px rgba(249, 115, 22, 0.25);
}

.score-icon-badge {
  font-size: 40px;
  margin-bottom: 4px;
}

.score-hero-banner h3 {
  font-size: 20px;
  font-weight: 800;
}

.big-score-number {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1px;
  margin: 4px 0;
}

#score-summary-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

/* 4-Metric Grid */
.results-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 22px;
}

.metric-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 12px 6px;
  text-align: center;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.metric-card.card-green { border-color: #A7F3D0; }
.metric-card.card-red { border-color: #FECDD3; }
.metric-card.card-yellow { border-color: #FDE68A; }
.metric-card.card-blue { border-color: #BAE6FD; }

.metric-icon {
  font-size: 16px;
  display: block;
  margin-bottom: 2px;
}

.metric-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.metric-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

/* Review Questions List */
.review-questions-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.review-item-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1.5px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
}

.review-item-card.is-correct {
  border-left: 5px solid var(--accent-green);
}

.review-item-card.is-incorrect {
  border-left: 5px solid var(--danger-red);
}

.review-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.status-badge.correct {
  background: #D1FAE5;
  color: #065F46;
}

.status-badge.incorrect {
  background: #FEE2E2;
  color: #991B1B;
}

.review-q-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.answers-comparison-box {
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 13px;
}

.ans-row {
  display: flex;
  gap: 8px;
}

.ans-label {
  font-weight: 700;
  min-width: 100px;
  color: var(--text-secondary);
}

.ans-val-user {
  font-weight: 700;
}

.ans-val-user.correct { color: var(--accent-green); }
.ans-val-user.incorrect { color: var(--danger-red); }

.ans-val-correct {
  color: var(--accent-green);
  font-weight: 700;
}

/* Rich-Text Code Container for Explanation */
.code-explanation-container {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: var(--radius-sm);
  padding: 12px;
  color: #E2E8F0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
}

.explanation-tag {
  color: var(--accent-yellow);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.explanation-body {
  white-space: pre-line;
  word-break: break-word;
}

.exit-review-wrapper {
  margin-top: 10px;
}

/* --- Screen 6: Competitive Leagues (Module 5) --- */
.league-hero-card {
  background: linear-gradient(135deg, #312E81 0%, #4F46E5 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.league-trophy-icon {
  font-size: 38px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.league-hero-card h4 {
  font-size: 16px;
  font-weight: 800;
}

.league-hero-card p {
  font-size: 12px;
  color: #C7D2FE;
  margin-top: 4px;
}

.competitive-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.league-track-card {
  background: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s ease;
}

.league-track-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.track-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.track-icon {
  font-size: 24px;
}

.track-title-info {
  flex: 1;
}

.track-title-info h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.track-category {
  font-size: 11px;
  color: var(--text-muted);
}

.hots-tag {
  font-size: 10px;
  font-weight: 800;
  background: #EDE9FE;
  color: #6D28D9;
  padding: 3px 8px;
  border-radius: 6px;
}

.track-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 12px;
}

.track-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #F1F5F9;
  padding-top: 10px;
}

.benchmark-pill {
  font-size: 11px;
  color: #0369A1;
  background: #E0F2FE;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

.league-enter-btn {
  background: #4F46E5;
  color: #FFFFFF;
  border: none;
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.league-enter-btn:hover {
  background: #4338CA;
  transform: translateY(-1px);
}

/* --- Modals: Abandon Quiz Safeguard --- */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease forwards;
}

.modal-backdrop.show {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-icon-alert {
  font-size: 40px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 12px;
}

.modal-cancel-btn {
  flex: 1;
  background: #F1F5F9;
  border: 1px solid #CBD5E1;
  color: var(--text-primary);
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.modal-danger-btn {
  flex: 1;
  background: var(--danger-red);
  color: #FFFFFF;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* --- AdMob Interstitial Simulator Modal --- */
.interstitial-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.interstitial-backdrop.show {
  display: flex;
}

.interstitial-container {
  background: #0F172A;
  border: 1.5px solid #334155;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.interstitial-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: #1E293B;
  border-bottom: 1px solid #334155;
}

.admob-pill {
  font-size: 11px;
  background: #D97706;
  color: #FFFFFF;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
}

.interstitial-skip-btn {
  background: #334155;
  border: 1px solid #475569;
  color: #CBD5E1;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  cursor: not-allowed;
  transition: all 0.2s;
}

.interstitial-skip-btn.ready-to-skip {
  background: #EF4444;
  color: #FFFFFF;
  border-color: #DC2626;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.interstitial-media {
  padding: 28px 24px;
  display: flex;
  justify-content: center;
}

.ad-creative-card {
  background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(59, 130, 246, 0.35);
  width: 100%;
}

.ad-sponsor-badge {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.ad-logo-icon {
  font-size: 42px;
  margin-bottom: 6px;
}

.ad-creative-card h4 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 8px;
}

.ad-creative-card p {
  font-size: 13px;
  color: #E2E8F0;
  line-height: 1.4;
  margin-bottom: 16px;
}

.ad-interactive-demo {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 18px;
}

.ad-cta-btn {
  background: var(--accent-orange);
  color: #FFFFFF;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-glow-orange);
}

.interstitial-footer {
  padding: 8px 16px;
  background: #090D16;
  font-size: 10px;
  color: #64748B;
  text-align: center;
  font-family: var(--font-mono);
}

/* Celebration Confetti Canvas */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
}
