/* ═══════════════════════════════════════
   DriveScore — Global Stylesheet
   Supplements Tailwind utility classes
═══════════════════════════════════════ */

/* ── Custom font smoothing ── */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Smooth scrolling ── */
html { scroll-behavior: smooth; }

/* ── Brand shadow helper ── */
.shadow-brand {
  box-shadow: 0 8px 28px rgba(255, 214, 0, 0.28);
}

/* ── Section label badge ── */
.section-badge {
  display: inline-block;
  background: #1c1900;
  border: 1px solid #3a3200;
  color: #FFD600;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 10px;
}

/* ── Section title & sub ── */
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 8px;
}
.section-sub {
  color: #aaa;
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 560px;
}

/* ── Feature card ── */
.feat-card {
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: border-color 0.2s;
}
.feat-card:hover { border-color: rgba(255,214,0,0.25); }
.feat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #1c1900;
  border: 1px solid #3a3200;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Demo option (sample questions) ── */
.demo-opt {
  background: #1a1a1a;
  border: 1.5px solid #2e2e2e;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 0.78rem;
  color: #aaa;
  cursor: not-allowed;
  user-select: none;
}
.correct-demo {
  border-color: #2ecc40;
  background: #001a06;
  color: #2ecc40;
}

/* ── FORM styles ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 0.72rem;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}
.form-input {
  width: 100%;
  background: #111;
  border: 1.5px solid #333;
  border-radius: 9px;
  padding: 11px 13px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: #FFD600; }
.form-input.error { border-color: #ff3b30; }
.form-error {
  color: #ff6b6b;
  font-size: 0.72rem;
  margin-top: 4px;
  font-weight: 600;
}

/* ── Question count button ── */
.qcount-btn {
  flex: 1;
  background: #111;
  border: 1.5px solid #333;
  color: #888;
  border-radius: 8px;
  padding: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  transition: all 0.2s;
}
.qcount-btn.active {
  background: #1c1900;
  border-color: #FFD600;
  color: #FFD600;
  font-weight: 800;
}

/* ── Quiz option button ── */
.option-btn {
  width: 100%;
  background: #1a1a1a;
  border: 1.5px solid #2e2e2e;
  border-radius: 9px;
  padding: 12px 14px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  color: #fff;
  transition: all 0.18s;
}
.option-btn:hover:not(.disabled) {
  border-color: #FFD600;
  background: #1c1900;
}
.option-btn.correct {
  border-color: #2ecc40;
  background: #001a06;
  color: #2ecc40;
}
.option-btn.wrong {
  border-color: #ff3b30;
  background: #1a0000;
  color: #ff6b6b;
}
.option-btn.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── Spinner ── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,214,0,0.15);
  border-top-color: #FFD600;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Fade-in animation ── */
.animate-fadein {
  animation: fadeIn 0.4s ease both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Utility helpers ── */
/* NOTE: Do NOT define .hidden here — Tailwind CDN provides it.
   A custom .hidden would override Tailwind's responsive variants
   like "hidden md:flex" and break the desktop navbar. */


/* ══════════════════════════════════════════════
  7 CATEGORY BADGE COLORS
  Used in quiz question tag + result breakdown
══════════════════════════════════════════════ */

/* 🚦 Signals & Signs — Yellow */
.cat-badge-signals-signs {
  background: rgba(255,214,0,0.12); color: #FFD600;
  border: 1px solid rgba(255,214,0,0.3);
}
/* 📋 Rules & Laws — Green */
.cat-badge-rules-laws {
  background: rgba(46,204,64,0.1); color: #2ecc40;
  border: 1px solid rgba(46,204,64,0.3);
}
/* 🛣️ Situations & Hazards — Blue */
.cat-badge-situations-hazards {
  background: rgba(90,200,250,0.1); color: #5ac8fa;
  border: 1px solid rgba(90,200,250,0.3);
}
/* 🌦️ Weather & Conditions — Cyan */
.cat-badge-weather-conditions {
  background: rgba(0,210,211,0.1); color: #00d2d3;
  border: 1px solid rgba(0,210,211,0.3);
}
/* 🧠 Psychology & Behavior — Purple */
.cat-badge-psychology-behavior {
  background: rgba(175,82,222,0.12); color: #bf5af2;
  border: 1px solid rgba(175,82,222,0.3);
}
/* 🚨 Emergency & Safety — Red */
.cat-badge-emergency-safety {
  background: rgba(255,59,48,0.1); color: #ff6b6b;
  border: 1px solid rgba(255,59,48,0.3);
}
/* 🔧 Vehicle & Mechanical — Orange */
.cat-badge-vehicle-mechanical {
  background: rgba(255,149,0,0.1); color: #ff9500;
  border: 1px solid rgba(255,149,0,0.3);
}

/* ── Category progress bar fill colors ── */
.cat-bar-signals-signs    { background: #FFD600; }
.cat-bar-rules-laws       { background: #2ecc40; }
.cat-bar-situations-hazards { background: #5ac8fa; }
.cat-bar-weather-conditions { background: #00d2d3; }
.cat-bar-psychology-behavior { background: #bf5af2; }
.cat-bar-emergency-safety { background: #ff6b6b; }
.cat-bar-vehicle-mechanical { background: #ff9500; }

/* ══════════════════════════════════════════════
   SCROLL-REVEAL ANIMATIONS
   Triggered by IntersectionObserver in app.js
══════════════════════════════════════════════ */

/* Base reveal — fade up */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Reveal from left */
.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Reveal scale up */
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-scale.active {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays for grid children */
.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }
.stagger-5 { transition-delay: 0.40s; }
.stagger-6 { transition-delay: 0.48s; }
.stagger-7 { transition-delay: 0.56s; }
.stagger-8 { transition-delay: 0.64s; }


/* ══════════════════════════════════════════════
   SVG ICON CONTAINERS
══════════════════════════════════════════════ */

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 16px;
}

.icon-box svg {
  width: 22px;
  height: 22px;
}

/* How It Works step icon */
.step-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
  background: rgba(255, 214, 0, 0.1);
  border: 1px solid rgba(255, 214, 0, 0.2);
}

.step-icon svg {
  width: 24px;
  height: 24px;
}

/* Feature icon override */
.feat-icon svg {
  width: 20px;
  height: 20px;
}


/* ══════════════════════════════════════════════
   HERO SCORE COUNTER GLOW
══════════════════════════════════════════════ */

.score-glow {
  text-shadow: 0 0 20px rgba(255, 214, 0, 0.4),
               0 0 40px rgba(255, 214, 0, 0.15);
}