/* ============================================
   Seats.aero Prototype - Premium Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* === CSS Variables === */
:root {
  --bg-primary: #050510;
  --bg-secondary: #0d0d20;
  --bg-card: #12122a;
  --bg-card-hover: #1a1a3a;
  --bg-glass: rgba(18, 18, 42, 0.75);
  --bg-glass-light: rgba(255, 255, 255, 0.03);

  --gold: #d4af37;
  --gold-light: #f0d060;
  --gold-dim: rgba(212, 175, 55, 0.15);

  --text-primary: #f0f0f5;
  --text-secondary: #8888aa;
  --text-dim: #555570;

  --accent-green: #00d68f;
  --accent-red: #ff4d6a;
  --accent-blue: #4d8af0;
  --accent-purple: #a855f7;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-gold: rgba(212, 175, 55, 0.3);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.08);
  --shadow-float: 0 12px 40px rgba(0, 0, 0, 0.5);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  min-height: 100vh;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-dim);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* === Header / Navbar === */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  height: 64px;
  background: rgba(5, 5, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
}

.logo span {
  color: var(--gold);
}

.logo-icon {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #f2f2f2;
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
}

.logo-image {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

.logo-wordmark {
  width: 170px;
  height: 32px;
  max-width: 170px;
  max-height: 32px;
  object-fit: contain;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border: none;
  background: none;
  cursor: pointer;
}

.nav-pill:hover,
.nav-pill.active {
  color: var(--gold);
  background: var(--gold-dim);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bg-primary);
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.nav-badge:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

/* === Hero Section === */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 140px 24px 40px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--gold-dim);
  border: 1px solid var(--border-gold);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
  animation: fadeInUp 0.6s ease-out;
}

.hero-badge .pulse {
  width: 6px;
  height: 6px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero h1 {
  font-family: 'Inter', sans-serif;
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--gold), var(--gold-light), #fff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 550px;
  line-height: 1.6;
  margin-bottom: 32px;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* === Stats Bar === */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 20px 0;
  margin-bottom: 12px;
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* === Search Panel === */
.search-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  max-width: 720px;
  width: 100%;
  margin: 0 auto 40px;
  animation: fadeInUp 0.6s ease-out 0.4s both;
  box-shadow: var(--shadow-card);
}

.search-group {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 16px;
  transition: var(--transition);
  min-width: 140px;
}

.search-group:hover {
  background: var(--bg-glass-light);
}

.search-group label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  white-space: nowrap;
}

.search-group select,
.search-group input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  min-width: 0;
}

.search-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.search-divider {
  width: 1px;
  height: 32px;
  background: var(--border-subtle);
  flex-shrink: 0;
}

/* With many controls, keep the panel readable by hiding decorative dividers */
@media (max-width: 1400px) {
  .search-divider {
    display: none;
  }
}

.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  border: none;
  cursor: pointer;
  color: var(--bg-primary);
  font-size: 20px;
  flex-shrink: 0;
  transition: var(--transition);
}

.search-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

/* === Main Content Layout === */
.main-content {
  display: flex;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 24px 48px;
  min-height: 70vh;
}

/* === Map Container === */
.map-wrapper {
  flex: 1;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  min-height: 550px;
}

.map-quick-filters {
  position: absolute;
  top: 12px;
  left: 68px;
  z-index: 850;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: calc(100% - 80px);
}

.map-filter-btn {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(13, 13, 32, 0.88);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.map-filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-gold);
}

.map-filter-btn.active {
  color: var(--gold);
  border-color: var(--border-gold);
  background: var(--gold-dim);
}

#map {
  width: 100%;
  height: 100%;
  min-height: 550px;
  background: var(--bg-secondary);
}

.map-overlay-stats {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 800;
  display: flex;
  gap: 8px;
}

.map-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.map-stat-chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-gold {
  background: var(--gold);
}

.dot-green {
  background: var(--accent-green);
}

.dot-blue {
  background: var(--accent-blue);
}

/* === Sidebar / Results Panel === */
.sidebar {
  width: 380px;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-left: 20px;
  flex-shrink: 0;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.sidebar-header h3 {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
}

.sidebar-count {
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 10px;
  background: var(--bg-glass-light);
  border-radius: 10px;
}

.sidebar-filters {
  display: flex;
  gap: 6px;
  padding: 12px 20px;
  background: var(--bg-card);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sidebar-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-glass-light);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.filter-chip:hover,
.filter-chip.active {
  color: var(--gold);
  background: var(--gold-dim);
  border-color: var(--border-gold);
}

.flights-list {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  max-height: 450px;
}

/* === Flight Card === */
.flight-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
}

.flight-card:hover {
  background: var(--bg-card-hover);
}

.flight-card:last-child {
  border-bottom: none;
}

.flight-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flight-airports {
  display: flex;
  align-items: center;
  gap: 12px;
}

.airport-code {
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.route-line {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
}

.route-line .plane-icon {
  font-size: 14px;
  color: var(--gold);
}

.route-line .dash {
  width: 30px;
  height: 1px;
  background: var(--border-subtle);
}

.flight-city {
  font-size: 12px;
  color: var(--text-secondary);
}

.flight-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flight-airlines {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.airline-tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  background: var(--bg-glass-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.flight-points {
  text-align: right;
}

.points-value {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
}

.points-label {
  font-size: 10px;
  color: var(--text-dim);
}

.availability-badges {
  display: flex;
  gap: 6px;
}

.avail-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.avail-badge.available {
  background: rgba(0, 214, 143, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0, 214, 143, 0.2);
}

.avail-badge.unavailable {
  background: rgba(255, 77, 106, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(255, 77, 106, 0.15);
  opacity: 0.5;
}

/* === Loading State === */
.loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  z-index: 900;
  gap: 16px;
  border-radius: var(--radius-lg);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-subtle);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  font-size: 14px;
  color: var(--text-secondary);
}

.loading-progress {
  width: 200px;
  height: 3px;
  background: var(--border-subtle);
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
  gap: 12px;
}

.empty-state .icon {
  font-size: 48px;
  opacity: 0.3;
}

.empty-state h4 {
  font-size: 16px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 13px;
  color: var(--text-dim);
}

/* === Destination Detail Modal === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.modal-backdrop.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-glass-light);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--accent-red);
  color: white;
  border-color: var(--accent-red);
}

.modal-body {
  padding: 20px 28px 28px;
  overflow-y: auto;
  max-height: 60vh;
}

.modal-route-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 20px 0;
}

.modal-airport {
  text-align: center;
}

.modal-airport .code {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--gold);
}

.modal-airport .city {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-route-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
}

.modal-route-line .long-dash {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--border-subtle), var(--gold), var(--border-subtle));
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}

.detail-card {
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.detail-card .label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.detail-card .value {
  font-family: 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.detail-card .value.gold {
  color: var(--gold);
}

.detail-card .value.green {
  color: var(--accent-green);
}

.modal-dates {
  margin-top: 16px;
}

.modal-dates h4 {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.date-chip {
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

/* === Hybrid Results Section === */
.hybrid-section {
  max-width: 1440px;
  margin: 40px auto 0;
  padding: 0 24px;
}

.hybrid-header {
  margin-bottom: 24px;
}

.hybrid-header h2 {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hybrid-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.hybrid-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* === Horizontal Timeline Card (mockup-matching) === */
.hy-timeline-card {
  background: #0c0e21;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hy-option-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.hy-option-select {
  flex: 1;
  min-width: 220px;
  background: rgba(11, 14, 33, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.24);
  color: #d8dbec;
  border-radius: 8px;
  font-size: 12px;
  padding: 7px 10px;
}

.hy-option-btn {
  border: 1px solid rgba(39, 216, 134, 0.45);
  background: rgba(39, 216, 134, 0.08);
  color: #27d886;
  border-radius: 8px;
  font-size: 12px;
  padding: 7px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.hy-option-btn:hover {
  background: rgba(39, 216, 134, 0.16);
}

/* Header row */
.htl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.htl-head-date {
  color: #c7c9d9;
  font-size: 13px;
}

.htl-head-dur {
  color: #878cac;
  font-size: 13px;
}

/* Horizontal timeline strip */
.htl-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 14px;
  background: linear-gradient(135deg, #090b19 0%, #0d1025 100%);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  scrollbar-width: thin;
}

/* Departure / arrival node */
.htl-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 50px;
  flex-shrink: 0;
}

.htl-time {
  font-size: 17px;
  font-weight: 800;
  color: #f4f4f8;
  line-height: 1.1;
}

.htl-code {
  font-size: 12px;
  font-weight: 700;
  color: #a0a4c0;
  margin-top: 3px;
}

/* Segment bar */
.htl-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 90px;
  padding: 0 4px;
  gap: 4px;
}

.htl-seg-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.htl-airline-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.htl-airline-badge-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #0d0d20;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  letter-spacing: -0.3px;
  background: #d4af37;
}

.htl-seg.seg-cash .htl-airline-badge-fallback {
  background: #1ed47f;
}

.htl-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 10px;
  color: #0d0d20;
  background: #d4af37;
  white-space: nowrap;
}

.htl-seg.seg-cash .htl-tag {
  background: #1ed47f;
}

.htl-bar-wrap {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.htl-bar-line {
  flex: 1;
  height: 4px;
  border-radius: 3px;
  background: #d4af37;
}

.htl-seg.seg-cash .htl-bar-line {
  background: #1ed47f;
}

.htl-bar-dur {
  font-size: 10px;
  color: #a0a4c0;
  white-space: nowrap;
  margin-left: 6px;
  flex-shrink: 0;
}

/* Layover node with circle connector */
.htl-layover-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 68px;
  padding: 0 4px;
  gap: 3px;
}

.htl-layover-circle {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid #c9a93f;
  background: transparent;
}

.htl-layover-label {
  font-size: 9px;
  color: #c9a93f;
  white-space: nowrap;
  font-weight: 600;
}

/* Per-leg cost columns */
.htl-costs-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.htl-cost-col {
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.htl-cost-col.reward {
  background: rgba(212, 175, 55, 0.06);
}

.htl-cost-col.cash {
  background: rgba(39, 216, 134, 0.04);
}

.htl-cost-label {
  font-size: 11px;
  color: #878cac;
}

.htl-cost-val {
  font-size: 26px;
  font-weight: 800;
}

.htl-cost-val.reward-val {
  color: #e8be52;
}

.htl-cost-val.cash-val {
  color: #27d886;
}

.htl-cost-sub {
  font-size: 11px;
  color: #9ca3bf;
}

.htl-cost-cabin {
  font-size: 11px;
  color: #b0b3c6;
}

.htl-cost-seats {
  font-size: 11px;
  color: #27d886;
}

.htl-cost-link {
  font-size: 12px;
  margin-top: 4px;
  text-decoration: none;
}

.htl-cost-link.cash {
  color: #27d886;
}

.htl-cost-link.reward {
  color: #d4af37;
}

/* Total Trip Cost bar */
.htl-total-bar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.18);
}

.htl-total-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.htl-total-left span {
  font-size: 11px;
  color: #878cac;
}

.htl-total-left strong {
  font-size: 20px;
  font-weight: 800;
  color: #d4af37;
}

.htl-total-right {
  font-size: 12px;
  color: #9ca3bf;
}

/* === Ranked Option Card === */
.ranked-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.ranked-card:hover {
  border-color: var(--border-gold);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.ranked-card.rank-1 {
  border-color: var(--gold);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.12);
}

.ranked-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}

.ranked-route {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ranked-route .code {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
}

.ranked-route .arrow {
  color: var(--gold);
  font-size: 16px;
}

.ranked-route .city {
  font-size: 12px;
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}

.rank-medal {
  font-size: 24px;
  line-height: 1;
}

.score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--gold-dim);
  color: var(--gold);
}

/* Comparison Row */
.comparison-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.comparison-item {
  flex: 1;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.comparison-item .comp-label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.comparison-item .comp-value {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.comp-value.gold {
  color: var(--gold);
}

.comp-value.green {
  color: var(--accent-green);
}

.comp-value.blue {
  color: var(--accent-blue);
}

/* Tags Row */
.tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.hybrid-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hybrid-tag.best-value {
  background: rgba(0, 214, 143, 0.1);
  color: var(--accent-green);
  border: 1px solid rgba(0, 214, 143, 0.2);
}

.hybrid-tag.fastest {
  background: rgba(77, 138, 240, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(77, 138, 240, 0.2);
}

.hybrid-tag.flexible {
  background: rgba(168, 85, 247, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.hybrid-tag.hub-route {
  background: rgba(255, 165, 0, 0.1);
  color: #ffa500;
  border: 1px solid rgba(255, 165, 0, 0.2);
}

.hybrid-tag.time-ok {
  background: rgba(0, 214, 143, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(0, 214, 143, 0.15);
}

.hybrid-tag.time-slow {
  background: rgba(255, 77, 106, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(255, 77, 106, 0.15);
}

.hybrid-tag.direct {
  background: var(--gold-dim);
  color: var(--gold);
  border: 1px solid var(--border-gold);
}

/* Meta row */
.ranked-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.ranked-meta-left {
  display: flex;
  gap: 4px;
}

.ranked-meta-right {
  font-size: 11px;
  color: var(--text-dim);
}

.cpp-value {
  font-weight: 700;
  color: var(--accent-green);
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border-subtle);
  margin-top: 40px;
}

.footer-brand {
  margin-bottom: 10px;
}

.footer-logo {
  width: 120px;
  height: auto;
  object-fit: contain;
  opacity: 0.95;
}

.footer p {
  font-size: 13px;
  color: var(--text-dim);
}

.footer a {
  color: var(--gold);
  text-decoration: none;
}

/* === Animations === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
}

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

@keyframes arcDraw {
  from {
    stroke-dashoffset: 1000;
  }

  to {
    stroke-dashoffset: 0;
  }
}

/* === Leaflet Custom Markers === */
.custom-marker {
  position: relative;
}

.marker-dot {
  width: 10px;
  height: 10px;
  background: var(--gold);
  border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  transition: transform 0.2s ease;
}

.marker-dot:hover {
  transform: scale(1.4);
}

.marker-dot.origin {
  width: 14px;
  height: 14px;
  background: var(--accent-green);
  border-color: rgba(0, 214, 143, 0.4);
  box-shadow: 0 0 20px rgba(0, 214, 143, 0.5);
}

.marker-label {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

/* === Leaflet Overrides === */
.leaflet-container {
  background: var(--bg-secondary) !important;
  font-family: 'Inter', sans-serif !important;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border-subtle) !important;
  box-shadow: var(--shadow-float) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
}

.leaflet-popup-content {
  margin: 12px 16px !important;
  font-size: 13px !important;
}

.leaflet-control-zoom {
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-sm) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-subtle) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-card-hover) !important;
  color: var(--gold) !important;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    margin-left: 0;
    margin-top: 20px;
  }

  .flights-list {
    max-height: 350px;
  }
}

@media (max-width: 768px) {
  .navbar {
    padding: 0 16px;
  }

  .nav-links {
    display: none;
  }

  .hero {
    padding: 100px 16px 24px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .stats-bar {
    gap: 24px;
  }

  .stat-value {
    font-size: 22px;
  }

  .search-panel {
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 16px;
  }

  .search-divider {
    width: 100%;
    height: 1px;
  }

  .search-btn {
    width: 100%;
    border-radius: var(--radius-md);
    height: 44px;
  }

  .main-content {
    padding: 0 16px 32px;
  }

  .map-wrapper {
    min-height: 400px;
  }

  #map {
    min-height: 400px;
  }

  .modal {
    width: 95%;
    max-height: 85vh;
  }

  .modal-route-hero {
    gap: 12px;
  }

  .modal-airport .code {
    font-size: 24px;
  }

  .modal-detail-grid {
    grid-template-columns: 1fr;
  }

  .map-quick-filters {
    left: 12px;
    top: 60px;
    max-width: calc(100% - 24px);
  }
}

/* === Sort Toggles === */
.hybrid-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.sort-toggles {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.sort-btn {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.sort-btn:hover {
  color: var(--text-primary);
}

.sort-btn.active {
  background: var(--gold);
  color: #000;
}

/* === Overnight Toggle === */
.hybrid-options-bar {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.toggle-text {
  user-select: none;
}

/* === Expandable Cards === */
.ranked-card {
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
}

.ranked-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}

.ranked-card .flight-legs {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.ranked-card.expanded .flight-legs {
  max-height: 600px;
  opacity: 1;
}

.expand-hint {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  padding: 6px 0 0;
  opacity: 0.6;
}

.ranked-card.expanded .expand-hint {
  display: none;
}

/* Flight leg breakdown inside expanded card */
.flight-leg {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  margin: 4px 0;
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

.flight-leg .leg-route {
  font-weight: 700;
  min-width: 120px;
  color: var(--text-primary);
}

.flight-leg .leg-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.flight-leg .leg-type.reward {
  background: var(--gold-dim);
  color: var(--gold);
}

.flight-leg .leg-type.cash {
  background: rgba(77, 138, 240, 0.15);
  color: #4d8af0;
}

.flight-leg .leg-cost {
  margin-left: auto;
  font-weight: 700;
}

.flight-leg .leg-cost.gold {
  color: var(--gold);
}

.flight-leg .leg-cost.blue {
  color: #4d8af0;
}

/* Total summary row inside expanded card */
.total-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(212, 175, 55, 0.08);
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid var(--border-gold);
  font-weight: 700;
}

.total-summary .total-label {
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.total-summary .total-value {
  color: var(--gold);
  font-size: 15px;
}

/* === Combined Cost Display === */
.cost-combined {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.cost-combined .points-part {
  color: var(--gold);
  font-weight: 700;
}

.cost-combined .cash-part {
  color: #4d8af0;
  font-size: 12px;
}

.cost-combined .plus {
  color: var(--text-secondary);
  font-size: 11px;
}