/* ==========================================================================
   ExamKru Unified Design System (theme.css)
   Desktop-first clarity + Mobile-friendly ergonomics
   Palette: Crisp Royal Blue / Indigo + Cool Slate (aligned with ExamKru brand)
   ========================================================================== */

:root {
  /* Brand & Accent */
  --ek-primary: #2563eb;
  --ek-primary-hover: #1d4ed8;
  --ek-primary-active: #1e40af;
  --ek-primary-soft: #eff6ff;
  --ek-primary-ring: rgba(37, 99, 235, 0.22);

  --ek-indigo: #4f46e5;
  --ek-indigo-soft: #eef2ff;

  --ek-accent: #f59e0b;
  --ek-accent-hover: #d97706;
  --ek-accent-soft: #fffbeb;

  /* Semantic */
  --ek-success: #059669;
  --ek-success-soft: #ecfdf5;
  --ek-success-border: #a7f3d0;

  --ek-warning: #d97706;
  --ek-warning-soft: #fffbeb;
  --ek-warning-border: #fde68a;

  --ek-danger: #dc2626;
  --ek-danger-soft: #fef2f2;
  --ek-danger-border: #fecaca;

  /* Neutrals */
  --ek-slate-950: #020617;
  --ek-slate-900: #0f172a;
  --ek-slate-800: #1e293b;
  --ek-slate-700: #334155;
  --ek-slate-600: #475569;
  --ek-slate-500: #64748b;
  --ek-slate-400: #94a3b8;
  --ek-slate-300: #cbd5e1;
  --ek-slate-200: #e2e8f0;
  --ek-slate-100: #f1f5f9;
  --ek-slate-50: #f8fafc;

  /* Surfaces & Text */
  --ek-bg: #f1f5f9;
  --ek-surface: #ffffff;
  --ek-surface-subtle: #f8fafc;
  --ek-border: #e2e8f0;
  --ek-border-strong: #cbd5e1;
  --ek-text: #0f172a;
  --ek-text-secondary: #334155;
  --ek-text-muted: #64748b;

  /* Radii */
  --ek-radius-sm: 8px;
  --ek-radius-md: 12px;
  --ek-radius-lg: 16px;
  --ek-radius-xl: 22px;
  --ek-radius-full: 9999px;

  /* Elevation */
  --ek-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --ek-shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
  --ek-shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 3px 8px -3px rgba(15, 23, 42, 0.04);
  --ek-shadow-lg: 0 20px 35px -8px rgba(15, 23, 42, 0.14), 0 8px 14px -6px rgba(15, 23, 42, 0.06);

  /* Safe-area insets for mobile devices with notches / home indicators */
  --ek-safe-top: env(safe-area-inset-top, 0px);
  --ek-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ek-safe-left: env(safe-area-inset-left, 0px);
  --ek-safe-right: env(safe-area-inset-right, 0px);
}

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

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

/* Tabular figures for timers, scores, and live counters (prevents layout jitter) */
.tabular-nums,
#timerDisplay,
.timer-badge,
.stat-value,
.stat-number,
.card-live-score {
  font-variant-numeric: tabular-nums;
}

/* Crisp accessible focus rings for keyboard navigation */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ek-primary);
  outline-offset: 2px;
}

/* Prevent accidental horizontal overflow on mobile */
html, body {
  overflow-x: clip;
}

/* Respect user motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
