/* ============================================
   monopole.systems - Cyberpunk NOC Dashboard
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
    background: #080818;
    color: #A0B0A0;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(12px, 0.8vw, 14px);
    line-height: 1.65;
}

/* --- Circuit Board Background --- */
#circuit-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Data Streams --- */
#data-streams {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.data-stream {
    stroke: #00E0FF;
    stroke-width: 1;
    stroke-dasharray: 4 8;
    opacity: 0.15;
    animation: dataFlow 2s linear infinite;
}

.data-stream.stream-v {
    animation: dataFlowV 2.5s linear infinite;
}

@keyframes dataFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -24; }
}

@keyframes dataFlowV {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -24; }
}

/* --- Header / Logotype --- */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(8, 8, 24, 0.92);
    border-bottom: 1px solid rgba(0, 255, 128, 0.15);
    backdrop-filter: blur(4px);
}

#logotype {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 32px);
    color: #00FF80;
    letter-spacing: 0.05em;
    text-transform: lowercase;
}

#logo-text {
    display: inline;
}

#cursor {
    display: inline-block;
    color: #00FF80;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    color: #00FF80;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.header-status-text {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.header-status-text.visible {
    opacity: 1;
}

/* --- Status Indicators --- */
.status-indicator {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-green {
    background: #00FF80;
    box-shadow: 0 0 6px #00FF80, 0 0 12px rgba(0, 255, 128, 0.4);
}

.status-amber {
    background: #FFB020;
    box-shadow: 0 0 6px #FFB020, 0 0 12px rgba(255, 176, 32, 0.4);
}

.status-red {
    background: #FF3040;
    box-shadow: 0 0 6px #FF3040, 0 0 12px rgba(255, 48, 64, 0.4);
}

.status-cyan {
    background: #00E0FF;
    box-shadow: 0 0 6px #00E0FF, 0 0 12px rgba(0, 224, 255, 0.4);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* --- Dashboard Grid --- */
#dashboard {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(150px, auto);
    gap: 4px;
    padding: 60px 8px 50px 8px;
    max-width: 1600px;
    margin: 0 auto;
}

/* --- Panel Base --- */
.panel {
    background: #101028;
    border: 1px solid rgba(0, 255, 128, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 255, 128, 0.05);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
    overflow: hidden;
}

.panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.panel-featured {
    grid-column: span 2;
}

.panel-wide {
    grid-column: span 2;
}

.panel-tall {
    grid-row: span 2;
}

/* --- Panel Header --- */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0, 255, 128, 0.12);
    background: rgba(0, 255, 128, 0.03);
}

.panel-title {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 11px;
    color: #00FF80;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* --- Panel Body --- */
.panel-body {
    padding: 12px;
}

/* --- Metric Rows (System Health) --- */
.metric-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.metric-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
    min-width: 70px;
    letter-spacing: 0.05em;
}

.metric-bar {
    flex: 1;
    height: 4px;
    background: rgba(0, 255, 128, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    width: 0;
    background: #00FF80;
    border-radius: 2px;
    transition: width 1.5s ease-out;
    box-shadow: 0 0 4px rgba(0, 255, 128, 0.4);
}

.metric-value {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #00FF80;
    min-width: 50px;
    text-align: right;
}

/* --- Process List --- */
.process-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 255, 128, 0.05);
}

.process-pid {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #00E0FF;
    min-width: 65px;
}

.process-name {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #A0B0A0;
    flex: 1;
}

.process-cpu {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #FFB020;
    min-width: 50px;
    text-align: right;
}

/* --- Network Stats --- */
.network-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 255, 128, 0.05);
}

.net-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
    letter-spacing: 0.05em;
}

.net-value {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #00E0FF;
    font-weight: 700;
}

/* --- Alert Log --- */
.alert-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(0, 255, 128, 0.05);
}

.alert-time {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: rgba(160, 176, 160, 0.6);
    min-width: 65px;
}

.alert-msg {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    flex: 1;
}

.alert-green .alert-msg { color: #00FF80; }
.alert-amber .alert-msg { color: #FFB020; }
.alert-red .alert-msg { color: #FF3040; }

/* --- Terminal Body --- */
.terminal-body {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    padding: 10px 12px;
}

.terminal-line {
    padding: 2px 0;
    color: #A0B0A0;
    white-space: nowrap;
    overflow: hidden;
}

.terminal-prompt {
    color: #00FF80;
}

/* --- Topology Map --- */
.topology-body {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 40px);
    padding: 8px;
}

#topology-svg {
    width: 100%;
    height: 100%;
}

.topo-node {
    fill: #00E0FF;
    opacity: 0.8;
    animation: nodePulse 3s ease-in-out infinite;
}

.topo-node-core {
    fill: #00FF80;
    animation: nodePulse 2s ease-in-out infinite;
}

.topo-link {
    stroke: rgba(0, 224, 255, 0.25);
    stroke-width: 1;
    stroke-dasharray: 3 5;
    animation: linkFlow 3s linear infinite;
}

@keyframes nodePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.4; }
}

@keyframes linkFlow {
    from { stroke-dashoffset: 0; }
    to { stroke-dashoffset: -16; }
}

.topo-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    fill: #A0B0A0;
    text-anchor: middle;
    letter-spacing: 0.1em;
}

/* --- Field Metrics --- */
.field-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 255, 128, 0.05);
}

.fm-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
    letter-spacing: 0.05em;
}

.fm-value {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #00FF80;
    font-weight: 700;
}

/* --- Uptime Monitor --- */
.uptime-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#uptime-svg {
    width: 100%;
    height: 80px;
}

.uptime-graph-line {
    stroke: #00FF80;
    stroke-width: 1.5;
    filter: drop-shadow(0 0 3px rgba(0, 255, 128, 0.5));
}

.uptime-baseline {
    stroke: rgba(0, 255, 128, 0.1);
    stroke-width: 1;
}

.uptime-label {
    font-family: 'Fira Code', monospace;
    font-size: 8px;
    fill: rgba(160, 176, 160, 0.5);
}

.uptime-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.uptime-stat-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
}

.uptime-stat-value {
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #00FF80;
    font-weight: 700;
}

/* --- Encryption --- */
.encrypt-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 255, 128, 0.05);
}

.encrypt-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
    letter-spacing: 0.05em;
}

.encrypt-value {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #00E0FF;
}

/* --- Power Grid --- */
.power-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.power-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    color: #A0B0A0;
    min-width: 65px;
    letter-spacing: 0.05em;
}

.power-bar {
    flex: 1;
    height: 6px;
    background: rgba(0, 255, 128, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.power-fill {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: width 1.5s ease-out;
}

.power-fill-green {
    background: #00FF80;
    box-shadow: 0 0 4px rgba(0, 255, 128, 0.4);
}

.power-fill-amber {
    background: #FFB020;
    box-shadow: 0 0 4px rgba(255, 176, 32, 0.4);
}

.power-value {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    color: #00FF80;
    min-width: 40px;
    text-align: right;
}

/* --- Footer Status Bar --- */
#footer-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 20px;
    background: rgba(8, 8, 24, 0.92);
    border-top: 1px solid rgba(0, 255, 128, 0.15);
    backdrop-filter: blur(4px);
}

.footer-section {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #A0B0A0;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

#footer-clock {
    color: #00E0FF;
    font-weight: 700;
}

/* --- Neon Border Variations --- */
#panel-network {
    border-color: rgba(0, 224, 255, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 224, 255, 0.05);
}

#panel-network .panel-header {
    border-bottom-color: rgba(0, 224, 255, 0.12);
    background: rgba(0, 224, 255, 0.03);
}

#panel-network .panel-title {
    color: #00E0FF;
}

#panel-alerts {
    border-color: rgba(255, 176, 32, 0.3);
    box-shadow: inset 0 0 8px rgba(255, 176, 32, 0.05);
}

#panel-alerts .panel-header {
    border-bottom-color: rgba(255, 176, 32, 0.12);
    background: rgba(255, 176, 32, 0.03);
}

#panel-alerts .panel-title {
    color: #FFB020;
}

#panel-terminal {
    border-color: rgba(0, 224, 255, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 224, 255, 0.05);
}

#panel-terminal .panel-header {
    border-bottom-color: rgba(0, 224, 255, 0.12);
    background: rgba(0, 224, 255, 0.03);
}

#panel-terminal .panel-title {
    color: #00E0FF;
}

#panel-topology {
    border-color: rgba(0, 224, 255, 0.3);
    box-shadow: inset 0 0 8px rgba(0, 224, 255, 0.05);
}

#panel-topology .panel-header {
    border-bottom-color: rgba(0, 224, 255, 0.12);
    background: rgba(0, 224, 255, 0.03);
}

#panel-topology .panel-title {
    color: #00E0FF;
}

#panel-power {
    border-color: rgba(255, 176, 32, 0.3);
    box-shadow: inset 0 0 8px rgba(255, 176, 32, 0.05);
}

#panel-power .panel-header {
    border-bottom-color: rgba(255, 176, 32, 0.12);
    background: rgba(255, 176, 32, 0.03);
}

#panel-power .panel-title {
    color: #FFB020;
}

#panel-syslog {
    border-color: rgba(0, 255, 128, 0.2);
}

#panel-syslog .panel-header {
    background: rgba(0, 255, 128, 0.03);
}

/* --- Scrollbar Styling --- */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #080818;
}

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

/* --- Responsive --- */
@media (max-width: 1024px) {
    #dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    #dashboard {
        grid-template-columns: 1fr;
        padding: 56px 4px 46px 4px;
    }

    .panel-featured,
    .panel-wide {
        grid-column: span 1;
    }

    .panel-tall {
        grid-row: span 1;
    }

    #header {
        padding: 10px 12px;
    }

    #logotype {
        font-size: 16px;
    }

    #header-status {
        font-size: 9px;
    }
}
