/* styles.css */

:root{
  --brand-blue: #2563eb;
  --brand-blue-dark: #1e40af;
  --muted: #64748b;
  --card-bg: #ffffff;
  --glass: rgba(255,255,255,0.6);
  --success: #10b981;
}

/* Reset-ish */
* { box-sizing: border-box; }
html,body,#root { height: 100%; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale; }

/* Scrollbar (WebKit) */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Animation helpers */
.animate-in { animation: fadeIn 0.28s ease-out forwards; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Utility */
.hidden { display: none !important; }
.sr-only { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }

/* -----------------------------
   Top hero / header styling
   ----------------------------- */
header.site-hero {
  background: var(--brand-blue);
  color: white;
  padding: 3rem 0 4rem;
  text-align: center;
}

/* Card containers */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.12);
  padding: 1.25rem;
}

/* -----------------------------
   Search form and controls
   ----------------------------- */
.search-form-card {
  width: 100%;
  overflow: visible;
}

.search-form-card .card-inner {
  overflow: visible;
}

.search-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.search-controls .control {
  flex: 1 1 200px;
  min-width: 160px;
  position: relative;
  overflow: visible;
}

.search-controls .control.passengers {
  max-width: 220px;
  flex: 0 0 220px;
}

.search-controls .search-btn {
  flex: 0 0 auto;
  align-self: stretch;
  margin-left: 0;
  white-space: nowrap;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Ensure selects and native dropdown popups are not clipped */
.search-controls select,
.search-controls select * {
  z-index: 9999;
  position: relative;
}

/* Dropdowns/elements that create popovers need high z-index */
.autocomplete-dropdown,
.search-controls .dropdown,
.search-controls [role="listbox"],
.modal-content,
.filter-panel,
.sidebar,
.autocomplete-results {
  z-index: 9999 !important;
}

/* -----------------------------
   Input container and icon alignment
   ----------------------------- */
.input-container {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  color: #111827;
  font-size: 0.95rem;
  border-radius: 10px;
  height: 56px;
  display: flex;
  align-items: center;
  position: relative;
  transition: box-shadow .12s ease, border-color .12s ease;
}
.input-container:focus-within {
  box-shadow: 0 6px 18px rgba(37,99,235,0.12);
  border-color: rgba(37,99,235,0.9);
}

.input-container .left-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  display: flex; align-items:center;
}

.input-container input,
.input-container select,
.input-container .display-placeholder {
  width: 100%;
  height: 100%;
  padding-left: 44px;
  padding-right: 12px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.95rem;
  color: #111827;
}

.date-input-container { position: relative; }
.date-input-placeholder {
  position: absolute;
  left: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
  color: #9ca3af;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* -----------------------------
   Autocomplete dropdown
   ----------------------------- */
.autocomplete-dropdown,
.autocomplete-results,
[data-testid$="-dropdown"] {
  background: #fff;
  border: 1px solid #e6eef8;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.08);
  max-height: 280px;
  overflow-y: auto;
  width: 100%;
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 9999;
}

.autocomplete-dropdown li,
.autocomplete-results li {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.autocomplete-dropdown li:last-child { border-bottom: none; }
.autocomplete-dropdown li:hover { background: #f8fafc; }

/* ---------------------------------------------------------
   STRICT DISPLAY LOGIC - Copy this block exactly
   --------------------------------------------------------- */

/* --- 1. The Floating Mobile Filter Button (Bottom Bar) --- */
.mobile-filter-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: white;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  z-index: 50; /* Above regular content */
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
  display: flex; /* Visible by default (Mobile first) */
  justify-content: center;
}

.mobile-filter-btn {
  width: 100%;
  background-color: var(--brand-blue);
  color: white;
  font-weight: 700;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* HIDE the mobile button on Desktop */
@media (min-width: 768px) {
  .mobile-filter-bar {
    display: none !important;
  }
}

/* --- 2. The Desktop Sidebar (Left Column) --- */
.desktop-sidebar-wrapper {
  display: none !important; /* Hidden by default (Mobile) */
}

/* SHOW the sidebar on Desktop */
@media (min-width: 768px) {
  .desktop-sidebar-wrapper {
    display: block !important;
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 80px; /* Below navbar */
    height: calc(100vh - 100px);
    overflow-y: auto;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
  }
}

/* --- 3. The Mobile Modal Overlay (When button is clicked) --- */
.mobile-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 10050; /* Highest z-index to cover everything */
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.mobile-filter-content {
  background: white;
  width: 100%;
  max-width: 480px;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slide-up 0.3s ease-out;
}
/* -----------------------------
   Seat selection / seat map
   ----------------------------- */
.seat-map {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.seat {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  transition: transform .08s ease, box-shadow .08s ease;
}
.seat:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(2,6,23,0.08); }
.seat-available { background-color: #e5e7eb; border: 1px solid #d1d5db; color: #111827; }
.seat-selected { background-color: #dc2626; color: white; border: 1px solid #dc2626; }
.seat-booked { background-color: #9ca3af; color: white; cursor: not-allowed; }
.seat-premium { border: 2px solid #f59e0b; }

.seat-legend { display:flex; gap:12px; flex-wrap:wrap; align-items:center; }
@media (max-width: 640px) {
  .seat-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .seat-legend-item { display:flex; align-items:center; gap:6px; font-size:12px; }
}

/* -----------------------------
   Flight path decoration
   ----------------------------- */
.flight-path { position: relative; display:block; }
.flight-path::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #dc2626 50%, transparent 100%);
}
.flight-path::after {
  content: '✈';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 0 8px;
  font-size: 14px;
  color: #6b7280;
}

/* -----------------------------
   Modal styles
   ----------------------------- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}
.modal-content {
  background: white;
  border-radius: 10px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 25px rgba(2,6,23,0.18);
  padding: 0;
}

/* -----------------------------
   Booking summary / success
   ----------------------------- */
.success-badge {
  width: 80px; height: 80px;
  border-radius: 9999px;
  display:flex; align-items:center; justify-content:center;
  background: #ecfdf5; color: #059669;
}

/* -----------------------------
   Responsive adjustments
   ----------------------------- */
@media (max-width: 640px) {
  .search-controls .control { flex-basis: 100%; min-width: auto; }
  .search-controls .control.passengers { max-width: none; }
  .seat-map { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

@media (min-width: 1400px) {
  .card { padding: 1.75rem; border-radius: 14px; }
  .search-controls .control { min-width: 240px; }
}

/* Ensure proper z-index for mobile filter */
.z-50 {
  z-index: 50;
}

/* Make sure the main content area takes remaining space */
.flex-1 {
  flex: 1 1 0%;
}

.min-w-0 {
  min-width: 0;
}

/* Mobile filter overlay */
.fixed {
  position: fixed;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.bg-opacity-50 {
  --tw-bg-opacity: 0.5;
}

/* Responsive behavior */
@media (max-width: 768px) {
  .md\\:hidden {
    display: none;
  }

  .md\\:flex-row {
    flex-direction: column;
  }
}

@media (min-width: 769px) {
  .md\\:flex-row {
    flex-direction: row;
  }
}

