/* Blazor reconnect overlay — dark theme */
#components-reconnect-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.65);
    align-items: center;
    justify-content: center;
}

#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex;
}

.reconnect-box {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 24px 32px;
    text-align: center;
    color: #e6edf3;
    min-width: 220px;
}

/* Show only the relevant state panel */
.reconnect-state { display: none; }

#components-reconnect-modal.components-reconnect-show .reconnect-state-show { display: block; }
#components-reconnect-modal.components-reconnect-failed .reconnect-state-failed { display: block; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-state-rejected { display: block; }

/* Bootstrap missing utilities */
.min-w-0 { min-width: 0; }
.gap-px  { gap: 1px; }

/* Base overrides for dark aviation theme */
html, body {
    background-color: #0d1117;
    color: #e6edf3;
}

/* Pending-messages banner */
.pending-banner {
    background-color: #1f6feb;
    color: #fff;
    text-align: center;
    padding: 5px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.pending-banner:hover {
    background-color: #388bfd;
}

/* ACARS message card */
.acars-card {
    background-color: #161b22;
    border-color: #30363d !important;
    transition: border-color 0.15s;
}

.acars-card:hover {
    border-color: #58a6ff !important;
}

/* Aircraft photo thumbnail */
.acars-photo {
    width: 120px;
    height: 80px;
}

.acars-photo img {
    width: 120px;
    height: 80px;
    object-fit: cover;
}

.photo-credit {
    font-size: 0.6rem;
    color: #8b949e;
    text-align: center;
    max-width: 120px;
    margin-top: 2px;
}

.acars-photo-placeholder {
    width: 120px;
    height: 80px;
    background-color: #21262d;
    border: 1px dashed #30363d;
}

/* Mobile: reduce photo size on small phones */
@media (max-width: 479px) {
    .acars-photo,
    .acars-photo img,
    .acars-photo-placeholder {
        width: 80px;
        height: 54px;
    }
    .photo-credit {
        max-width: 80px;
    }
}

/* Very small screens: stack card content vertically */
@media (max-width: 359px) {
    .acars-card-content {
        flex-wrap: wrap;
    }
    .acars-card-content .acars-photo,
    .acars-card-content .acars-photo img,
    .acars-card-content .acars-photo-placeholder {
        width: 100%;
        height: 90px;
    }
    .acars-card-content .photo-credit {
        max-width: 100%;
    }
}

/* Raw message text */
.acars-text {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.78rem;
    color: #adbac7;
    white-space: pre-wrap;
    word-break: break-all;
    background-color: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 6px 10px;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* Frame type color badges */
.frame-badge-vdl2 {
    background-color: #1f6feb;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.frame-badge-hfdl {
    background-color: #e67700;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.frame-badge-acars {
    background-color: #2da44e;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.frame-badge-aerol {
    background-color: #a371f7;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
}

.frame-badge-iridium {
    background-color: #db6d28;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 4px;
}

/* Material Icons sizing inside navbar */
.nav-material-icon {
    font-size: 1.1rem;
    line-height: 1;
    vertical-align: middle;
}

/* Navbar tweaks */
.navbar {
    background-color: #161b22 !important;
}

.nav-link.active {
    color: #58a6ff !important;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #58a6ff;
}

/* Spinning refresh icon */
@keyframes spin {
    from { transform: rotate(0deg);   }
    to   { transform: rotate(360deg); }
}
.spin { display: inline-block; animation: spin 1s linear infinite; }

/* Stats page — progress bar fills matching frame badge colors */
.frame-bar-vdl2    { background-color: #1f6feb; }
.frame-bar-hfdl    { background-color: #e67700; }
.frame-bar-acars   { background-color: #2da44e; }
.frame-bar-aerol   { background-color: #a371f7; }
.frame-bar-iridium { background-color: #db6d28; }

/* Stats summary cards */
.stat-card {
    background-color: #161b22;
    border-color: #30363d !important;
    transition: border-color 0.15s;
}
.stat-card:hover {
    border-color: #58a6ff !important;
}

/* 24h activity bar chart */
.activity-bar {
    background-color: #1f6feb;
    border-radius: 2px 2px 0 0;
    opacity: 0.8;
    min-height: 1px;
    transition: opacity 0.15s;
}
.activity-bar:hover {
    opacity: 1;
}

/* Mobile: make summary stat cards 2-per-row */
@media (max-width: 575px) {
    .stats-header-actions {
        flex-wrap: nowrap;
    }
}

/* ── Map page ────────────────────────────────────────────── */
.map-container {
    min-height: 0; /* prevents flex overflow */
}

.map-range-input {
    width: 90px;
    background-color: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}
.map-range-input:focus {
    background-color: #161b22;
    border-color: #58a6ff;
    color: #e6edf3;
    box-shadow: 0 0 0 0.2rem rgba(88,166,255,.15);
}

/* Leaflet overrides for dark theme */
.leaflet-container {
    background: #161b22;
    font-family: inherit;
}
.leaflet-control-layers {
    background: #161b22 !important;
    border: 1px solid #30363d !important;
    color: #e6edf3 !important;
}
.leaflet-control-layers label {
    color: #e6edf3 !important;
}
.leaflet-control-zoom a {
    background-color: #161b22 !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}
.leaflet-control-zoom a:hover {
    background-color: #21262d !important;
}
.leaflet-control-attribution {
    background: rgba(13,17,23,.8) !important;
    color: #8b949e !important;
}
.leaflet-control-attribution a { color: #58a6ff !important; }

/* Aircraft marker — remove Leaflet wrapper background */
.av-aircraft-icon {
    background: transparent !important;
    border: none !important;
}

/* METAR temperature badge on map */
.av-metar-badge {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 1px 5px;
    border: 1.5px solid;
    border-radius: 4px;
    background: rgba(13,17,23,.85);
    white-space: nowrap;
    pointer-events: none;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.4;
}

/* Leaflet tooltip */
.av-tooltip.leaflet-tooltip {
    background: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 6px;
    font-size: 0.8rem;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.av-tooltip.leaflet-tooltip::before { border-top-color: #30363d !important; }

/* Leaflet popup */
.av-popup .leaflet-popup-content-wrapper {
    background: #161b22;
    border: 1px solid #30363d;
    color: #e6edf3;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.6);
}
.av-popup .leaflet-popup-tip { background: #161b22; }
.av-popup .leaflet-popup-close-button { color: #8b949e !important; }
.av-popup .leaflet-popup-content { margin: 10px 14px; font-size: 0.82rem; line-height: 1.6; }

.av-popup-title {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid #30363d;
}

/* ── METAR decoded panel ──────────────────────────────────── */
.metar-panel {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #21262d;
}

.metar-report + .metar-report {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #30363d;
}

.metar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.metar-type-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}

.metar-regular { background-color: #1f6feb; color: #fff; }
.metar-speci   { background-color: #d29922; color: #fff; }

.metar-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 2px;
    font-size: 0.8rem;
    color: #adbac7;
}

.metar-item {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

.metar-wind-arrow {
    display: inline-block;
    font-size: 0.9rem;
    line-height: 1;
    opacity: 0.8;
}

.metar-cloud {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.metar-cloud-skc,
.metar-cloud-clr,
.metar-cloud-ncd,
.metar-cloud-nsc { background-color: rgba(45,164,78,0.15); color: #3fb950; }

.metar-cloud-few { background-color: rgba(31,111,235,0.15); color: #58a6ff; }
.metar-cloud-sct { background-color: rgba(210,153,34,0.15); color: #d29922; }
.metar-cloud-bkn { background-color: rgba(219,109,40,0.15); color: #ffa94d; }
.metar-cloud-ovc { background-color: rgba(248,81,73,0.15);  color: #ff7b72; }
.metar-cloud-vv  { background-color: rgba(163,113,247,0.15); color: #a371f7; }

.metar-wx-badge {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.75rem;
    background-color: rgba(88,166,255,0.12);
    color: #58a6ff;
    padding: 1px 6px;
    border-radius: 3px;
    cursor: default;
}
