/* Expedia-like Flight Results UI */
:root {
  --page-bg: #f7f8fb;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow-sm: 0 2px 8px rgba(2, 6, 23, 0.06);
  --shadow-md: 0 10px 24px rgba(2, 6, 23, 0.10);
  --radius: 14px;
  /* Expedia-ish brand */
  --brand-blue: #3665f3;
  --brand-blue-600: #2853d8;
  --brand-yellow: #ffda00;
  --brand-yellow-600: #f2cc00;
  --success: #059669;
}

.bg-white {
  background-color: transparent !important;
}

.bg-white shadow rounded-lg p-4 {
  padding-top: 0px !important;
}

.shadow {
  --tw-shadow: none !important;
  --tw-shadow-colored: none !important;
  box-shadow: none !important;
}

.max-w-7xl {
  max-width: 90% !important;
}

.bg-gray-50 {
  background: #eef5ff3b !important;
}


/* Messages */
.message-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-message {
  background: #fff5f5;
  border-color: #fecaca;
  color: #9b1c1c;
}

.info-message {
  background: #eef5ff;
  border-color: #c7dbff;
  color: #1e40af;
}

.success-message {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

/* Filter sidebar */
.filter-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.filter-section {
  margin-bottom: 20px;
}

.filter-section-title {
  font-weight: 700;
  color: #0f172a;
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Flight Card (used across list + wizard cards) */
.flight-card-simple {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease;
}

.flight-card-simple:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* New summary layout to match design */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.route-title {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  gap: 10px;
}

.time-big {
  font-weight: 800;
  color: #111827;
}

.timeline {
  position: relative;
  height: 2px;
  background: #e5e7eb;
  border-radius: 999px;
}

.timeline::before,
.timeline::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 8px;
  height: 8px;
  background: #9ca3af;
  border-radius: 999px;
}

.timeline::before {
  left: 0;
}

.timeline::after {
  right: 0;
}

.dates-row {
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.chip {
  font-size: 12px;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 600;
}

.airline-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.airline-badge img.airline-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 2px;
}

.airline-badge .name {
  font-weight: 700;
  color: #0f172a;
}

.airline-badge .code {
  font-size: 12px;
  color: var(--muted);
}

.price-stack {
  text-align: right;
  min-width: 180px;
}

.price-stack .price-label {
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.price-stack .price-value {
  color: var(--success);
  font-weight: 900;
  font-size: 22px;
}

.price-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Typical layout like Expedia: left info, right price/actions */
.flight-card-simple .text-emerald-600 {
  color: var(--success) !important;
}

.flight-card-simple .text-gray-600 {
  color: var(--muted) !important;
}

.flight-card-simple .text-lg {
  font-weight: 700;
}

.flight-card-simple .text-xl {
  font-weight: 800;
}

/* Buttons inside cards */
.flight-card-simple .view-details {
  background: var(--brand-blue) !important;
  color: #fff !important;
  border: 1px solid var(--brand-blue) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  box-shadow: 0 6px 14px rgba(54, 101, 243, .25);
}

.flight-card-simple .view-details:hover {
  background: var(--brand-blue-600) !important;
}

.flight-card-simple .select-arrival,
.flight-card-simple .select-return {
  background: var(--brand-yellow) !important;
  color: #111827 !important;
  border: 1px solid #eab308 !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  box-shadow: 0 6px 14px rgba(250, 204, 21, .25);
}

.flight-card-simple .select-arrival:hover,
.flight-card-simple .select-return:hover {
  background: var(--brand-yellow-600) !important;
}

/* Legacy generic buttons (if used) */
.btn-details {
  background: #f3f4f6;
  color: #111827;
  border-radius: 10px;
}

.btn-details:hover {
  background: #e5e7eb;
}

.btn-book {
  background: var(--brand-blue);
  color: #fff;
  border-radius: 10px;
}

.btn-book:hover {
  filter: brightness(1.05);
}

.price {
  color: var(--success);
  font-weight: 800;
  font-size: 20px;
}

/* Divider line within card actions */
.flight-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.buttons {
  display: flex;
  gap: 10px;
}

/* Wizard containers */
#roundtripWizard {
  background: transparent;
}


#wizardStep1 h3,
#wizardStep2 h3 {
  font-weight: 800;
  color: #0f172a;
}

#backToStep1 {
  color: var(--brand-blue);
  font-weight: 700;
}

#backToStep1:hover {
  text-decoration: underline;
}

/* Popup (modal) */
.flight-details-popup {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .6);
  backdrop-filter: blur(6px);
}

.popup-content {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 960px;
  max-width: 92%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .25);
}

.popup-header {
  background: #f0bd00 !important;
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 2;
}

.popup-header h3 {
  margin: 0;
  font-weight: 900;
  letter-spacing: .01em;
}

.close-popup {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.close-popup:hover {
  background: rgba(255, 255, 255, .25);
}

.popup-body {
  padding: 20px;
  max-height: calc(90vh - 64px);
  overflow-y: auto;
}

/* Segment details inside popup */
.segment-detail {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
  font-weight: 800;
  color: #0f172a;
}

.segment-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}

.segment-departure,
.segment-arrival {
  text-align: center;
  flex: 1;
}

.segment-arrow {
  color: var(--brand-blue);
  font-weight: 900;
  margin: 0 12px;
}

.time {
  font-weight: 800;
  color: #111827;
}

.date,
.airport {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.segment-duration {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px dashed var(--border);
}

.layover-info {
  background: #fff8e1;
  color: #92400e;
  border-left: 3px solid #f59e0b;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  margin: 10px 0;
}

/* Fare block */
.fare-breakdown {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 14px;
}

.fare-breakdown h4 {
  margin: 0 0 10px;
  font-weight: 800;
  color: #0f172a;
}

.fare-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
}

.fare-row:last-child {
  border-bottom: none;
}

.fare-row.discount {
  color: #16a34a;
  font-weight: 700;
}

.fare-row.total {
  color: #0f172a;
  font-weight: 900;
  border-top: 2px solid var(--brand-blue);
  margin-top: 6px;
  padding-top: 12px;
}

/* Responsive tweaks */
@media (max-width: 1024px) {
  .popup-content {
    width: 95%;
  }
}

@media (max-width: 768px) {
  .popup-body {
    padding: 14px;
  }

  .segment-route {
    flex-direction: column;
    gap: 10px;
  }

  .segment-arrow {
    transform: rotate(90deg);
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .price-stack {
    text-align: left;
  }

  .price-actions {
    justify-content: center;
  }
}

/* Ensure popup opens reliably and layers correctly */
.flight-details-popup[style*="display: flex"],
.flight-details-popup.open {
  display: flex !important;
}

.flight-details-popup .popup-overlay {
  z-index: 1;
}

.flight-details-popup .popup-content {
  z-index: 2;
}