/**
 * -----------------------------------------------------------------------------
 * 1. THE DESIGN SYSTEM (CYBERPUNK / INDUSTRIAL TERMINAL)
 * -----------------------------------------------------------------------------
 */
:root {
    --neon-cyan: #00f2ff;
    --neon-magenta: #ff00ff;
    --neon-dim: #00454d;
    --bg-dark: #020508;
    --terminal-bg: #050a0f;
    --accent-gold: #ffd700;
    --warning-red: #ff3c3c;
    --success-green: #39ff14;
    --font-main: 'Consolas', 'Courier New', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body { 
    font-family: var(--font-main); 
    background: var(--bg-dark); 
    color: var(--neon-cyan); 
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- CRT SCANLINE EFFECT --- */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 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.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    z-index: 1000;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: 0.5;
}

/* --- MAIN UI CONTAINER --- */
.interface-frame { 
    background: var(--terminal-bg); 
    padding: 45px; 
    border: 1px solid var(--neon-dim); 
    width: 95vw;
    max-width: 1000px;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.05);
    border-radius: 2px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--neon-dim);
    padding-bottom: 15px;
    margin-bottom: 30px;
}

.header h1 { 
    font-size: 24px; 
    letter-spacing: 6px; 
    font-weight: 900; 
    text-shadow: 0 0 10px var(--neon-cyan);
}

.sys-status { font-size: 10px; color: var(--accent-gold); text-transform: uppercase; letter-spacing: 2px; }

/* --- TELEMETRY READOUT --- */
.grid-layout {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 35px;
}

#rawValueDisplay { 
    font-size: 130px; 
    line-height: 1;
    margin: 15px 0; 
    color: var(--neon-cyan); 
    text-shadow: 0 0 30px var(--neon-cyan);
    font-weight: 900;
    letter-spacing: -8px;
    font-variant-numeric: tabular-nums;
}

/* --- PROGRESS SYSTEM --- */
.progress-container { margin: 25px 0; }
.meta-labels { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 8px; text-transform: uppercase; }

.progress-bar-bg { 
    width: 100%; 
    background: #000; 
    height: 45px; 
    border: 1px solid var(--neon-dim); 
    position: relative; 
    overflow: hidden;
}

#progress-bar-fill { 
    width: 0%; 
    height: 100%; 
    background: linear-gradient(90deg, #00454d, var(--neon-cyan)); 
    box-shadow: 0 0 20px var(--neon-cyan); 
    transition: width 0.1s linear;
}

.stat-box {
    background: rgba(0, 69, 77, 0.05);
    border: 1px solid #0f1c24;
    padding: 20px;
    margin-bottom: 15px;
    border-left: 3px solid var(--neon-dim);
}

.stat-label { font-size: 9px; color: var(--neon-dim); display: block; margin-bottom: 6px; letter-spacing: 1px; }
.stat-value { font-size: 28px; color: var(--accent-gold); font-weight: bold; }

/* --- CONTROLS --- */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

button { 
    background: transparent;
    padding: 22px;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-main);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    transition: 0.3s;
    position: relative;
}

button:hover:not(:disabled) {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 30px var(--neon-cyan);
    color: white;
}

button:disabled { border-color: #1a2a2d; color: #1a2a2d; cursor: not-allowed; }

button.abort-btn { border-color: var(--warning-red); color: var(--warning-red); }
button.abort-btn:hover:not(:disabled) {
    background: rgba(255, 60, 60, 0.1);
    box-shadow: 0 0 30px var(--warning-red);
}

/* --- TERMINAL LOG --- */
#terminal {
    margin-top: 35px;
    height: 160px;
    background: #010408;
    border: 1px solid #0a1114;
    padding: 15px;
    font-size: 11px;
    overflow-y: auto;
    color: #4a6a6d;
    display: flex;
    flex-direction: column-reverse;
    border-left: 3px solid #111;
}

.log-line { margin-bottom: 5px; border-bottom: 1px solid #0a1114; padding-bottom: 2px; }
.log-error { color: var(--warning-red); }
.log-success { color: var(--success-green); }
.log-warn { color: var(--accent-gold); }

/* --- DECORATIVE GLITCH --- */
@keyframes glitch {
    0% { transform: translate(0) }
    20% { transform: translate(-2px, 2px) }
    40% { transform: translate(-2px, -2px) }
    60% { transform: translate(2px, 2px) }
    80% { transform: translate(2px, -2px) }
    100% { transform: translate(0) }
}
.glitch-active { animation: glitch 0.2s infinite; }