:root {
    --bg-dark: #020202;
    --tactical-red: #ff2a2a;
    --tactical-red-dim: rgba(255, 42, 42, 0.4);
    --grid-line: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.15);
    --text-primary: #e0e0e0;
    --text-dim: #7a7a7a;
    --mono-font: 'Space Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: url('hero_bg.png');
    background-size: cover;
    background-position: center;
    color: var(--text-primary);
    font-family: var(--mono-font);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Overlays */
.overlay-scanline {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px; z-index: 9999; pointer-events: none;
}
.overlay-grid {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
                linear-gradient(var(--grid-line) 1px, transparent 1px);
    background-size: 50px 50px; z-index: -1; pointer-events: none;
}

/* Grid Layout */
.system-container {
    display: grid;
    grid-template-columns: 1.2fr 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    width: 95vw;
    height: 90vh;
    padding: 20px;
}

/* Panels */
.panel {
    border: 1px solid var(--border-color);
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(4px);
    position: relative;
    display: flex;
    flex-direction: column;
}
.panel::before, .panel::after {
    content: ''; position: absolute; width: 10px; height: 10px;
    border: 2px solid var(--tactical-red); pointer-events: none; opacity: 0.5; z-index: 10;
}
.panel::before { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.panel::after { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.panel-header {
    font-size: 0.65rem; color: var(--text-dim); letter-spacing: 2px;
    padding: 8px; border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.02); z-index: 10;
}
.panel-content {
    flex: 1; padding: 10px; overflow: hidden; position: relative;
    display: flex; flex-direction: column;
}

/* Center column - Globe */
.col-center {
    grid-row: 1 / 3;
    grid-column: 2 / 3;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.85);
    position: relative;
    overflow: hidden;
}

#globe-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.core-data {
    position: absolute;
    display: flex; flex-direction: column; align-items: center;
    font-size: 0.75rem; letter-spacing: 2px;
    text-shadow: 0 0 5px var(--tactical-red);
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; z-index: 5;
    color: var(--tactical-red);
}
.core-hex {
    margin-top: 5px; font-size: 0.6rem; color: var(--text-dim); text-shadow: none;
}

/* Map */
.map-wrapper { padding: 0 !important; }
#tactical-map { width: 100%; height: 100%; background: #000; }
.leaflet-container { font-family: var(--mono-font) !important; background: #000 !important; }
.leaflet-control-zoom, .leaflet-control-attribution { display: none; }
#tactical-map::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.4); pointer-events: none; z-index: 400;
}
#map-overlay-text {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    color: var(--tactical-red); font-size: 0.8rem; z-index: 500;
    text-shadow: 0 0 5px var(--tactical-red); pointer-events: none;
    animation: blink 1s infinite; text-align: center;
}

/* Tactical Tooltip */
.tactical-tooltip {
    background: rgba(0,0,0,0.85) !important;
    border: 1px solid var(--tactical-red) !important;
    color: #fff !important;
    font-family: var(--mono-font) !important;
    font-size: 0.6rem !important;
    padding: 6px 8px !important;
    box-shadow: 0 0 10px rgba(255,42,42,0.3) !important;
    border-radius: 0 !important;
}
.leaflet-tooltip-left.tactical-tooltip::before { border-left-color: var(--tactical-red) !important; }
.leaflet-tooltip-right.tactical-tooltip::before { border-right-color: var(--tactical-red) !important; }

/* Tactical Marker */
.tactical-marker {
    background: var(--tactical-red); border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 15px var(--tactical-red);
    animation: pulse 1s infinite;
}

/* AI Panel */
.ai-status {
    font-size: 0.6rem; color: #0f0; margin-bottom: 10px;
    border-bottom: 1px solid #0f0; padding-bottom: 5px;
}
.ai-logs { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; }
.ai-entry { font-size: 0.55rem; margin-bottom: 4px; padding-left: 5px; border-left: 2px solid var(--text-dim); }
.ai-benign { color: var(--text-primary); border-color: var(--text-dim); }
.ai-threat { color: var(--tactical-red); border-color: var(--tactical-red); text-shadow: 0 0 5px var(--tactical-red); }

/* Console Logs */
.console-log {
    font-size: 0.65rem; color: var(--text-dim); line-height: 1.6;
    display: flex; flex-direction: column; justify-content: flex-start; letter-spacing: 1px;
}
.log-line { margin-bottom: 4px; word-wrap: break-word; }
.log-val { color: #fff; }

/* Exit button */
.exit-btn {
    position: fixed; bottom: 20px; right: 20px;
    color: var(--tactical-red); text-decoration: none; font-size: 0.6rem;
    border: 1px solid var(--tactical-red); padding: 5px 10px;
    z-index: 10000; transition: all 0.3s;
}
.exit-btn:hover { background: var(--tactical-red); color: #fff; }

/* Animations */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes pulse {
    0% { transform: scale(1); opacity: 1; box-shadow: 0 0 5px var(--tactical-red); }
    50% { transform: scale(1.5); opacity: 0.5; box-shadow: 0 0 20px var(--tactical-red); }
    100% { transform: scale(1); opacity: 1; box-shadow: 0 0 5px var(--tactical-red); }
}
