@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Space+Grotesk:wght@500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #020617;
    --primary-neon: #06b6d4;
    --primary-blue: #3b82f6;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dark: #0f172a;
    
    --border-glow: rgba(6, 182, 212, 0.2);
    --border-glow-focus: rgba(56, 189, 248, 0.65);
    
    --bg-glass: rgba(8, 14, 27, 0.55);
    --bg-glass-heavy: rgba(5, 9, 20, 0.85);
    
    --safe-green: #10b981;
    --safe-green-glow: rgba(16, 185, 129, 0.25);
    --danger-red: #ef4444;
    --danger-red-glow: rgba(239, 68, 68, 0.35);
    --warning-yellow: #f59e0b;
    --warning-yellow-glow: rgba(245, 158, 11, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Outfit', sans-serif;
}

body {
    min-height: 100vh;
    background-color: var(--bg-dark);
    background: 
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
        linear-gradient(180deg, #020617 0%, #070a13 100%);
    color: var(--text-main);
    overflow-x: hidden;
    position: relative;
}

/* ===== BACKGROUND PARTICLE & SCREEN SCANNER ===== */
#particle-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.laser-scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-neon), transparent);
    box-shadow: 0 0 15px 2px var(--primary-neon);
    animation: screenScan 8s infinite linear;
    z-index: 2;
    pointer-events: none;
}

@keyframes screenScan {
    0% { top: 0%; opacity: 0.1; }
    10% { opacity: 0.7; }
    90% { opacity: 0.7; }
    100% { top: 100%; opacity: 0.1; }
}

/* ===== CYBER HUD TELEMETRIES ===== */
.cyber-hud-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    font-family: 'Space Grotesk', sans-serif;
}

.hud-tag {
    position: absolute;
    font-size: 11px;
    font-weight: 700;
    color: rgba(6, 182, 212, 0.35);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hud-top-left { top: 90px; left: 40px; display: flex; flex-direction: column; gap: 4px; }
.hud-top-right { top: 90px; right: 40px; text-align: right; }
.hud-bottom-left { bottom: 40px; left: 40px; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-neon);
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(6, 182, 212, 0.3);
}

.status-dot {
    width: 6px;
    height: 6px;
    background-color: var(--primary-neon);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--primary-neon);
    animation: activePulse 1.6s infinite ease-in-out;
}

@keyframes activePulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

/* ===== NAVBAR STYLES HANDLED BY CENTRAL NAVBAR_RESPONSIVE.CSS ===== */

/* ===== MAIN CONSOLE ===== */
.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 5;
    position: relative;
}

.diagnostics-container {
    flex: 1;
    padding: 170px 60px 40px 60px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.diagnostics-header {
    text-align: center;
    margin-bottom: 50px;
}

.diagnostics-header h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 38px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 30%, var(--primary-neon) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 16px;
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== RESOURCES PROGRESS GAUGE GRID ===== */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.resource-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.resource-card:hover {
    transform: translateY(-4px);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 15px 35px rgba(6, 182, 212, 0.12);
}

.resource-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 25px;
}

.gauge-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 0.65s cubic-bezier(0.4, 0, 0.2, 1);
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px var(--primary-neon));
}

#ram-ring {
    filter: drop-shadow(0 0 6px var(--primary-blue));
}

#temp-ring {
    filter: drop-shadow(0 0 6px var(--danger-red));
}

.gauge-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.resource-footer {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== DUAL GRID PLATFORMS ===== */
.diagnostics-dual-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.diagnostics-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.diagnostics-card h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

.section-desc {
    font-size: 13px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 25px;
}

/* Inference metrics */
.metrics-shelf {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.metric-block {
    flex: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-number-highlight {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: var(--danger-red);
    display: block;
    letter-spacing: -0.5px;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
    margin-bottom: 4px;
}

.metric-number-highlight.text-cyan {
    color: var(--primary-neon);
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.metric-sublabel {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.hardware-spec-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.spec-row span:first-child {
    color: var(--text-muted);
}

.spec-row span:last-child {
    font-weight: 600;
}

.code-font {
    font-family: 'Space Grotesk', monospace;
    font-size: 12px;
    color: var(--text-main);
}

.text-cyan { color: var(--primary-neon); }
.text-green { color: var(--safe-green); }
.text-blue { color: var(--primary-blue); }

/* Camera node latency */
.camera-nodes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.camera-node-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.camera-node-row:hover {
    background: rgba(6, 182, 212, 0.04);
    border-color: rgba(6, 182, 212, 0.15);
}

.node-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.node-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.node-ip {
    font-size: 12px;
    color: var(--text-muted);
}

.node-ping-graph {
    display: flex;
    align-items: center;
    gap: 15px;
}

.mini-bar-graph {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 20px;
    width: 25px;
}

.mini-bar {
    width: 3px;
    background-color: var(--primary-neon);
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(6, 182, 212, 0.4);
    opacity: 0.65;
}

.camera-node-row:nth-child(2) .mini-bar {
    background-color: var(--primary-blue);
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.4);
}

.ping-latency {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-neon);
    width: 45px;
    text-align: right;
}

/* ===== SYSTEM TERMINAL LOGGER PANEL ===== */
.log-terminal-panel {
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.terminal-header {
    background: #040811;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.terminal-dots {
    display: flex;
    gap: 6px;
    margin-right: 20px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-red { background-color: #ef4444; }
.dot-yellow { background-color: #f59e0b; }
.dot-green { background-color: #10b981; }

.terminal-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
    text-transform: uppercase;
    flex: 1;
}

.status-badge-inline {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--safe-green);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.terminal-body {
    background: #03060c;
    padding: 25px;
    height: 280px;
    overflow-y: auto;
    font-family: 'Space Grotesk', monospace;
    font-size: 13px;
    line-height: 1.8;
}

/* Custom terminal scrollbars */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
    background: #03060c;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}
.terminal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(6, 182, 212, 0.35);
}

.terminal-line {
    margin-bottom: 8px;
    color: #cbd5e1;
    display: flex;
    gap: 15px;
}

.line-time {
    color: #64748b;
    user-select: none;
    min-width: 80px;
}

.line-status {
    font-weight: 700;
    min-width: 60px;
}

.line-status.status-ok { color: var(--safe-green); }
.line-status.status-warn { color: var(--warning-yellow); }
.line-status.status-err { color: var(--danger-red); }

/* ===== MENU-TOGGLE STYLES HANDLED BY NAVBAR_RESPONSIVE.CSS ===== */

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(5, 9, 20, 0.4);
    margin-top: 50px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.5px;
}

/* =========================================
   MEDIA RESPONSIVENESS OVERRIDES
   ========================================= */

@media (max-width: 1200px) {
    .cyber-hud-layer {
        display: none;
    }
    
    .diagnostics-container {
        padding: 120px 40px 40px 40px;
    }
}

@media (max-width: 992px) {
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .diagnostics-dual-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .diagnostics-container {
        padding: 95px 20px 30px 20px;
    }

    .diagnostics-header h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    .gauge-wrapper {
        width: 130px;
        height: 130px;
    }
    
    .progress-ring {
        width: 130px;
        height: 130px;
    }
    
    .progress-ring circle {
        r: 55;
        cx: 65;
        cy: 65;
    }
    
    .gauge-value {
        font-size: 22px;
    }
}
