/**
 * ImPax Platform v3.0 - Theme Variables
 * Centralized design tokens for consistent styling
 */

:root {
  /* ============================================
     AVIATION CONTROL TOWER DESIGN SYSTEM
     ============================================ */

  /* Color Palette - Primary (Softer Radar Green) */
  --color-primary: #10b981;
  --color-primary-hover: #059669;
  --color-primary-light: #34d399;
  --color-primary-dark: #047857;
  --color-primary-glow: rgba(16, 185, 129, 0.35);

  /* Color Palette - Accent (Cyan for data) */
  --color-accent: #00d4ff;
  --color-accent-hover: #00b8e6;

  /* Color Palette - Aviation Status Colors */
  --color-success: #10b981;           /* All clear */
  --color-warning: #f59e0b;           /* Amber alert */
  --color-error: #ef4444;             /* Red alert */
  --color-info: #06b6d4;              /* Info cyan */
  --color-caution: #f97316;           /* Orange warning */

  /* Color Palette - Deep Navy Neutrals */
  --color-bg-primary: #0a0f1a;        /* Deepest background */
  --color-bg-secondary: #111827;      /* Cards, panels */
  --color-bg-tertiary: #1a2332;       /* Elevated elements */
  --color-bg-card: #111827;
  --color-bg-elevated: #1a2332;

  --color-text-primary: #f0f4f8;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;

  --color-border: rgba(16, 185, 129, 0.12);
  --color-border-light: rgba(16, 185, 129, 0.2);
  --color-border-solid: #1e2d3d;

  /* Data Visualization Palette */
  --color-data-1: #06b6d4;            /* Cyan */
  --color-data-2: #10b981;            /* Green */
  --color-data-3: #f59e0b;            /* Amber */
  --color-data-4: #ec4899;            /* Pink */
  --color-data-5: #8b5cf6;            /* Violet */
  --color-data-6: #f97316;            /* Orange */

  /* Typography - Aviation Control Tower */
  --font-family: 'DM Sans', 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'DM Sans', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;
  --font-mono: 'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace;

  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 64px;
  --chat-panel-width: 380px;
  --header-height: 64px;

  /* Z-Index Scale */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-tooltip: 400;
  --z-toast: 500;

  /* Aliases for components that reference alternate names */
  --color-surface: var(--color-bg-card);
  --color-background: var(--color-bg-primary);
  --color-hover: var(--color-bg-tertiary);
  --color-text: var(--color-text-primary);
}

/* Dark Mode Overrides (default - Control Tower theme) */
[data-theme="dark"] {
  --color-bg-primary: #0a0f1a;
  --color-bg-secondary: #111827;
  --color-bg-tertiary: #1a2332;
  --color-bg-card: #111827;
  --color-text-primary: #f0f4f8;
  --color-text-secondary: #94a3b8;
}

/* Light Mode */
[data-theme="light"] {
  --color-bg-primary: #f8fafc;
  --color-bg-secondary: #f1f5f9;
  --color-bg-tertiary: #e2e8f0;
  --color-bg-card: #ffffff;
  --color-text-primary: #0f172a;
  --color-text-secondary: #475569;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-light: #cbd5e1;

  /* Shadows for light mode - slightly more visible for card separation */
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.06);
}

/* Apply shadow to cards in light mode */
[data-theme="light"] .card,
[data-theme="light"] .metric-card {
  box-shadow: var(--shadow-card);
}

/* Keep sidebar dark in light mode for better contrast */
[data-theme="light"] .nav-sidebar {
  --color-bg-secondary: #1e293b;
  --color-bg-tertiary: #334155;
  --color-text-primary: #f8fafc;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-border: #334155;
  --color-border-light: #475569;
}

/* Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border-light);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background-color: var(--color-primary);
  color: white;
}
