/* ==========================================================================
   fligher - Modern European Flight Search Engine
   Custom Stylesheet (Complementing Tailwind CSS)
   ========================================================================== */

/* --- Custom Variables --- */
:root {
  --color-bg-light: #F0F8FF;      /* Alice Blue */
  --color-bg-mid: #E0F0FF;        /* Soft Blue */
  --color-accent: #B0D4F1;        /* Muted Sky Blue */
  --color-brand-orange: #FF8C00;  /* Dark Orange / Brand Accent */
  --color-brand-orange-hover: #E67E00;
  --color-text-dark: #0F172A;     /* Slate Dark Navy */
  --color-text-muted: #475569;    /* Slate Muted */
  --color-card-bg: #FFFFFF;
  --card-radius: 12px;
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.12);
  --header-height: 70px;
}

/* --- Base Styling --- */
html {
  font-family: 'Inter', sans-serif;
  color: var(--color-text-dark);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #F8FAFC;
  color: var(--color-text-dark);
  overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: var(--color-text-dark);
}

p, span, label, input, select, button {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
}

/* ==========================================================================
   CLEAN SKY BLUE AIRPLANE PRELOADER (#4A90D9 -> #B0D4F1)
   ========================================================================== */
.fligher-preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  will-change: opacity, visibility;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.fligher-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sky-background {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #4A90D9 0%, #72ABE2 50%, #B0D4F1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sky-cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 100px;
  filter: blur(1.5px);
  pointer-events: none;
}

.sky-cloud::before,
.sky-cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.65);
  border-radius: 50%;
}

.sky-cloud-1 {
  width: 320px;
  height: 80px;
  top: 18%;
  left: -340px;
  animation: driftSkyCloud 24s linear infinite;
  opacity: 0.7;
}
.sky-cloud-1::before { width: 130px; height: 130px; top: -55px; left: 45px; }
.sky-cloud-1::after { width: 150px; height: 150px; top: -65px; right: 45px; }

.sky-cloud-2 {
  width: 240px;
  height: 65px;
  top: 55%;
  left: -260px;
  animation: driftSkyCloud 32s linear infinite 6s;
  opacity: 0.55;
  transform: scale(0.85);
}
.sky-cloud-2::before { width: 95px; height: 95px; top: -40px; left: 35px; }
.sky-cloud-2::after { width: 110px; height: 110px; top: -50px; right: 35px; }

.sky-cloud-3 {
  width: 280px;
  height: 70px;
  top: 75%;
  left: -300px;
  animation: driftSkyCloud 20s linear infinite 2s;
  opacity: 0.6;
}
.sky-cloud-3::before { width: 110px; height: 110px; top: -45px; left: 40px; }
.sky-cloud-3::after { width: 125px; height: 125px; top: -55px; right: 40px; }

@keyframes driftSkyCloud {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 400px)); }
}

.flight-container {
  position: absolute;
  top: 30%;
  left: 0;
  width: 100%;
  height: 50px;
  pointer-events: none;
  z-index: 20;
}

.plane-flight-assembly {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  will-change: left;
  animation: flyStraightAcross 3.2s linear forwards;
}

@keyframes flyStraightAcross {
  0% { left: -350px; }
  100% { left: calc(100vw + 100px); }
}

.horizontal-airplane {
  width: 68px;
  height: 30px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contrail-tail {
  width: 220px;
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.55) 75%, rgba(255, 255, 255, 0.95) 100%);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
  margin-right: -4px;
  flex-shrink: 0;
}

.preloader-brand-box {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 60px;
  animation: preloaderBrandFadeIn 0.6s ease-out forwards;
}

@keyframes preloaderBrandFadeIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}

.preloader-logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.preloader-text-status {
  font-size: 0.95rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  text-shadow: 0 1px 4px rgba(15, 23, 42, 0.15);
}

.wave-dot {
  display: inline-block;
  animation: dotWave 1.4s infinite ease-in-out;
}
.wave-dot-1 { animation-delay: 0s; }
.wave-dot-2 { animation-delay: 0.2s; }
.wave-dot-3 { animation-delay: 0.4s; }

@keyframes dotWave {
  0%, 60%, 100% { opacity: 0.2; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.preloader-thin-progress {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.preloader-thin-fill {
  height: 100%;
  width: 0%;
  background: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  animation: fillThinBar 2.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes fillThinBar {
  0% { width: 0%; }
  40% { width: 55%; }
  85% { width: 90%; }
  100% { width: 100%; }
}

/* --- Header (Static) --- */
.site-header {
  height: var(--header-height);
  background-color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  position: static;
  width: 100%;
  z-index: 50;
}

.header-offset {
  padding-top: 0;
}

/* --- Card Styles & Hover Effects --- */
.fligher-card {
  background-color: var(--color-card-bg);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), border-color 0.25s ease;
  border: 1px solid rgba(176, 212, 241, 0.25);
}

.fligher-card-hover {
  cursor: pointer;
}

.fligher-card-hover:hover {
  transform: scale(1.03);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--color-accent);
}

/* --- Fade-In Page Animations --- */
@keyframes fadeInPage {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeInPage 0.4s ease-out forwards;
}

/* --- Main Page Sky Gradient & Animated Drifting Clouds --- */
.hero-gradient-bg {
  background: linear-gradient(180deg, #F0F8FF 0%, #E0F0FF 60%, #FFFFFF 100%);
  position: relative;
  overflow: hidden;
}

.clouds-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 100px;
  filter: blur(1px);
}

.cloud::before,
.cloud::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 50%;
}

.cloud-1 {
  width: 280px;
  height: 80px;
  top: 15%;
  left: -300px;
  animation: driftRight 45s linear infinite;
  opacity: 0.85;
}
.cloud-1::before { width: 110px; height: 110px; top: -50px; left: 40px; }
.cloud-1::after { width: 140px; height: 140px; top: -70px; right: 40px; }

.cloud-2 {
  width: 200px;
  height: 60px;
  top: 35%;
  left: -250px;
  animation: driftRight 65s linear infinite 12s;
  opacity: 0.6;
  transform: scale(0.8);
}
.cloud-2::before { width: 80px; height: 80px; top: -35px; left: 30px; }
.cloud-2::after { width: 90px; height: 90px; top: -45px; right: 35px; }

.cloud-3 {
  width: 240px;
  height: 70px;
  top: 60%;
  left: -280px;
  animation: driftRight 38s linear infinite 4s;
  opacity: 0.75;
}
.cloud-3::before { width: 95px; height: 95px; top: -40px; left: 35px; }
.cloud-3::after { width: 115px; height: 115px; top: -55px; right: 35px; }

.cloud-4 {
  width: 180px;
  height: 50px;
  top: 78%;
  left: -200px;
  animation: driftRight 80s linear infinite 25s;
  opacity: 0.5;
  transform: scale(0.65);
}
.cloud-4::before { width: 70px; height: 70px; top: -30px; left: 25px; }
.cloud-4::after { width: 80px; height: 80px; top: -40px; right: 25px; }

@keyframes driftRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(100vw + 400px)); }
}

/* --- Brand Orange Button --- */
.btn-search {
  background-color: var(--color-brand-orange);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 14px rgba(255, 140, 0, 0.35);
  cursor: pointer;
}

.btn-search:hover {
  background-color: var(--color-brand-orange-hover);
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.45);
  transform: translateY(-1px);
}

.btn-search:active {
  transform: translateY(1px);
}

.btn-search.loading {
  pointer-events: none;
  opacity: 0.92;
}

.btn-search.loading .btn-text {
  visibility: hidden;
}

.btn-search .btn-spinner {
  display: none;
  position: absolute;
}

.btn-search.loading .btn-spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #FFFFFF;
  animation: spin 0.8s linear infinite;
}

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

/* --- Mobile Drawer Navigation --- */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 80vw;
  background-color: #FFFFFF;
  z-index: 70;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 25px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

/* --- Form Field Enhancements --- */
.search-input-group {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.search-input-group:focus-within {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(176, 212, 241, 0.45);
}

/* --- Flight Timeline Bar in Results --- */
.flight-path-bar {
  position: relative;
  height: 2px;
  background-color: #CBD5E1;
  width: 100%;
}

.flight-path-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #3B82F6;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.flight-path-plane {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #FFFFFF;
  padding: 0 4px;
}

.badge-direct {
  background-color: #ECFDF5;
  color: #059669;
  border: 1px solid #A7F3D0;
}

.badge-stops {
  background-color: #FFFBEB;
  color: #D97706;
  border: 1px solid #FDE68A;
}

/* --- Sort Button Active States --- */
.sort-btn.active {
  background-color: #0F172A !important;
  color: #FFFFFF !important;
  border-color: #0F172A !important;
}

/* --- Flexible Dates Matrix Grid --- */
.flexible-matrix-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.matrix-date-cell {
  flex: 1;
  min-width: 95px;
  background-color: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.matrix-date-cell:hover {
  border-color: #3B82F6;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
}

.matrix-date-cell.active-date {
  border-color: #0F172A;
  background-color: #0F172A;
  color: #FFFFFF;
}

.matrix-date-cell.active-date .matrix-price {
  color: #FBBF24;
}

.matrix-date-cell.best-deal-date {
  border-color: #10B981;
  background-color: #ECFDF5;
}

/* --- Wishlist / Favorite Button --- */
.btn-wishlist {
  color: #94A3B8;
  transition: all 0.2s ease;
}

.btn-wishlist:hover {
  color: #F43F5E;
  transform: scale(1.15);
}

.btn-wishlist.active-fav {
  color: #F43F5E;
  fill: #F43F5E;
}

/* --- Fare Families Comparison Card --- */
.fare-family-badge {
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fare-family-badge:hover {
  border-color: #3B82F6;
  background-color: #EFF6FF;
}

.fare-family-badge.selected-fare {
  border-color: #3B82F6;
  background-color: #EFF6FF;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.2);
}

/* --- Airport Transfers Cards --- */
.transfer-card {
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.transfer-card:hover {
  border-color: #3B82F6;
  background-color: #F8FAFC;
}

.transfer-card.selected-transfer {
  border-color: #3B82F6;
  background-color: #EFF6FF;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.15);
}

/* --- Sticky Mobile Bottom Bar --- */
.sticky-mobile-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  padding: 12px 16px;
  z-index: 45;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

/* --- Range Slider Custom Styling --- */
input[type=range] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: #E2E8F0;
  border-radius: 6px;
}

input[type=range]::-webkit-slider-thumb {
  height: 18px;
  width: 18px;
  border-radius: 50%;
  background: #3B82F6;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -6px;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #2563EB;
}

/* --- Mobile Filter Bottom Sheet --- */
.mobile-filter-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 65;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-filter-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-filter-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 85vh;
  background-color: #FFFFFF;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  z-index: 75;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
}

.mobile-filter-sheet.open {
  transform: translateY(0);
}

/* --- Seat Map UI Styling --- */
.aircraft-cabin {
  background: #F8FAFC;
  border: 2px solid #E2E8F0;
  border-radius: 28px 28px 12px 12px;
  position: relative;
}

.aircraft-cockpit {
  width: 60px;
  height: 30px;
  margin: 0 auto 12px;
  border: 2px solid #CBD5E1;
  border-bottom: none;
  border-radius: 30px 30px 0 0;
  background: #E2E8F0;
}

.seat-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  cursor: pointer;
  user-select: none;
}

.seat-btn.seat-business {
  background-color: #EFF6FF;
  border: 1.5px solid #93C5FD;
  color: #1D4ED8;
}

.seat-btn.seat-legroom {
  background-color: #F0FDF4;
  border: 1.5px solid #86EFAC;
  color: #15803D;
}

.seat-btn.seat-economy {
  background-color: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  color: #334155;
}

.seat-btn:hover:not(.seat-occupied):not(.seat-selected) {
  transform: scale(1.1);
  border-color: #3B82F6;
  background-color: #DBEAFE;
}

.seat-btn.seat-selected {
  background-color: #FF8C00 !important;
  color: #FFFFFF !important;
  border-color: #E67E00 !important;
  box-shadow: 0 0 0 3px rgba(255, 140, 0, 0.35);
  transform: scale(1.08);
}

.seat-btn.seat-occupied {
  background-color: #E2E8F0 !important;
  color: #94A3B8 !important;
  border-color: #CBD5E1 !important;
  cursor: not-allowed;
  opacity: 0.6;
}

/* --- Add-on Option Cards --- */
.addon-card {
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  padding: 14px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.addon-card:hover {
  border-color: #93C5FD;
  background-color: #F8FAFC;
}

.addon-card.selected {
  border-color: #3B82F6;
  background-color: #EFF6FF;
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.1);
}

/* --- Printable E-Ticket View (@media print) --- */
@media print {
  body {
    background: #FFFFFF !important;
    color: #000000 !important;
  }
  .site-header,
  footer,
  .no-print,
  #mobileMenuBtn,
  #mobileDrawer,
  #mobileBackdrop,
  .fligher-preloader {
    display: none !important;
  }
  .header-offset {
    padding-top: 0 !important;
  }
  .printable-ticket {
    box-shadow: none !important;
    border: 1.5px solid #000000 !important;
    page-break-inside: avoid;
  }
}
