/**
 * TRIP COUNTDOWN DESIGN SYSTEM v3.0
 * Complete Modern Redesign with Glass Morphism & Micro-Interactions
 * Inspired by macOS & iOS - Clean, Sophisticated, and Modern
 */

/* ===== MODERN CSS RESET & FOUNDATIONS ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== DESIGN TOKENS & CUSTOM PROPERTIES ===== */
:root {
  /* Color Palette - Clean & Vibrant */
  --primary: #2563eb;
  --primary-light: #60a5fa;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --accent-alt: #ef4444;
  
  /* Glass Morphism Colors */
  --glass-primary: rgba(37, 99, 235, 0.08);
  --glass-secondary: rgba(16, 185, 129, 0.08);
  --glass-accent: rgba(245, 158, 11, 0.08);
  --glass-white: rgba(255, 255, 255, 0.8);
  --glass-dark: rgba(0, 0, 0, 0.05);
  
  /* Background Gradients */
  --bg-gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --bg-gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --bg-gradient-twilight: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --bg-gradient-aurora: linear-gradient(135deg, #2563eb 0%, #10b981 50%, #f59e0b 100%);
  --bg-gradient-ocean: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --bg-gradient-sunset: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  
  /* Neutral Colors */
  --white: #ffffff;
  --black: #000000;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;
  
  /* Background Colors */
  --bg-primary: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-dark: var(--gray-900);
  --bg-glass: rgba(255, 255, 255, 0.8);
  --bg-glass-strong: rgba(255, 255, 255, 0.9);
  
  /* Text Colors */
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-700);
  --text-muted: var(--gray-600);
  --text-light: var(--gray-500);
  --text-white: var(--white);
  --text-glass: var(--gray-900);
  --text-glass-muted: var(--gray-700);
  
  /* Border Colors */
  --border-color: var(--gray-200);
  --border-glass: rgba(0, 0, 0, 0.1);
  --border-glass-strong: rgba(0, 0, 0, 0.15);
  
  /* Glass Morphism Properties */
  --glass-blur: blur(20px);
  --glass-blur-strong: blur(40px);
  --glass-border: 1px solid var(--border-glass);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --glass-shadow-strong: 0 20px 60px rgba(31, 38, 135, 0.5);
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-sm: 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-glow: 0 0 20px var(--primary);
  
  /* Animation Properties */
  --timing-fast: 150ms;
  --timing-normal: 250ms;
  --timing-slow: 350ms;
  --timing-slower: 500ms;
  --easing-smooth: cubic-bezier(0.4, 0.0, 0.2, 1);
  --easing-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --easing-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Typography Scale */
  --font-size-xs: 0.75rem;      /* 12px */
  --font-size-sm: 0.875rem;     /* 14px */
  --font-size-base: 1rem;       /* 16px */
  --font-size-lg: 1.125rem;     /* 18px */
  --font-size-xl: 1.25rem;      /* 20px */
  --font-size-2xl: 1.5rem;      /* 24px */
  --font-size-3xl: 1.875rem;    /* 30px */
  --font-size-4xl: 2.25rem;     /* 36px */
  --font-size-5xl: 3rem;        /* 48px */
  --font-size-6xl: 3.75rem;     /* 60px */
  
  /* 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;
  
  /* Line Heights */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;
  
  /* Border Radius */
  --radius-xs: 0.125rem;         /* 2px */
  --radius-sm: 0.25rem;          /* 4px */
  --radius-md: 0.375rem;         /* 6px */
  --radius-lg: 0.5rem;           /* 8px */
  --radius-xl: 0.75rem;          /* 12px */
  --radius-2xl: 1rem;            /* 16px */
  --radius-3xl: 1.5rem;          /* 24px */
  --radius-full: 9999px;
  
  /* Spacing Scale */
  --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-8: 2rem;               /* 32px */
  --space-10: 2.5rem;            /* 40px */
  --space-12: 3rem;              /* 48px */
  --space-16: 4rem;              /* 64px */
  --space-20: 5rem;              /* 80px */
  --space-24: 6rem;              /* 96px */
  --space-32: 8rem;              /* 128px */
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: var(--gray-900);
    --bg-secondary: var(--gray-800);
    --text-primary: var(--white);
    --text-secondary: var(--gray-300);
    --text-muted: var(--gray-400);
    --border-color: var(--gray-700);
    --bg-glass: rgba(0, 0, 0, 0.3);
    --bg-glass-strong: rgba(0, 0, 0, 0.5);
  }
}

.dark-mode {
  --bg-primary: var(--gray-900);
  --bg-secondary: var(--gray-800);
  --text-primary: var(--white);
  --text-secondary: var(--gray-300);
  --text-muted: var(--gray-400);
  --border-color: var(--gray-700);
  --bg-glass: rgba(0, 0, 0, 0.3);
  --bg-glass-strong: rgba(0, 0, 0, 0.5);
}

/* ===== GLASS MORPHISM FOUNDATION ===== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.glass > * {
  position: relative;
  z-index: 2;
}

.glass-strong {
  background: var(--bg-glass-strong);
  backdrop-filter: var(--glass-blur-strong);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  border: 1px solid var(--border-glass-strong);
  box-shadow: var(--glass-shadow-strong);
}

/* ===== BACKGROUND LAYOUTS ===== */
.bg-gradient-page {
  min-height: 100vh;
  background: var(--bg-primary);
  position: relative;
  overflow-x: hidden;
}

.bg-gradient-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(245, 158, 11, 0.03) 0%, transparent 50%);
  pointer-events: none;
  animation: gradient-shift 10s ease-in-out infinite alternate;
}

@keyframes gradient-shift {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

/* ===== CARDS & CONTAINERS ===== */
.card-glass {
  @extend .glass;
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  color: var(--text-glass);
  transition: all var(--timing-normal) var(--easing-smooth);
}

.card-glass:hover {
  transform: translateY(-4px);
  box-shadow: var(--glass-shadow-strong);
  border-color: var(--border-glass-strong);
}

.card-modern {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  transition: all var(--timing-normal) var(--easing-smooth);
}

.card-modern:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-floating {
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  transition: all var(--timing-normal) var(--easing-smooth);
}

.card-floating:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-2xl);
}

/* ===== BUTTONS ===== */
.btn-glass {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-xl);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--timing-fast) var(--easing-smooth);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
}

.btn-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left var(--timing-slow) var(--easing-smooth);
}

.btn-glass:hover::before {
  left: 100%;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: var(--text-primary);
}

.btn-glass:active {
  transform: translateY(0);
}

/* Active state for filter buttons */
.btn-glass.active {
  background: var(--bg-gradient-primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-glass.active:hover {
  background: var(--bg-gradient-primary);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-modern {
  background: var(--primary);
  color: var(--white);
  padding: var(--space-3) var(--space-6);
  border: none;
  border-radius: var(--radius-xl);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: all var(--timing-normal) var(--easing-spring);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-modern:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: var(--white);
}

.btn-modern:active {
  transform: translateY(0);
}

.btn-gradient {
  background: var(--bg-gradient-primary);
  color: var(--white);
  padding: var(--space-4) var(--space-8);
  border: none;
  border-radius: var(--radius-xl);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: all var(--timing-normal) var(--easing-bounce);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-gradient-secondary);
  opacity: 0;
  transition: opacity var(--timing-normal) var(--easing-smooth);
}

.btn-gradient:hover::before {
  opacity: 1;
}

.btn-gradient:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
  color: var(--white);
}

/* ===== FORMS ===== */
.form-glass {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  color: var(--text-glass);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  transition: all var(--timing-normal) var(--easing-smooth);
  width: 100%;
}

.form-glass::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-glass:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--border-glass-strong);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
  color: var(--text-glass);
}

.form-modern {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  transition: all var(--timing-normal) var(--easing-smooth);
  width: 100%;
}

.form-modern:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ===== NAVIGATION (See navigation-modern.css for specific styles) ===== */

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  transition: all var(--timing-fast) var(--easing-smooth);
}

.nav-brand:hover {
  color: var(--primary);
  transform: scale(1.05);
}

.nav-link-glass {
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-medium);
  transition: all var(--timing-fast) var(--easing-smooth);
  position: relative;
}

.nav-link-glass::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 80%;
  height: 2px;
  background: var(--primary);
  transition: transform var(--timing-normal) var(--easing-smooth);
}

.nav-link-glass:hover {
  color: var(--text-primary);
  background: rgba(37, 99, 235, 0.05);
}

.nav-link-glass:hover::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== MODALS ===== */
/* Modal styles consolidated in components/modals.css */

/* ===== ANIMATIONS & MICRO-INTERACTIONS ===== */
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 0 40px rgba(102, 126, 234, 0.6); }
}

@keyframes slide-in-up {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scale-in {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ===== UTILITY CLASSES ===== */
.animate-float { animation: float 3s ease-in-out infinite; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }
.animate-slide-in { animation: slide-in-up 0.6s var(--easing-spring) forwards; }
.animate-fade-in { animation: fade-in 0.5s var(--easing-smooth) forwards; }
.animate-scale-in { animation: scale-in 0.4s var(--easing-bounce) forwards; }

.hover-lift {
  transition: transform var(--timing-normal) var(--easing-smooth);
}
.hover-lift:hover {
  transform: translateY(-4px);
}

.hover-scale {
  transition: transform var(--timing-normal) var(--easing-smooth);
}
.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  transition: all var(--timing-normal) var(--easing-smooth);
}
.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

.text-gradient {
  color: var(--primary);
  font-weight: var(--font-weight-bold);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
  :root {
    --font-size-3xl: 1.5rem;
    --font-size-4xl: 1.875rem;
    --font-size-5xl: 2.25rem;
    --space-16: 2rem;
    --space-20: 3rem;
    --space-24: 4rem;
  }
  
  .card-glass,
  .card-modern,
  .card-floating {
    padding: var(--space-4);
  }
  
  .btn-gradient {
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
  }
}

@media (max-width: 480px) {
  :root {
    --space-8: 1rem;
    --space-10: 1.5rem;
    --space-12: 2rem;
  }
}

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

/* Focus styles for accessibility */
.btn-glass:focus,
.btn-modern:focus,
.btn-gradient:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.form-glass:focus,
.form-modern:focus {
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}