/* TidalCurrentChart Design System Tokens
 * Based on ui-ux-pro-max: Minimalism & Swiss Style + ECDIS Marine Telemetry
 * Light & Dark modes paired with >= 4.5:1 WCAG AA contrast
 */

:root {
  /* Semantic Color Tokens - Light Mode (Daylight Chart) */
  --color-primary: #1D4ED8;
  --color-primary-hover: #1E40AF;
  --color-on-primary: #FFFFFF;
  --color-secondary: #0369A1;
  --color-on-secondary: #FFFFFF;
  --color-accent: #C2410C;
  --color-accent-soft: #FFEDD5;
  --color-on-accent: #FFFFFF;

  --color-background: #F8FAFC;
  --color-surface: #FFFFFF;
  --color-surface-alt: #F1F5F9;
  --color-foreground: #0F172A;
  --color-muted-foreground: #475569;
  --color-border: #CBD5E1;
  --color-border-subtle: #E2E8F0;

  --color-success: #047857;
  --color-success-bg: #ECFDF5;
  --color-warning: #B45309;
  --color-warning-bg: #FFFBEB;
  --color-destructive: #B91C1C;
  --color-destructive-bg: #FEF2F2;

  /* Chart Series Tokens (Accessible distinct hues) */
  --chart-tide: #1D4ED8;
  --chart-tide-fill: rgba(29, 78, 216, 0.14);
  --chart-current-flood: #0F766E;
  --chart-current-ebb: #C2410C;
  --chart-observed: #047857;
  --chart-grid: #E2E8F0;
  --chart-axis: #475569;

  /* Focus Ring */
  --color-ring: #2563EB;
  --ring-offset: #F8FAFC;

  /* Typography - Zero external CDN dependency, crisp technical stack */
  --font-sans: "Fira Sans", "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Fira Code", "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type Scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;

  /* Spacing Scale (8px rhythm, Density 7/10) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Radii & Elevation */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12);

  /* Z-index Scale */
  --z-base: 0;
  --z-sticky: 20;
  --z-header: 40;
  --z-drawer: 80;
  --z-modal: 100;
  --z-toast: 200;

  /* Motion Tokens */
  --dur-fast: 150ms;
  --dur-base: 220ms;
  --dur-slow: 340ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Layout */
  --container-max: 1280px;
  --header-height: 64px;
}

[data-theme="dark"] {
  --color-primary: #60A5FA;
  --color-primary-hover: #93C5FD;
  --color-on-primary: #0B1120;
  --color-secondary: #38BDF8;
  --color-on-secondary: #0B1120;
  --color-accent: #FB923C;
  --color-accent-soft: rgba(251, 146, 60, 0.16);
  --color-on-accent: #0B1120;

  --color-background: #0B1120;
  --color-surface: #111C33;
  --color-surface-alt: #172542;
  --color-foreground: #F1F5F9;
  --color-muted-foreground: #94A3B8;
  --color-border: #2A3B5E;
  --color-border-subtle: #1E2D4A;

  --color-success: #34D399;
  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning: #FBBF24;
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-destructive: #F87171;
  --color-destructive-bg: rgba(239, 68, 68, 0.15);

  --chart-tide: #60A5FA;
  --chart-tide-fill: rgba(96, 165, 250, 0.18);
  --chart-current-flood: #2DD4BF;
  --chart-current-ebb: #FB923C;
  --chart-observed: #34D399;
  --chart-grid: #1E2D4A;
  --chart-axis: #94A3B8;

  --color-ring: #60A5FA;
  --ring-offset: #0B1120;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 14px 32px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}
