/* -------------------------------------------------------------
   GLOBAL TACTICAL SITUATION DECK - STYLESHEET
   Theme: Hologram / Cyberpunk Tactical Command (Vanilla CSS)
   ------------------------------------------------------------- */

:root {
    --bg-base: #04060c;
    --bg-panel: rgba(8, 14, 27, 0.45);
    --bg-border: rgba(0, 242, 255, 0.15);
    
    /* Neon HSL Tokens */
    --cyan-primary: hsl(185, 100%, 50%);
    --cyan-glow: hsla(185, 100%, 50%, 0.3);
    --emerald-success: hsl(145, 100%, 50%);
    --emerald-glow: hsla(145, 100%, 50%, 0.3);
    --amber-warning: hsl(40, 100%, 50%);
    --amber-glow: hsla(40, 100%, 50%, 0.3);
    --crimson-danger: hsl(350, 100%, 50%);
    --crimson-glow: hsla(350, 100%, 50%, 0.3);
    --slate-text: #a1aab9;

    --font-display: 'Space Grotesk', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
}

/* Base Body Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body.cyber-deck {
    background-color: var(--bg-base);
    color: var(--slate-text);
    font-family: var(--font-display);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-col: true;
    flex-direction: column;
    position: relative;
    user-select: none;
}

/* CRT Screen Scanlines & Glitch overlays */
.crt-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 1000;
}

.scanlines {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
    z-index: 999;
}

/* Tactical Header */
.tactical-header {
    height: 60px;
    border-b: 1px solid var(--bg-border);
    border-bottom: 1px solid var(--bg-border);
    background: rgba(4, 7, 14, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

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

.radar-ping {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--cyan-primary);
    box-shadow: 0 0 10px var(--cyan-primary);
    animation: pulse-ping 2s infinite;
}

@keyframes pulse-ping {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(2.5); opacity: 0; }
}

.tactical-header .brand .title {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #fff;
    text-shadow: 0 0 10px var(--cyan-glow);
}

.tactical-header .brand .version {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan-primary);
    border: 1px solid var(--bg-border);
    padding: 2px 6px;
    border-radius: 4px;
}

.tactical-header .controls {
    display: flex;
    align-items: center;
    gap: 24px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.badge.ok {
    background-color: rgba(0, 255, 102, 0.1);
    color: var(--emerald-success);
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.badge.warning {
    background-color: rgba(255, 183, 0, 0.1);
    color: var(--amber-warning);
    border: 1px solid rgba(255, 183, 0, 0.3);
    animation: flash-border 1s infinite alternate;
}

@keyframes flash-border {
    0% { border-color: rgba(255, 183, 0, 0.3); }
    100% { border-color: var(--amber-warning); }
}

/* Controller Controls formatting */
.ctrl-btn {
    background: transparent;
    border: 1px solid var(--bg-border);
    color: #fff;
    padding: 6px 12px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.ctrl-btn:hover {
    background: var(--cyan-glow);
    border-color: var(--cyan-primary);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.ctrl-select {
    background: #080e1b;
    border: 1px solid var(--bg-border);
    color: var(--cyan-primary);
    padding: 6px 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
}

/* Tactical Layout Grid */
.tactical-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 350px 1fr 340px;
    height: calc(100vh - 100px); /* accounting header/footer */
    position: relative;
}

/* Glassmorphic Panels */
.glassmorphic {
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--bg-border);
    border-left: 1px solid var(--bg-border);
    display: flex;
    flex-direction: column;
    min-height: 0; /* Prevents panel from expanding beyond grid cell height */
    height: 100%; /* Force panels to lock to grid height for scrollbar enabling */
}

.left-panel {
    border-left: none;
}

.right-panel {
    border-right: none;
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--bg-border);
}

.panel-header h2 {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: var(--cyan-primary);
    text-shadow: 0 0 8px var(--cyan-glow);
}

.panel-body {
    padding: 16px; /* Reduced from 20px to give more content width */
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px; /* Reduced from 24px */
}

/* Info blocks & elements */
.info-block h3 {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: #fff;
    margin-bottom: 12px;
    letter-spacing: 1px;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 4px;
}

.details-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 242, 255, 0.05);
    border-radius: 8px;
    padding: 16px;
    min-height: 160px;
    font-size: 0.8rem;
    line-height: 1.5;
}

.placeholder-text {
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
    margin-top: 40px;
    font-style: italic;
    font-size: 0.75rem;
}

/* Trigger Button Grid */
.btn-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trigger-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: bold;
    color: #fff;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.trigger-btn:hover {
    transform: translateY(-2px);
}

.trigger-btn.warn-btn:hover {
    border-color: var(--amber-warning);
    background-color: var(--amber-glow);
    box-shadow: 0 0 12px var(--amber-glow);
}

.trigger-btn.danger-btn:hover {
    border-color: var(--crimson-danger);
    background-color: var(--crimson-glow);
    box-shadow: 0 0 12px var(--crimson-glow);
}

.trigger-btn.success-btn:hover {
    border-color: var(--emerald-success);
    background-color: var(--emerald-glow);
    box-shadow: 0 0 12px var(--emerald-glow);
}

/* Filters and Custom Checkboxes */
.filter-toggles {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-lbl {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-family: var(--font-mono);
    cursor: pointer;
}

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

.custom-chk {
    width: 14px;
    height: 14px;
    border: 1px solid var(--bg-border);
    border-radius: 3px;
    position: relative;
}

.filter-lbl input[type="checkbox"]:checked + .custom-chk.weather { background-color: var(--cyan-primary); box-shadow: 0 0 8px var(--cyan-primary); }
.filter-lbl input[type="checkbox"]:checked + .custom-chk.security { background-color: var(--crimson-danger); box-shadow: 0 0 8px var(--crimson-danger); }
.filter-lbl input[type="checkbox"]:checked + .custom-chk.economy { background-color: var(--amber-warning); box-shadow: 0 0 8px var(--amber-warning); }

/* Center Viewport Map Styles */
.globe-viewport {
    position: relative;
    overflow: hidden;
    cursor: grab;
}

.globe-viewport:active {
    cursor: grabbing;
}

#globe-container {
    width: 100%;
    height: 100%;
}

.hud-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.radar-reticle {
    width: 450px;
    height: 450px;
    border: 1px dashed rgba(0, 242, 255, 0.15);
    border-radius: 50%;
    position: absolute;
    animation: spin 60s linear infinite;
}

.radar-reticle::before {
    content: '';
    position: absolute;
    top: -5px; left: 50%;
    width: 10px; height: 10px;
    background: var(--cyan-primary);
    box-shadow: 0 0 10px var(--cyan-primary);
    border-radius: 50%;
}

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

.tactical-heading {
    position: absolute;
    bottom: 24px;
    text-align: center;
    font-family: var(--font-mono);
    color: var(--cyan-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.heading-deg {
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.coordinate-tick {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Right Sidebar: Terminal Log */
.log-container {
    padding: 0;
}

.terminal-log {
    width: 100%;
    height: 100%;
    background: #020306;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-top: none;
}

.log-entry {
    line-height: 1.4;
    word-break: break-all;
    border-left: 2px solid var(--cyan-primary);
    padding-left: 8px;
}

.log-entry.weather-event { border-color: var(--cyan-primary); color: #cbeeff; }
.log-entry.security-event { border-color: var(--crimson-danger); color: #ffd6d6; }
.log-entry.economy-event { border-color: var(--amber-warning); color: #fff1d6; }
.log-entry.bio-event { border-color: #a6ff00; color: #f2ffd6; }
.log-entry.system-event { border-color: var(--emerald-success); color: #d6ffd6; }

.log-time {
    color: rgba(255, 255, 255, 0.3);
    margin-right: 6px;
}

/* Footer / Bottom Ticker */
.tactical-footer {
    height: 40px;
    border-top: 1px solid var(--bg-border);
    background: #020407;
    display: grid;
    grid-template-columns: 1fr 280px;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
}

.ticker-wrap {
    overflow: hidden;
}

.ticker-content {
    white-space: nowrap;
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--cyan-primary);
    letter-spacing: 1px;
    animation: ticker-anim 20s linear infinite;
}

@keyframes ticker-anim {
    0% { transform: translate3d(100%, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

.connection-meta {
    display: flex;
    justify-content: flex-end;
    gap: 20px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Active Node Card styles */
.node-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.node-card-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.node-name {
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    font-family: var(--font-mono);
}

.node-stat-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
}

.stat-lbl {
    color: rgba(255, 255, 255, 0.4);
}

.stat-val {
    font-weight: bold;
    font-family: var(--font-mono);
}

.stat-val.crimson { color: var(--crimson-danger); }
.stat-val.amber { color: var(--amber-warning); }
.stat-val.emerald { color: var(--emerald-success); }
.stat-val.cyan { color: var(--cyan-primary); }

.node-news-box {
    margin-top: 6px;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    padding-top: 8px;
}

.node-news-title {
    font-size: 0.72rem;
    color: #fff;
    margin-bottom: 4px;
    font-weight: bold;
}

.node-news-desc {
    font-size: 0.7rem;
    color: var(--slate-text);
    line-height: 1.4;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .tactical-grid {
        grid-template-columns: 280px 1fr 0px; /* Hide right panel on medium screens */
    }
    .right-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .tactical-grid {
        grid-template-columns: 0px 1fr 0px; /* Viewport only on small screens */
    }
    .left-panel {
        display: none;
    }
}
