@import url("../vendor/maplibre-gl/maplibre-gl.css");

:root {
    color-scheme: light;
    --ink: #10213a;
    --muted: #687487;
    --paper: #f6f2e8;
    --panel: #fffdf7;
    --ocean: #c9e6ef;
    --border: rgba(16, 33, 58, 0.13);
    --orange: #f97316;
    --black-route: #15191f;
    --shadow: 0 18px 50px rgba(30, 54, 80, 0.13);
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-synthesis: none;
}

* {
    box-sizing: border-box;
}

html,
body,
#app {
    min-height: 100%;
    margin: 0;
}

html,
body {
    overflow: hidden;
}

body {
    background: var(--paper);
    color: var(--ink);
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 3px solid rgba(249, 115, 22, 0.45);
    outline-offset: 2px;
}

.app-shell {
    display: grid;
    min-height: 100dvh;
    grid-template-rows: 70px minmax(0, 1fr);
}

.topbar {
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--ink);
    color: white;
    box-shadow: 0 2px 16px rgba(11, 27, 49, 0.2);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.brand > span:last-child {
    display: grid;
    gap: 1px;
}

.brand strong {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.12rem;
    letter-spacing: 0.015em;
}

.brand small {
    color: #aebed0;
    font-size: 0.64rem;
    font-weight: 650;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand-mark {
    position: relative;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
}

.brand-mark span {
    position: absolute;
    width: 22px;
    height: 1px;
    background: #ff9a4d;
    transform-origin: center;
}

.brand-mark span:nth-child(1) {
    transform: rotate(-38deg);
}

.brand-mark span:nth-child(2) {
    width: 15px;
    transform: translate(7px, -5px) rotate(34deg);
}

.brand-mark span:nth-child(3) {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: white;
    transform: translate(-9px, 7px);
}

.snapshot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #cbd7e5;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #58b68c;
    box-shadow: 0 0 0 4px rgba(88, 182, 140, 0.13);
}

.workspace {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(340px, 410px) minmax(0, 1fr);
}

.control-panel {
    z-index: 10;
    display: flex;
    min-height: 0;
    flex-direction: column;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background:
        radial-gradient(circle at 12% 3%, rgba(218, 165, 32, 0.12), transparent 30%),
        var(--panel);
    box-shadow: 8px 0 28px rgba(23, 40, 63, 0.08);
    scrollbar-color: #c6c3bb transparent;
    scrollbar-width: thin;
}

.intro {
    padding: 34px 28px 20px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #9b5b26;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.intro h1 {
    max-width: 320px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.15rem, 3.1vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 0.98;
}

.intro h1 em {
    color: #d76d1c;
    font-weight: 500;
}

.intro > p:last-child {
    max-width: 315px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.snapshot-warning {
    display: grid;
    gap: 3px;
    margin: 0 28px 18px;
    padding: 10px 12px;
    border: 1px solid #e7c986;
    border-radius: 9px;
    background: #fff8df;
    color: #6e5318;
    font-size: 0.67rem;
    line-height: 1.4;
}

.snapshot-warning strong {
    font-size: 0.59rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-section {
    position: relative;
    z-index: 5;
    padding: 0 28px 22px;
}

.search-section > label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box svg {
    position: absolute;
    left: 14px;
    width: 18px;
    fill: none;
    stroke: #798396;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.search-box input {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 43px;
    border: 1px solid #d8d6cd;
    border-radius: 8px;
    background: white;
    color: var(--ink);
    font-size: 0.88rem;
    box-shadow: 0 5px 15px rgba(31, 48, 70, 0.06);
}

.search-box input::placeholder {
    color: #9299a6;
}

.search-box input:focus {
    border-color: #9cabbc;
}

.clear-search,
.airport-heading > button {
    display: grid;
    border: 0;
    background: transparent;
    color: #778191;
    cursor: pointer;
    place-items: center;
}

.clear-search {
    position: absolute;
    right: 8px;
    width: 30px;
    height: 30px;
    font-size: 1.3rem;
}

.search-results {
    position: absolute;
    right: 28px;
    left: 28px;
    max-height: min(390px, 50vh);
    margin: 6px 0 0;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: white;
    box-shadow: var(--shadow);
    list-style: none;
}

.search-results li button {
    display: grid;
    width: 100%;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.search-results li.active button,
.search-results li button:hover {
    background: #f3f5f3;
}

.result-code {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.81rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.result-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.result-copy strong,
.result-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-copy strong {
    font-size: 0.81rem;
}

.result-copy small {
    color: var(--muted);
    font-size: 0.7rem;
}

.result-count {
    min-width: 25px;
    padding: 4px 6px;
    border-radius: 999px;
    background: #edf1f3;
    color: #5f6c7a;
    font-size: 0.66rem;
    font-weight: 750;
    text-align: center;
}

.panel-state,
.empty-selection {
    display: grid;
    margin: 2px 28px 22px;
    padding: 24px;
    border: 1px dashed #cbc8bd;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
    place-items: center;
}

.panel-state strong,
.empty-selection strong {
    margin-top: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.panel-state p,
.empty-selection p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.panel-state.error {
    border-color: rgba(128, 0, 32, 0.3);
}

.panel-state button {
    margin-top: 14px;
    padding: 8px 14px;
    border: 0;
    border-radius: 6px;
    background: var(--ink);
    color: white;
    cursor: pointer;
}

.loader-ring {
    width: 28px;
    height: 28px;
    border: 3px solid #dce3e7;
    border-top-color: #d76d1c;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

.gesture {
    color: #d76d1c;
    font-family: Georgia, serif;
    font-size: 2rem;
}

.airport-details {
    padding: 4px 28px 24px;
}

.airport-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.airport-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 3.2rem;
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 0.9;
}

.airport-heading > button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    font-size: 1.3rem;
}

.airport-details > h3 {
    margin: 13px 0 2px;
    font-size: 0.95rem;
}

.airport-details > p {
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.connection-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 19px 0 12px;
    padding: 12px 14px;
    border-left: 3px solid #d76d1c;
    background: #f5f1e7;
}

.connection-summary strong {
    font-family: Georgia, serif;
    font-size: 1.65rem;
}

.connection-summary span {
    color: #657083;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.destination-list {
    display: grid;
    max-height: 40vh;
    gap: 7px;
    overflow-y: auto;
    padding-right: 3px;
}

.destination-card {
    padding: 12px 12px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: white;
    transition:
        border-color 160ms ease,
        background-color 160ms ease,
        box-shadow 160ms ease;
}

.destination-card.selected {
    border-color: rgba(215, 109, 28, 0.72);
    background: #fffaf3;
    box-shadow: 0 0 0 2px rgba(215, 109, 28, 0.12);
}

.destination-card.selected.year-round {
    border-color: rgba(21, 25, 31, 0.6);
    box-shadow: 0 0 0 2px rgba(21, 25, 31, 0.1);
}

.destination-route {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.route-swatch {
    width: 10px;
    height: 10px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.25);
}

.route-swatch.year-round {
    background: var(--black-route);
}

.route-swatch.seasonal {
    background: var(--orange);
}

.destination-route button {
    display: flex;
    min-width: 0;
    align-items: baseline;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
}

.destination-route button strong {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
}

.destination-route button span {
    overflow: hidden;
    font-size: 0.74rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-focus-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid rgba(16, 33, 58, 0.1);
}

.route-focus-actions button {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 0.66rem;
    font-weight: 800;
}

.route-focus-actions .explore-route {
    color: var(--navy);
}

.route-focus-actions .clear-route {
    color: var(--muted);
}

.route-focus-actions button:hover,
.route-focus-actions button:focus-visible {
    color: var(--orange);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.route-badge {
    padding: 3px 6px;
    border-radius: 999px;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.route-badge.year-round {
    background: #eceeef;
    color: #303944;
}

.route-badge.seasonal {
    background: #fff0e5;
    color: #ad4c08;
}

.airlines,
.season-note {
    margin: 7px 0 0 22px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.4;
}

.airlines {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
}

.airlines > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.airlines a {
    color: inherit;
}

.airlines small {
    padding: 1px 4px;
    border-radius: 999px;
    background: #eceeef;
    color: #4b5662;
    font-size: 0.51rem;
    font-weight: 800;
    text-transform: uppercase;
}

.airlines small.seasonal {
    background: #fff0e5;
    color: #ad4c08;
}

.season-note {
    color: #a95417;
}

.source-link {
    display: inline-flex;
    gap: 4px;
    margin: 8px 0 0 22px;
    color: #53667c;
    font-size: 0.62rem;
    font-weight: 650;
    text-decoration: none;
}

.source-link:hover {
    text-decoration: underline;
}

.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin: 7px 0 0 22px;
}

.source-links .source-link {
    margin: 0;
}

.schedule-note {
    margin: 5px 0 0 22px;
    color: #4b5d70;
    font-size: 0.66rem;
}

.legend {
    margin-top: auto;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    background: rgba(248, 246, 239, 0.72);
}

.legend-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.legend-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.95rem;
}

.legend-heading span {
    color: var(--muted);
    font-size: 0.61rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dot-scale,
.line-scale {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dot-scale {
    margin-top: 14px;
}

.dot-scale span,
.line-scale span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #626e7c;
    font-size: 0.62rem;
    font-weight: 650;
}

.dot-scale i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dot-color);
    box-shadow: 0 0 0 1px white, 0 0 0 2px rgba(16, 33, 58, 0.18);
}

.line-scale {
    justify-content: flex-start;
    margin-top: 13px;
    gap: 22px;
}

.line-scale .line {
    width: 28px;
    height: 0;
    border-top: 2px solid var(--black-route);
}

.line-scale .line.seasonal {
    border-top: 2px dashed var(--orange);
}

.control-panel footer {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 12px 28px 16px;
    border-top: 1px solid var(--border);
    color: #8a919b;
    font-size: 0.58rem;
}

.control-panel footer span {
    width: 100%;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.control-panel footer a {
    color: #6e7d8e;
}

.data-notes {
    width: 100%;
    margin-top: 3px;
}

.data-notes summary {
    cursor: pointer;
    color: #637489;
    font-weight: 700;
}

.data-notes p {
    margin: 7px 0 0;
    color: #737f8d;
    font-size: 0.6rem;
    line-height: 1.5;
}

.map-stage {
    position: relative;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: var(--ocean);
}

.map-host {
    position: absolute;
    inset: 0;
}

.map-context {
    position: absolute;
    top: 18px;
    left: 18px;
    z-index: 3;
    display: grid;
    max-width: calc(100% - 92px);
    gap: 8px;
    justify-items: start;
}

.map-watermark,
.selected-chip,
.map-mode-toggle {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 253, 247, 0.88);
    color: #536174;
    box-shadow: 0 8px 24px rgba(39, 69, 91, 0.12);
    backdrop-filter: blur(8px);
}

.map-watermark {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.64rem;
    font-weight: 650;
    letter-spacing: 0.03em;
}

.map-watermark span {
    color: var(--ink);
    font-weight: 800;
}

.selected-chip {
    display: grid;
    grid-template-columns: 12px auto;
    column-gap: 8px;
    padding: 10px 13px;
    border-radius: 8px;
}

.selected-chip > span {
    width: 11px;
    height: 11px;
    grid-row: span 2;
    align-self: center;
    border: 2px solid white;
    border-radius: 50%;
    background: var(--airport-color);
    box-shadow: 0 0 0 1px rgba(16, 33, 58, 0.2);
}

.selected-chip strong {
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.78rem;
}

.selected-chip small {
    color: var(--muted);
    font-size: 0.62rem;
}

.map-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 9px;
}

.map-mode-toggle button {
    min-height: 30px;
    padding: 6px 11px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #647184;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.025em;
}

.map-mode-toggle button:hover {
    color: var(--navy);
}

.map-mode-toggle button:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 1px;
}

.map-mode-toggle button.active {
    background: var(--navy);
    color: white;
    box-shadow: 0 2px 7px rgba(16, 33, 58, 0.2);
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border: 1px solid rgba(16, 33, 58, 0.16) !important;
    border-radius: 7px !important;
    box-shadow: 0 7px 20px rgba(40, 67, 88, 0.15) !important;
}

.maplibregl-ctrl-group button {
    width: 34px !important;
    height: 34px !important;
}

.maplibregl-ctrl-attrib {
    background: rgba(255, 255, 255, 0.76) !important;
    font-size: 9px !important;
}

.not-found {
    display: grid;
    min-height: 100dvh;
    padding: 40px;
    background: var(--paper);
    place-content: center;
    text-align: center;
}

.not-found h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(2rem, 5vw, 4rem);
}

.not-found p:not(.eyebrow) {
    color: var(--muted);
}

.not-found a {
    justify-self: center;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--ink);
    color: white;
    text-decoration: none;
}

.loading-progress {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    transform: translate(-50%, -50%);
}

.loading-progress circle {
    fill: none;
    stroke: #d6dfdf;
    stroke-width: 0.5rem;
}

.loading-progress circle:last-child {
    stroke: #d76d1c;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    top: calc(50% + 54px);
    left: 50%;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: translateX(-50%);
}

.loading-progress-text::after {
    content: "Loading Flight Connector";
}

#blazor-error-ui {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1000;
    display: none;
    max-width: 420px;
    padding: 12px 42px 12px 14px;
    border: 1px solid #d7a5af;
    border-radius: 8px;
    background: #fff2f4;
    color: #6f172b;
    box-shadow: var(--shadow);
    font-size: 0.78rem;
}

#blazor-error-ui .reload {
    margin-left: 6px;
    color: inherit;
    font-weight: 750;
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 11px;
    cursor: pointer;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    html,
    body {
        overflow: auto;
    }

    .app-shell {
        min-height: 100dvh;
        grid-template-rows: 62px auto;
    }

    .topbar {
        position: sticky;
        top: 0;
        padding: 0 16px;
    }

    .brand small,
    .snapshot-status span:last-child {
        display: none;
    }

    .workspace {
        display: flex;
        flex-direction: column-reverse;
    }

    .control-panel {
        min-height: 55vh;
        overflow: visible;
        border-top: 1px solid var(--border);
        border-right: 0;
    }

    .map-stage {
        min-height: 48vh;
    }

    .map-context {
        top: 10px;
        left: 10px;
        max-width: calc(100% - 64px);
        gap: 6px;
    }

    .map-mode-toggle button {
        min-height: 28px;
        padding: 5px 9px;
        font-size: 0.61rem;
    }

    .selected-chip {
        padding: 8px 10px;
    }

    .intro {
        padding-top: 26px;
    }

    .destination-list {
        max-height: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
