/* ── Loading ───────────────────────────────────────────── */

.loading {
    padding: 32px 20px 24px;
    display: none;
    text-align: center;
}

.loading.active {
    display: block;
}

.loading-label {
    font-size: 0.85rem;
    color: var(--fg-3);
    margin-bottom: 14px;
    min-height: 1.2em;
}

.progress-track {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    height: 3px;
    background: var(--progress-track);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bg);
    border-radius: 2px;
}

.progress-bar.animating {
    animation: progress-fill 2.2s ease-out forwards;
}

.progress-bar.complete {
    animation: none;
    width: 100% !important;
    transition: width 0.2s ease-in;
}

@keyframes progress-fill {
    0%   { width: 0%; }
    50%  { width: 60%; }
    80%  { width: 76%; }
    100% { width: 83%; }
}

/* ── Warnings Banner ───────────────────────────────────── */

.warnings {
    margin-bottom: 16px;
    display: none;
}

.warnings.active {
    display: block;
}

.warning-item {
    padding: 8px 12px;
    background: var(--yellow-bg);
    border-left: 4px solid var(--yellow-accent);
    font-size: 0.75rem;
    color: var(--yellow-fg);
    margin-bottom: 4px;
}

/* ── Panels (shared) ───────────────────────────────────── */

.results {
    display: none;
    margin-top:15px;
}

.results.active {
    display: block;
}

/* ── Comparison Grid ──────────────────────────────────── */

.results-grid {
    display: grid;
    gap: 16px;
    align-items: start;
    margin-top:30px;
}

.results-grid.cols-1 {
    grid-template-columns: 1fr;
}

.results-grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 900px));
    gap: 10px;
}

.mode-layer:has(#results-grid.cols-2) {
    max-width: 1842px;
}

#main-container.mode-area .mode-layer {
    max-width: 1100px;
}

.results-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.results-grid.cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

.airport-column,
.grid-cell {
    min-width: 0;
}

/* ── Airport tabs (always available, shown via JS tab-mode) ── */
.airport-tabs {
    display: none;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
    margin-top:20px
}
.airport-tab {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 18px;
    border: 2px solid var(--border);
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    text-transform: uppercase;
    border-radius: var(--radius);
    transition: background 0.1s, color 0.1s;
}
.airport-tab.active {
    background: var(--bg-emphasis);
    color: var(--fg-inv);
}
.airport-tab:hover:not(.active) {
    background: var(--bg-inset);
}
.results-grid.tab-mode {
    grid-template-columns: 1fr !important;
}

/* Tab bar shown/hidden via JS .tabs-visible class */
.airport-tabs.tabs-visible {
    display: flex;
}

@media (max-width: 1300px) {
    .results-grid.cols-2,
    .results-grid.cols-3,
    .results-grid.cols-4 {
        grid-template-columns: 1fr !important;
    }

    .swll-full-row {
        grid-column: 1 / -1;
    }
}

.panel {
    margin-bottom: 24px;
    border: 0px solid var(--border-3);
    border-radius: var(--radius);
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--bg-emphasis);
    color: var(--fg-inv);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header-icao {
    font-weight: 400;
    opacity: 0.6;
    margin-left: 6px;
}

.stale-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #e03535;
    font-weight: 700;
    cursor: help;
    letter-spacing: 0.5px;
}

.stale-badge::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e03535;
    flex-shrink: 0;
}

#stale-tooltip {
    position: fixed;
    z-index: 9999;
    display: none;
    background: var(--bg-emphasis);
    color: var(--fg-inv);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: var(--radius);
    pointer-events: none;
    white-space: normal;
    max-width: 240px;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid #e03535;
}

.panel-body {
    padding: 12px;
    overflow-x: hidden;
    container-type: inline-size;
    container-name: panel;
}

.p-body-noHpadding{
    padding: 12px 0px;

}

.wca-area-link-btn {
    background: none;
    border: 1px solid var(--fg-inv);
    color: var(--fg-inv);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.65rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: none;
    padding: 3px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.wca-area-link-btn:hover { opacity: 1; }

/* ── Webcam (single-airport panel) ─────────────────────── */

.webcam-body {
    padding: 0;
}

.webcam-title {
    margin: 0;
    padding: 6px 10px;
    font-size: 0.8rem;
    color: var(--fg-2);
}

.webcam-img {
    width: 100%;
    display: block;
}

/* ── Sticky airport header cell ───────────────────────── */

.grid-cell-header {
    position: sticky;
    top: 0px;
    z-index: 10;
    background: var(--bg);
    border-bottom: 3px solid var(--border-3);
    box-shadow: 0 2px 10px rgba(0,0,0,0);
}

@media (max-width: 767px) {
    .grid-cell-header { top: -15px; }
}

/* ── Airport Info ──────────────────────────────────────── */

.airport-info {
    text-align: center;
    padding: 20px 16px 10px;
    margin-bottom: 0;
    position: relative;
}

.airport-info-center {
    display: inline-block;
    text-align: center;
}

/* Small screens: arrows pinned to cell edges */
.airport-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--fg-2);
    font-size: 1.1rem;
    line-height: 1;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.airport-nav-btn:hover {
    background: var(--fg);
    color: var(--bg);
    border-color: transparent;
}

.airport-nav-prev { left: 12px; }
.airport-nav-next { right: 12px; }

/* Skeleton lines: indent on small screens to clear absolute arrows */
@media (max-width: 799px) {
    .airport-info .skeleton-line {
        margin-left: 44px;
        margin-right: 44px;
    }
}

/* Large screens: arrows in fixed-width columns so title width never shifts button positions */
@media (min-width: 800px) {
    .airport-info {
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        gap: 14px;
    }
    .airport-nav-btn {
        position: static;
        transform: none;
        justify-self: center;
    }
    .airport-info-center {
        display: block;
    }
}

.airport-title-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.airport-remove-btn {
    background: none;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    color: var(--fg-3);
    font-size: 0.8rem;
    line-height: 1;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}

.airport-remove-btn:hover {
    border-color: var(--red-fg);
    color: var(--red-fg);
    background: var(--red-bg);
}

.airport-info .icao-big {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 4px;
}

.airport-info .airport-name {
    font-size: 0.78rem;
    color: var(--fg-3);
    font-weight: 300;
    margin-top: 2px;
}
