:root {
  --bg: #0f172a;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #f1f5f9;
}

a { color: var(--primary); }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0ea5e9 100%);
  color: #fff;
  padding: 0 16px 90px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 0;
}

.brand { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.5px; }

.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-link { color: rgba(255, 255, 255, 0.85); text-decoration: none; font-weight: 600; font-size: 0.9rem; padding: 4px 2px; border-bottom: 2px solid transparent; }
.nav-link:hover { color: #fff; }
.nav-link.active { color: #fff; border-bottom-color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.currency-picker select {
  font: inherit;
  font-weight: 600;
  font-size: 0.82rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
}
.currency-picker select option { color: var(--text); }

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.hero-text { text-align: center; max-width: 720px; margin: 24px auto 36px; }
.hero-text h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 8px; }
.hero-text p { margin: 0; opacity: 0.9; }

/* Search card */
.search-card {
  max-width: 1080px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 8px 8px 20px;
  color: var(--text);
}

.tabs { display: flex; gap: 4px; padding: 8px; }
.tab {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
}
.tab.active { background: #eff6ff; color: var(--primary-dark); }

.search-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 8px 12px;
}
.search-form.hidden { display: none; }

.field { display: flex; flex-direction: column; flex: 1 1 150px; }
.field.small { flex: 0 0 110px; }
.field.grow { flex: 2 1 240px; }
.field label { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field label small { font-weight: 400; }
.field input {
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
}
.field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* Travelers selector */
.field.travelers { position: relative; flex: 0 0 170px; }
.travelers-toggle {
  font: inherit;
  text-align: left;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.travelers-toggle:hover { border-color: var(--primary); }
.travelers-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 280px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.travelers-panel.hidden { display: none; }
.trav-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.trav-label strong { display: block; font-size: 0.92rem; }
.trav-label small { color: var(--muted); font-size: 0.75rem; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .step {
  width: 32px; height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.stepper .step:hover { border-color: var(--primary); color: var(--primary); }
.stepper span { min-width: 16px; text-align: center; font-weight: 600; }
.young-list .trav-row { border-top: 1px dashed var(--border); }
.young-controls { display: flex; align-items: center; gap: 8px; }
.young-age { font: inherit; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px; }
.young-remove { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 0.95rem; }
.young-remove:hover { color: #dc2626; }
.add-young {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px dashed var(--border);
  border-radius: 9px;
  background: #f8fafc;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.add-young:hover:not(:disabled) { background: #eff6ff; }
.add-young:disabled { opacity: 0.5; cursor: not-allowed; }
.trav-note { margin: 10px 0 0; font-size: 0.78rem; color: #059669; background: #ecfdf5; padding: 8px 10px; border-radius: 8px; }
.trav-note.hidden { display: none; }
.trav-done { width: 100%; margin-top: 12px; padding: 10px; border: none; border-radius: 9px; background: var(--primary); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.trav-done:hover { background: var(--primary-dark); }
.sum-hint { color: #94a3b8; font-size: 0.85rem; }

/* Trip-type toggle */
.trip-type {
  flex: 1 1 100%;
  display: flex;
  gap: 18px;
  padding: 0 4px 2px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.trip-type label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.trip-type input { accent-color: var(--primary); }

/* Airport autocomplete combobox */
.combobox { position: relative; }
.combo-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
}
.combo-list.hidden { display: none; }
.combo-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.combo-list li:hover,
.combo-list li.active { background: #eff6ff; }
.combo-list .ac-code {
  flex: 0 0 auto;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--primary-dark);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  padding: 4px 7px;
  min-width: 42px;
  text-align: center;
}
.combo-list .ac-text { font-size: 0.82rem; line-height: 1.25; }
.combo-list .ac-text small { color: var(--muted); }

.btn-search {
  flex: 0 0 auto;
  background: var(--primary);
  color: #fff;
  border: none;
  font: inherit;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-search:hover { background: var(--primary-dark); }
.btn-search:disabled { opacity: 0.6; cursor: progress; }

/* Results */
.results { max-width: 1080px; margin: -50px auto 40px; padding: 0 16px; }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 60px 0 14px; flex-wrap: wrap; }
.result-head h2 { margin: 0; font-size: 1.2rem; }
.result-head .hint { color: var(--muted); font-size: 0.85rem; }

/* Sort dropdown */
.sort { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.sort select {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  padding: 8px 30px 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.sort select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15); }

/* Round-trip pricing explainer */
.rt-note {
  background: #eff6ff;
  border: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 10px 14px;
  border-radius: 10px;
  margin: 0 0 16px;
}

/* Estimated (outbound) price is de-emphasized vs the exact total */
.price .price-pre { font-size: 0.72rem; color: var(--muted); line-height: 1; }
.amount.estimate { font-size: 1.15rem; color: var(--muted); }

/* Leg headers (round-trip outbound / return) */
.leg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 22px 0 12px; flex-wrap: wrap; }
.leg-title { margin: 0; font-size: 1rem; color: var(--text); }
.leg-title small { color: var(--muted); font-weight: 400; }

/* Two-column round-trip layout */
.legs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.leg-col { min-width: 0; }
.flight-list { display: flex; flex-direction: column; }
.legs-grid .flight { grid-template-columns: 1fr auto; padding: 14px; }
.legs-grid .flight .price { text-align: right; }

/* Selectable cards */
.flight.selectable { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s, transform 0.06s; }
.flight.selectable:hover { border-color: var(--primary); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.12); }
.flight.selectable:active { transform: scale(0.997); }
.flight.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.select-hint { display: inline-block; margin-top: 6px; font-size: 0.78rem; font-weight: 600; color: var(--primary); }
.flight.selected .select-hint::before { content: '✓ '; }
.flight.selected .select-hint { color: #059669; }
.flight.selected .select-hint::after { content: 'ed'; }

/* Round-trip summary bar */
.trip-summary {
  position: sticky;
  bottom: 14px;
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  background: #0f172a;
  color: #fff;
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.35);
}
.trip-summary.hidden { display: none; }
.sum-legs { display: flex; flex-wrap: wrap; gap: 18px; flex: 1 1 320px; }
.sum-leg { display: flex; flex-direction: column; font-size: 0.85rem; }
.sum-leg strong { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; color: #94a3b8; }
.sum-leg .sum-price { font-weight: 700; color: #38bdf8; }
.sum-leg.empty span { color: #64748b; font-style: italic; }
.sum-total { text-align: right; }
.sum-total .t-label { font-size: 0.72rem; color: #94a3b8; }
.sum-total .t-amount { font-size: 1.5rem; font-weight: 700; }
.btn-book.big { padding: 12px 22px; font-size: 0.95rem; }
.btn-book.disabled { background: #475569; pointer-events: none; opacity: 0.7; }

@media (max-width: 720px) {
  .legs-grid { grid-template-columns: 1fr; }
}

/* Book it button */
.btn-book {
  display: inline-block;
  margin-top: 8px;
  background: #059669;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 9px;
  transition: background 0.15s;
}
.btn-book:hover { background: #047857; }

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.05);
  margin-bottom: 14px;
  overflow: hidden;
}

/* Flight card */
.flight {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 18px;
  align-items: center;
}
.flight .route { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.flight .leg { text-align: center; }
.flight .leg .time { font-size: 1.25rem; font-weight: 700; }
.flight .leg .code { color: var(--muted); font-size: 0.85rem; }
.flight .path { text-align: center; color: var(--muted); font-size: 0.8rem; min-width: 120px; }
.flight .path .line { border-top: 2px dashed var(--border); margin: 6px 0; position: relative; }
.flight .airline { font-weight: 600; margin-bottom: 4px; }
.flight .price { text-align: right; }
.flight .price .amount { font-size: 1.5rem; font-weight: 700; color: var(--primary-dark); }
.flight .price .stops { color: var(--muted); font-size: 0.8rem; }

/* Hotel grid */
.hotel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.hotel { display: flex; flex-direction: column; }
.hotel .thumb { height: 150px; background: #dbeafe center/cover no-repeat; display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.hotel .body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
.hotel .name { font-weight: 600; margin: 0 0 4px; }
.hotel .meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 8px; }
.hotel .rating { color: #b45309; font-weight: 600; font-size: 0.85rem; }
.hotel .amenities { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.hotel .amenities span { background: #f1f5f9; color: var(--muted); font-size: 0.72rem; padding: 3px 8px; border-radius: 999px; }
.hotel .price { margin-top: auto; font-weight: 700; color: var(--primary-dark); font-size: 1.1rem; }
.hotel .price small { color: var(--muted); font-weight: 400; }

/* States */
.notice { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); }
.notice.error { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 12px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Booking modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 460px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
}
.bk-head { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.bk-head small { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.bk-sub { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; }
.bk-list { display: flex; flex-direction: column; gap: 8px; }
.bk-row {
  display: grid;
  grid-template-columns: 28px 1fr auto auto;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.bk-row:hover { border-color: var(--primary); background: #f8fbff; }
.bk-logo { width: 28px; height: 28px; object-fit: contain; }
.bk-logo-ph { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: #eff6ff; border-radius: 6px; }
.bk-name { font-weight: 600; }
.bk-name em { font-style: normal; font-size: 0.7rem; font-weight: 700; color: #059669; background: #ecfdf5; padding: 2px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.bk-price { font-weight: 700; color: var(--primary-dark); }
.bk-go { font-size: 0.8rem; font-weight: 600; color: var(--primary); }
.bk-close { margin-top: 16px; width: 100%; padding: 11px; border: 1px solid var(--border); background: #fff; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer; }
.bk-close:hover { background: #f1f5f9; }
.bk-fallback { margin: 14px 0; }
.sum-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Explore (map) page ---- */
.explore-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.hero.compact { padding: 0 16px 18px; flex: 0 0 auto; }
.explore-bar { max-width: 1080px; margin: 14px auto 0; }
.explore-bar .search-form {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: var(--text);
}

/* Region toggle (Europe / World) */
.region-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.region-toggle .region {
  border: none;
  background: #fff;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  padding: 11px 16px;
  cursor: pointer;
}
.region-toggle .region + .region { border-left: 1px solid var(--border); }
.region-toggle .region.active { background: var(--primary); color: #fff; }

.explore-main { flex: 1 1 auto; display: flex; min-height: 0; }
.explore-list {
  flex: 0 0 340px;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  border-right: 1px solid var(--border);
}
.explore-map { flex: 1 1 auto; min-width: 0; z-index: 0; }

.explore-head { margin-bottom: 12px; }
.explore-head h2 { margin: 0; font-size: 1.1rem; }
.explore-head .hint { color: var(--muted); font-size: 0.82rem; }

.dest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.dest-row:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12); }
.dest-city strong { display: block; font-size: 0.95rem; }
.dest-city small { color: var(--muted); font-size: 0.78rem; }
.dest-price { font-weight: 700; color: var(--primary-dark); font-size: 1.05rem; white-space: nowrap; }

/* Map price tags */
.price-pin {
  background: #fff;
  border: 1px solid var(--primary);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(2, 6, 23, 0.25);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}
.price-pin.cheapest { background: #059669; border-color: #047857; color: #fff; }

@media (max-width: 700px) {
  .explore-page { height: auto; overflow: visible; }
  .explore-main { flex-direction: column; }
  .explore-list { flex: none; border-right: none; border-bottom: 1px solid var(--border); }
  .explore-map { height: 60vh; }
}

.footer { text-align: center; padding: 24px; color: var(--muted); font-size: 0.85rem; }

@media (max-width: 560px) {
  .flight { grid-template-columns: 1fr; }
  .flight .price { text-align: left; }
}
