/* Copyright (c) 2026 Juan Manuel De La Garza. All rights reserved. */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

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

body {
    background: #020818;
    color: #c0d8ff;
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image:
        radial-gradient(1px 1px at 20% 30%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 40% 70%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 60% 20%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 80% 50%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 10% 60%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 90% 80%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 50% 90%, #fff 0%, transparent 100%),
        radial-gradient(1px 1px at 70% 40%, #fff 0%, transparent 100%);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(2, 8, 24, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal {
    background: #0a1628;
    border: 1px solid #4488ff44;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: visible;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px #4488ff22;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #1a3a6a44;
    background: #030d2e;
}

.modal-title {
    font-family: 'Orbitron', monospace;
    font-size: 13px;
    color: #4488ff;
    letter-spacing: 2px;
}

.modal-close {
    background: none;
    border: 1px solid #1a3a6a;
    color: #4466aa;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover { border-color: #ff4444; color: #ff4444; }

.modal-body {
    padding: 20px;
    
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #1a3a6a #030d2e;
}

.modal-section {
    margin-bottom: 16px;
}

.modal-section-title {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    color: #4466aa;
    letter-spacing: 1px;
    margin-bottom: 8px;
    text-transform: uppercase;
    border-bottom: 1px solid #1a3a6a22;
    padding-bottom: 4px;
}

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

.modal-field {
    background: #020818;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 2px solid #4488ff44;
}

.modal-field-label {
    font-size: 9px;
    color: #4466aa;
    letter-spacing: 1px;
    margin-bottom: 3px;
}

.modal-field-value {
    font-size: 12px;
    color: #c0d8ff;
    word-break: break-all;
}

.modal-field-value.highlight { color: #ff4444; font-weight: bold; }
.modal-field-value.green { color: #44ffaa; }
.modal-field-value.purple { color: #aa44ff; }
.modal-field-value.blue { color: #4488ff; }

.json-block {
    background: #020818;
    border: 1px solid #1a3a6a33;
    border-radius: 4px;
    padding: 12px;
    font-size: 11px;
    color: #44ffaa;
    overflow-x: auto;
    white-space: pre-wrap; word-break: break-word; overflow-x: hidden;
    line-height: 1.6;
    max-height: 150px;
    
}

.modal-matches-title {
    font-family: 'Orbitron', monospace;
    font-size: 10px;
    color: #4466aa;
    letter-spacing: 1px;
    margin: 16px 0 8px;
    border-bottom: 1px solid #1a3a6a22;
    padding-bottom: 4px;
}

.match-item {
    background: #020818;
    border-left: 2px solid #4488ff33;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 0 4px 4px 0;
    font-size: 10px;
    color: #4466aa;
    cursor: pointer;
    transition: border-color 0.2s;
}

.match-item:hover { border-left-color: #4488ff; }

.severity-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 1px;
}

.severity-1 { background: #ff444422; color: #ff4444; border: 1px solid #ff444433; }
.severity-2 { background: #ffaa4422; color: #ffaa44; border: 1px solid #ffaa4433; }
.severity-3 { background: #4488ff22; color: #4488ff; border: 1px solid #4488ff33; }

/* ── Header ─────────────────────────────────────────────────────────────────── */
.header {
    background: linear-gradient(135deg, #030d2e 0%, #0a1628 50%, #030d2e 100%);
    border-bottom: 2px solid #1a4aff44;
    padding: 12px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.header::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #4466ff, #aa44ff, #4466ff, transparent);
    animation: scanline 3s linear infinite;
}

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

.logo-section { display: flex; align-items: center; gap: 15px; }

.cerberus-logo {
    width: 60px; height: 60px;
    filter: drop-shadow(0 0 10px #4466ff);
}

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

.logo-title {
    font-family: 'Orbitron', monospace;
    font-size: 22px; font-weight: 900;
    color: #4488ff;
    text-shadow: 0 0 20px #4488ff88;
    letter-spacing: 4px;
}

.logo-subtitle { font-size: 10px; color: #4466aa; letter-spacing: 2px; }

.header-right { display: flex; align-items: center; gap: 20px; }

.ussf-badge {
    background: linear-gradient(135deg, #0a1628, #1a2a4a);
    border: 1px solid #4466ff44;
    padding: 6px 12px; border-radius: 4px;
    font-size: 10px; color: #4488ff; letter-spacing: 1px;
}

.live-indicator { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #44ffaa; }

.live-dot {
    width: 8px; height: 8px;
    background: #44ffaa; border-radius: 50%;
    animation: pulse 1.5s infinite;
    box-shadow: 0 0 8px #44ffaa;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.4; transform: scale(1.4); }
}

/* ── Stats Bar ──────────────────────────────────────────────────────────────── */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    background: #0a1628;
    border-bottom: 1px solid #1a3a6a22;
    position: relative; z-index: 10;
}

.stat-item {
    background: #030d2e;
    padding: 12px 15px; text-align: center;
    border-right: 1px solid #1a3a6a22;
    position: relative; overflow: visible;
}

.stat-item::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, #4466ff, transparent);
    opacity: 0.5;
}

.stat-value {
    font-family: 'Orbitron', monospace;
    font-size: 24px; font-weight: 700;
    color: #4488ff;
    text-shadow: 0 0 10px #4488ff66;
}

.stat-value.green  { color: #44ffaa; text-shadow: 0 0 10px #44ffaa66; }
.stat-value.purple { color: #aa44ff; text-shadow: 0 0 10px #aa44ff66; }
.stat-value.orange { color: #ffaa44; text-shadow: 0 0 10px #ffaa4466; }
.stat-label { font-size: 9px; color: #4466aa; letter-spacing: 1px; margin-top: 3px; }

/* ── Three Heads ────────────────────────────────────────────────────────────── */
.three-heads {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 1px; background: #0a1628;
    border-bottom: 1px solid #1a3a6a22;
    position: relative; z-index: 10;
}

.head-panel {
    background: #030d2e;
    padding: 15px 20px;
    border-right: 1px solid #1a3a6a22;
    position: relative;
}

.head-title {
    font-family: 'Orbitron', monospace;
    font-size: 11px; letter-spacing: 2px;
    margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px;
}

.head-title.scad   { color: #4488ff; }
.head-title.stin   { color: #aa44ff; }
.head-title.opssat { color: #44ffaa; }

.head-icon {
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}

.head-icon.scad   { background: #4488ff22; border: 1px solid #4488ff44; }
.head-icon.stin   { background: #aa44ff22; border: 1px solid #aa44ff44; }
.head-icon.opssat { background: #44ffaa22; border: 1px solid #44ffaa44; }

.head-stats { display: flex; gap: 20px; font-size: 11px; }

.head-stat-val { font-family: 'Orbitron', monospace; font-size: 18px; font-weight: 700; }
.head-stat-val.scad   { color: #4488ff; }
.head-stat-val.stin   { color: #aa44ff; }
.head-stat-val.opssat { color: #44ffaa; }
.head-stat-label { font-size: 9px; color: #4466aa; letter-spacing: 1px; }
.head-label { margin-top: 6px; font-size: 10px; color: #4466aa; }

/* ── Main Grid ──────────────────────────────────────────────────────────────── */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: 400px auto;
    gap: 1px; background: #0a1628;
    min-height: calc(100vh - 230px);
    position: relative; z-index: 10;
}

.panel { background: #030d2e; padding: 15px; overflow: hidden; }

.panel-title {
    font-family: 'Orbitron', monospace;
    font-size: 10px; color: #4488ff;
    letter-spacing: 2px; margin-bottom: 12px;
    text-transform: uppercase;
    border-bottom: 1px solid #1a3a6a33;
    padding-bottom: 6px;
    display: flex; align-items: center; gap: 8px;
}

#map {
    width: 100%; height: calc(100% - 35px);
    border-radius: 4px;
    filter: brightness(0.7) saturate(0.5) hue-rotate(200deg);
}

PLACEHOLDER_START
    grid-column: 2; grid-row: 1 / 3;

}

.chart-container { background: #030d2e; padding: 15px; height: 190px; flex-shrink: 0; overflow: hidden; }

.pqc-panel {
    background: linear-gradient(135deg, #030d2e, #0a1a2e);
    padding: 15px;
    border-top: 1px solid #aa44ff22;
}

.pqc-stat {
    display: flex; justify-content: space-between;
    padding: 4px 0; font-size: 11px;
    border-bottom: 1px solid #1a3a6a11;
}

.pqc-val { font-family: 'Orbitron', monospace; color: #aa44ff; font-size: 13px; }

.bottom-left {
    grid-column: 1; grid-row: 2;
    display: grid; grid-template-columns: 1fr 1fr 1fr;
    gap: 1px; background: #0a1628;
}

/* ── Threat Feed ────────────────────────────────────────────────────────────── */
.threat-feed {
    height: calc(100% - 35px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #1a3a6a #030d2e;
}

.threat-item {
    background: #0a1628;
    border-left: 3px solid #4488ff;
    padding: 8px 10px; margin-bottom: 4px;
    border-radius: 0 4px 4px 0;
    animation: fadeIn 0.3s ease;
    cursor: pointer;
    transition: background 0.2s, border-left-color 0.2s;
}

.threat-item:hover { background: #1a2a4a; }

.threat-item.scad    { border-left-color: #4488ff; }
.threat-item.stin    { border-left-color: #aa44ff; }
.threat-item.opssat  { border-left-color: #44ffaa; }
.threat-item.suricata{ border-left-color: #ffaa44; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-5px); }
    to   { opacity: 1; transform: translateX(0); }
}

.threat-label  { font-size: 11px; font-weight: bold; color: #c0d8ff; }
.threat-stream { font-size: 9px; float: right; }
.threat-stream.scad   { color: #4488ff; }
.threat-stream.stin   { color: #aa44ff; }
.threat-stream.opssat { color: #44ffaa; }
.threat-conf  { font-size: 10px; color: #44ffaa; }
.threat-time  { font-size: 9px;  color: #4466aa; margin-top: 2px; }
.threat-expl  { font-size: 9px;  color: #4466aa; margin-top: 3px; line-height: 1.4; }

/* ── Rules ──────────────────────────────────────────────────────────────────── */
.rule-item {
    background: #0a1628;
    border-left: 3px solid #aa44ff;
    padding: 7px 10px; margin-bottom: 3px;
    border-radius: 0 4px 4px 0;
    font-size: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.rule-item:hover { background: #1a2a4a; }
.rule-msg  { color: #c0d8ff; font-weight: bold; }
.rule-meta { color: #4466aa; margin-top: 2px; font-size: 9px; }

/* ── Services ───────────────────────────────────────────────────────────────── */
.services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.svc-item {
    background: #0a1628; padding: 8px 10px;
    border-radius: 4px; font-size: 10px;
    display: flex; align-items: center; gap: 6px;
}

.svc-dot { width: 7px; height: 7px; border-radius: 50%; }
.svc-dot.on  { background: #44ffaa; box-shadow: 0 0 6px #44ffaa; }
.svc-dot.off { background: #ff4444; box-shadow: 0 0 6px #ff4444; }

/* ── Scrollbars ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: #030d2e; }
::-webkit-scrollbar-thumb { background: #1a3a6a; border-radius: 2px; }

/* ── Mobile Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-bar {
        grid-template-columns: repeat(3, 1fr);
    }

    .three-heads {
        grid-template-columns: 1fr;
    }

    .main-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 300px auto auto;
        height: auto;
    }

    .right-col {
        grid-column: 1;
        grid-row: 2;
        height: auto;
        max-height: none;
        overflow-y: visible;
    }

    .chart-container {
        height: 200px;
        flex-shrink: 0;
    }

    .bottom-left {
        grid-column: 1;
        grid-row: 3;
        grid-template-columns: 1fr;
    }

    .logo-title { font-size: 16px; }
    .logo-subtitle { font-size: 8px; }
    .cerberus-logo { width: 40px; height: 40px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 8px; }
    .header { padding: 8px 15px; }
    .head-panel { padding: 10px; }

    .modal {
        width: 95%;
        max-height: 90vh;
    }

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

@media (max-width: 480px) {
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }

    .header-right .ussf-badge { display: none; }
    #clock { font-size: 9px; }
}



#threat-feed { max-height: 380px; overflow-y: auto; }

#rules-list { overflow-y: auto; max-height: 220px; }
#threat-feed { max-height: 220px; overflow-y: auto; }

#rules-list { max-height: 220px; overflow-y: auto; }



.bottom-left .panel:nth-child(1) { height: auto; }

.bottom-left .panel:nth-child(3) { height: auto; }

#network-alerts { max-height: 320px; overflow-y: auto; }

.bottom-left .panel:nth-child(2) { overflow: visible; }
