/* ========================================
   DESIGN TOKENS - Modern Minimalism Premium
   ======================================== */

/* CSS Custom Properties from design-tokens.json */
:root {
  /* Colors */
  --color-primary-50: #E6F0FF;
  --color-primary-100: #CCE0FF;
  --color-primary-500: #0066FF;
  --color-primary-600: #0052CC;
  --color-primary-900: #003D99;
  
  --color-neutral-50: #FAFAFA;
  --color-neutral-100: #F5F5F5;
  --color-neutral-200: #E5E5E5;
  --color-neutral-500: #A3A3A3;
  --color-neutral-700: #404040;
  --color-neutral-900: #171717;
  
  --color-success-500: #10B981;
  --color-error-500: #EF4444;
  --color-warning-500: #F59E0B;
  
  --color-background-page: var(--color-neutral-50);
  --color-background-surface: #FFFFFF;
  --color-background-elevated: #FFFFFF;
  
  /* Typography */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --font-size-hero-xl: 64px;
  --font-size-title-lg: 48px;
  --font-size-subtitle: 32px;
  --font-size-body-lg: 20px;
  --font-size-body: 16px;
  --font-size-small: 14px;
  --font-size-caption: 12px;
  
  --line-height-tight: 1.1;
  --line-height-snug: 1.2;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  
  --letter-spacing-tight: -0.02em;
  --letter-spacing-snug: -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.01em;
  
  /* Spacing */
  --spacing-2: 8px;
  --spacing-4: 16px;
  --spacing-6: 24px;
  --spacing-8: 32px;
  --spacing-12: 48px;
  --spacing-16: 64px;
  --spacing-24: 96px;
  --spacing-32: 128px;
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  /* Box Shadows */
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-card-hover: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-modal: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-dropdown: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
  
  /* Animation */
  --duration-fast: 200ms;
  --duration-base: 250ms;
  --duration-smooth: 300ms;
  --easing-out: cubic-bezier(0, 0, 0.2, 1);
  --easing-inOut: cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Component Dimensions */
  --button-height: 56px;
  --button-height-desktop: 64px;
  --input-height: 56px;
  
  /* Container Max Widths */
  --container-max-width-sm: 100%;
  --container-max-width-md: 100%;
  --container-max-width-lg: 1024px;
  --container-max-width-xl: 1200px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-primary);
  font-size: var(--font-size-body);
  line-height: var(--line-height-normal);
  color: var(--color-neutral-900);
  background-color: var(--color-background-page);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width-xl);
  margin: 0 auto;
  padding: 0 var(--spacing-6);
}

@media (min-width: 768px) {
  .container {
    padding: 0 var(--spacing-8);
  }
}

/* ========================================
   HEADER
   ======================================== */

.header {
  height: 72px;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-neutral-200);
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  height: 100%;
}

.logo {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-primary-500);
  letter-spacing: var(--letter-spacing-normal);
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero {
  min-height: 600px;
  display: flex;
  align-items: center;
  padding: var(--spacing-32) 0;
  background-color: var(--color-neutral-50);
  position: relative;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.hero-title {
  font-size: var(--font-size-hero-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  color: var(--color-neutral-900);
  margin-bottom: var(--spacing-4);
}

.hero-subtitle {
  font-size: var(--font-size-body-lg);
  color: var(--color-neutral-700);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-12);
}

/* ========================================
   SEARCH FORM
   ======================================== */

.search-form {
  background: var(--color-background-surface);
  border-radius: var(--radius-lg);
  padding: var(--spacing-8);
  box-shadow: var(--shadow-card-hover);
  margin-top: var(--spacing-12);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.form-grid {
  display: grid;
  gap: var(--spacing-4);
}

@media (min-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "origin destination"
      "departure return"
      "passengers passengers";
  }
  
  .form-group:nth-child(1) { grid-area: origin; }
  .form-group:nth-child(2) { grid-area: destination; }
  .form-group:nth-child(3) { grid-area: departure; }
  .form-group:nth-child(4) { grid-area: return; }
  .form-group:nth-child(5) { grid-area: passengers; }
}

@media (max-width: 767px) {
  .hero-title {
    font-size: 40px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  .hero {
    min-height: 500px;
    padding: var(--spacing-24) 0;
  }
}

.form-group {
  position: relative;
}

.form-label {
  display: block;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-700);
  margin-bottom: var(--spacing-2);
}

.form-label .optional {
  font-weight: var(--font-weight-normal);
  color: var(--color-neutral-500);
  font-size: 0.85em;
}

.optional-input {
  border: 2px dashed var(--color-neutral-300) !important;
  background-color: var(--color-neutral-50);
}

.optional-input:focus {
  border: 2px solid var(--color-primary-400) !important;
  background-color: var(--color-background);
}

.optional-input:has(::-webkit-datetime-edit-fields-wrapper) {
  background-image: linear-gradient(45deg, transparent 50%, var(--color-neutral-400) 50%);
  background-size: 8px 8px;
  background-position: right 12px center;
  background-repeat: no-repeat;
}

.optional-input:not(:placeholder-shown) {
  border: 2px solid var(--color-success-300) !important;
  background-color: var(--color-success-50);
}

/* Trip Type Selector */
.trip-type-selector {
  display: flex;
  gap: var(--spacing-2);
  margin-top: var(--spacing-2);
}

.trip-option {
  display: flex;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-3);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--duration-fast) var(--easing-out);
  background-color: var(--color-background-surface);
  flex: 1;
  justify-content: center;
}

.trip-option:hover {
  border-color: var(--color-primary-500);
  background-color: var(--color-primary-50);
}

.trip-option input[type="radio"] {
  display: none;
}

.trip-option input[type="radio"]:checked + .trip-label {
  color: var(--color-primary-600);
  font-weight: var(--font-weight-medium);
}

.trip-option:has(input[type="radio"]:checked) {
  border-color: var(--color-primary-500);
  background-color: var(--color-primary-50);
  box-shadow: 0 0 0 1px var(--color-primary-500);
}

.trip-label {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  color: var(--color-neutral-700);
  transition: all var(--duration-fast) var(--easing-out);
}

/* Hide trip type hint - no longer needed */
.trip-type-hint {
  display: none;
}

.trip-type-hint small {
  color: var(--color-neutral-600);
  font-size: 0.875em;
  line-height: 1.4;
  background-color: var(--color-neutral-100);
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.trip-type-hint small {
  color: var(--color-neutral-600);
  font-size: 0.875em;
  line-height: 1.4;
  background-color: var(--color-neutral-100);
  padding: var(--spacing-1) var(--spacing-2);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.input-container {
  position: relative;
}

.form-input {
  width: 100%;
  height: var(--input-height);
  padding: 18px var(--spacing-4);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  color: var(--color-neutral-900);
  background-color: var(--color-background-surface);
  transition: all var(--duration-fast) var(--easing-out);
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-input::placeholder {
  color: var(--color-neutral-500);
}

.form-input:hover {
  border-color: var(--color-neutral-700);
}

.form-input:focus {
  outline: none;
  border-color: transparent;
  box-shadow: 0 0 0 2px var(--color-primary-500), var(--shadow-dropdown);
}

.form-input.error {
  border-color: var(--color-error-500);
  box-shadow: 0 0 0 2px var(--color-error-500);
}

.form-input.success {
  border-color: var(--color-success-500);
  box-shadow: 0 0 0 2px var(--color-success-500);
}

.input-icon {
  position: absolute;
  right: var(--spacing-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-neutral-500);
  pointer-events: none;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-background-surface);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dropdown);
  max-height: 320px;
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  visibility: hidden;
  transition: all var(--duration-fast) var(--easing-out);
}

.autocomplete-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.autocomplete-item {
  padding: 12px var(--spacing-4);
  cursor: pointer;
  border-bottom: 1px solid var(--color-neutral-100);
  font-size: var(--font-size-body);
  color: var(--color-neutral-900);
  transition: background-color var(--duration-fast) var(--easing-out);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: var(--color-primary-50);
}

.autocomplete-item.selected {
  background-color: var(--color-primary-100);
  color: var(--color-primary-600);
}

.autocomplete-item .city {
  font-weight: var(--font-weight-semibold);
}

.autocomplete-item .airport {
  color: var(--color-neutral-700);
  font-size: var(--font-size-small);
}

.autocomplete-item .iata {
  color: var(--color-neutral-500);
  font-family: monospace;
  font-weight: var(--font-weight-medium);
}

/* Passenger Counter */
.passenger-counter {
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  padding: var(--spacing-4);
  background: var(--color-background-surface);
  transition: all var(--duration-fast) var(--easing-out);
}

.passenger-counter:focus-within {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 2px var(--color-primary-500);
}

.counter-display {
  margin-bottom: var(--spacing-2);
}

.counter-text {
  font-size: var(--font-size-body);
  color: var(--color-neutral-900);
}

.counter-controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-2);
}

.counter-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-full);
  background: var(--color-primary-500);
  color: white;
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--easing-out);
}

.counter-btn:hover:not(:disabled) {
  background: var(--color-primary-600);
  transform: scale(1.05);
}

.counter-btn:disabled {
  background: var(--color-neutral-500);
  cursor: not-allowed;
  transform: none;
}

/* Error Messages */
.error-message {
  color: var(--color-error-500);
  font-size: var(--font-size-small);
  margin-top: var(--spacing-2);
  min-height: 1.5em;
  opacity: 0;
  transition: opacity var(--duration-base) var(--easing-out);
}

.error-message.show {
  opacity: 1;
}

/* Search Button */
.form-actions {
  margin-top: var(--spacing-6);
}

.search-btn {
  width: 100%;
  max-width: 400px;
  height: var(--button-height);
  background: var(--color-primary-500);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-2);
  transition: all var(--duration-fast) var(--easing-out);
  margin: 0 auto;
  position: relative;
}

@media (min-width: 768px) {
  .search-btn {
    height: var(--button-height-desktop);
  }
}

.search-btn:hover:not(:disabled) {
  background: var(--color-primary-600);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
}

.search-btn:active {
  transform: translateY(0) scale(1);
  box-shadow: var(--shadow-card);
}

.search-btn:disabled {
  background: var(--color-neutral-500);
  cursor: not-allowed;
  transform: none;
}

.btn-text {
  transition: opacity var(--duration-fast) var(--easing-out);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

.loading-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  opacity: 0;
  transition: opacity var(--duration-fast) var(--easing-out);
}

.loading-spinner.show {
  opacity: 1;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   BENEFITS SECTION
   ======================================== */

.benefits {
  padding: var(--spacing-24) 0;
  background: var(--color-background-surface);
}

.section-title {
  font-size: var(--font-size-title-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-neutral-900);
  text-align: center;
  margin-bottom: var(--spacing-12);
  line-height: var(--line-height-snug);
}

@media (max-width: 767px) {
  .section-title {
    font-size: 32px;
  }
  
  .benefits {
    padding: var(--spacing-16) 0;
  }
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-6);
}

@media (min-width: 1024px) {
  .benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.benefit-card {
  background: var(--color-background-surface);
  border: 1px solid var(--color-neutral-200);
  border-radius: var(--radius-lg);
  padding: var(--spacing-8);
  text-align: center;
  transition: all var(--duration-base) var(--easing-out);
  box-shadow: var(--shadow-card);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

@media (max-width: 767px) {
  .benefit-card {
    padding: var(--spacing-6);
  }
}

.benefit-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-card-hover);
}

.benefit-icon {
  color: var(--color-primary-500);
  margin-bottom: var(--spacing-4);
}

.benefit-title {
  font-size: 20px;
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-900);
  margin-bottom: var(--spacing-4);
  line-height: var(--line-height-snug);
}

.benefit-description {
  color: var(--color-neutral-700);
  line-height: var(--line-height-normal);
  font-size: var(--font-size-body);
}

/* ========================================
   SERVICE INFO SECTION
   ======================================== */

.service-info {
  padding: var(--spacing-16) 0;
  background: var(--color-neutral-50);
}

.info-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.info-title {
  font-size: var(--font-size-subtitle);
  font-weight: var(--font-weight-semibold);
  color: var(--color-neutral-900);
  margin-bottom: var(--spacing-6);
  line-height: var(--line-height-snug);
}

@media (max-width: 767px) {
  .info-title {
    font-size: 24px;
  }
  
  .service-info {
    padding: var(--spacing-12) 0;
  }
}

.info-text {
  color: var(--color-neutral-700);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--spacing-4);
  font-size: var(--font-size-body);
}

.info-text:last-child {
  margin-bottom: 0;
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
  padding: var(--spacing-12) var(--spacing-6);
  background: var(--color-neutral-900);
  color: var(--color-neutral-200);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--spacing-4);
}

.footer-copyright {
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
}

.footer-links {
  display: flex;
  gap: var(--spacing-6);
}

.footer-link {
  color: var(--color-neutral-200);
  text-decoration: none;
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-regular);
  transition: color var(--duration-fast) var(--easing-out);
}

.footer-link:hover {
  color: white;
}

/* ========================================
   UTILITIES
   ======================================== */

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for better accessibility */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--color-primary-500);
  outline-offset: 2px;
}

/* 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: 0;
}

/* Print styles */
@media print {
  .header,
  .footer {
    display: none;
  }
  
  .hero {
    min-height: auto;
    padding: var(--spacing-8) 0;
  }
  
  .search-form {
    box-shadow: none;
    border: 1px solid var(--color-neutral-200);
  }
}
