:root {
  --brand: #2D34FF;
  --brand-dark: #1c22c7;
  --brand-soft: #e8e9ff;
  --bg: #04060f;
  --bg-elevated: #0b1022;
  --bg-card: rgba(255, 255, 255, 0.06);
  --text: #f4f4f8;
  --text-soft: #b9bed0;
  --text-muted: #8f95a8;
  --border: rgba(255, 255, 255, 0.14);
  --input-bg: rgba(255, 255, 255, 0.05);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.light-mode {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.96);
  --text: #191b22;
  --text-soft: #4f566b;
  --text-muted: #70778b;
  --border: rgba(25, 27, 34, 0.10);
  --input-bg: #f2f4fb;
  --shadow: 0 18px 45px rgba(22, 28, 45, 0.10);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Comfortaa', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

/* Deep navy, no photo, so the glass panels and tabs stand out */
body {
  background:
    radial-gradient(1100px 620px at 12% -10%, rgba(45, 52, 255, 0.22), transparent 60%),
    radial-gradient(900px 560px at 100% 8%, rgba(45, 52, 255, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

body.light-mode {
  background: var(--bg);
}

a, button, input, select {
  font-family: 'Comfortaa', sans-serif;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px 40px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logo {
  margin: 0;
  color: var(--brand);
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 700;
  line-height: 1;
}

.sub {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.home-link,
.mode-toggle {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero-card,
.services,
.section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  position: relative;
  z-index: 5;
}

.tab {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
  padding: 14px 20px;
  border-radius: 16px 16px 0 0;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.09);
}

body.light-mode .tab {
  background: rgba(25, 27, 34, 0.04);
  border-color: rgba(25, 27, 34, 0.08);
}

.tab.active {
  background: rgba(255, 255, 255, 0.10);
  color: var(--brand);
  border-color: var(--border);
}

.hero-card {
  padding: 22px;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.panel {
  display: none;
  overflow: visible;
}

.panel.active {
  display: block;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 18px;
  position: relative;
  z-index: 20;
}

.pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.pill.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(45, 52, 255, 0.28);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.grid-flight,
.grid-stay,
.grid-activity {
  display: grid;
  gap: 12px;
  overflow: visible;
}

.grid-flight {
  grid-template-columns: 1.1fr 1.1fr 0.9fr 0.9fr 1fr 150px;
}

.grid-stay {
  grid-template-columns: 1.4fr 0.9fr 0.9fr 1fr 150px;
}

.grid-activity {
  grid-template-columns: 1fr 150px;
}

.field {
  position: relative;
  min-height: 60px;
  display: flex;
  align-items: center;
  padding: 0 16px 0 44px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: visible;
  z-index: 25;
}

.field:focus-within {
  z-index: 60;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--brand);
  font-size: 1rem;
  z-index: 2;
}

.field input,
.field select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 0;
}

.field input::placeholder {
  color: var(--text-muted);
  font-weight: 500;
}

.search-btn {
  min-height: 60px;
  border: 0;
  border-radius: 14px;
  background: var(--brand);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s ease;
}

.search-btn:hover {
  background: var(--brand-dark);
}

.services {
  margin-top: 24px;
  padding: 18px 12px;
  position: relative;
  z-index: 1;
}

.services-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.service {
  text-align: center;
  padding: 12px 6px;
}

.service-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 1.3rem;
  font-weight: 700;
}

.service-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.45;
  font-weight: 700;
}

.section {
  margin-top: 24px;
  padding: 22px;
  position: relative;
  z-index: 1;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(1.2rem, 4vw, 1.9rem);
  color: var(--text);
}

.view-more {
  color: var(--brand);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.dest-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.dest-card {
  position: relative;
  height: 300px;
  border-radius: 18px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  display: block;
}

.dest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dest-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.68), rgba(0,0,0,0.14));
}

.dest-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  z-index: 1;
  font-size: 1rem;
  font-weight: 700;
}

.autocomplete-box {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 420px;
  width: max(100%, 420px);
  max-width: min(92vw, 560px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
  z-index: 9999;
  padding: 8px;
  display: none;
  max-height: 360px;
  overflow-y: auto;
}

.autocomplete-box.show {
  display: block;
}

.auto-section-title {
  padding: 8px 10px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auto-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
}

.auto-item:hover {
  background: var(--input-bg);
}

.auto-main {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}

.auto-sub {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 3px;
  line-height: 1.55;
  max-width: 360px;
}

.auto-tag {
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (max-width: 1100px) {
  .grid-flight,
  .grid-stay {
    grid-template-columns: 1fr 1fr;
  }

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

  .services-row,
  .dest-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-btn {
    width: 100%;
  }
}

@media (max-width: 700px) {
  .page {
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .tabs {
    gap: 8px;
  }

  .tab {
    flex: 1 1 auto;
    border-radius: 14px;
    text-align: center;
    padding: 14px 12px;
    font-size: 0.88rem;
  }

  .hero-card {
    padding: 16px;
  }

  .grid-flight,
  .grid-stay,
  .grid-activity,
  .services-row,
  .dest-grid {
    grid-template-columns: 1fr;
  }

  .dest-card {
    height: 260px;
  }

  .filters {
    align-items: flex-start;
  }

  .check {
    font-size: 0.84rem;
  }

  .autocomplete-box {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .auto-sub {
    max-width: 100%;
  }
}

/* Vertical tabs are links to /flights/, /hotels/, /holidays/, /activities/ */
a.tab {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.tab-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  opacity: 0.85;
}

.tab.active .tab-icon {
  opacity: 1;
}

.grid-holiday {
  display: grid;
  gap: 12px;
  overflow: visible;
  grid-template-columns: 1.1fr 1.1fr 0.9fr 0.9fr 1fr 150px;
}

/* ---- Search validation ---- */
.field.invalid {
  margin-bottom: 20px;
  border-color: #ef4b58;
  box-shadow: 0 0 0 3px rgba(239, 75, 88, 0.18);
}

.field-error {
  position: absolute;
  left: 14px;
  top: calc(100% + 4px);
  color: #ff6b77;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
}

.field.invalid .autocomplete-box.show {
  top: calc(100% + 24px);
}

.auto-item.active {
  background: var(--input-bg);
  outline: 1px solid rgba(45, 52, 255, 0.4);
}

.auto-empty {
  padding: 12px 10px 4px;
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.auto-hint {
  padding: 8px 10px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
}

.auto-hint b {
  color: var(--text-soft);
}

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

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

  .field-error {
    white-space: normal;
  }
}

/* Return date greyed out for one-way flights */
.field.disabled {
  opacity: 0.4;
}

.field.disabled input {
  cursor: not-allowed;
}

/* ---- Date fields (custom range picker, assets/js/datepicker.js) ---- */
.date-field {
  cursor: pointer;
  user-select: none;
  outline: none;
}

.date-field:focus-visible,
.date-field.picking {
  border-color: rgba(45, 52, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(45, 52, 255, 0.2);
}

.date-display {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-field.has-value .date-display {
  color: var(--text);
}

.date-btn {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  margin-left: 8px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") center / 16px no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.date-field:hover .date-btn {
  background-color: rgba(255, 255, 255, 0.2);
}

.date-field:active .date-btn {
  transform: scale(0.9);
}

body.light-mode .date-btn {
  border-color: rgba(25, 27, 34, 0.14);
  background-color: rgba(25, 27, 34, 0.05);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23191b22' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
}

.field.disabled {
  cursor: not-allowed;
}

/* Calendar popover */
.dp {
  display: none;
  position: absolute;
  z-index: 9000;
  width: min(640px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(11, 16, 34, 0.9);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dp.open {
  display: block;
  animation: dp-in 0.14s ease-out;
}

@keyframes dp-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.dp-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.dp-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.dp-body {
  position: relative;
}

.dp-months {
  display: grid;
  grid-template-columns: repeat(var(--months, 2), 1fr);
  gap: 28px;
}

.dp-month-name {
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  margin: 6px 0 10px;
}

.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 4px;
}

.dp-wd {
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  padding-bottom: 4px;
}

.dp-day {
  position: relative;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: 'Comfortaa', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border-radius: 12px;
  transition: background-color 0.1s ease;
}

.dp-day:hover:not([disabled]) {
  background: rgba(255, 255, 255, 0.1);
}

.dp-day:focus-visible {
  outline: 2px solid rgba(143, 149, 255, 0.9);
  outline-offset: -2px;
}

.dp-day[disabled] {
  color: rgba(255, 255, 255, 0.2);
  cursor: not-allowed;
  text-decoration: line-through;
}

.dp-day.today::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: #8f95ff;
}

.dp-day.in-range {
  background: rgba(45, 52, 255, 0.22);
  border-radius: 0;
}

.dp-day.start,
.dp-day.end {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(45, 52, 255, 0.45);
}

.dp-day.start.has-range { border-radius: 12px 0 0 12px; }
.dp-day.end.has-range { border-radius: 0 12px 12px 0; }
.dp-day.start.end { border-radius: 12px; }

.dp-nav {
  position: absolute;
  top: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.dp-nav[disabled] {
  opacity: 0.25;
  cursor: not-allowed;
}

.dp-prev { left: 0; }
.dp-next { right: 0; }

.dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dp-summary {
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

.dp-foot-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.dp-clear,
.dp-done {
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: 'Comfortaa', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.dp-done {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

body.light-mode .dp {
  background: rgba(255, 255, 255, 0.97);
  border-color: rgba(25, 27, 34, 0.12);
}

body.light-mode .dp-day[disabled] {
  color: rgba(25, 27, 34, 0.22);
}

body.light-mode .dp-day:hover:not([disabled]),
body.light-mode .dp-close,
body.light-mode .dp-nav,
body.light-mode .dp-clear {
  background: rgba(25, 27, 34, 0.05);
  border-color: rgba(25, 27, 34, 0.12);
}

/* Mobile: bottom sheet, one month */
@media (max-width: 700px) {
  .dp {
    position: fixed;
    left: 0 !important;
    right: 0;
    bottom: 0;
    top: auto !important;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 22px 22px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  }

  body.dp-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 8999;
  }

  .dp-day {
    height: 46px;
  }

  .dp-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .dp-foot-actions button {
    flex: 1;
  }
}

.dp-day.start:hover:not([disabled]),
.dp-day.end:hover:not([disabled]) {
  background: var(--brand);
}

.dp-day.in-range:hover:not([disabled]) {
  background: rgba(45, 52, 255, 0.32);
}
