/* LocalJam - Extreme Minimalist & Colorblind-Safe Design Tokens */
:root {
  color-scheme: light dark;
  /* Surface & Background (Deep Matte Slate Hierarchy) */
  --bg-base: #0a0e17;
  --bg-surface: #111827;
  --bg-surface-elevated: #1a2333;
  --bg-surface-hover: #222e44;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.15);

  /* Typography */
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #64748b;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* Colorblind-Safe Accessible Accents (Double Coded) */
  --accent-cyan: #38bdf8;        /* Focus rings, primary buttons, seek slider, active highlights */
  --accent-blue: #0072B2;        /* Primary contrast cobalt blue */
  --accent-amber: #fbbf24;       /* Star favorites, warnings, cautionary state */
  --accent-rose: #f43f5e;        /* Missing files, errors, destructive actions */
  --accent-purple: #a855f7;      /* Playing indicators, visualizer, audio badges */

  /* Semantic Status Aliases */
  --status-available: var(--accent-blue);   /* [AVAILABLE] / [PASS] */
  --status-warn: var(--accent-amber);       /* [WARN] / [RECONNECT] */
  --status-missing: var(--accent-rose);     /* [MISSING] / [FAIL] */
  --primary-color: var(--accent-cyan);
  --surface-bg: var(--bg-surface-elevated);
  --status-success: var(--status-available);
  --status-error: var(--status-missing);

  /* Dimensions & Spacing */
  --stage-max: 420px;
  --sheet-max: 720px;
  --row-h: 48px;
  --row-h-coarse: 52px;
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Glassmorphism & Translucency */
  --backdrop-blur: 20px;
  --backdrop-blur-sm: 10px;
  --surface-glass: rgba(17, 24, 39, 0.88);
  --player-glass: rgba(10, 14, 23, 0.94);
  --modal-backdrop-glass: rgba(4, 7, 13, 0.78);

  /* Tactile Shadows & Glows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px -1px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 16px 32px -4px rgba(0, 0, 0, 0.65), 0 6px 12px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow-cyan: 0 0 16px -2px rgba(56, 189, 248, 0.35);
  --shadow-glow-amber: 0 0 14px -2px rgba(251, 191, 36, 0.35);
}

/* Screen-Reader Only Utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Light Theme Overrides */
html[data-theme="light"] {
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.18);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --surface-glass: rgba(255, 255, 255, 0.92);
  --player-glass: rgba(248, 250, 252, 0.96);
  --overlay-scrim: rgba(255, 255, 255, 0.6);
  
  /* Retain accessible accents */
  --accent-cyan: #0284c7;  /* Slightly darker for light mode contrast */
  --accent-amber: #d97706; /* Darker amber */
  --status-warn: #D55E00;  /* Orange */
}

@media (prefers-color-scheme: light) {
  html:not([data-theme="dark"]) {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-surface-hover: #e2e8f0;
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.18);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --surface-glass: rgba(255, 255, 255, 0.92);
    --player-glass: rgba(248, 250, 252, 0.96);
    --overlay-scrim: rgba(255, 255, 255, 0.6);
    
    --accent-cyan: #0284c7;
    --accent-amber: #d97706;
    --status-warn: #D55E00;
  }
}
