/**
 * HabitFlow - Design System & CSS Variables
 * Centralized design tokens for colors, typography, radii, and shadows.
 * Supports light mode and dark mode via [data-theme="dark"].
 */

:root {
  /* Brand & Primary Hues */
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: #ecfdf5;
  --primary-glow: rgba(16, 185, 129, 0.2);

  /* Light Theme Canvas & Surfaces */
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-secondary: #f1f5f9;
  --surface-elevated: #ffffff;
  --surface-muted: #e2e8f0;

  /* Typography Colors */
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-on-primary: #ffffff;

  /* Borders & Dividers */
  --border: #e2e8f0;
  --border-focus: #10b981;

  /* State & Semantic Colors */
  --success: #10b981;
  --success-light: #ecfdf5;
  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --info: #3b82f6;
  --info-light: #eff6ff;

  /* Radii Scale */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Shadow Scale (Subtle, mathematical elevation) */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.03);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-phone: 0 25px 50px -12px rgba(15, 23, 42, 0.18);

  /* Spacing Scale */
  --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;
  --space-20: 80px;

  /* Typography Stack */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Mobile Safe Areas */
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  /* Touch Targets */
  --touch-target-min: 44px;
}

/* Dark Theme Variables */
[data-theme="dark"] {
  --primary: #10b981;
  --primary-dark: #059669;
  --primary-light: rgba(16, 185, 129, 0.15);
  --primary-glow: rgba(16, 185, 129, 0.3);

  --background: #090d16;
  --surface: #111827;
  --surface-secondary: #1e293b;
  --surface-elevated: #1e293b;
  --surface-muted: #334155;

  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --text-on-primary: #ffffff;

  --border: #1e293b;
  --border-focus: #10b981;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-phone: 0 25px 50px -12px rgba(0, 0, 0, 0.85);

  --success-light: rgba(16, 185, 129, 0.18);
  --warning-light: rgba(245, 158, 11, 0.18);
  --danger-light: rgba(239, 68, 68, 0.18);
  --info-light: rgba(59, 130, 246, 0.18);
}
