/* BPD Data Logger - Master Stylesheet */
/* Common styles shared across all dashboard pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto Mono', monospace;
    background: #0d1117;
    color: #c9d1d9;
    min-height: 100vh;
}

a {
    color: #58a6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ── Top Navigation ───────────────────────────────── */
.top-nav {
    background: #161b22;
    border-bottom: 1px solid #21262d;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 48px;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    color: #e6edf3;
    white-space: nowrap;
    letter-spacing: -0.3px;
    text-decoration: none;
    transition: opacity 0.15s;
}

.nav-brand:hover {
    opacity: 0.8;
    text-decoration: none;
}

.nav-brand-logo {
    width: 28px;
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #e6edf3;
    transition: background 0.15s;
    text-decoration: none;
}

.nav-link:hover {
    background: #21262d;
    text-decoration: none;
}

.nav-link.active {
    background: #1f6feb33;
    color: #58a6ff;
}

.nav-clock {
    margin-left: auto;
    font-family: 'Roboto Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #8b949e;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.nav-controls select {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

/* ── Mobile Responsive (Navigation) ──────────────── */
@media (max-width: 768px) {
    .top-nav {
        padding: 0 10px;
        height: 40px;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .nav-brand {
        font-size: 13px;
        flex-shrink: 0;
    }

    .nav-brand-logo {
        width: 22px;
        height: 22px;
    }

    .nav-brand span {
        display: none;
    }

    .nav-links {
        flex-shrink: 0;
        gap: 2px;
    }

    .nav-link {
        padding: 4px 6px;
        font-size: 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .nav-clock {
        display: none;
    }

    .nav-controls select {
        font-size: 12px;
        padding: 4px 6px;
    }
}

@media (max-width: 480px) {
    .nav-brand {
        display: none;
    }

    .nav-link {
        padding: 3px 5px;
        font-size: 10px;
    }
}

/* ── Basemap Switcher ──────────────────────────────── */
.basemap-switcher {
    background: rgba(13, 17, 23, 0.9) !important;
    border: 1px solid #30363d !important;
    border-radius: 6px !important;
    padding: 3px 2px !important;
    display: flex !important;
    gap: 2px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    z-index: 1000;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.basemap-btn {
    background: #21262d;
    color: #8b949e;
    border: none;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px;
    white-space: nowrap;
    line-height: 1.4;
}

.basemap-btn:hover {
    color: #e6edf3;
    background: #30363d;
}

.basemap-btn.active {
    background: #58a6ff;
    color: #0d1117;
}

@media (max-width: 768px) {
    .basemap-switcher {
        font-size: 10px;
    }

    .basemap-btn {
        padding: 2px 5px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .basemap-btn {
        padding: 2px 4px;
        font-size: 9px;
    }
}

/* ═══════════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: index.html
   ═══════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────── */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 24px;
}

/* ── Fleet Status Bar ────────────────────────── */
.fleet-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 14px 20px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fleet-title {
    font-size: 18px;
    font-weight: 700;
    color: #e6edf3;
    margin-right: auto;
}

.fleet-stat {
    text-align: center;
}

.fleet-stat-value {
    font-size: 24px;
    font-weight: 800;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.fleet-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b949e;
}

.c-green { color: #3fb950; }
.c-yellow { color: #d29922; }
.c-red { color: #f85149; }
.c-blue { color: #58a6ff; }
.c-muted { color: #8b949e; }

/* ── Featured Node ───────────────────────────── */
.featured-node {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 20px 24px;
    margin-bottom: 20px;
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.featured-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.featured-title h2 {
    font-size: 20px;
    font-weight: 700;
    color: #e6edf3;
}

.featured-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    background: #1f6feb33;
    color: #58a6ff;
    border: 1px solid #1f6feb55;
}

.status-badge {
    padding: 4px 14px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.healthy { background: #238636; color: #e6edf3; }
.status-badge.warning { background: #9e6a03; color: #e6edf3; }
.status-badge.critical { background: #da3633; color: #e6edf3; }
.status-badge.offline { background: #da3633; color: #e6edf3; animation: pulse-badge 2s ease-in-out infinite; }

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .featured-grid { grid-template-columns: 1fr; }
}

.featured-col { display: flex; flex-direction: column; gap: 12px; }

/* ── Stats Row ───────────────────────────────── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.stat-cell {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
}

.stat-cell-value {
    font-size: 22px;
    font-weight: 800;
    color: #e6edf3;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.2;
}

.stat-cell-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b949e;
    margin-top: 2px;
}

/* ── Section Label ───────────────────────────── */
.section-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #58a6ff;
    padding-bottom: 6px;
    border-bottom: 1px solid #21262d;
    margin-bottom: 8px;
}

.section-label.ais { color: #3fb950; border-bottom-color: #238636; }

/* ── Metric Rows ─────────────────────────────── */
.metric-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
    border-bottom: 1px solid #21262d22;
}

.metric-row:last-child { border-bottom: none; }
.metric-label { color: #8b949e; }
.metric-value { color: #e6edf3; font-weight: 600; font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }

/* ── Waffle Chart ────────────────────────────── */
.waffle-chart {
    display: grid;
    grid-template-columns: repeat(24, 1fr);
    gap: 2px;
    margin: 6px 0;
}

.waffle-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    position: relative;
    cursor: default;
    min-width: 0;
}

.waffle-cell.ok { background: #238636; }
.waffle-cell.warning { background: #9e6a03; }
.waffle-cell.missing { background: #da3633; }
.waffle-cell.future { background: #21262d; }

.waffle-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1c2128;
    color: #e6edf3;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 100;
    pointer-events: none;
    border: 1px solid #30363d;
}

.waffle-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #30363d;
}

.waffle-cell:hover .waffle-tooltip { display: block; }

.waffle-legend {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.waffle-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #8b949e;
}

.waffle-legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

/* ── Sparkline Cards ─────────────────────────── */
.sparkline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.sparkline-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 8px 10px 6px;
}

.sparkline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.sparkline-title {
    font-size: 10px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sparkline-current {
    font-size: 12px;
    font-weight: 700;
    color: #e6edf3;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.sparkline-chart-wrap {
    position: relative;
    display: flex;
    height: 60px;
}

.sparkline-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 4px 0 0;
    width: 24px;
    flex-shrink: 0;
}

.sparkline-y-axis span {
    font-size: 8px;
    color: #484f58;
    text-align: right;
    line-height: 1;
}

.sparkline-chart-area {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: crosshair;
}

.sparkline-svg { display: block; width: 100%; height: 100%; }

.sparkline-crosshair {
    position: absolute;
    top: 0;
    width: 1px;
    height: 100%;
    background: rgba(88, 166, 255, 0.5);
    pointer-events: none;
    display: none;
}

.sparkline-dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: 1.5px solid #0d1117;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: none;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
}

.sparkline-hover-tip {
    position: absolute;
    top: -4px;
    transform: translateX(-50%) translateY(-100%);
    background: #1c2128;
    color: #e6edf3;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    pointer-events: none;
    display: none;
    z-index: 10;
    border: 1px solid #30363d;
}

.sparkline-x-axis {
    display: flex;
    justify-content: space-between;
    padding-left: 24px;
    margin-top: 2px;
}

.sparkline-x-axis span {
    font-size: 8px;
    color: #484f58;
}

/* ── Range Map ───────────────────────────────── */
.range-map-container {
    width: 100%;
    height: 160px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #21262d;
    position: relative;
}

.range-map-container .leaflet-container {
    width: 100%;
    height: 100%;
    background: #0d1117;
}

.range-map-label {
    position: absolute;
    bottom: 6px;
    left: 6px;
    background: rgba(22, 27, 34, 0.9);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    color: #58a6ff;
    font-weight: 600;
    z-index: 1000;
    pointer-events: none;
    border: 1px solid #21262d;
}

.range-map-label.ais { color: #3fb950; }

.range-map-location-info {
    margin-top: 6px;
    padding: 6px 10px;
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 4px;
}

.location-coords {
    font-size: 11px;
    font-weight: 600;
    color: #58a6ff;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.location-method {
    font-size: 10px;
    color: #8b949e;
    margin-top: 2px;
}

.range-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #484f58;
    font-size: 12px;
}

/* ── Type Tags ───────────────────────────────── */
.type-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 0;
}

.type-tag {
    background: #1f6feb22;
    color: #58a6ff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.type-tag .tag-count {
    color: #484f58;
    font-weight: 400;
    margin-left: 2px;
}

.type-tag.ais {
    background: #23863622;
    color: #3fb950;
}

.type-tag.ais .tag-count { color: #484f58; }

/* ── Nodes Grid ──────────────────────────────── */
.nodes-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.nodes-section-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #e6edf3;
}

.nodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 16px;
}

.node-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 16px 18px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.node-card:hover { border-color: #30363d; }

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

.node-id {
    font-size: 15px;
    font-weight: 700;
    color: #e6edf3;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* ── Alerts ──────────────────────────────────── */
.alerts {
    margin: 8px 0;
    padding: 8px 12px;
    background: #9e6a0322;
    border-left: 3px solid #d29922;
    border-radius: 4px;
}

.alerts.offline-alert {
    background: #da363322;
    border-left-color: #f85149;
}

.alert-item {
    color: #d29922;
    font-size: 12px;
    margin: 3px 0;
}

.alerts.offline-alert .alert-item { color: #f85149; }

/* ── No Data ─────────────────────────────────── */
.no-data-msg {
    color: #484f58;
    font-size: 12px;
    padding: 10px 0;
    text-align: center;
    font-style: italic;
}

/* ── Health / Insights Compact ───────────────── */
.ai-panel {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.ai-panel h2 {
    font-size: 15px;
    font-weight: 700;
    color: #e6edf3;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-badge {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #8957e5;
    color: #e6edf3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.health-status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.health-status-badge.healthy { background: #238636; color: #e6edf3; }
.health-status-badge.warning { background: #9e6a03; color: #e6edf3; }
.health-status-badge.critical { background: #da3633; color: #e6edf3; }
.health-status-badge.unknown { background: #21262d; color: #8b949e; }

.health-summary-text {
    font-size: 13px;
    color: #c9d1d9;
    line-height: 1.6;
    margin: 8px 0;
}

.health-section { margin: 8px 0; }

.health-section h3 {
    font-size: 12px;
    color: #58a6ff;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.health-item {
    font-size: 12px;
    color: #8b949e;
    padding: 2px 0 2px 14px;
    position: relative;
}

.health-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.health-item.issue::before { background: #f85149; }
.health-item.rec::before { background: #d29922; }

.ai-generated {
    font-size: 10px;
    color: #484f58;
    text-align: right;
    margin-top: 8px;
}

/* Claude AI Flight Analysis */
.claude-summary {
    background: #8957e512;
    border: 1px solid #8957e533;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.claude-summary-header {
    font-size: 12px;
    font-weight: 700;
    color: #d2a8ff;
    margin-bottom: 6px;
}

.claude-summary-text {
    font-size: 13px;
    color: #c9d1d9;
    line-height: 1.5;
}

.claude-flight-explain {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 6px 0;
    border-left: 3px solid #8957e5;
}

.claude-flight-explain .cfe-callsign {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 13px;
    color: #d2a8ff;
}

.claude-flight-explain .cfe-what {
    font-size: 12px;
    color: #e6edf3;
    font-weight: 600;
    margin-left: 6px;
}

.claude-flight-explain .cfe-why {
    font-size: 12px;
    color: #8b949e;
    line-height: 1.4;
    margin-top: 3px;
}

.claude-flight-explain .cfe-mission {
    font-size: 12px;
    color: #d2a8ff;
    font-style: italic;
    margin-top: 3px;
}

.claude-flight-explain .cfe-meta {
    font-size: 10px;
    color: #484f58;
    margin-top: 4px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── NEW Badge ──────────────────────────────── */
.new-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8514922;
    color: #f85149;
    border: 1px solid #f8514944;
    margin-left: 6px;
    vertical-align: middle;
    animation: new-pulse 2s ease-in-out infinite;
}
@keyframes new-pulse { 0%,100%{ opacity:1; } 50%{ opacity:0.6; } }

/* ── Timestamp styling ──────────────────────── */
.ts-bright {
    font-size: 13px !important;
    color: #e6edf3 !important;
    font-family: 'SF Mono','Fira Code',monospace;
    font-weight: 600;
}

/* ── Insight Cards ───────────────────────────── */
.insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.insight-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 12px;
}

.insight-card.military { border-color: #9e6a03; }
.insight-card.heli { border-color: #238636; }
.insight-card.speed { border-color: #da3633; }

.insight-headline {
    font-size: 13px;
    font-weight: 700;
    color: #e6edf3;
    margin-bottom: 2px;
}

.insight-detail {
    font-size: 11px;
    color: #8b949e;
    line-height: 1.3;
}

/* ── Insights List Items ─────────────────────── */
.insights-list { margin-top: 10px; }

.insights-list h3 {
    font-size: 12px;
    color: #58a6ff;
    margin-bottom: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.insights-list-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #21262d22;
    font-size: 12px;
    color: #c9d1d9;
}

.insights-list-item:last-child { border-bottom: none; }

.insights-list-item .il-flight {
    font-weight: 700;
    color: #58a6ff;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
}

.insights-list-item .il-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
}

.il-tag.gov { background: #da363322; color: #f85149; }
.il-tag.mil { background: #1f6feb22; color: #58a6ff; }
.il-tag.cap { background: #23863622; color: #3fb950; }
.il-tag.med { background: #da363322; color: #f85149; }
.il-tag.notable { background: #21262d; color: #8b949e; }

/* ── Loading ─────────────────────────────────── */
.loading {
    text-align: center;
    padding: 40px;
    color: #484f58;
    font-size: 14px;
}

.error {
    background: #da363322;
    color: #f85149;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #da363355;
    margin: 20px 0;
}

/* ── Controls ────────────────────────────────── */
.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: background 0.15s;
}

.btn:hover { background: #30363d; }

.controls label {
    font-size: 12px;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 4px;
}

.last-updated {
    font-size: 11px;
    color: #484f58;
}

/* ── Progress Bar ────────────────────────────── */
.progress-bar {
    height: 4px;
    background: #21262d;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #3fb950;
    transition: width 0.3s;
}

.progress-fill.warning { background: #d29922; }
.progress-fill.critical { background: #f85149; }

/* ═══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: node.html
   ═══════════════════════════════════════════════ */

/* ── Node Header ─────────────────────────────── */
.node-header-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.node-header-bar h1 {
    font-size: 22px;
    font-weight: 700;
    color: #e6edf3;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.node-last-seen {
    font-size: 12px;
    color: #8b949e;
    margin-left: auto;
}

/* ── Section ─────────────────────────────────── */
.section {
    margin-bottom: 20px;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: #e6edf3;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #21262d;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Panel ───────────────────────────────────── */
.panel {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.panel h2 {
    font-size: 15px;
    font-weight: 700;
    color: #e6edf3;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Two-column layout ───────────────────────── */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

/* ── Charts ──────────────────────────────────── */
.chart-card {
    background: #161b22;
    border: 1px solid #21262d;
    border-radius: 8px;
    padding: 16px 20px;
}

.chart-card h3 {
    font-size: 14px;
    color: #e6edf3;
    margin-bottom: 10px;
}

.chart-wrap {
    position: relative;
    height: 260px;
}

/* ── Tables ──────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    background: #21262d;
    color: #58a6ff;
    font-weight: 700;
    text-align: left;
    padding: 6px 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
}

.data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #21262d;
    color: #c9d1d9;
}

.data-table tr:hover {
    background: #161b2288;
}

.data-table .mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 600;
    color: #58a6ff;
}

.table-scroll {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #21262d;
    border-radius: 6px;
}

/* ── Badges ──────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.badge-heli {
    background: #23863622;
    color: #3fb950;
}

.badge-mil {
    background: #9e6a0322;
    color: #d29922;
}

.badge-gov {
    background: #da363322;
    color: #f85149;
}

.badge-notable {
    background: #21262d;
    color: #8b949e;
}

.badge-speed {
    background: #da363322;
    color: #f85149;
}

.badge-alt {
    background: #8957e522;
    color: #d2a8ff;
}

/* ── Claude AI (node.html specific) ──────────── */
.claude-flight-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 6px 0;
    border-left: 3px solid #8957e5;
}

.claude-flight-card .cfe-callsign {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-weight: 700;
    font-size: 13px;
    color: #d2a8ff;
}

.claude-flight-card .cfe-what {
    font-size: 12px;
    color: #e6edf3;
    font-weight: 600;
    margin-left: 6px;
}

.claude-flight-card .cfe-why {
    font-size: 12px;
    color: #8b949e;
    line-height: 1.4;
    margin-top: 3px;
}

.claude-flight-card .cfe-mission {
    font-size: 12px;
    color: #d2a8ff;
    font-style: italic;
    margin-top: 3px;
}

.claude-flight-card .cfe-meta {
    font-size: 10px;
    color: #484f58;
    margin-top: 4px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Insight Grid (node.html) ────────────────── */
.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

/* ── Category Cards ──────────────────────────── */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.cat-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 12px;
    text-align: center;
}

.cat-card .cat-name {
    font-size: 12px;
    font-weight: 700;
    color: #e6edf3;
}

.cat-card .cat-code {
    font-size: 10px;
    color: #58a6ff;
    font-family: monospace;
}

.cat-card .cat-stat {
    font-size: 20px;
    font-weight: 800;
    color: #e6edf3;
    margin: 4px 0;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.cat-card .cat-obs {
    font-size: 10px;
    color: #8b949e;
}

/* ── Node Card Enhancements (node.html) ──────── */
.node-card.selected {
    border-color: #58a6ff;
    opacity: 1;
}

.node-card:not(.selected) {
    opacity: 0.7;
}

/* ── Mobile Responsive (node.html) ───────────── */
@media (max-width: 600px) {
    .container {
        padding: 12px;
    }

    .node-header-bar {
        padding: 12px;
        gap: 10px;
    }

    .node-header-bar h1 {
        font-size: 18px;
    }

    .insight-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .insight-card {
        padding: 10px;
    }

    .insight-headline {
        font-size: 12px;
    }

    .insight-detail {
        font-size: 10px;
    }

    .cat-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }

    .cat-card .cat-stat {
        font-size: 16px;
    }

    .stats-row {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }

    .stat-cell-value {
        font-size: 18px;
    }

    .stat-cell-label {
        font-size: 9px;
    }

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

    .chart-wrap {
        height: 200px;
    }

    .two-col {
        gap: 12px;
    }

    .panel {
        padding: 12px 14px;
    }

    .data-table {
        font-size: 11px;
    }

    .data-table th,
    .data-table td {
        padding: 5px 6px;
    }
}

@media (max-width: 380px) {
    .insight-grid {
        grid-template-columns: 1fr;
    }

    .nav-clock {
        display: none;
    }
}

/* ═══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: map.html
   ═══════════════════════════════════════════════ */

body.map-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Toolbar (controls row below nav) ─────── */
.toolbar {
    background: #161b22;
    color: #c9d1d9;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 1000;
    border-bottom: 1px solid #21262d;
}

.toolbar-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-left: auto;
}

.toolbar-stat {
    font-size: 14px;
    color: #c9d1d9;
}

.toolbar-stat strong {
    color: #f0f6fc;
    font-size: 18px;
}

.toolbar-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-controls select,
.toolbar-controls button {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
}

.toolbar-controls button:hover {
    background: #30363d;
}

.toolbar-controls label {
    font-size: 14px;
    color: #c9d1d9;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Category Filter Panel ───────────────────── */
.filter-bar {
    background: #161b22;
    border-bottom: 1px solid #21262d;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    z-index: 1000;
}

.filter-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #c9d1d9;
    font-weight: 600;
    margin-right: 4px;
}

/* ── Mode Buttons (3D, Timelapse) ────────────── */
.mode-btn {
    background: #21262d;
    color: #58a6ff;
    border: 1px solid #58a6ff;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.mode-btn:hover {
    background: #58a6ff;
    color: #0d1117;
    text-decoration: none;
}

/* ── Filter Dropdown ─────────────────────────── */
.filter-dropdown-btn {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filter-dropdown-btn:hover {
    border-color: #58a6ff;
}
.filter-active-count {
    background: #58a6ff;
    color: #0d1117;
    border-radius: 8px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 16px;
    text-align: center;
}
.filter-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #161b22;
    border-bottom: 1px solid #21262d;
    padding: 8px 20px;
    z-index: 1001;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.filter-dropdown.open {
    display: flex;
}
.filter-dropdown-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid;
    transition: all 0.2s;
    user-select: none;
}

.filter-pill .pill-count {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}

.filter-pill[data-cat="civilian"] {
    border-color: #fb8861;
    color: #fb8861;
}

.filter-pill[data-cat="military"] {
    border-color: #fcffa4;
    color: #fcffa4;
}

.filter-pill[data-cat="helicopter"] {
    border-color: #f7d13d;
    color: #f7d13d;
}

.filter-pill[data-cat="cargo"] {
    border-color: #e65164;
    color: #e65164;
}

.filter-pill[data-cat="vip"] {
    border-color: #b73779;
    color: #b73779;
}

.filter-pill.active {
    color: #0d1117;
    font-weight: 700;
}

.filter-pill.active[data-cat="civilian"] {
    background: #fb8861;
}

.filter-pill.active[data-cat="military"] {
    background: #fcffa4;
}

.filter-pill.active[data-cat="helicopter"] {
    background: #f7d13d;
}

.filter-pill.active[data-cat="cargo"] {
    background: #e65164;
}

.filter-pill[data-cat="private"] {
    border-color: #79c0ff;
    color: #79c0ff;
}

.filter-pill.active[data-cat="private"] {
    background: #79c0ff;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill.active[data-cat="vip"] {
    background: #b73779;
}

.filter-pill.dimmed {
    opacity: 0.35;
}

.filter-sep {
    width: 1px;
    height: 20px;
    background: #30363d;
    margin: 0 4px;
}

/* ── LIVE Mode ────────────────────────────────── */
.live-btn {
    background: #21262d;
    color: #f85149;
    border: 2px solid #f85149;
    padding: 5px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s;
}

.live-btn:hover {
    background: #f85149;
    color: #e6edf3;
}

.live-btn.active {
    background: #f85149;
    color: #e6edf3;
    animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.6);
    }
    50% {
        box-shadow: 0 0 12px 4px rgba(248, 81, 73, 0.3);
    }
}

.live-status {
    font-size: 13px;
    color: #c9d1d9;
    white-space: nowrap;
}

.live-status.connected {
    color: #3fb950;
}

.live-status.stale {
    color: #d29922;
}

.live-status.offline {
    color: #f85149;
}

.color-toggle,
.label-toggle {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.color-toggle:hover,
.label-toggle:hover {
    background: #30363d;
}

/* ── Map ──────────────────────────────────────── */
#map {
    flex: 1;
    background: #0d1117;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(22, 27, 34, 0.95);
    color: #c9d1d9;
    padding: 20px 30px;
    border-radius: 8px;
    z-index: 2000;
    font-size: 15px;
    display: none;
    align-items: center;
    gap: 12px;
    border: 1px solid #30363d;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

.loading-overlay.visible {
    display: flex;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-bar {
    background: #da3633;
    color: #e6edf3;
    padding: 8px 20px;
    font-size: 13px;
    display: none;
    z-index: 1000;
}

/* ── Timeline / Animation Bar ─────────────────── */
.timeline-bar {
    background: #161b22;
    border-top: 1px solid #21262d;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
}

.timeline-btn {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-btn:hover {
    background: #30363d;
}

.timeline-btn.active {
    background: #58a6ff;
    color: #0d1117;
}

.timeline-speed {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    min-width: 44px;
    text-align: center;
}

.timeline-speed:hover {
    background: #30363d;
}

.timeline-scrubber {
    flex: 1;
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
}

.timeline-track {
    width: 100%;
    height: 6px;
    background: #21262d;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.timeline-progress {
    height: 100%;
    background: #58a6ff;
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.timeline-thumb {
    width: 14px;
    height: 14px;
    background: #58a6ff;
    border: 2px solid #e6edf3;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    z-index: 2;
}

.timeline-thumb:active {
    cursor: grabbing;
}

.timeline-time {
    font-family: 'Roboto Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #f0f6fc;
    min-width: 85px;
    text-align: center;
}

.timeline-date {
    font-size: 13px;
    color: #c9d1d9;
    min-width: 100px;
    text-align: center;
}

.timeline-label {
    font-size: 12px;
    color: #c9d1d9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* ── Popups & Labels ──────────────────────────── */
.aircraft-popup {
    font-family: 'Roboto Mono', monospace;
    min-width: 200px;
}

.aircraft-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #30363d;
}

.aircraft-popup .flight-id {
    font-size: 16px;
    font-weight: 600;
    color: #0d1117;
}

.aircraft-popup .hex-id {
    font-size: 11px;
    color: #888;
    font-family: 'Roboto Mono', monospace;
}

.aircraft-popup .popup-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 12px;
}

.aircraft-popup .popup-label {
    color: #666;
}

.aircraft-popup .popup-value {
    font-weight: 500;
    color: #333;
}

.aircraft-popup .type-badge {
    display: inline-block;
    background: #eef2ff;
    color: #4338ca;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.plane-label {
    background: rgba(22, 27, 34, 0.9);
    color: #999;
    border-radius: 4px;
    padding: 3px 7px;
    font-size: 12px;
    font-weight: 400;
    white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
}

/* Hover tooltip (like the screenshot) */
.flight-tooltip {
    background: rgba(22, 27, 34, 0.95) !important;
    border: 1px solid #30363d !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5) !important;
    min-width: 180px !important;
}

.flight-tooltip .tooltip-flight {
    font-size: 16px;
    font-weight: 600;
    color: #58a6ff;
    margin-bottom: 4px;
}

.flight-tooltip .tooltip-badge {
    display: inline-block;
    background: #f0f6fc;
    color: #0d1117;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 8px;
}

.flight-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 2px 0;
    color: #c9d1d9;
}

.flight-tooltip .tooltip-label {
    color: #8b949e;
}

.flight-tooltip .tooltip-value {
    font-weight: 500;
    color: #e6edf3;
    text-align: right;
}

/* Hover tooltip styled like the white click popup */
.popup-tooltip {
    background: #fff !important;
    border: 1px solid #d0d7de !important;
    border-radius: 8px !important;
    padding: 10px 12px !important;
    font-family: 'Roboto Mono', monospace !important;
    font-size: 12px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2) !important;
    min-width: 200px !important;
    color: #333 !important;
}

.popup-tooltip .leaflet-tooltip-content .aircraft-popup {
    min-width: 200px;
}

.popup-tooltip .tooltip-flight {
    font-size: 14px;
    font-weight: 600;
    color: #0d1117;
    margin-bottom: 4px;
}

.popup-tooltip .tooltip-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 8px;
}

.popup-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 2px 0;
}

.popup-tooltip .tooltip-label {
    color: #6e7681;
    font-size: 12px;
}

.popup-tooltip .tooltip-value {
    font-weight: 500;
    color: #0d1117;
    font-size: 12px;
    text-align: right;
}

/* Remove blue outline from plane markers */
.leaflet-marker-icon,
.leaflet-marker-icon * {
    outline: none !important;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: rgba(22, 27, 34, 0.95);
    z-index: 1000;
    overflow-y: auto;
    border-left: 1px solid #21262d;
    display: none;
}

.sidebar.open {
    display: block;
}

.sidebar-header {
    padding: 12px 15px;
    background: #21262d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: #f0f6fc;
    font-size: 15px;
}

.sidebar-close {
    background: none;
    border: none;
    color: #8b949e;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-search {
    padding: 8px 15px;
    border-bottom: 1px solid #21262d;
}

.sidebar-search input {
    width: 100%;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 14px;
}

/* ── Isolation Banner ─────────────────────────── */
#isolation-banner {
    display: none;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(22, 27, 34, 0.95);
    border: 1px solid #58a6ff;
    color: #e6edf3;
    padding: 6px 16px;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

/* ── Vessel List ──────────────────────────────── */
.vessel-list-item {
    padding: 8px 15px;
    border-bottom: 1px solid #21262d;
    cursor: pointer;
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
}
.vessel-list-item:hover {
    background: #1c2128;
}
.vessel-list-item.moving {
    border-left: 3px solid #3fb950;
}

/* ── History Panel ─────────────────────────────── */
.history-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 340px;
    height: 100%;
    background: rgba(22, 27, 34, 0.95);
    z-index: 1000;
    overflow-y: auto;
    border-right: 1px solid #21262d;
    display: none;
}

.history-panel.open {
    display: block;
}

.history-search-box {
    padding: 8px 15px;
    display: flex;
    gap: 6px;
    border-bottom: 1px solid #21262d;
}

.history-search-box input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 14px;
}

.history-search-btn {
    background: #1f6feb;
    color: #e6edf3;
    border: 1px solid #388bfd;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.history-search-btn:hover {
    background: #388bfd;
}

.history-filters {
    padding: 8px 15px;
    border-bottom: 1px solid #21262d;
}

.history-filters select {
    background: #0d1117;
    border: 1px solid #30363d;
    color: #e6edf3;
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.history-status {
    padding: 8px 15px;
    font-size: 12px;
    color: #8b949e;
}

.history-result-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
}

.history-result-item:hover {
    background: rgba(88, 166, 255, 0.1);
}

.history-result-item.selected {
    background: rgba(31, 111, 235, 0.2);
    border-left: 3px solid #58a6ff;
}

.history-result-name {
    font-weight: 700;
    color: #58a6ff;
    font-size: 14px;
}

.history-result-mmsi {
    color: #8b949e;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
}

.history-result-meta {
    color: #c9d1d9;
    font-size: 12px;
    margin-top: 3px;
}

#map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

#map-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.map-loading-content {
    text-align: center;
}

.map-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #30363d;
    border-top-color: #58a6ff;
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.map-loading-text {
    color: #c9d1d9;
    font-size: 13px;
    font-family: 'Roboto Mono', monospace;
}

.history-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-top: 1px solid #21262d;
}

.pagination-btn {
    background: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
    cursor: pointer;
}

.pagination-btn:hover:not(:disabled) {
    background: #30363d;
    border-color: #58a6ff;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination-info {
    font-size: 11px;
    color: #8b949e;
}

.history-track-info {
    padding: 12px 15px;
    border-top: 1px solid #21262d;
    font-size: 12px;
    color: #c9d1d9;
}

.history-track-info .track-stat {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
}

.history-track-info .track-stat-label {
    color: #8b949e;
}

.history-track-info .track-stat-value {
    color: #e6edf3;
    font-weight: 500;
}

.toolbar-sep {
    width: 1px;
    height: 20px;
    background: #30363d;
    margin: 0 4px;
    align-self: center;
}

.ac-list-item {
    padding: 8px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
}

.ac-list-item:hover {
    background: rgba(88, 166, 255, 0.1);
}

.ac-list-item .ac-flight {
    font-weight: 700;
    color: #58a6ff;
    font-size: 15px;
}

.ac-list-item .ac-detail {
    color: #c9d1d9;
    font-size: 12px;
}

/* ── Legend ────────────────────────────────────── */
.legend {
    background: rgba(22, 27, 34, 0.92);
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #30363d;
    color: #e6edf3;
    font-size: 13px;
    line-height: 1.8;
}

.legend-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #c9d1d9;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}

/* ── Legend toggle ────────────────────────────── */
.legend-toggle {
    position: absolute;
    bottom: 8px;
    left: 8px;
    z-index: 1001;
    background: rgba(22, 27, 34, 0.92);
    color: #c9d1d9;
    border: 1px solid #30363d;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.legend-toggle:hover {
    background: #30363d;
    color: #e6edf3;
}

.legend.collapsed {
    display: none !important;
}

/* ── Node Location Markers ──────────────────────── */
.node-marker {
    position: relative;
    width: 20px;
    height: 20px;
}

.node-marker-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: #3fb950;
    border-radius: 50%;
    border: 2px solid #0d1117;
    box-shadow: 0 0 8px rgba(63, 185, 80, 0.6);
    z-index: 2;
}

.node-marker-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(63, 185, 80, 0.3);
    border-radius: 50%;
    animation: node-pulse 2s ease-out infinite;
    z-index: 1;
}

@keyframes node-pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
    }
}

.node-label {
    background: rgba(22, 27, 34, 0.9);
    color: #3fb950;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Mobile Responsive (map.html) ─────────────── */
@media (max-width: 768px) {
    .toolbar {
        padding: 4px 10px;
        gap: 6px;
    }

    .toolbar-controls {
        gap: 4px;
        flex-wrap: wrap;
    }

    .toolbar-controls select,
    .toolbar-controls button {
        padding: 4px 8px;
        font-size: 12px;
    }

    .toolbar-stats {
        gap: 8px;
    }

    .toolbar-stat {
        font-size: 11px;
    }

    .toolbar-stat strong {
        font-size: 14px;
    }

    .live-btn {
        padding: 4px 10px;
        font-size: 12px;
    }

    /* Compact filter bar on mobile */
    .filter-bar {
        padding: 4px 8px;
        gap: 4px;
    }

    .filter-label {
        font-size: 10px;
        margin-right: 2px;
    }

    .filter-pill {
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 11px;
        border-width: 1.5px;
        gap: 3px;
    }

    .filter-pill .pill-count {
        padding: 0 4px;
        font-size: 9px;
        min-width: 14px;
    }

    .filter-sep {
        height: 16px;
        margin: 0 2px;
    }

    .color-toggle,
    .label-toggle {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* Timeline */
    .timeline-bar {
        padding: 6px 10px;
        gap: 6px;
    }

    .timeline-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .timeline-speed {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 34px;
    }

    .timeline-time {
        font-size: 13px;
        min-width: 70px;
    }

    .timeline-date {
        font-size: 11px;
        min-width: 80px;
    }

    .timeline-label {
        font-size: 10px;
    }

    /* Legend */
    .legend {
        font-size: 11px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    /* Stack filter pills in a tight grid */
    .filter-bar {
        padding: 4px 6px;
        gap: 3px;
        display: flex;
        flex-wrap: wrap;
    }

    .filter-label {
        display: none;
    }

    .filter-pill {
        padding: 2px 6px;
        font-size: 10px;
        border-radius: 10px;
        gap: 2px;
    }

    .filter-pill .pill-count {
        padding: 0 3px;
        font-size: 8px;
        min-width: 12px;
    }

    .filter-sep {
        display: none;
    }

    .color-toggle,
    .label-toggle {
        padding: 2px 6px;
        font-size: 10px;
    }

    #heatmap-btn {
        padding: 2px 6px;
        font-size: 10px;
    }

    /* Toolbar */
    .toolbar-stats {
        display: none;
    }

    .toolbar-controls label {
        font-size: 11px;
    }

    /* Timeline compact */
    .timeline-label {
        display: none;
    }

    .timeline-date {
        display: none;
    }

    .timeline-time {
        font-size: 12px;
        min-width: 60px;
    }
}

/* ═══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: map3d.html
   ═══════════════════════════════════════════════ */

body.map3d-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Slider Group (map3d) ────────────────────── */
.slider-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #c9d1d9;
}

.slider-group input[type="range"] {
    width: 80px;
    accent-color: #58a6ff;
    cursor: pointer;
}

.slider-group .slider-val {
    font-weight: 700;
    color: #f0f6fc;
    min-width: 28px;
    text-align: center;
}

/* ── Map Container (map3d) ───────────────────── */
#map-container {
    flex: 1;
    position: relative;
}

#map {
    width: 100%;
    height: 100%;
}

/* ── Tooltip (map3d) ─────────────────────────── */
.deck-tooltip {
    position: absolute;
    z-index: 3000;
    pointer-events: none;
    background: rgba(22, 27, 34, 0.95);
    color: #e6edf3;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    border: 1px solid #30363d;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    max-width: 280px;
    line-height: 1.6;
    font-family: 'Roboto Mono', monospace;
}

.deck-tooltip .tt-flight {
    font-size: 16px;
    font-weight: 600;
    color: #58a6ff;
}

.deck-tooltip .tt-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.deck-tooltip .tt-label {
    color: #999;
}

.deck-tooltip .tt-val {
    font-weight: 500;
}

.deck-tooltip .tt-cat {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

/* ── Help overlay (map3d) ────────────────────── */
.help-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(22, 27, 34, 0.9);
    color: #8b949e;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    z-index: 1500;
    border: 1px solid #30363d;
    pointer-events: none;
    transition: opacity 0.5s;
}

/* ── Mobile Responsive (map3d.html) ──────────── */
@media (max-width: 768px) {
    .slider-group input[type="range"] {
        width: 60px;
    }

    .timeline-bar {
        padding: 6px 10px;
        gap: 6px;
    }

    .timeline-btn {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .timeline-speed {
        padding: 3px 6px;
        font-size: 11px;
        min-width: 34px;
    }

    .timeline-time {
        font-size: 13px;
        min-width: 70px;
    }

    .timeline-date {
        font-size: 11px;
        min-width: 80px;
    }

    .timeline-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .toolbar-stats {
        display: none;
    }

    .slider-group span:first-child {
        display: none;
    }

    .timeline-label {
        display: none;
    }

    .timeline-date {
        display: none;
    }

    .timeline-time {
        font-size: 12px;
        min-width: 60px;
    }
}

/* ═══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: map-ais.html
   ═══════════════════════════════════════════════ */

/* AIS map uses same map-page layout as flight map */

/* ── Vessel Popup ─────────────────────────────── */
.vessel-popup {
    font-family: 'Roboto Mono', monospace;
    min-width: 220px;
}

.vessel-popup-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #30363d;
}

.vessel-name {
    font-size: 16px;
    font-weight: 700;
    color: #0d1117;
}

.vessel-mmsi {
    font-size: 11px;
    color: #666;
    font-family: 'Roboto Mono', monospace;
}

.vessel-popup .popup-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 12px;
    color: #333;
}

.vessel-popup .popup-row span:first-child {
    color: #666;
    font-weight: 500;
}

.vessel-popup .popup-row span:last-child {
    font-weight: 600;
    color: #0d1117;
    text-align: right;
}

/* ── Vessel Label ────────────────────────────── */
.vessel-label {
    background: rgba(22, 27, 34, 0.9);
    color: #c9d1d9;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    font-family: 'Roboto Mono', monospace;
    border: 1px solid #30363d;
}

/* ── Vessel type filter colors (AIS specific) ── */
.filter-pill[data-cat="cargo"] {
    border-color: #3fb950;
    color: #3fb950;
}

.filter-pill.active[data-cat="cargo"] {
    background: #3fb950;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill[data-cat="tanker"] {
    border-color: #d29922;
    color: #d29922;
}

.filter-pill.active[data-cat="tanker"] {
    background: #d29922;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill[data-cat="passenger"] {
    border-color: #58a6ff;
    color: #58a6ff;
}

.filter-pill.active[data-cat="passenger"] {
    background: #58a6ff;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill[data-cat="fishing"] {
    border-color: #f7d13d;
    color: #f7d13d;
}

.filter-pill.active[data-cat="fishing"] {
    background: #f7d13d;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill[data-cat="tug"] {
    border-color: #e65164;
    color: #e65164;
}

.filter-pill.active[data-cat="tug"] {
    background: #e65164;
    color: #0d1117;
    font-weight: 700;
}

.filter-pill[data-cat="other"] {
    border-color: #8b949e;
    color: #8b949e;
}

.filter-pill.active[data-cat="other"] {
    background: #8b949e;
    color: #0d1117;
    font-weight: 700;
}

/* ── Aircraft Search ─────────────────────────── */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-bar input {
    flex: 1;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 8px 12px;
    color: #e6edf3;
    font-family: 'Roboto Mono', monospace;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s;
}

.search-bar input:focus {
    border-color: #58a6ff;
}

.search-bar input::placeholder {
    color: #484f58;
}

.search-btn {
    padding: 8px 20px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

.search-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px;
    color: #8b949e;
    font-size: 13px;
}

.search-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.search-stat-card {
    background: #0d1117;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 10px 12px;
    text-align: center;
}

.search-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #58a6ff;
}

.search-stat-label {
    font-size: 10px;
    color: #8b949e;
    text-transform: uppercase;
    margin-top: 2px;
}

.search-aircraft-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.search-callsign {
    font-size: 20px;
    font-weight: 700;
    color: #e6edf3;
}

.search-type-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #21262d;
    color: #8b949e;
    border: 1px solid #30363d;
}

.search-map-container {
    height: 220px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #21262d;
    margin-bottom: 16px;
}

.search-section-label {
    font-size: 12px;
    font-weight: 600;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 16px 0 8px 0;
}

.search-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.search-table th {
    text-align: left;
    padding: 6px 10px;
    color: #8b949e;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #21262d;
    white-space: nowrap;
}

.search-table td {
    padding: 6px 10px;
    border-bottom: 1px solid #161b22;
    color: #c9d1d9;
    white-space: nowrap;
}

.search-table tr:hover td {
    background: #161b22;
}

.search-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.search-no-results {
    text-align: center;
    padding: 30px;
    color: #484f58;
    font-size: 13px;
}

.search-multi-aircraft {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.search-aircraft-pill {
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid #30363d;
    background: #21262d;
    color: #c9d1d9;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
}

.search-aircraft-pill:hover,
.search-aircraft-pill.active {
    border-color: #58a6ff;
    color: #58a6ff;
    background: #58a6ff22;
}

/* ═══════════════════════════════════════════════
   PAGE-SPECIFIC STYLES: timelapse.html
   ═══════════════════════════════════════════════ */

/* ── Date Input ──────────────────────────────── */
.date-input {
    background: #21262d;
    color: #e6edf3;
    border: 1px solid #30363d;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    cursor: pointer;
    color-scheme: dark;
}

.date-input:focus {
    outline: none;
    border-color: #58a6ff;
}

.toolbar-sep {
    width: 1px;
    height: 24px;
    background: #30363d;
    margin: 0 4px;
}

/* ── Timelapse Stats Overlay ─────────────────── */
.timelapse-stats {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 800;
    display: flex;
    gap: 12px;
    background: rgba(13, 17, 23, 0.88);
    border: 1px solid #30363d;
    border-radius: 10px;
    padding: 10px 16px;
    backdrop-filter: blur(8px);
}

.tl-stat {
    text-align: center;
    min-width: 60px;
}

.tl-stat-value {
    font-size: 22px;
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    color: #e6edf3;
    line-height: 1.1;
}

.tl-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8b949e;
    margin-top: 2px;
}

/* ── Hour Markers on Timeline ────────────────── */
.timeline-hours {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.hour-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(139, 148, 158, 0.25);
}

.hour-marker::after {
    content: attr(data-hour);
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: #8b949e;
    white-space: nowrap;
}

/* ── Color Toggle Active State ───────────────── */
.color-toggle.active {
    border-color: #f97316;
    color: #f97316;
    background: #f9731622;
}

@media (max-width: 768px) {
    .timelapse-stats {
        top: 8px;
        right: 8px;
        gap: 8px;
        padding: 8px 12px;
    }

    .tl-stat-value {
        font-size: 16px;
    }

    .tl-stat-label {
        font-size: 8px;
    }

    .hour-marker::after {
        display: none;
    }
}
