/**
 * The Fallback v2 - Design Tokens
 * Light mode color palette with CSS custom properties
 */

:root {
  /* ═══════════════════════════════════════════════════════════════════════════
     BRAND COLORS - Light Mode
     ═══════════════════════════════════════════════════════════════════════════ */
  
  /* Primary palette */
  --color-base: #f4f1eb;           /* Warm cream background */
  --color-surface: #ffffff;         /* Cards, panels */
  --color-surface-alt: #f8f6f2;     /* Slightly darker surface */
  --color-primary: #2d5a47;         /* Deep forest green */
  --color-primary-light: #3d7a5f;   /* Lighter primary for hover */
  --color-primary-muted: rgba(45, 90, 71, 0.1);
  --color-accent: #c9a45c;          /* Golden amber */
  --color-accent-light: #d4b574;    /* Lighter accent for hover */
  --color-accent-muted: rgba(201, 164, 92, 0.15);
  
  /* Text colors */
  --color-text: #1a1f1e;            /* Primary text */
  --color-text-secondary: #5a6360;  /* Secondary text */
  --color-text-muted: #8b9a91;      /* Muted/hint text */
  --color-text-inverse: #f4f1eb;    /* Text on dark backgrounds */
  
  /* Semantic colors */
  --color-success: #2d5a47;
  --color-success-light: #e8f5e9;
  --color-warning: #e65100;
  --color-warning-light: #fff3e0;
  --color-error: #c62828;
  --color-error-light: #ffebee;
  --color-info: #1976d2;
  --color-info-light: #e3f2fd;
  
  /* UI colors */
  --color-border: #e8e4dc;
  --color-border-light: #f0ece4;
  --color-divider: rgba(0, 0, 0, 0.06);
  --color-overlay: rgba(0, 0, 0, 0.5);
  --color-backdrop: rgba(26, 31, 30, 0.7);
  
  /* Map marker colors */
  --color-marker-default: #2d5a47;
  --color-marker-current: #3498db;
  --color-marker-backup: #f59e0b;
  --color-route: #B855D3;
  
  /* ═══════════════════════════════════════════════════════════════════════════
     TYPOGRAPHY
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-family-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  
  /* Font sizes */
  --text-xs: 10px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  
  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Line heights */
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;
  
  /* ═══════════════════════════════════════════════════════════════════════════
     SPACING
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --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;
  
  /* ═══════════════════════════════════════════════════════════════════════════
     BORDERS & RADII
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* ═══════════════════════════════════════════════════════════════════════════
     SHADOWS
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-float: 0 4px 20px rgba(0, 0, 0, 0.15);
  
  /* ═══════════════════════════════════════════════════════════════════════════
     TRANSITIONS
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-bounce: 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* ═══════════════════════════════════════════════════════════════════════════
     Z-INDEX SCALE
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --z-base: 0;
  --z-map: 1;
  --z-controls: 100;
  --z-header: 200;
  --z-nav: 300;
  --z-panel: 400;
  --z-drawer: 500;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 1100;
  
  /* ═══════════════════════════════════════════════════════════════════════════
     SAFE AREAS (iOS notch, etc.)
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  
  /* ═══════════════════════════════════════════════════════════════════════════
     LAYOUT CONSTANTS
     ═══════════════════════════════════════════════════════════════════════════ */
  
  --header-height: 56px;
  --nav-height: 72px;
  --nav-height-mobile: calc(72px + var(--safe-bottom));
  --sidebar-width: 72px;
  --panel-width: 320px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root.auto-theme {
    --color-base: #1a1f1e;
    --color-surface: #2d3b36;
    --color-surface-alt: #243029;
    --color-text: #f4f1eb;
    --color-text-secondary: #a8b5ae;
    --color-text-muted: #8b9a91;
    --color-text-inverse: #1a1f1e;
    --color-border: #3d4a44;
    --color-border-light: #2d3b36;
    --color-divider: rgba(255, 255, 255, 0.08);
    --color-overlay: rgba(0, 0, 0, 0.7);
  }
}

/* Manual dark mode class */
:root.dark-theme {
  --color-base: #1a1f1e;
  --color-surface: #2d3b36;
  --color-surface-alt: #243029;
  --color-text: #f4f1eb;
  --color-text-secondary: #a8b5ae;
  --color-text-muted: #8b9a91;
  --color-text-inverse: #1a1f1e;
  --color-border: #3d4a44;
  --color-border-light: #2d3b36;
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-overlay: rgba(0, 0, 0, 0.7);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEGACY VARIABLE ALIASES
   Allows the trips module (ported from v1) to use old variable names
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --card: var(--color-surface);
  --forest: var(--color-primary);
  --teal: #7FC3A5;
  --teal-light: rgba(127, 195, 165, 0.10);
  --teal-mid: rgba(127, 195, 165, 0.15);
  --text: var(--color-text);
  --text-mid: var(--color-text-secondary);
  --text-muted: var(--color-text-muted);
  --border: var(--color-border);
  --bg: var(--color-base);
}
