@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --bg-top: #081523;
  --bg-bottom: #143554;
  --card: #f4f8fc;
  --card-border: #d4e1f0;
  --ink: #0f2945;
  --ink-soft: #4a6788;
  --accent: #f97316;
  --accent-2: #0ea5e9;
  --ok: #1d9b5f;
  --warn: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 450px at 8% -10%, rgba(88, 138, 197, 0.5) 0%, rgba(88, 138, 197, 0) 65%),
    radial-gradient(780px 380px at 100% 110%, rgba(34, 197, 219, 0.42) 0%, rgba(34, 197, 219, 0) 70%),
    linear-gradient(155deg, var(--bg-top), var(--bg-bottom));
}

.shell {
  width: min(1120px, 92vw);
  margin: 2.4rem auto;
}

.tabs {
  display: inline-flex;
  gap: 0.45rem;
  margin-bottom: 1rem;
  padding: 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(191, 219, 254, 0.3);
  background: rgba(10, 25, 43, 0.34);
  backdrop-filter: blur(4px);
}

.tab-btn {
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: #e6effd;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.tab-btn:hover {
  transform: none;
  filter: none;
  border-color: rgba(56, 189, 248, 0.8);
  background: rgba(56, 189, 248, 0.1);
}

.tab-btn.active {
  border-color: transparent;
  background: linear-gradient(100deg, #0ea5e9, #38bdf8);
  color: #fff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: panel-in 160ms ease-out;
}

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

.app {
  width: 100%;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-areas:
    "form output"
    "map map";
}

.card {
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.95), rgba(239, 247, 255, 0.94));
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.15rem;
  box-shadow: 0 16px 36px rgba(7, 20, 37, 0.24);
}

.app > .card:nth-child(1) {
  grid-area: form;
}

.app > .card:nth-child(2) {
  grid-area: output;
}

.map-card {
  grid-area: map;
}

h1, h2 {
  margin: 0 0 0.45rem;
  letter-spacing: -0.01em;
}

.subhead {
  margin: 0 0 0.95rem;
  color: var(--ink-soft);
}

form {
  display: grid;
  gap: 0.6rem;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #20405f;
}

input, select, button {
  font: inherit;
}

input, select {
  padding: 0.66rem 0.8rem;
  border: 1px solid #c4d7ec;
  border-radius: 0.62rem;
  color: var(--ink);
  background: #fff;
}

input::placeholder {
  color: #7a94b2;
}

input:focus, select:focus {
  outline: 2px solid rgba(14, 165, 233, 0.32);
  border-color: var(--accent-2);
}

.typeahead {
  position: relative;
}

.typeahead-list {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  right: 0;
  z-index: 25;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid #bdd1e8;
  border-radius: 0.62rem;
  background: #0c2139;
  box-shadow: 0 12px 26px rgba(5, 18, 33, 0.45);
  display: none;
}

.typeahead-list.open {
  display: block;
}

.typeahead-item {
  padding: 0.55rem 0.65rem;
  color: #deebfb;
  font-size: 0.86rem;
  cursor: pointer;
  border-top: 1px solid rgba(189, 209, 232, 0.16);
}

.typeahead-item:first-child {
  border-top: 0;
}

.typeahead-item:hover,
.typeahead-item.active {
  background: rgba(56, 189, 248, 0.22);
  color: #fff;
}

.typeahead-mark {
  background: rgba(250, 204, 21, 0.34);
  color: #fff;
  padding: 0 0.08rem;
  border-radius: 0.2rem;
}

.mode-help {
  margin-top: 0.08rem;
  padding: 0.58rem 0.68rem;
  border-radius: 0.64rem;
  border: 1px solid #d3e3f4;
  background: #edf5fe;
  color: var(--ink-soft);
  font-size: 0.82rem;
  line-height: 1.33;
}

.mode-help p {
  margin: 0;
}

.mode-help p + p {
  margin-top: 0.28rem;
}

button {
  margin-top: 0.4rem;
  border: 0;
  border-radius: 0.68rem;
  padding: 0.72rem 0.88rem;
  font-weight: 700;
  background: linear-gradient(100deg, var(--accent), #fb923c);
  color: #fff;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 8px 20px rgba(249, 115, 22, 0.28);
}

button:disabled {
  background: #b8c2d1;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.status {
  margin: 0 0 0.75rem;
  color: var(--ink-soft);
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.result-list,
.airport-results {
  margin: 0;
  padding: 0.65rem;
  border-radius: 0.75rem;
  background: #0c2139;
  color: #deebfb;
  border: 1px solid rgba(189, 209, 232, 0.24);
}

.result-list {
  min-height: 320px;
}

.airport-results {
  min-height: 320px;
}

.result-empty {
  color: #9bb7d8;
  font-size: 0.92rem;
  padding: 0.25rem 0.4rem;
}

.result-item {
  display: grid;
  grid-template-columns: 2.35rem 1fr;
  gap: 0.64rem;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.68rem;
  padding: 0.58rem 0.68rem;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.result-item + .result-item {
  margin-top: 0.52rem;
}

.result-item:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.62);
  background: rgba(255, 255, 255, 0.1);
}

.result-item.active {
  border-color: rgba(251, 146, 60, 0.95);
  background: rgba(251, 146, 60, 0.18);
}

.result-rank {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #082038;
  background: linear-gradient(120deg, #fb923c, #facc15);
}

.result-icao {
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.93rem;
}

.result-name {
  color: #c3d7f1;
  font-size: 0.84rem;
}

.map-view,
.explorer-map-view {
  width: 100%;
  border-radius: 0.8rem;
  overflow: hidden;
  border: 1px solid #bdd1e8;
}

.map-view {
  height: 460px;
}

.explorer-map-view {
  height: 280px;
}

.copy {
  width: 100%;
  background: linear-gradient(98deg, #0891b2, #38bdf8);
}

.actions {
  display: grid;
  gap: 0.54rem;
  margin-top: 0.75rem;
}

.actions .copy {
  margin-top: 0;
}

.simbrief {
  width: 100%;
  background: linear-gradient(96deg, #0f766e, #14b8a6);
}

.explorer-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aircraft-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.aircraft-spec-content {
  margin-top: 0.7rem;
  padding: 0.7rem;
  border-radius: 0.75rem;
  background: #0c2139;
  border: 1px solid rgba(189, 209, 232, 0.24);
  color: #deebfb;
}

.aircraft-spec-title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #f8c98a;
}

.aircraft-spec-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.8rem;
  margin: 0;
}

.aircraft-spec-item {
  font-size: 0.84rem;
  color: #c3d7f1;
}

.aircraft-spec-item strong {
  color: #e7f0ff;
}

.aircraft-spec-item a {
  color: #7dd3fc;
}

.aircraft-spec-item a:hover {
  color: #bae6fd;
}

.aircraft-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 0.8rem;
  border: 1px solid #bdd1e8;
  background: #0f223b;
}

.airport-row {
  display: grid;
  grid-template-columns: 5.3rem 1fr;
  gap: 0.68rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.7rem;
  padding: 0.58rem 0.68rem;
  color: #deebfb;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.airport-row + .airport-row {
  margin-top: 0.52rem;
}

.airport-row:hover {
  transform: translateY(-1px);
  border-color: rgba(250, 204, 21, 0.6);
  background: rgba(255, 255, 255, 0.1);
}

.airport-row.active {
  border-color: rgba(56, 189, 248, 0.92);
  background: rgba(56, 189, 248, 0.16);
}

.airport-icao {
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f8c98a;
}

.airport-meta {
  color: #c3d7f1;
  font-size: 0.85rem;
}

.airport-runways {
  margin-top: 0.2rem;
  color: #9bc4f1;
  font-size: 0.79rem;
}

.explorer-map-title {
  margin: 0.9rem 0 0.4rem;
  font-size: 0.98rem;
}

@media (max-width: 860px) {
  .shell {
    margin: 1.4rem auto;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "output"
      "map";
  }

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

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

  .result-list,
  .airport-results {
    min-height: 240px;
  }

  .map-view {
    height: 340px;
  }

  .explorer-map-view {
    height: 250px;
  }
}
