/* ============================================
   NEXUS — Global Conflict Detection System
   Ultra-Premium Cinematic Design System v4.0
   ============================================ */

:root {
    /* Color Palette: Deep cinematic tones */
    --bg-void: hsl(230, 25%, 3%);
    --bg-deep: hsl(230, 20%, 6%);
    --bg-panel: rgba(12, 16, 26, 0.45);
    --bg-panel-hover: rgba(18, 24, 38, 0.6);
    --bg-glass: rgba(12, 16, 26, 0.3);

    /* Accents: Realistic light emitters */
    --cyan-primary: hsl(190, 90%, 65%);
    --cyan-glow: rgba(50, 220, 255, 0.2);
    --cyan-dim: rgba(50, 220, 255, 0.05);

    --red-critical: hsl(350, 90%, 65%);
    --red-glow: rgba(255, 50, 80, 0.2);

    --orange-high: hsl(25, 95%, 60%);
    --orange-glow: rgba(255, 120, 30, 0.2);

    --yellow-moderate: hsl(45, 95%, 60%);
    --green-low: hsl(150, 80%, 55%);
    --green-glow: rgba(30, 220, 130, 0.2);

    --blue-accent: hsl(210, 90%, 65%);
    --blue-glow: rgba(50, 150, 255, 0.2);

    /* Text: Optical elegance */
    --text-primary: rgba(255, 255, 255, 0.95);
    --text-secondary: rgba(255, 255, 255, 0.65);
    --text-dim: rgba(255, 255, 255, 0.35);

    /* Borders: Micro-thin reflections */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(255, 255, 255, 0.15);

    /* Architecture */
    --panel-width: 380px;
    --top-bar-height: 68px;
    --bottom-bar-height: 52px;
    --timeline-height: 46px;
    --border-radius: 6px;
    --panel-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;

    /* Easing */
    --ease-buttery: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
    width: 3px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* === NOISE & VIGNETTE === */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* === LOADING SCREEN === */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(circle at center, var(--bg-deep) 0%, var(--bg-void) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1.2s var(--ease-buttery), visibility 1.2s;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.loader-ring {
    width: 140px;
    height: 140px;
    position: relative;
}

.ring-segment {
    position: absolute;
    inset: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    opacity: 0.6;
}

.ring-segment:nth-child(1) {
    border-top-color: var(--cyan-primary);
    animation: spin 2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.ring-segment:nth-child(2) {
    inset: 12px;
    border-right-color: var(--text-secondary);
    animation: spin 3s linear infinite reverse;
}

.ring-segment:nth-child(3) {
    inset: 24px;
    border-bottom-color: var(--red-critical);
    animation: spin 4s ease-in-out infinite;
}

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

.loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-title {
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 16px;
    color: var(--text-primary);
    margin-right: -16px;
    /* Balance letter spacing */
    text-transform: uppercase;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
}

.loader-subtitle {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 6px;
    color: var(--text-dim);
    text-transform: uppercase;
    animation: blink 2s step-end infinite;
    margin-right: -6px;
}

@keyframes blink {
    50% {
        opacity: 0.4;
    }
}

.loader-bar {
    width: 320px;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.loader-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan-primary), #fff);
    transition: width 0.4s var(--ease-buttery);
    box-shadow: 0 0 15px var(--cyan-glow);
}

.loader-percent {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

/* === MAIN APP === */
#app {
    width: 100%;
    height: 100%;
    position: relative;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#app.visible {
    opacity: 1;
}

#globe-container {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: transparent;
    overflow: hidden;
}

#globe-container canvas {
    display: block;
}

#globe-container>div {
    width: 100% !important;
    height: 100% !important;
}

/* Optical Grid & Scanline Overlay */
.scanline-overlay {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, 0.15) 50%);
    background-size: 100% 4px;
    mix-blend-mode: overlay;
    opacity: 0.3;
}

#globe-container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(2, 3, 5, 0.7) 70%, rgba(2, 3, 5, 1) 100%);
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.9);
}

/* === TOP BAR === */
#top-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-bar-height);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: linear-gradient(180deg, rgba(6, 10, 16, 0.8) 0%, rgba(6, 10, 16, 0) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.top-bar-left,
.top-bar-center,
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    color: var(--text-primary);
    opacity: 0.9;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.logo-sub {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-top: 2px;
    opacity: 0.6;
    text-transform: uppercase;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 40px;
    background: rgba(255, 255, 255, 0.02);
}

.status-indicator.active .status-dot {
    background: var(--cyan-primary);
    box-shadow: 0 0 8px var(--cyan-glow);
}

.status-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    opacity: 0.8;
}

.status-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.datetime {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.metric-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 0;
    min-width: 120px;
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 3px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.metric-value {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.metric-value.threat-high {
    color: var(--orange-high);
    text-shadow: 0 0 20px var(--orange-glow);
}

.metric-value.threat-critical {
    color: var(--red-critical);
    text-shadow: 0 0 20px var(--red-glow);
    animation: subtle-pulse 2s ease-in-out infinite;
}

@keyframes subtle-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* === SIDE PANELS === */
#left-panel,
#right-panel {
    position: fixed;
    top: calc(var(--top-bar-height) + 24px);
    bottom: calc(var(--bottom-bar-height) + 24px);
    width: var(--panel-width);
    z-index: 100;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    backdrop-filter: blur(36px) saturate(160%);
    -webkit-backdrop-filter: blur(36px) saturate(160%);
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.6s var(--ease-buttery), opacity 0.4s ease;
}

#left-panel {
    left: 24px;
}

#right-panel {
    right: 24px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    flex-shrink: 0;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 6px;
    color: var(--text-primary);
    text-transform: uppercase;
    opacity: 0.9;
}

.panel-controls {
    display: flex;
    gap: 8px;
}

.panel-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    color: var(--text-dim);
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s var(--ease-buttery);
    display: flex;
    align-items: center;
    justify-content: center;
}

.panel-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* === Search Bar === */
.search-container {
    padding: 16px 24px 12px;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 38px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all 0.3s var(--ease-buttery);
    align-items: center;
}

.search-input::placeholder {
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.search-input:focus {
    border-color: var(--border-active);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 13px;
    color: var(--text-dim);
    pointer-events: none;
    transition: color 0.3s;
    opacity: 0.6;
}

.search-wrapper:focus-within .search-icon {
    color: var(--text-primary);
    opacity: 1;
}

/* Conflict Filters */
.conflict-filters {
    display: flex;
    gap: 8px;
    padding: 0 24px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    flex-wrap: wrap;
    flex-shrink: 0;
}

.filter-tag {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.3s var(--ease-buttery);
}

.filter-tag:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
}

.filter-tag.active {
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-tag .filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 8px;
    color: inherit;
    opacity: 0.6;
}

/* Conflict List */
.conflict-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.conflict-item {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-subtle);
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.4s var(--ease-buttery);
    position: relative;
    overflow: hidden;
}

.conflict-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    transition: width 0.4s var(--ease-buttery);
}

.conflict-item.critical::before {
    background: var(--red-critical);
    width: 2px;
}

.conflict-item.high::before {
    background: var(--orange-high);
    width: 2px;
}

.conflict-item.moderate::before {
    background: var(--yellow-moderate);
    width: 2px;
}

.conflict-item.low::before {
    background: var(--green-low);
    width: 2px;
}

.conflict-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.conflict-item:hover::before {
    width: 4px;
}

.conflict-item.active {
    border-color: var(--border-active);
    background: rgba(255, 255, 255, 0.05);
}

.conflict-name {
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.conflict-region {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.conflict-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conflict-severity {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.severity-critical {
    color: var(--red-critical);
    background: rgba(255, 31, 68, 0.1);
}

.severity-high {
    color: var(--orange-high);
    background: rgba(255, 94, 0, 0.1);
}

.severity-moderate {
    color: var(--yellow-moderate);
    background: rgba(255, 183, 0, 0.1);
}

.severity-low {
    color: var(--green-low);
    background: rgba(0, 223, 131, 0.1);
}

.conflict-casualties {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.conflict-status-badge {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    margin-top: 10px;
    display: inline-block;
}

/* Panel Sections (Right Panel) */
.panel-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
}

.panel-section:last-child {
    border-bottom: none;
    flex: 1;
    overflow: hidden;
}

.threat-chart {
    padding: 10px 24px;
    height: 150px;
}

#threat-canvas {
    width: 100%;
    height: 100%;
}

.region-stats {
    padding: 10px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 125px;
    overflow-y: auto;
}

.region-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 0;
}

.region-name {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    min-width: 100px;
    text-transform: uppercase;
}

.region-bar-bg {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.region-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s var(--ease-buttery);
}

.region-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    min-width: 24px;
    text-align: right;
}

/* Intel Feed */
.intel-feed {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.intel-item {
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.02);
    border-left: 2px solid var(--border-subtle);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s var(--ease-buttery);
    position: relative;
}

.intel-item:hover {
    background: rgba(255, 255, 255, 0.03);
    transform: translateX(2px);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.intel-item.critical {
    border-left-color: var(--red-critical);
}

.intel-item.high,
.intel-item.alert {
    border-left-color: var(--orange-high);
}

.intel-item.moderate {
    border-left-color: var(--yellow-moderate);
}

.intel-item.info {
    border-left-color: var(--cyan-primary);
}

.intel-time {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-dim);
    letter-spacing: 2px;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.intel-text {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 500;
}

.intel-type-tag {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 7px;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 6px;
    font-weight: 700;
    transform: translateY(-1px);
}

.intel-type-tag.critical {
    background: rgba(255, 31, 68, 0.15);
    color: var(--red-critical);
}

.intel-type-tag.high,
.intel-type-tag.alert {
    background: rgba(255, 94, 0, 0.15);
    color: var(--orange-high);
}

.intel-type-tag.moderate {
    background: rgba(255, 183, 0, 0.15);
    color: var(--yellow-moderate);
}

.intel-type-tag.info {
    background: rgba(50, 220, 255, 0.15);
    color: var(--cyan-primary);
}

/* === BOTTOM BAR === */
#bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-bar-height);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: linear-gradient(0deg, rgba(6, 10, 16, 0.9) 0%, rgba(6, 10, 16, 0) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.bottom-left,
.bottom-center,
.bottom-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

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

.coord-label {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-dim);
    letter-spacing: 2px;
}

.coord-value {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    min-width: 70px;
}

.globe-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s var(--ease-buttery);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.control-btn.active {
    color: var(--cyan-primary);
    border-color: rgba(50, 220, 255, 0.3);
    background: rgba(50, 220, 255, 0.05);
}

.control-btn .tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: rgba(10, 14, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 2px;
    padding: 6px 10px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: all 0.2s;
    z-index: 200;
    text-transform: uppercase;
}

.control-btn:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.network-stats {
    display: flex;
    gap: 24px;
}

.stat-item {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.stat-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.stat-dot.green {
    background: var(--green-low);
    box-shadow: 0 0 8px var(--green-glow);
}

.stat-dot.blue {
    background: var(--blue-accent);
    box-shadow: 0 0 8px var(--blue-glow);
}

.stat-dot.orange {
    background: var(--orange-high);
    box-shadow: 0 0 8px var(--orange-glow);
}

/* === TOOLTIP 3D Globe === */
.globe-tooltip {
    position: fixed;
    z-index: 500;
    pointer-events: none;
    background: rgba(10, 14, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 18px;
    min-width: 180px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: translate(-50%, -100%) translateY(-16px);
}

.globe-tooltip.visible {
    opacity: 1;
}

.globe-tooltip-name {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.globe-tooltip-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.globe-tooltip-region {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 3, 5, 0.85);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fade-in 0.4s var(--ease-buttery);
}

@keyframes fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: rgba(12, 16, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    animation: modal-slide-in 0.6s var(--ease-buttery);
    position: relative;
    display: flex;
    flex-direction: column;
}

@keyframes modal-slide-in {
    from {
        transform: translateY(40px) scale(0.97);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-severity-indicator {
    width: 3px;
    height: 24px;
    border-radius: 2px;
    margin-right: 16px;
    flex-shrink: 0;
}

.modal-severity-indicator.critical {
    background: var(--red-critical);
    box-shadow: 0 0 12px var(--red-glow);
}

.modal-severity-indicator.high {
    background: var(--orange-high);
    box-shadow: 0 0 12px var(--orange-glow);
}

.modal-severity-indicator.moderate {
    background: var(--yellow-moderate);
}

.modal-severity-indicator.low {
    background: var(--green-low);
}

.modal-header-left {
    display: flex;
    align-items: center;
    flex: 1;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-primary);
    text-transform: uppercase;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

.modal-body {
    padding: 32px;
    flex: 1;
    overflow-y: auto;
}

.modal-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.modal-stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    transition: border-color 0.3s;
}

.modal-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.modal-stat-label {
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    display: block;
}

.modal-stat-value {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

.modal-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.modal-row:last-child {
    border-bottom: none;
}

.modal-label {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.modal-value {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
    text-align: right;
    max-width: 60%;
}

.modal-description {
    margin-top: 24px;
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal-description::before {
    content: 'INTELLIGENCE BRIEF';
    display: block;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.modal-news-section {
    margin-top: 32px;
}

.modal-news-header {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--text-dim);
    margin-bottom: 16px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-news-header::before {
    content: '●';
    color: var(--red-critical);
    font-size: 10px;
    animation: flash 2s infinite;
}

.modal-news-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-card {
    display: flex;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    text-decoration: none;
    align-items: center;
}

.news-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateX(4px);
}

.news-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.news-image-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    background: rgba(0, 136, 255, 0.1);
    flex-shrink: 0;
    border: 1px solid rgba(0, 180, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 8px;
    color: var(--blue-glow);
    text-align: center;
}

.news-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.news-title {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}


.modal-footer {
    padding: 20px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.modal-coords,
.modal-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* === MOBILE TOGGLE BUTTONS === */
.panel-toggle {
    display: none;
    position: fixed;
    z-index: 150;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(16px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.panel-toggle:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.panel-toggle.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--cyan-primary);
    color: var(--cyan-primary);
}

#toggle-left-panel {
    bottom: calc(var(--bottom-bar-height) + 24px);
    left: 24px;
}

#toggle-right-panel {
    bottom: calc(var(--bottom-bar-height) + 24px);
    right: 24px;
}

/* === KEYBOARD SHORTCUTS HINT === */
.shortcuts-hint {
    position: fixed;
    bottom: calc(var(--bottom-bar-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    display: flex;
    gap: 16px;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.shortcuts-hint.visible {
    opacity: 1;
}

.shortcut-key {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.shortcut-key kbd {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
}

/* === ANIMATIONS === */
@keyframes count-flash {
    0% {
        color: var(--cyan-primary);
        text-shadow: 0 0 15px var(--cyan-glow);
    }

    100% {
        color: inherit;
        text-shadow: none;
    }
}

.count-flash {
    animation: count-flash 0.8s ease;
}

.notification-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 8px;
    height: 8px;
    background: var(--red-critical);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--red-glow);
    animation: subtle-pulse 1.5s ease-in-out infinite;
}

.live-badge {
    color: var(--red-critical);
    font-size: 8px;
    margin-left: 8px;
    letter-spacing: 2px;
    animation: subtle-pulse 2s infinite;
}

/* === STARFIELD === */
#starfield {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

/* === NOTIFICATION BELL === */
.notif-bell-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    color: var(--text-dim);
    width: 34px;
    height: 34px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s var(--ease-buttery);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notif-bell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.notif-bell-btn.active {
    color: var(--cyan-primary);
    border-color: rgba(50, 220, 255, 0.3);
    background: rgba(50, 220, 255, 0.05);
}

.notif-status {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: var(--green-low);
    border-radius: 50%;
    display: none;
    box-shadow: 0 0 6px var(--green-glow);
}

/* === TIMELINE BAR === */
#timeline-bar {
    position: fixed;
    bottom: var(--bottom-bar-height);
    left: 0;
    right: 0;
    z-index: 99;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 40px;
    background: linear-gradient(0deg, rgba(6, 10, 16, 0.95) 0%, rgba(6, 10, 16, 0.6) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    height: var(--timeline-height);
}

.timeline-controls { flex-shrink: 0; }

.timeline-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s var(--ease-buttery);
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.timeline-btn.active {
    color: var(--cyan-primary);
    border-color: rgba(50, 220, 255, 0.4);
    background: rgba(50, 220, 255, 0.08);
}

.timeline-track {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#timeline-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cyan-primary);
    cursor: pointer;
    box-shadow: 0 0 12px var(--cyan-glow), 0 0 4px rgba(50, 220, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: transform 0.2s;
}

#timeline-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }

#timeline-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--cyan-primary);
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 12px var(--cyan-glow);
}

#timeline-slider::-moz-range-track {
    background: rgba(255, 255, 255, 0.08);
    height: 3px;
    border: none;
    border-radius: 2px;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 7px;
    color: var(--text-dim);
    letter-spacing: 1px;
    padding: 0 2px;
}

.timeline-year {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--cyan-primary);
    letter-spacing: 2px;
    min-width: 50px;
    text-align: right;
    text-shadow: 0 0 20px var(--cyan-glow);
}

/* === CASUALTY CHART === */
.casualty-chart {
    padding: 10px 24px;
    height: 170px;
}

#casualty-canvas {
    width: 100%;
    height: 100%;
}

/* === CONFLICT TYPE CHART === */
.type-chart {
    padding: 10px 24px;
    height: 145px;
}

#type-canvas {
    width: 100%;
    height: 100%;
}

/* === CLICKABLE REGION ROWS === */
.region-row {
    cursor: pointer;
    padding: 4px 6px !important;
    border-radius: 4px;
    margin: 0 -6px;
}

.region-row:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
}

.region-row:hover .region-name {
    color: var(--cyan-primary);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    :root {
        --panel-width: 320px;
    }

    .top-bar-center {
        display: none;
    }

    /* Free up space */
}

@media (max-width: 900px) {
    :root {
        --panel-width: 90vw;
    }

    #left-panel,
    #right-panel {
        top: calc(var(--top-bar-height) + 8px);
        bottom: calc(var(--bottom-bar-height) + 8px);
        height: auto;
        border-radius: var(--border-radius);
    }

    #left-panel {
        left: 5vw;
        transform: translateX(calc(-100vw - 10px));
    }

    #right-panel {
        right: 5vw;
        transform: translateX(calc(100vw + 10px));
    }

    #left-panel.mobile-open,
    #right-panel.mobile-open {
        transform: translateX(0);
    }

    .panel-toggle {
        display: flex;
    }

    .metric-box {
        padding: 8px;
        min-width: auto;
    }

    .metric-label {
        font-size: 7px;
    }

    .metric-value {
        font-size: 14px;
    }

    .modal-content {
        width: 92vw;
        max-height: 90vh;
    }

    .modal-stats-grid {
        grid-template-columns: 1fr;
    }

    .bottom-left,
    .network-stats {
        display: none;
    }
}

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

    .top-bar-right {
        gap: 12px;
    }

    .globe-controls {
        gap: 6px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
    }
}