/* =================================================================
   SENTINEL — Geopolitical Airspace & Conflict Monitor
   JARVIS / HUD Theme Stylesheet
   ================================================================= */

/* -----------------------------------------------------------------
   CSS VARIABLES
   ----------------------------------------------------------------- */
:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #0d1321;
    --bg-panel: rgba(13, 19, 33, 0.85);
    --accent-cyan: #00d4ff;
    --accent-blue: #0066ff;
    --accent-orange: #ff6b00;
    --accent-red: #ff1744;
    --accent-green: #00e676;
    --accent-yellow: #ffea00;
    --text-primary: #e0e6ed;
    --text-secondary: #7a8ba0;
    --text-accent: #00d4ff;
    --border-glow: rgba(0, 212, 255, 0.3);
    --grid-line: rgba(0, 212, 255, 0.05);
}


/* -----------------------------------------------------------------
   1. BASE / RESET
   ----------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-primary);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            var(--grid-line) 49px,
            var(--grid-line) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            var(--grid-line) 49px,
            var(--grid-line) 50px
        );
    font-family: 'Rajdhani', 'Share Tech Mono', sans-serif;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* -----------------------------------------------------------------
   2. BOOT SCREEN
   ----------------------------------------------------------------- */
#boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-primary);
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 49px,
            var(--grid-line) 49px,
            var(--grid-line) 50px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 49px,
            var(--grid-line) 49px,
            var(--grid-line) 50px
        );
    flex-direction: column;
}

.boot-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.boot-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.boot-radar {
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.4));
}

.boot-radar .radar-sweep {
    animation: radar-sweep 2s linear infinite;
    transform-origin: 60px 60px;
}

.boot-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 12px;
    text-shadow:
        0 0 10px rgba(0, 212, 255, 0.6),
        0 0 30px rgba(0, 212, 255, 0.3),
        0 0 60px rgba(0, 212, 255, 0.15);
    text-transform: uppercase;
}

.boot-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 360px;
}

.boot-text {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.boot-progress {
    width: 100%;
    height: 3px;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.boot-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue));
    border-radius: 2px;
    transition: width 0.3s ease-out;
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.boot-log {
    width: 100%;
    max-height: 120px;
    overflow-y: auto;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: left;
    padding: 8px 0;
}

.boot-log-line {
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boot-log-line:last-child {
    opacity: 1;
    color: var(--accent-cyan);
}

.boot-complete {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 1s ease-out;
}


/* -----------------------------------------------------------------
   3. SCAN LINES
   ----------------------------------------------------------------- */
#scan-lines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    animation: scanline-drift 8s linear infinite;
}

@keyframes scanline-drift {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}


/* -----------------------------------------------------------------
   4. HEADER
   ----------------------------------------------------------------- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 65px;
    z-index: 50;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 260px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.5));
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.logo-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-cyan);
    letter-spacing: 4px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
    text-transform: uppercase;
}

.logo-version {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.header-subtitle {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    text-transform: uppercase;
    padding-left: 48px;
}

/* Header navigation */
.header-nav {
    display: flex;
    gap: 4px;
    padding-left: 48px;
    margin-top: 2px;
}

.nav-link {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 2px;
    padding: 2px 8px;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
    background: rgba(0, 212, 255, 0.05);
}

.nav-link.active {
    color: var(--accent-cyan);
    border-color: rgba(0, 212, 255, 0.3);
    background: rgba(0, 212, 255, 0.08);
}

.header-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.utc-display {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.utc-label {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.utc-time {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 22px;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.utc-date {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 260px;
    justify-content: flex-end;
}

.region-tabs {
    display: flex;
    gap: 4px;
}

.region-tab {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 5px 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.region-tab:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
    background: rgba(0, 212, 255, 0.05);
}

.region-tab.active {
    color: var(--bg-primary);
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
    font-weight: 600;
}

.system-status-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.system-status-wrapper .status-label {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}


/* -----------------------------------------------------------------
   5. CONTENT WRAPPER
   ----------------------------------------------------------------- */
#content-wrapper {
    position: fixed;
    top: 65px;
    bottom: 30px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: row;
}


/* -----------------------------------------------------------------
   6. LEFT PANEL
   ----------------------------------------------------------------- */
#left-panel {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-glow);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

/* Panel sections */
.panel-section {
    margin-bottom: 20px;
    position: relative;
}

.panel-section::before,
.panel-section::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    pointer-events: none;
}

.panel-section::before {
    top: -2px;
    left: -2px;
    border-top: 2px solid rgba(0, 212, 255, 0.4);
    border-left: 2px solid rgba(0, 212, 255, 0.4);
}

.panel-section::after {
    top: -2px;
    right: -2px;
    border-top: 2px solid rgba(0, 212, 255, 0.4);
    border-right: 2px solid rgba(0, 212, 255, 0.4);
}

.panel-header {
    font-family: 'Rajdhani', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}


/* Stats grid */
.stats-grid {
    display: flex;
    flex-direction: column;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 4px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.stat-value {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 16px;
    color: var(--text-primary);
    text-align: right;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-highlight {
    color: var(--accent-cyan);
}

.stat-warn {
    color: var(--accent-yellow);
}

.stat-alert {
    color: var(--accent-red);
}

/* Stat divider with diamond */
.stat-divider {
    height: 1px;
    background: var(--border-glow);
    margin: 10px 0;
    position: relative;
}

.stat-divider::after {
    content: '\u25C6';
    position: absolute;
    left: 50%;
    top: -6px;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--accent-cyan);
    background: var(--bg-secondary);
    padding: 0 6px;
}


/* Threat level bar */
.threat-bar {
    display: inline-block;
    width: 60px;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    overflow: hidden;
    vertical-align: middle;
}

.threat-fill {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.5s ease;
}

.threat-text {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Threat fill colors set by JS via inline styles or data attributes */
.threat-fill.threat-low {
    background: var(--accent-green);
    width: 20%;
}

.threat-fill.threat-moderate {
    background: var(--accent-blue);
    width: 40%;
}

.threat-fill.threat-elevated {
    background: var(--accent-yellow);
    width: 60%;
}

.threat-fill.threat-high {
    background: var(--accent-orange);
    width: 80%;
}

.threat-fill.threat-critical {
    background: var(--accent-red);
    width: 100%;
    animation: pulse-red 1.5s ease-in-out infinite;
}


/* API Quota */
.quota-display {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.quota-numbers {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
    background: var(--accent-green);
}

.progress-fill.quota-good {
    background: var(--accent-green);
}

.progress-fill.quota-warn {
    background: var(--accent-yellow);
}

.progress-fill.quota-critical {
    background: var(--accent-red);
    animation: pulse-red 1.5s ease-in-out infinite;
}

.quota-percent {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.quota-sync {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    opacity: 0.7;
}


/* Regions list */
.regions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}


/* Filter checkboxes */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-checkbox,
.layer-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    user-select: none;
    transition: color 0.2s ease;
}

.filter-checkbox:hover,
.layer-toggle:hover {
    color: var(--text-primary);
}

.filter-checkbox input[type="checkbox"],
.layer-toggle input[type="checkbox"] {
    display: none;
}

.filter-checkbox .checkmark,
.layer-toggle .checkmark {
    width: 16px;
    height: 16px;
    border: 1px solid rgba(0, 212, 255, 0.4);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    position: relative;
    background: rgba(0, 212, 255, 0.03);
}

.filter-checkbox .checkmark::after,
.layer-toggle .checkmark::after {
    content: '';
    width: 8px;
    height: 5px;
    border-left: 2px solid var(--bg-primary);
    border-bottom: 2px solid var(--bg-primary);
    transform: rotate(-45deg);
    display: none;
    margin-top: -2px;
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark,
.layer-toggle input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

.filter-checkbox input[type="checkbox"]:checked + .checkmark::after,
.layer-toggle input[type="checkbox"]:checked + .checkmark::after {
    display: block;
}


/* Select dropdown */
.filter-select-group {
    margin-top: 4px;
}

.filter-select-label {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.filter-select-group select {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid rgba(0, 212, 255, 0.25);
    border-radius: 3px;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: 1px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300d4ff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.filter-select-group select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.25);
}

.filter-select-group select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}


/* -----------------------------------------------------------------
   7. MAP CONTAINER
   ----------------------------------------------------------------- */
#map-container {
    flex-grow: 1;
    position: relative;
    min-width: 0;
}

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

/* Mobile toggle buttons */
.mobile-toggle {
    display: none;
    position: absolute;
    z-index: 1001;
    top: 12px;
    width: 36px;
    height: 36px;
    background: var(--bg-panel);
    border: 1px solid var(--border-glow);
    border-radius: 4px;
    color: var(--accent-cyan);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.mobile-toggle:hover {
    background: rgba(0, 212, 255, 0.1);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.mobile-toggle-left {
    left: 12px;
}

.mobile-toggle-right {
    right: 12px;
}

/* Panel backdrop overlay */
.panel-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 55;
}

.panel-backdrop.active {
    display: block;
}

/* Leaflet map dark tiles adjustments */
.leaflet-container {
    background: var(--bg-primary);
    font-family: 'Rajdhani', sans-serif;
}

/* Leaflet controls styling */
.leaflet-control-zoom a {
    background: var(--bg-panel) !important;
    color: var(--accent-cyan) !important;
    border: 1px solid var(--border-glow) !important;
    backdrop-filter: blur(8px);
}

.leaflet-control-zoom a:hover {
    background: rgba(0, 212, 255, 0.15) !important;
}

.leaflet-control-attribution {
    background: rgba(10, 14, 23, 0.8) !important;
    color: var(--text-secondary) !important;
    font-size: 9px !important;
}

.leaflet-control-attribution a {
    color: var(--text-secondary) !important;
}


/* Map overlays */
.map-overlay {
    position: absolute;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glow);
    padding: 10px 12px;
    border-radius: 4px;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.map-overlay::before,
.map-overlay::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    pointer-events: none;
}

.map-overlay::before {
    top: -1px;
    left: -1px;
    border-top: 2px solid rgba(0, 212, 255, 0.5);
    border-left: 2px solid rgba(0, 212, 255, 0.5);
}

.map-overlay::after {
    bottom: -1px;
    right: -1px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.5);
    border-right: 2px solid rgba(0, 212, 255, 0.5);
}

.map-overlay-tr {
    top: 10px;
    right: 10px;
}

.map-overlay-bc {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.overlay-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.layer-toggles {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.layer-divider {
    height: 1px;
    background: rgba(0, 212, 255, 0.1);
    margin: 4px 0;
}


/* Time filter buttons */
.time-filter-buttons {
    display: flex;
    gap: 4px;
}

.time-btn {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 4px 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.time-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
    background: rgba(0, 212, 255, 0.05);
}

.time-btn.active {
    color: var(--bg-primary);
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
    font-weight: 600;
}


/* -----------------------------------------------------------------
   8. RIGHT PANEL
   ----------------------------------------------------------------- */
#right-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid var(--border-glow);
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

#right-panel .panel-section {
    padding: 16px 16px 0;
    flex-shrink: 0;
}

/* Event feed controls */
.event-feed-controls {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.feed-filter-btn {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid rgba(0, 212, 255, 0.15);
    padding: 4px 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.feed-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-glow);
    background: rgba(0, 212, 255, 0.05);
}

.feed-filter-btn.active {
    color: var(--bg-primary);
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}


/* Event feed */
.event-feed {
    flex-grow: 1;
    overflow-y: auto;
    padding: 8px 12px 12px;
}


/* Event cards */
.event-card {
    background: rgba(13, 19, 33, 0.6);
    border-left: 3px solid var(--border-glow);
    margin: 8px 0;
    padding: 10px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    background: rgba(13, 19, 33, 0.9);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

.event-card:first-child {
    margin-top: 0;
}

.event-card.type-military {
    border-left-color: var(--accent-cyan);
}

.event-card.type-airstrike {
    border-left-color: var(--accent-red);
}

.event-card.type-shelling {
    border-left-color: var(--accent-orange);
}

.event-card.type-missile {
    border-left-color: #ff4400;
}

.event-card.type-ied {
    border-left-color: var(--accent-yellow);
}

.event-card.type-emergency {
    border-left-color: var(--accent-red);
    animation: pulse-red 2s ease-in-out infinite;
}

.event-card.type-civilian {
    border-left-color: var(--text-secondary);
}

.event-card.type-interesting {
    border-left-color: var(--accent-yellow);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.event-card-type {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.event-card-time {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
}

.event-card-title {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
}

.event-card-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.event-card-details {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 212, 255, 0.08);
}


/* -----------------------------------------------------------------
   9. BOTTOM STATUS BAR
   ----------------------------------------------------------------- */
#status-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    z-index: 50;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-glow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.status-group {
    display: flex;
    align-items: center;
    gap: 0;
}

.status-item {
    display: inline-flex;
    align-items: center;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 4px;
    flex-shrink: 0;
}

.status-online {
    background: var(--accent-green);
    box-shadow: 0 0 6px rgba(0, 230, 118, 0.5);
    animation: pulse-green 2s ease-in-out infinite;
}

.status-stale {
    background: var(--accent-yellow);
    box-shadow: 0 0 4px rgba(255, 234, 0, 0.4);
}

.status-offline {
    background: var(--accent-red);
    box-shadow: 0 0 4px rgba(255, 23, 68, 0.4);
}

.status-unknown {
    background: #555;
}

.status-separator {
    color: rgba(0, 212, 255, 0.15);
    margin: 0 10px;
    font-size: 11px;
    user-select: none;
}

.status-right {
    justify-content: flex-end;
}


/* -----------------------------------------------------------------
   10. POPUP STYLES (Leaflet Popups)
   ----------------------------------------------------------------- */
.leaflet-popup-content-wrapper {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-glow) !important;
    border-radius: 6px !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5) !important;
    padding: 0 !important;
    color: var(--text-primary) !important;
}

.leaflet-popup-content {
    margin: 0 !important;
    font-family: 'Rajdhani', sans-serif !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    min-width: 260px;
}

.leaflet-popup-tip {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-glow) !important;
    box-shadow: none !important;
}

.leaflet-popup-close-button {
    color: var(--text-secondary) !important;
    font-size: 18px !important;
    padding: 6px 8px !important;
    width: auto !important;
    height: auto !important;
}

.leaflet-popup-close-button:hover {
    color: var(--accent-cyan) !important;
}

.popup-detail {
    padding: 0;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-glow);
    text-transform: uppercase;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
}

.popup-type {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    letter-spacing: 1px;
    font-weight: 600;
}

.aircraft-type-badge {
    background: rgba(0, 212, 255, 0.15);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 212, 255, 0.3);
}

.conflict-type-badge {
    background: rgba(255, 23, 68, 0.15);
    color: var(--accent-red);
    border: 1px solid rgba(255, 23, 68, 0.3);
}

.popup-callsign,
.popup-event-type {
    color: var(--text-primary);
    font-size: 14px;
}

.popup-flag {
    font-size: 16px;
    margin-left: auto;
}

.popup-body {
    padding: 8px 14px;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 3px 0;
    font-size: 12px;
}

.popup-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 212, 255, 0.04);
}

.popup-label {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
    margin-right: 12px;
}

.popup-value {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-primary);
    text-align: right;
    word-break: break-all;
}

.popup-notes-row {
    flex-direction: column;
    gap: 4px;
}

.popup-notes-row .popup-value {
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    word-break: break-word;
}

.popup-footer {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    border-top: 1px solid var(--border-glow);
}

.popup-btn {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--accent-cyan);
    background: transparent;
    border: 1px solid var(--border-glow);
    padding: 4px 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    border-radius: 2px;
    flex: 1;
    text-align: center;
}

.popup-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}


/* -----------------------------------------------------------------
   11. ANIMATIONS
   ----------------------------------------------------------------- */

/* Pulse glow for active elements */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.3); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.6); }
}

/* Radar ping for new aircraft markers */
@keyframes radar-ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

/* Radar sweep rotation */
@keyframes radar-sweep {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Red pulse for critical alerts */
@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 23, 68, 0.3); }
    50% { box-shadow: 0 0 15px rgba(255, 23, 68, 0.7); }
}

/* Green pulse for online status */
@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 3px rgba(0, 230, 118, 0.3); }
    50% { box-shadow: 0 0 8px rgba(0, 230, 118, 0.6); }
}

/* Number tick animation class - added by JS */
.stat-updating {
    animation: stat-tick 0.3s ease-out;
}

@keyframes stat-tick {
    0% { transform: translateY(-5px); opacity: 0.5; }
    100% { transform: translateY(0); opacity: 1; }
}

/* New event flash */
@keyframes event-flash {
    0% { background: rgba(0, 212, 255, 0.2); }
    100% { background: rgba(13, 19, 33, 0.6); }
}

.event-new {
    animation: event-flash 1.5s ease-out;
}

/* Conflict marker icons — ensure visibility */
.conflict-icon-wrapper {
    background: transparent !important;
    border: none !important;
}

.conflict-marker {
    filter: drop-shadow(0 0 4px rgba(255, 234, 0, 0.6));
    transition: transform 0.2s ease;
}

.conflict-marker:hover {
    transform: scale(1.3);
}

.conflict-airstrike {
    filter: drop-shadow(0 0 6px rgba(255, 23, 68, 0.8));
}

.conflict-shelling {
    filter: drop-shadow(0 0 6px rgba(255, 107, 0, 0.8));
}

.conflict-missile {
    filter: drop-shadow(0 0 6px rgba(255, 69, 0, 0.8));
}

.conflict-ied {
    filter: drop-shadow(0 0 6px rgba(255, 234, 0, 0.8));
}

/* Conflict tooltip */
.conflict-tooltip {
    background: var(--bg-secondary, rgba(13, 19, 33, 0.95)) !important;
    color: var(--text-primary, #e0e6ed) !important;
    border: 1px solid rgba(0, 212, 255, 0.3) !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 11px !important;
    padding: 4px 8px !important;
    border-radius: 2px !important;
}

.conflict-tooltip::before {
    border-top-color: rgba(0, 212, 255, 0.3) !important;
}

/* Conflict cluster icons */
.conflict-cluster {
    background: rgba(255, 107, 0, 0.7) !important;
    border: 2px solid rgba(255, 234, 0, 0.8);
    border-radius: 50%;
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    color: #fff;
    font-weight: 700;
}

.conflict-cluster div {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.conflict-cluster-small {
    background: rgba(255, 234, 0, 0.6) !important;
}

.conflict-cluster-medium {
    background: rgba(255, 107, 0, 0.7) !important;
}

.conflict-cluster-large {
    background: rgba(255, 23, 68, 0.7) !important;
}


/* -----------------------------------------------------------------
   12. CUSTOM SCROLLBAR
   ----------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 212, 255, 0.3) var(--bg-primary);
}


/* -----------------------------------------------------------------
   13. MARKER CLUSTER OVERRIDES
   ----------------------------------------------------------------- */
.marker-cluster-small {
    background-color: rgba(0, 212, 255, 0.2) !important;
}

.marker-cluster-small div {
    background-color: rgba(0, 212, 255, 0.4) !important;
    color: var(--text-primary) !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 12px !important;
}

.marker-cluster-medium {
    background-color: rgba(255, 107, 0, 0.2) !important;
}

.marker-cluster-medium div {
    background-color: rgba(255, 107, 0, 0.4) !important;
    color: var(--text-primary) !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 12px !important;
}

.marker-cluster-large {
    background-color: rgba(255, 23, 68, 0.2) !important;
}

.marker-cluster-large div {
    background-color: rgba(255, 23, 68, 0.4) !important;
    color: var(--text-primary) !important;
    font-family: 'Share Tech Mono', monospace !important;
    font-size: 12px !important;
}


/* -----------------------------------------------------------------
   14. RESPONSIVE BREAKPOINTS
   ----------------------------------------------------------------- */
@media (max-width: 1200px) {
    .mobile-toggle {
        display: flex;
    }

    #left-panel {
        position: fixed;
        left: -300px;
        z-index: 60;
        transition: left 0.3s ease;
        height: calc(100vh - 95px);
        top: 65px;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    }

    #left-panel.open {
        left: 0;
    }

    #right-panel {
        width: 260px;
    }

    .header-subtitle {
        font-size: 9px;
        letter-spacing: 2px;
    }

    .header-nav {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    #header {
        padding: 0 10px;
        height: 55px;
    }

    .header-subtitle {
        display: none;
    }

    .header-nav {
        padding-left: 0;
        gap: 2px;
    }

    .nav-link {
        font-size: 9px;
        padding: 1px 5px;
        letter-spacing: 1px;
    }

    .logo-title {
        font-size: 18px;
        letter-spacing: 3px;
    }

    .utc-time {
        font-size: 18px;
    }

    .utc-date {
        display: none;
    }

    .region-tab {
        padding: 4px 8px;
        font-size: 11px;
        letter-spacing: 1px;
    }

    #content-wrapper {
        top: 55px;
    }

    #left-panel {
        height: calc(100vh - 85px);
        top: 55px;
    }

    #right-panel {
        position: fixed;
        bottom: -100%;
        z-index: 60;
        transition: bottom 0.3s ease;
        width: 100%;
        height: 50vh;
        left: 0;
        border-left: none;
        border-top: 1px solid var(--border-glow);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    #right-panel.open {
        bottom: 30px;
    }

    .mobile-toggle {
        width: 40px;
        height: 40px;
    }

    .map-overlay-tr {
        top: 60px;
        right: 8px;
    }

    .map-overlay-bc {
        bottom: 8px;
    }

    .time-btn {
        font-size: 10px;
        padding: 3px 7px;
    }

    .system-status-wrapper {
        display: none;
    }
}

@media (max-width: 480px) {
    .header-logo {
        gap: 8px;
    }

    .logo-icon {
        width: 28px;
        height: 28px;
    }

    .logo-title {
        font-size: 16px;
        letter-spacing: 2px;
    }

    .header-center {
        display: none;
    }

    .region-tab {
        padding: 3px 6px;
        font-size: 10px;
    }

    .map-overlay {
        padding: 8px;
    }
}


/* -----------------------------------------------------------------
   15. UTILITY & MISC
   ----------------------------------------------------------------- */

/* Fading vignette edges on the body for depth */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.35) 100%);
}

/* Selection styling */
::selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 212, 255, 0.3);
    color: var(--text-primary);
}

/* Focus styling for accessibility */
*:focus-visible {
    outline: 1px solid var(--accent-cyan);
    outline-offset: 2px;
}

/* Prevent text selection on UI elements */
#header,
#status-bar,
.panel-header,
.region-tab,
.time-btn,
.feed-filter-btn,
.popup-btn,
.filter-checkbox,
.layer-toggle {
    user-select: none;
    -webkit-user-select: none;
}

/* Hide template content */
template {
    display: none;
}

/* Region item styling (populated by JS) */
.region-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 6px;
    border-radius: 3px;
    font-size: 11px;
    transition: background 0.2s ease;
}

.region-item:hover {
    background: rgba(0, 212, 255, 0.05);
}

.region-item .region-name {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.region-item .region-status {
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    font-size: 10px;
    color: var(--accent-cyan);
}

/* Aircraft trail polyline */
.aircraft-trail {
    stroke-dasharray: 4, 4;
}

/* Loading shimmer for placeholder values */
.stat-value[data-loading]::after {
    content: '';
    display: inline-block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
