/* ============================================================
   AIRPAK EXPRESS NOVA — Apple iOS 26 Design System
   Exact Apple HIG Compliance + Logistics Platform Customization
   ============================================================ */

/* ===== DESIGN TOKENS — LIGHT MODE ===== */
:root {
  /* ---- Apple Semantic Colors ---- */
  --apple-blue: #007AFF;
  --apple-blue-dark: #0056B3;
  --apple-blue-light: #5AC8FA;
  --apple-green: #34C759;
  --apple-green-dark: #248A3D;
  --apple-red: #FF3B30;
  --apple-red-dark: #D62C28;
  --apple-orange: #FF9500;
  --apple-orange-dark: #CC7A00;
  --apple-yellow: #FFCC00;
  --apple-yellow-dark: #B38900;
  --apple-purple: #AF52DE;
  --apple-purple-dark: #8B3AB9;
  --apple-pink: #FF2D55;
  --apple-indigo: #5856D6;
  --apple-teal: #5AC8FA;
  --apple-gray: #8E8E93;
  --apple-gray-2: #AEAEB2;
  --apple-gray-3: #C7C7CC;
  --apple-gray-4: #D1D1D6;
  --apple-gray-5: #E5E5EA;
  --apple-gray-6: #F2F2F7;

  /* ---- Apple System Colors ---- */
  --apple-label: #000000;
  --apple-label-secondary: rgba(60, 60, 67, 0.6);
  --apple-label-tertiary: rgba(60, 60, 67, 0.3);
  --apple-label-quaternary: rgba(60, 60, 67, 0.18);
  --apple-separator: rgba(60, 60, 67, 0.29);
  --apple-separator-opaque: #C6C6C8;
  --apple-fill: rgba(120, 120, 128, 0.2);
  --apple-fill-secondary: rgba(120, 120, 128, 0.16);
  --apple-fill-tertiary: rgba(118, 118, 128, 0.12);

  /* ---- Light Mode Backgrounds ---- */
  --apple-bg: #F2F2F7;
  --apple-bg-secondary: #FFFFFF;
  --apple-bg-tertiary: #F2F2F7;
  --apple-bg-grouped: #F2F2F7;
  --apple-bg-grouped-secondary: #FFFFFF;

  /* ---- Glass System (iOS 26 Core) ---- */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-dark: rgba(255, 255, 255, 0.64);
  --glass-bg-ultra: rgba(255, 255, 255, 0.85);
  --glass-bg-light: rgba(255, 255, 255, 0.55);
  --glass-bg-tinted: rgba(0, 122, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-border-strong: rgba(255, 255, 255, 0.35);
  --glass-border-subtle: rgba(0, 0, 0, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  --glass-shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.20);
  --glass-shadow-ultra: 0 24px 80px rgba(0, 0, 0, 0.24);
  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-heavy: blur(40px) saturate(200%);
  --glass-blur-ultra: blur(60px) saturate(220%);

  /* ---- Typography ---- */
  --font-system: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-text: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Type Scale — iOS 26 (device-optimized) */
  --text-2xs: 0.6875rem;   /* 11px */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.8125rem;     /* 13px */
  --text-base: 1rem;        /* 16px — iOS minimum to prevent zoom on focus */
  --text-md: 1.0625rem;     /* 17px */
  --text-lg: 1.125rem;       /* 18px */
  --text-xl: 1.25rem;        /* 20px */
  --text-2xl: 1.375rem;      /* 22px */
  --text-2_5xl: 1.5rem;      /* 24px */
  --text-3xl: 1.75rem;       /* 28px */
  --text-4xl: 2rem;          /* 32px */
  --text-5xl: 2.5rem;        /* 40px */
  --text-6xl: 3rem;          /* 48px */
  --text-7xl: 3.5rem;        /* 56px */
  --text-8xl: 4rem;          /* 64px */
  --text-9xl: 5rem;          /* 80px */

  /* Font Weights */
  --font-regular: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-heavy: 800;
  --font-black: 900;

  /* Line Heights */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 1.75;

  /* Letter Spacing */
  --tracking-tighter: -0.04em;
  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.02em;
  --tracking-wider: 0.03em;
  --tracking-widest: 0.06em;

  /* ---- Spacing (8pt Grid) ---- */
  --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 */

  /* ---- Layout Constants ---- */
  --nav-height: 56px;
  --sidebar-width: 260px;
  --content-max: 960px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --space-24: 6rem;      /* 96px */
  --space-32: 8rem;      /* 128px */

  /* ---- Border Radius (iOS 26 Standard) ---- */
  --radius-2xs: 4px;
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-3xl: 28px;
  --radius-4xl: 32px;
  --radius-full: 9999px;

  /* ---- Shadows (Layered Depth) ---- */
  --shadow-2xs: 0 0.5px 1px rgba(0, 0, 0, 0.04);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px 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.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.20);
  --shadow-glow-blue: 0 0 40px rgba(0, 122, 255, 0.4), 0 0 80px rgba(0, 122, 255, 0.15);
  --shadow-glow-green: 0 0 40px rgba(52, 199, 89, 0.4), 0 0 80px rgba(52, 199, 89, 0.15);
  --shadow-glow-red: 0 0 40px rgba(255, 59, 48, 0.4);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  --shadow-inner-dark: inset 0 1px 0 rgba(0, 0, 0, 0.08);

  /* ---- Motion / Animation ---- */
  --ease-spring: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --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-sharp: cubic-bezier(0.4, 0, 0.6, 1);

  --duration-0: 0ms;
  --duration-instant: 100ms;
  --duration-fast: 200ms;
  --duration-normal: 300ms;
  --duration-slow: 400ms;
  --duration-slower: 500ms;
  --duration-slowest: 700ms;

  /* ---- Z-Index Scale ---- */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
  --z-chat-widget: 900;

  /* ---- Layout ---- */
  --max-width-sm: 540px;
  --max-width-md: 720px;
  --max-width-lg: 960px;
  --max-width-xl: 1200px;
  --max-width-2xl: 1400px;
  --sidebar-width: 260px;
  --sidebar-collapsed: 68px;
  --topbar-height: 56px;
  --nav-height: 56px;
}

/* ===== DESIGN TOKENS — DARK MODE ===== */
[data-theme="dark"] {
  /* Semantic Colors remain same in dark mode for consistency */
  --apple-label: #FFFFFF;
  --apple-label-secondary: rgba(235, 235, 245, 0.6);
  --apple-label-tertiary: rgba(235, 235, 245, 0.3);
  --apple-label-quaternary: rgba(235, 235, 245, 0.18);
  --apple-separator: rgba(84, 84, 88, 0.65);
  --apple-separator-opaque: #38383A;
  --apple-fill: rgba(120, 120, 128, 0.36);
  --apple-fill-secondary: rgba(120, 120, 128, 0.32);
  --apple-fill-tertiary: rgba(118, 118, 128, 0.24);

  /* Dark Mode Backgrounds */
  --apple-bg: #000000;
  --apple-bg-secondary: #1C1C1E;
  --apple-bg-tertiary: #2C2C2E;
  --apple-bg-grouped: #000000;
  --apple-bg-grouped-secondary: #1C1C1E;

  /* Glass System (Dark) */
  --glass-bg: rgba(28, 28, 30, 0.72);
  --glass-bg-dark: rgba(28, 28, 30, 0.64);
  --glass-bg-ultra: rgba(28, 28, 30, 0.85);
  --glass-bg-light: rgba(44, 44, 46, 0.55);
  --glass-bg-tinted: rgba(0, 122, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-strong: rgba(255, 255, 255, 0.15);
  --glass-border-subtle: rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --glass-shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass-shadow-ultra: 0 24px 80px rgba(0, 0, 0, 0.6);

  /* Shadows adjust in dark */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.16);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.24);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.32);
  --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.40);
  --shadow-glow-blue: 0 0 40px rgba(0, 122, 255, 0.3), 0 0 80px rgba(0, 122, 255, 0.1);
  --shadow-inner: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-inner-dark: inset 0 1px 0 rgba(0, 0, 0, 0.15);
}

/* ===== LOGISTICS-SPECIFIC TOKENS ===== */
:root {
  /* Status Colors */
  --status-picked-up: #34C759;
  --status-processing: #007AFF;
  --status-in-transit: #FF9500;
  --status-out-for-delivery: #FF9500;
  --status-customs: #AF52DE;
  --status-delivered: #34C759;
  --status-exception: #FF3B30;
  --status-pending: #FFCC00;
  --status-cancelled: #8E8E93;

  /* Service Tiers */
  --service-express: #007AFF;
  --service-economy: #34C759;
  --service-freight: #AF52DE;
  --service-overnight: #FF2D55;

  /* Maps */
  --map-route-line: linear-gradient(90deg, #007AFF, #00D4FF);
  --map-pulse-color: rgba(0, 122, 255, 0.6);

  /* Platform Branding (Airpak Accent) */
  --airpak-primary: #007AFF;
  --airpak-secondary: #00D4FF;
  --airpak-gold: #FFD60A;
  --airpak-navy: #0A1628;
  --airpak-surface: #1E3A5F;
}

/* ===== CSS CUSTOM PROPERTIES API ===== */
@property --hue {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@property --saturation {
  syntax: '<percentage>';
  initial-value: 0%;
  inherits: false;
}

@property --lightness {
  syntax: '<percentage>';
  initial-value: 100%;
  inherits: false;
}

/* ===== BASE RESET + GLOBAL ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-system);
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  color: var(--apple-label);
  background: var(--apple-bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--duration-slow) var(--ease-smooth),
              color var(--duration-slow) var(--ease-smooth);
}

a {
  color: var(--apple-blue);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: var(--font-system);
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

input, select, textarea {
  font-family: var(--font-system);
  -webkit-appearance: none;
  appearance: none;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.5);
}

/* Selection */
::selection {
  background: rgba(0, 122, 255, 0.2);
  color: var(--apple-label);
}

/* Focus visible — Apple style */
:focus-visible {
  outline: 2px solid var(--apple-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Hide focus ring on mouse users */
:focus:not(:focus-visible) {
  outline: none;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}