/* ============================================================
   RAVELLO JETS — range-explorer.css
   Page-specific styles for the Range Explorer tool
   ============================================================ */

/* ----- Layout ----- */

.range-explorer {
  position: relative;
  width: 100vw;
  height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000000;
}

#map .maplibregl-canvas {
  background: #000000;
}

#map .maplibregl-ctrl-top-right {
  top: 12px;
  right: 12px;
}

#map .maplibregl-ctrl-group {
  background: rgba(11, 11, 13, 0.85);
  border: 1px solid var(--edge);
  border-radius: 10px;
  overflow: hidden;
}

#map .maplibregl-ctrl-group button {
  width: 36px;
  height: 36px;
  border-bottom: 1px solid var(--edge);
}

#map .maplibregl-ctrl-group button:last-child {
  border-bottom: none;
}

#map .maplibregl-ctrl-group button span {
  filter: invert(1) brightness(0.7);
}

/* ----- Settings button ----- */

.settings-btn {
  position: absolute;
  top: 106px;
  right: 12px;
  z-index: 30;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(11, 11, 13, 0.85);
  border: 1px solid var(--edge);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ash);
  cursor: pointer;
  transition: color 0.2s ease;
}

.settings-btn:hover {
  color: var(--bone);
}

.settings-btn svg {
  width: 18px;
  height: 18px;
}

.settings-dropdown {
  position: absolute;
  top: 148px;
  right: 12px;
  z-index: 30;
  background: rgba(11, 11, 13, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--edge);
  border-radius: 12px;
  padding: 16px 18px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}

.settings-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.settings-label {
  font-size: 9.5px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 10px;
}

.pill-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 980px;
  padding: 3px;
  gap: 2px;
}

.pill-toggle button {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 980px;
  color: var(--ash);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pill-toggle button.active {
  background: var(--brass);
  color: var(--obsidian);
}

/* ----- Left Panel ----- */

.panel {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  width: 420px;
  height: 100%;
  background: rgba(11, 11, 13, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.panel.collapsed {
  transform: translateX(-420px);
}

.panel-collapse-btn {
  position: absolute;
  top: 50%;
  right: -32px;
  transform: translateY(-50%);
  width: 32px;
  height: 56px;
  background: rgba(11, 11, 13, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--edge);
  border-left: none;
  border-radius: 0 10px 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ash);
  transition: color 0.2s ease;
}

.panel-collapse-btn:hover {
  color: var(--bone);
}

.panel-collapse-btn svg {
  width: 16px;
  height: 16px;
  transition: transform 0.35s ease;
}

.panel.collapsed .panel-collapse-btn svg {
  transform: rotate(180deg);
}

/* Panel hero */
.panel-hero {
  padding: 28px 24px 20px;
  border-bottom: 1px solid var(--edge);
  flex-shrink: 0;
}

.panel-hero .eyebrow {
  font-size: 9px;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 10px;
  font-weight: 500;
}

.panel-hero h1 {
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.05;
  color: var(--bone);
}

/* Panel scroll area */
.panel-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.panel-scroll::-webkit-scrollbar {
  width: 6px;
}

.panel-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.panel-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

/* ----- Collapsible sections ----- */

.panel-section {
  border-bottom: 1px solid var(--edge);
}

.panel-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.panel-section-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.panel-section-title {
  font-size: 9.5px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 500;
}

.panel-section-chevron {
  width: 14px;
  height: 14px;
  color: var(--ash);
  transition: transform 0.25s ease;
}

.panel-section.collapsed .panel-section-chevron {
  transform: rotate(-90deg);
}

.panel-section-body {
  padding: 0 24px 20px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
}

.panel-section.collapsed .panel-section-body {
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* ----- Airport card ----- */

.airport-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.airport-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

.airport-card-label {
  font-size: 9px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 6px;
  font-weight: 500;
}

.airport-card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--bone);
  line-height: 1.3;
}

.airport-card-detail {
  font-size: 12px;
  color: var(--ash);
  margin-top: 2px;
}

.airport-card-placeholder {
  font-size: 14px;
  color: rgba(138, 138, 144, 0.5);
}

.airport-card-chevron {
  width: 14px;
  height: 14px;
  color: var(--ash);
  flex-shrink: 0;
  margin-left: 10px;
}

.airport-card-clear {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ash);
  flex-shrink: 0;
  margin-left: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.airport-card-clear:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bone);
}

.airport-card-clear svg {
  width: 12px;
  height: 12px;
}

/* Airport search */
.airport-search-wrap {
  position: relative;
  margin-bottom: 10px;
  display: none;
}

.airport-search-wrap.active {
  display: block;
}

.airport-search {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--brass);
  border-radius: 10px;
  color: var(--bone);
  font-size: 14px;
  font-family: var(--sans);
  outline: none;
  box-shadow: 0 0 0 3px rgba(196, 162, 101, 0.12);
}

.airport-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  background: var(--carbon);
  border: 1px solid var(--edge);
  border-radius: 10px;
  margin-top: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.airport-result {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--edge);
  transition: background 0.15s ease;
}

.airport-result:last-child {
  border-bottom: none;
}

.airport-result:hover,
.airport-result.focused {
  background: rgba(196, 162, 101, 0.08);
}

.airport-result-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--bone);
}

.airport-result-empty {
  padding: 14px;
  color: var(--ash);
  font-size: 13px;
  text-align: center;
  cursor: default;
}
.airport-result-empty:hover {
  background: none;
}

.airport-result-detail {
  font-size: 11px;
  color: var(--ash);
  margin-top: 1px;
}

/* ----- Distance readout ----- */

.distance-readout {
  font-size: 13px;
  color: var(--brass);
  padding: 10px 0 6px;
  font-weight: 500;
  display: none;
}

.distance-readout.visible {
  display: block;
}

/* ----- Trip / Passengers / Dates ----- */

.trip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.trip-row-label {
  font-size: 12px;
  color: var(--ash);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.pax-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pax-stepper button {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--bone);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.pax-stepper button:hover {
  border-color: var(--brass);
  background: rgba(196, 162, 101, 0.1);
}

.pax-stepper button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pax-count {
  font-size: 15px;
  font-weight: 500;
  color: var(--bone);
  min-width: 20px;
  text-align: center;
}

.date-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--bone);
  font-size: 13px;
  font-family: var(--sans);
  margin-top: 6px;
  transition: border-color 0.2s ease;
  color-scheme: dark;
}

.date-input:focus {
  outline: none;
  border-color: var(--brass);
}

/* ----- Suggested card ----- */

.suggested-card {
  background: rgba(196, 162, 101, 0.06);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  display: none;
}

.suggested-card.visible {
  display: block;
}

.suggested-card .eyebrow {
  font-size: 8.5px;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 8px;
  font-weight: 500;
}

.suggested-card-category {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--bone);
  margin-bottom: 6px;
}

.suggested-card-route {
  font-size: 11.5px;
  color: var(--ash);
  margin-bottom: 14px;
  line-height: 1.5;
}

.suggested-card .btn {
  width: 100%;
  font-size: 12.5px;
  padding: 10px 20px;
}

/* ----- Aircraft list ----- */

.aircraft-category-header {
  font-size: 9.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ash);
  padding: 14px 24px 6px;
  font-weight: 500;
}

.aircraft-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 24px;
  cursor: pointer;
  transition: background 0.15s ease;
  position: relative;
}

.aircraft-row:hover {
  background: rgba(255, 255, 255, 0.025);
}

.aircraft-row.selected {
  background: rgba(196, 162, 101, 0.06);
}

.aircraft-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.aircraft-info {
  flex: 1;
  min-width: 0;
}

.aircraft-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--bone);
  line-height: 1.3;
}

.aircraft-meta {
  font-size: 12px;
  color: var(--ash);
  margin-top: 1px;
}

/* Range badge */
.range-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 980px;
  flex-shrink: 0;
}

.range-badge.nonstop {
  background: rgba(76, 175, 80, 0.15);
  color: #66bb6a;
}

.range-badge.fuel-stop {
  background: rgba(255, 179, 0, 0.15);
  color: #ffb300;
}

/* Deselect button */
.aircraft-deselect {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--ash);
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.aircraft-row.selected .aircraft-deselect {
  display: flex;
}

.aircraft-deselect:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--bone);
}

.aircraft-deselect svg {
  width: 10px;
  height: 10px;
}

/* ----- Comparison header ----- */

.comparison-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--edge);
  display: none;
}

.comparison-header.visible {
  display: block;
}

.comparison-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.comparison-label {
  font-size: 9.5px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ash);
  font-weight: 500;
}

.comparison-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.comparison-clear {
  font-size: 12px;
  color: var(--brass);
  cursor: pointer;
  background: none;
  border: none;
  transition: opacity 0.2s ease;
}

.comparison-clear:hover {
  opacity: 0.7;
}

.comparison-count {
  font-size: 11px;
  color: var(--ash);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 8px;
  border-radius: 980px;
}

.comparison-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.comparison-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--bone);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--edge);
  padding: 4px 10px;
  border-radius: 980px;
}

.comparison-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ----- Fuel-stop plan ----- */

.fuel-stop-plan {
  padding: 16px 24px 20px;
  border-bottom: 1px solid var(--edge);
  display: none;
}

.fuel-stop-plan.visible {
  display: block;
}

.fuel-stop-plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fuel-stop-plan-badge {
  font-size: 8.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #ffb300;
  font-weight: 600;
}

.fuel-stop-plan-aircraft {
  font-size: 12px;
  color: var(--ash);
}

.fuel-stop-count {
  font-family: var(--serif);
  font-size: 22px;
  color: var(--bone);
  margin-bottom: 12px;
}

.fuel-stop-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.fuel-stop-stat {
  font-size: 11px;
  color: var(--ash);
}

.fuel-stop-stat strong {
  color: var(--bone);
  font-weight: 500;
}

.fuel-stop-legs {
  border-top: 1px solid var(--edge);
  padding-top: 12px;
}

.fuel-stop-leg {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.fuel-stop-leg:last-child {
  border-bottom: none;
}

.fuel-stop-leg-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ash);
  margin-bottom: 3px;
  font-weight: 500;
}

.fuel-stop-leg-route {
  font-size: 13px;
  color: var(--bone);
  font-weight: 500;
}

.fuel-stop-leg-detail {
  font-size: 11px;
  color: var(--ash);
  margin-top: 2px;
}

.fuel-stop-disclaimer {
  font-size: 10.5px;
  color: rgba(138, 138, 144, 0.5);
  line-height: 1.55;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--edge);
}

/* ----- Panel disclosure ----- */

.panel-disclosure {
  padding: 20px 24px;
  font-size: 10.5px;
  color: rgba(138, 138, 144, 0.5);
  line-height: 1.65;
  border-top: 1px solid var(--edge);
}

/* ----- Bottom bar ----- */

.panel-bottom {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-top: 1px solid var(--edge);
  background: rgba(11, 11, 13, 0.98);
}

.panel-bottom-text {
  font-size: 12px;
  color: var(--ash);
}

.panel-bottom-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-bottom-reset {
  font-size: 12px;
  color: var(--ash);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s ease;
}

.panel-bottom-reset:hover {
  color: var(--bone);
}

.panel-bottom .btn {
  font-size: 12px;
  padding: 8px 18px;
}

/* ----- Map markers ----- */

.origin-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--brass);
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.origin-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bone);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-6px);
}

.dest-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.dest-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--bone);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-6px);
}

.fuel-stop-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffb300;
  border: 1.5px solid rgba(255, 179, 0, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.fuel-stop-label {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffb300;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
  transform: translateY(-4px);
}

/* ----- D3 Globe canvas ----- */

#globe-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#globe-canvas.dragging {
  cursor: grabbing;
}

#flat-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#flat-map.hidden,
#globe-canvas.hidden {
  display: none;
}

/* ----- Noscript ----- */

.map-noscript {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--carbon);
  color: var(--ash);
  font-size: 16px;
  padding: 40px;
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 960px) {
  .panel {
    width: 360px;
  }

  .panel.collapsed {
    transform: translateX(-360px);
  }
}

@media (max-width: 768px) {
  .range-explorer {
    height: calc(100vh - var(--header-h));
    margin-top: var(--header-h);
  }

  .panel {
    width: 100vw;
    border-right: none;
  }

  .panel.collapsed {
    transform: translateX(-100vw);
  }

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

  .settings-btn {
    top: 96px;
  }

  .settings-dropdown {
    top: 138px;
  }
}

@media (max-width: 480px) {
  .panel-hero {
    padding: 20px 18px 16px;
  }

  .panel-section-header {
    padding: 14px 18px;
  }

  .panel-section-body {
    padding: 0 18px 16px;
  }

  .aircraft-row {
    padding: 10px 18px;
  }

  .aircraft-category-header {
    padding: 12px 18px 6px;
  }

  .comparison-header {
    padding: 14px 18px;
  }

  .fuel-stop-plan {
    padding: 14px 18px 18px;
  }

  .panel-disclosure {
    padding: 16px 18px;
  }

  .panel-bottom {
    padding: 12px 18px;
  }
}

/* Phase 1: consent banner sits bottom-right here so it never covers the trip panel's action bar */
.consent { left: auto; right: 20px; }
