/* ================================================================
   ROADCOLLECT DESIGN SYSTEM v2.0
   ================================================================
   A modern, cohesive design system for the RoadCollect platform
   Based on implemented styles across the application
   ================================================================ */

:root {
  /* ================================
     COLOR PALETTE
     ================================ */
  
  /* Primary Brand Colors */
  --color-primary-50: #F0F4FF;
  --color-primary-100: #E0E9FF;
  --color-primary-200: #C7D4FE;
  --color-primary-300: #A4B8FD;
  --color-primary-400: #7A93FB;
  --color-primary-500: #667EEA; /* Main Primary */
  --color-primary-600: #5468D1;
  --color-primary-700: #4652B8;
  --color-primary-800: #3A439E;
  --color-primary-900: #2F3785;

  /* Secondary Brand Colors */
  --color-secondary-50: #FAF5FF;
  --color-secondary-100: #F3E8FF;
  --color-secondary-200: #E9D5FF;
  --color-secondary-300: #D8B4FE;
  --color-secondary-400: #C084FC;
  --color-secondary-500: #A855F7;
  --color-secondary-600: #9333EA;
  --color-secondary-700: #764BA2; /* Main Secondary */
  --color-secondary-800: #6B21A8;
  --color-secondary-900: #581C87;

  /* Accent Colors */
  --color-accent-purple: #5B5FCF;
  --color-accent-blue: #667EEA;
  --color-accent-teal: #10B981;
  --color-accent-yellow: #F59E0B;
  --color-accent-red: #EF4444;

  /* Semantic Colors */
  --color-success: #10B981;
  --color-success-light: rgba(16, 185, 129, 0.1);
  --color-success-border: rgba(16, 185, 129, 0.2);
  
  --color-warning: #F59E0B;
  --color-warning-light: rgba(251, 191, 36, 0.1);
  --color-warning-border: rgba(251, 191, 36, 0.2);
  
  --color-error: #EF4444;
  --color-error-light: rgba(239, 68, 68, 0.1);
  --color-error-border: rgba(239, 68, 68, 0.2);
  
  --color-info: #3B82F6;
  --color-info-light: rgba(59, 130, 246, 0.1);
  --color-info-border: rgba(59, 130, 246, 0.2);

  /* 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;

  /* Background Colors */
  --bg-primary: #F8F9FA;
  --bg-secondary: #FFFFFF;
  --bg-tertiary: #F3F4F6;
  --bg-elevated: #FFFFFF;
  --bg-overlay: rgba(0, 0, 0, 0.5);
  --bg-glass: rgba(255, 255, 255, 0.98);
  --surface-color: #FFFFFF; /* For card/panel surfaces */

  /* Text Colors */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --text-on-primary: #FFFFFF;
  --text-on-dark: #FFFFFF;
  --text-link: #667EEA;
  --text-link-hover: #5468D1;

  /* Border Colors */
  --border-light: rgba(0, 0, 0, 0.04);
  --border-default: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(102, 126, 234, 0.4);

  /* ================================
     TYPOGRAPHY
     ================================ */
  
  --font-family-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-family-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
  
  /* Font Sizes */
  --font-size-xs: 10px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 16px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 30px;
  --font-size-4xl: 36px;
  
  /* Font Weights */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  /* Line Heights */
  --line-height-tight: 1;
  --line-height-snug: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;
  --line-height-loose: 2;
  
  /* Letter Spacing */
  --letter-spacing-tight: -0.02em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.01em;
  --letter-spacing-wider: 0.02em;

  /* ================================
     SPACING SYSTEM
     ================================ */
  
  /* Base 4px/8px grid system */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-14: 56px;
  --space-16: 64px;
  --space-18: 72px;
  --space-20: 80px;
  
  /* Component-specific spacing */
  --padding-xs: 6px;
  --padding-sm: 10px;
  --padding-md: 14px;
  --padding-lg: 20px;
  --padding-xl: 24px;
  
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 12px;
  --gap-lg: 16px;
  --gap-xl: 24px;

  /* ================================
     LAYOUT
     ================================ */
  
  /* Container widths */
  --container-xs: 480px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;
  
  /* Component sizes */
  --sidebar-width: 260px;
  --header-height: 72px;
  --mobile-header-height: auto;
  --bottom-nav-height: 80px;
  --search-width: 360px;
  --search-width-min: 280px;
  
  /* Grid */
  --grid-columns: 12;
  --grid-gap: 24px;

  /* ================================
     BORDERS & RADIUS
     ================================ */
  
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 20px;
  --radius-pill: 50px;
  --radius-circle: 50%;
  --radius-full: 999px;
  
  /* Component-specific radius */
  --radius-button: 10px;
  --radius-input: 12px;
  --radius-card: 12px;
  --radius-modal: 16px;
  --radius-dropdown: 12px;
  --radius-badge: 6px;
  --radius-avatar: 50%;
  --radius-tab: 20px;
  --radius-pill-nav: 28px;

  /* ================================
     SHADOWS & ELEVATION
     ================================ */
  
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.12);
  --shadow-2xl: 0 24px 48px rgba(0, 0, 0, 0.16);
  
  /* Layered shadows for depth */
  --shadow-elevated: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
    
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Focus shadows */
  --shadow-focus-primary: 0 0 0 2px rgba(102, 126, 234, 0.2);
  --shadow-focus-secondary: 0 0 0 2px rgba(91, 95, 207, 0.3);
  --shadow-focus-success: 0 0 0 2px rgba(16, 185, 129, 0.2);
  --shadow-focus-error: 0 0 0 2px rgba(239, 68, 68, 0.2);

  /* ================================
     TRANSITIONS & ANIMATIONS
     ================================ */
  
  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
  --transition-slower: 500ms ease;
  
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-smooth: cubic-bezier(0.25, 0.1, 0.25, 1);
  
  /* Component transitions */
  --transition-all: all 0.2s ease;
  --transition-colors: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  
  /* ================================
     GRADIENTS
     ================================ */
  
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #5468D1 0%, #9333EA 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --gradient-accent: linear-gradient(135deg, #667EEA 0%, #5B5FCF 100%);
  --transition-transform: transform 0.2s ease;
  --transition-opacity: opacity 0.2s ease;
  --transition-shadow: box-shadow 0.2s ease;

  /* ================================
     Z-INDEX SYSTEM
     ================================ */
  
  --z-dropdown: 1000;
  --z-sticky: 100;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-notification: 2000;
  
  /* Component z-index */
  --z-sidebar: 50;
  --z-header: 100;
  --z-mobile-nav: 1000;

  /* ================================
     BREAKPOINTS
     ================================ */
  
  --breakpoint-xs: 0;
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 992px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;

  /* ================================
     GRADIENTS
     ================================ */
  
  --gradient-primary: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  --gradient-secondary: linear-gradient(135deg, #667EEA 0%, #5B5FCF 100%);
  --gradient-success: linear-gradient(135deg, #10B981 0%, #059669 100%);
  --gradient-error: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  --gradient-warning: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  --gradient-dark: linear-gradient(135deg, #1F2937 0%, #111827 100%);
  --gradient-light: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 100%);

  /* ================================
     COMPONENT TOKENS
     ================================ */
  
  /* Buttons */
  --button-height-sm: 32px;
  --button-height-md: 40px;
  --button-height-lg: 48px;
  --button-padding-x: 20px;
  --button-padding-y: 10px;
  --button-font-size: 14px;
  --button-font-weight: 500;
  
  /* Inputs */
  --input-height: 44px;
  --input-padding-x: 16px;
  --input-padding-y: 12px;
  --input-font-size: 14px;
  --input-border-width: 1px;
  
  /* Cards */
  --card-padding: 20px;
  --card-border-width: 1px;
  --card-background: var(--bg-secondary);
  
  /* Navigation */
  --nav-item-padding: 12px 16px;
  --nav-item-radius: 10px;
  --nav-item-gap: 12px;
  
  /* Mobile specific */
  --mobile-tab-height: 56px;
  --mobile-tab-icon-size: 22px;
  --mobile-tab-label-size: 10px;
  
  /* Icons */
  --icon-size-xs: 16px;
  --icon-size-sm: 18px;
  --icon-size-md: 20px;
  --icon-size-lg: 24px;
  --icon-size-xl: 32px;
  
  /* Avatars */
  --avatar-size-xs: 24px;
  --avatar-size-sm: 32px;
  --avatar-size-md: 40px;
  --avatar-size-lg: 48px;
  --avatar-size-xl: 64px;

  /* ================================
     EFFECTS
     ================================ */
  
  /* Backdrop filters */
  --backdrop-blur: blur(24px) saturate(200%);
  --backdrop-blur-sm: blur(8px) saturate(180%);
  --backdrop-blur-md: blur(16px) saturate(200%);
  --backdrop-blur-lg: blur(32px) saturate(200%);
  
  /* Opacity values */
  --opacity-0: 0;
  --opacity-5: 0.05;
  --opacity-10: 0.1;
  --opacity-20: 0.2;
  --opacity-30: 0.3;
  --opacity-40: 0.4;
  --opacity-50: 0.5;
  --opacity-60: 0.6;
  --opacity-70: 0.7;
  --opacity-80: 0.8;
  --opacity-90: 0.9;
  --opacity-100: 1;
}

/* ================================
   DARK MODE VARIABLES
   ================================ */
[data-theme="dark"] {
  /* Inverted color scheme for dark mode */
  --bg-primary: #0F1114;
  --bg-secondary: #1A1D23;
  --bg-tertiary: #22262E;
  --bg-elevated: #2A2F39;
  
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;
  
  --border-light: rgba(255, 255, 255, 0.06);
  --border-default: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* ================================
   UTILITY CLASSES
   ================================ */

/* Layout utilities */
.container { max-width: var(--container-xl); margin: 0 auto; padding: 0 var(--space-4); }
.grid { display: grid; gap: var(--grid-gap); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* Spacing utilities */
.p-0 { padding: 0; }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }

.m-0 { margin: 0; }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-5 { margin: var(--space-5); }
.m-6 { margin: var(--space-6); }

/* Text utilities */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }

.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-tertiary); }

/* Border utilities */
.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

/* Shadow utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* Transition utilities */
.transition-all { transition: var(--transition-all); }
.transition-colors { transition: var(--transition-colors); }
.transition-transform { transition: var(--transition-transform); }
.transition-opacity { transition: var(--transition-opacity); }
.transition-shadow { transition: var(--transition-shadow); }

/* Animation keyframes */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideDown {
  from { transform: translateY(-10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Animation classes */
.animate-pulse { animation: pulse 2s infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideUp { animation: slideUp 0.3s ease; }
.animate-slideDown { animation: slideDown 0.3s ease; }
