/**
 * Design Tokens - Core Design System Variables
 * Based on UX Enhancement Specification
 */

:root {
  /* ===== COLOR SYSTEM ===== */
  
  /* Primary Colors */
  --primary-50: #f0f4ff;
  --primary-100: #e0e9ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #667eea;
  --primary-600: #5a6fd8;
  --primary-700: #4c63d2;
  --primary-800: #434190;
  --primary-900: #1e3a8a;

  /* Semantic Colors */
  --success-50: #ecfdf5;
  --success-100: #d1fae5;
  --success-500: #10b981;
  --success-600: #059669;
  --success-700: #047857;

  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;

  --info-50: #eff6ff;
  --info-100: #dbeafe;
  --info-500: #3b82f6;
  --info-600: #2563eb;
  --info-700: #1d4ed8;

  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Category Colors (Enhanced) */
  --category-nature: #059669;
  --category-nature-light: rgba(5, 150, 105, 0.1);
  --category-nature-bg: #ecfdf5;

  --category-food: #dc2626;
  --category-food-light: rgba(220, 38, 38, 0.1);
  --category-food-bg: #fef2f2;

  --category-culture: #7c3aed;
  --category-culture-light: rgba(124, 58, 237, 0.1);
  --category-culture-bg: #f5f3ff;

  --category-entertainment: #ea580c;
  --category-entertainment-light: rgba(234, 88, 12, 0.1);
  --category-entertainment-bg: #fff7ed;

  --category-art: #3b82f6;
  --category-art-light: rgba(59, 130, 246, 0.1);
  --category-art-bg: #eff6ff;

  --category-adventure: #e67e22;
  --category-adventure-light: rgba(230, 126, 34, 0.1);
  --category-adventure-bg: #fff7ed;

  --category-relaxation: #1abc9c;
  --category-relaxation-light: rgba(26, 188, 156, 0.1);
  --category-relaxation-bg: #f0fdfa;

  --category-sports: #9b59b6;
  --category-sports-light: rgba(155, 89, 182, 0.1);
  --category-sports-bg: #faf5ff;

  --category-shopping: #34495e;
  --category-shopping-light: rgba(52, 73, 94, 0.1);
  --category-shopping-bg: #f8fafc;

  --category-nightlife: #2c3e50;
  --category-nightlife-light: rgba(44, 62, 80, 0.1);
  --category-nightlife-bg: #f8fafc;

  /* ===== TYPOGRAPHY SYSTEM ===== */
  
  /* Font Families */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Font Sizes (Fluid Typography) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3rem);
  --text-5xl: clamp(3rem, 2.5rem + 2.5vw, 4rem);

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

  /* ===== SPACING SYSTEM ===== */
  
  --space-px: 1px;
  --space-0: 0;
  --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-7: 1.75rem;   /* 28px */
  --space-8: 2rem;      /* 32px */
  --space-9: 2.25rem;   /* 36px */
  --space-10: 2.5rem;   /* 40px */
  --space-11: 2.75rem;  /* 44px */
  --space-12: 3rem;     /* 48px */
  --space-14: 3.5rem;   /* 56px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* ===== BORDER RADIUS ===== */
  
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* ===== SHADOWS ===== */
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);

  /* ===== TRANSITIONS ===== */
  
  --transition-none: none;
  --transition-all: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-default: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===== Z-INDEX SCALE ===== */
  
  --z-0: 0;
  --z-10: 10;
  --z-20: 20;
  --z-30: 30;
  --z-40: 40;
  --z-50: 50;
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;

  /* ===== BREAKPOINTS ===== */
  
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ===== TOUCH TARGETS ===== */
  
  --touch-target-min: 44px;
  --touch-target-comfortable: 48px;
  --touch-target-large: 56px;

  /* ===== ACCESSIBILITY ===== */
  
  --focus-ring: 0 0 0 2px var(--primary-500);
  --focus-ring-offset: 0 0 0 2px white, 0 0 0 4px var(--primary-500);
  
  /* High contrast mode colors */
  --high-contrast-border: #000000;
  --high-contrast-text: #000000;
  --high-contrast-bg: #ffffff;
}

/* ===== DARK MODE TOKENS ===== */

@media (prefers-color-scheme: dark) {
  :root {
    /* Primary colors adjusted for dark mode */
    --primary-50: #1e3a8a;
    --primary-100: #434190;
    --primary-500: #818cf8;
    --primary-600: #a5b4fc;
    --primary-900: #f0f4ff;

    /* Neutral colors inverted */
    --gray-50: #111827;
    --gray-100: #1f2937;
    --gray-200: #374151;
    --gray-300: #4b5563;
    --gray-400: #6b7280;
    --gray-500: #9ca3af;
    --gray-600: #d1d5db;
    --gray-700: #e5e7eb;
    --gray-800: #f3f4f6;
    --gray-900: #f9fafb;

    /* Semantic colors adjusted */
    --success-50: #047857;
    --success-100: #059669;
    --success-500: #10b981;

    --warning-50: #b45309;
    --warning-100: #d97706;
    --warning-500: #f59e0b;

    --error-50: #b91c1c;
    --error-100: #dc2626;
    --error-500: #ef4444;

    --info-50: #1d4ed8;
    --info-100: #2563eb;
    --info-500: #3b82f6;

    /* Category colors adjusted for dark mode */
    --category-nature-bg: rgba(5, 150, 105, 0.2);
    --category-food-bg: rgba(220, 38, 38, 0.2);
    --category-culture-bg: rgba(124, 58, 237, 0.2);
    --category-entertainment-bg: rgba(234, 88, 12, 0.2);
    --category-art-bg: rgba(59, 130, 246, 0.2);
    --category-adventure-bg: rgba(230, 126, 34, 0.2);
    --category-relaxation-bg: rgba(26, 188, 156, 0.2);
    --category-sports-bg: rgba(155, 89, 182, 0.2);
    --category-shopping-bg: rgba(52, 73, 94, 0.2);
    --category-nightlife-bg: rgba(44, 62, 80, 0.2);

    /* High contrast mode colors for dark mode */
    --high-contrast-border: #ffffff;
    --high-contrast-text: #ffffff;
    --high-contrast-bg: #000000;
  }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-all: none;
    --transition-default: none;
    --transition-fast: none;
    --transition-slow: none;
    --transition-bounce: none;
  }
  
  /* Disable animations for reduced motion */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  /* Keep essential loading indicators */
  .loading__spinner,
  .loading__dots,
  .btn--loading::after {
    animation-duration: 1s !important;
  }
}

/* ===== HIGH CONTRAST MODE ===== */

@media (prefers-contrast: high) {
  :root {
    --primary-500: var(--high-contrast-text);
    --gray-900: var(--high-contrast-text);
    --gray-50: var(--high-contrast-bg);
    
    /* Ensure sufficient contrast ratios */
    --shadow-base: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 8px 0 rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 16px 0 rgba(0, 0, 0, 0.5);
  }
}