/* ============================================
   COMMUNITY HEALTH INTELLIGENCE DESIGN SYSTEM
   ============================================
   Professional, high-contrast, accessible
   Healthcare executive & scientist focused
   WCAG AAA compliant color system
   ============================================ */

/* ============================================
   COLOR PALETTE - Professional Healthcare
   ============================================ */
:root {
  /* Primary - Professional Blue (Trust, Healthcare) */
  --color-primary-900: #002855;
  --color-primary-800: #003d7a;
  --color-primary-700: #0052a0;
  --color-primary-600: #0066cc;
  --color-primary-500: #007bff;
  /* Main blue */
  --color-primary-400: #3395ff;
  --color-primary-300: #66b0ff;
  --color-primary-200: #99caff;
  --color-primary-100: #cce5ff;

  /* Secondary - Teal (Clinical, Data) */
  --color-secondary-900: #003d3d;
  --color-secondary-800: #005757;
  --color-secondary-700: #007272;
  --color-secondary-600: #008c8c;
  --color-secondary-500: #00a3bf;
  /* Main teal */
  --color-secondary-400: #33b5cc;
  --color-secondary-300: #66c7d9;
  --color-secondary-200: #99d9e6;
  --color-secondary-100: #ccecf2;

  /* Accent - Warm Orange (Action, Focus) */
  --color-accent-900: #8c2800;
  --color-accent-800: #b33600;
  --color-accent-700: #d94400;
  --color-accent-600: #ff5200;
  --color-accent-500: #ff6b35;
  /* Main orange */
  --color-accent-400: #ff8c5c;
  --color-accent-300: #ffad85;
  --color-accent-200: #ffcdad;
  --color-accent-100: #ffeed6;

  /* Neutral - Professional Grays (High Contrast) */
  --color-neutral-900: #0a0e17;
  --color-neutral-800: #111827;
  --color-neutral-700: #374151;
  --color-neutral-600: #4b5563;
  --color-neutral-500: #6b7280;
  --color-neutral-400: #9ca3af;
  --color-neutral-300: #d1d5db;
  --color-neutral-200: #e5e7eb;
  --color-neutral-100: #f3f4f6;
  --color-neutral-50: #f9fafb;

  /* Semantic colors */
  --color-success: #10b981;
  --color-success-light: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-light: #fef3c7;
  --color-error: #ef4444;
  --color-error-light: #fee2e2;
  --color-info: #3b82f6;
  --color-info-light: #dbeafe;
}

/* ============================================
   GLASSMORPHISM EFFECTS
   ============================================ */
:root {
  /* Glass surface layers */
  --glass-background: rgb(255 255 255 / 5%);
  --glass-background-hover: rgb(255 255 255 / 8%);
  --glass-background-strong: rgb(255 255 255 / 12%);
  --glass-border: rgb(255 255 255 / 15%);
  --glass-border-strong: rgb(255 255 255 / 25%);

  /* Blur effects */
  --blur-xs: 4px;
  --blur-sm: 8px;
  --blur-md: 16px;
  --blur-lg: 24px;
  --blur-xl: 40px;

  /* Shadow layers */
  --shadow-glass-sm: 0 4px 16px rgb(0 0 0 / 12%);
  --shadow-glass-md: 0 8px 32px rgb(0 0 0 / 18%);
  --shadow-glass-lg: 0 16px 48px rgb(0 0 0 / 25%);
  --shadow-glass-xl: 0 24px 64px rgb(0 0 0 / 32%);

  /* Glow effects */
  --glow-primary: 0 0 20px rgb(0 102 204 / 40%);
  --glow-secondary: 0 0 20px rgb(0 163 191 / 40%);
  --glow-accent: 0 0 20px rgb(255 107 53 / 40%);
}

/* ============================================
   SPACING SCALE
   ============================================ */
:root {
  --space-1: 0.25rem;
  /* 4px */
  --space-2: 0.5rem;
  /* 8px */
  --space-3: 0.75rem;
  /* 12px */
  --space-4: 1rem;
  /* 16px */
  --space-5: 1.25rem;
  /* 20px */
  --space-6: 1.5rem;
  /* 24px */
  --space-8: 2rem;
  /* 32px */
  --space-10: 2.5rem;
  /* 40px */
  --space-12: 3rem;
  /* 48px */
  --space-16: 4rem;
  /* 64px */
  --space-20: 5rem;
  /* 80px */
  --space-24: 6rem;
  /* 96px */
  --space-32: 8rem;
  /* 128px */
  --space-40: 10rem;
  /* 160px */
}

/* ============================================
   TYPOGRAPHY SYSTEM
   ============================================ */
:root {
  /* Font families */
  --font-display:
    "Inter", -apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", sans-serif;
  --font-body:
    "Inter", -apple-system, blinkmacsystemfont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", sans-serif;
  --font-mono: "Fira Code", "Courier New", monospace;

  /* Font sizes */
  --text-xs: 0.75rem;
  /* 12px */
  --text-sm: 0.875rem;
  /* 14px */
  --text-base: 1rem;
  /* 16px */
  --text-lg: 1.125rem;
  /* 18px */
  --text-xl: 1.25rem;
  /* 20px */
  --text-2xl: 1.5rem;
  /* 24px */
  --text-3xl: 1.875rem;
  /* 30px */
  --text-4xl: 2.25rem;
  /* 36px */
  --text-5xl: 3rem;
  /* 48px */
  --text-6xl: 3.75rem;
  /* 60px */
  --text-7xl: 4.5rem;
  /* 72px */
  --text-8xl: 6rem;
  /* 96px */

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Font weights */
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;
  --font-black: 900;

  /* Letter spacing */
  --tracking-tighter: -0.05em;
  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.025em;
  --tracking-wider: 0.05em;
  --tracking-widest: 0.1em;
}

/* ============================================
   BORDER RADIUS
   ============================================ */
:root {
  --radius-none: 0;
  --radius-sm: 0.25rem;
  /* 4px */
  --radius-base: 0.5rem;
  /* 8px */
  --radius-md: 0.75rem;
  /* 12px */
  --radius-lg: 1rem;
  /* 16px */
  --radius-xl: 1.5rem;
  /* 24px */
  --radius-2xl: 2rem;
  /* 32px */
  --radius-full: 9999px;
}

/* ============================================
   TRANSITIONS & ANIMATIONS
   ============================================ */
:root {
  /* Durations */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 350ms;
  --duration-slower: 500ms;

  /* Easing functions */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ============================================
   Z-INDEX LAYERS
   ============================================ */
:root {
  --z-base: 0;
  --z-dropdown: 1000;
  --z-sticky: 1100;
  --z-fixed: 1200;
  --z-modal-backdrop: 1300;
  --z-modal: 1400;
  --z-popover: 1500;
  --z-tooltip: 1600;
}

/* ============================================
   LAYOUT CONSTRAINTS
   ============================================ */
:root {
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  --content-width: 1200px;
  --content-width-narrow: 800px;
  --content-width-wide: 1400px;
}

/* ============================================
   GRADIENTS
   ============================================ */
:root {
  /* Primary gradients */
  --gradient-primary: linear-gradient(135deg,
      var(--color-primary-600) 0%,
      var(--color-primary-400) 100%);
  --gradient-primary-radial: radial-gradient(circle,
      var(--color-primary-600) 0%,
      var(--color-primary-800) 100%);

  /* Secondary gradients */
  --gradient-secondary: linear-gradient(135deg,
      var(--color-secondary-600) 0%,
      var(--color-secondary-400) 100%);
  --gradient-secondary-radial: radial-gradient(circle,
      var(--color-secondary-600) 0%,
      var(--color-secondary-800) 100%);

  /* Accent gradients */
  --gradient-accent: linear-gradient(135deg,
      var(--color-accent-600) 0%,
      var(--color-accent-400) 100%);

  /* Mixed gradients */
  --gradient-hero: linear-gradient(135deg,
      var(--color-primary-900) 0%,
      var(--color-primary-700) 50%,
      var(--color-secondary-700) 100%);
  --gradient-card: linear-gradient(135deg, rgb(0 102 204 / 10%) 0%, rgb(0 163 191 / 10%) 100%);

  /* Overlay gradients */
  --gradient-overlay-dark: linear-gradient(180deg, rgb(0 0 0 / 0%) 0%, rgb(0 0 0 / 80%) 100%);
  --gradient-overlay-light: linear-gradient(180deg,
      rgb(255 255 255 / 0%) 0%,
      rgb(255 255 255 / 80%) 100%);
}

/* ============================================
   GLOBAL BASE STYLES
   ============================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--text-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-neutral-50);
  background: var(--color-neutral-900);
  background-image: var(--gradient-hero);
  background-attachment: fixed;
  min-height: 100vh;
}

/* ============================================
   LIGHT THEME OVERRIDES
   ============================================ */
[data-theme="light"] {
  /* Swap neutral scale for readability on light */
  --color-neutral-50: #111827;
  --color-neutral-100: #1f2937;
  --color-neutral-200: #374151;
  --color-neutral-300: #4b5563;
  --color-neutral-400: #6b7280;
  --color-neutral-500: #9ca3af;
  --color-neutral-600: #d1d5db;
  --color-neutral-700: #e5e7eb;
  --color-neutral-800: #f3f4f6;
  --color-neutral-900: #f9fafb;

  /* Softer glass on light backgrounds */
  --glass-background: rgb(0 0 0 / 4%);
  --glass-background-hover: rgb(0 0 0 / 7%);
  --glass-background-strong: rgb(0 0 0 / 10%);
  --glass-border: rgb(0 0 0 / 12%);
  --glass-border-strong: rgb(0 0 0 / 20%);

  /* Gradients tuned for light */
  --gradient-hero: linear-gradient(135deg,
      rgb(204 229 255 / 90%) 0%,
      rgb(204 236 242 / 90%) 100%);
}

[data-theme="light"] body {
  color: var(--color-neutral-50);
  /* Light mode: clean white or softly faded */
  background: #ffffff;
  background-image: none;
}

/* ============================================
   UTILITY CLASSES - GLASS EFFECTS
   ============================================ */
.glass-surface {
  background: var(--glass-background);
  backdrop-filter: blur(var(--blur-md));
  backdrop-filter: blur(var(--blur-md));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass-md);
}

.glass-surface-strong {
  background: var(--glass-background-strong);
  backdrop-filter: blur(var(--blur-lg));
  backdrop-filter: blur(var(--blur-lg));
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow-glass-lg);
}

.glass-surface:hover {
  background: var(--glass-background-hover);
  border-color: var(--glass-border-strong);
  transform: translateY(-2px);
  transition: all var(--duration-base) var(--ease-out);
}

/* ============================================
   UTILITY CLASSES - GLOW EFFECTS
   ============================================ */
.glow-primary {
  box-shadow: var(--glow-primary);
}

.glow-secondary {
  box-shadow: var(--glow-secondary);
}

.glow-accent {
  box-shadow: var(--glow-accent);
}

/* ============================================
   UTILITY CLASSES - TEXT
   ============================================ */
.text-gradient-primary {
  background: var(--gradient-primary);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-secondary {
  background: var(--gradient-secondary);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   UTILITY CLASSES - ANIMATIONS
   ============================================ */
.transition-base {
  transition: all var(--duration-base) var(--ease-out);
}

.transition-fast {
  transition: all var(--duration-fast) var(--ease-out);
}

.transition-slow {
  transition: all var(--duration-slow) var(--ease-out);
}

/* Hover lift effect */
.hover-lift {
  transition: transform var(--duration-base) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* Focus visible styles */
*:focus-visible {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   RESPONSIVE BREAKPOINTS
   ============================================ */

/*
  Mobile-first approach:
  - Default styles: < 640px (mobile)
  - @media (min-width: 640px): sm (tablet)
  - @media (min-width: 768px): md (tablet landscape)
  - @media (min-width: 1024px): lg (desktop)
  - @media (min-width: 1280px): xl (large desktop)
  - @media (min-width: 1536px): 2xl (extra large)
*/
