:root {
    --bg-color: #050505;
    --matrix-green: #0f0;
    --matrix-green-dim: #00aa00;
    --matrix-green-glow: rgba(0, 255, 0, 0.4);
    --warning-red: #ff003c;
    --warning-red-dim: #aa0000;
    --warning-red-glow: rgba(255, 0, 60, 0.6);
    --white: #e0e0e0;
    --panel-bg: rgba(10, 15, 10, 0.85);
    --border-color: #1a331a;
    --font-main: 'Share Tech Mono', monospace;
}

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

body {
    background-color: var(--bg-color);
    color: var(--matrix-green);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    position: relative;
    user-select: none;
}

/* CRT and Scanlines Effects */
.crt {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, rgba(255,255,255,0) 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 100;
    animation: flicker 0.15s infinite;
}

.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.2) 50%,
        rgba(0,0,0,0.2)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 99;
}

@keyframes flicker {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.98; }
}

/* Layout */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    gap: 20px;
    padding: 20px;
    height: 100vh;
    z-index: 10;
    position: relative;
}

/* Panels */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.1) inset;
    position: relative;
}

.panel h2 {
    font-size: 14px;
    border-bottom: 1px solid var(--matrix-green-dim);
    padding-bottom: 5px;
    margin-bottom: 10px;
    color: var(--white);
    letter-spacing: 2px;
}

.stat {
    margin-bottom: 12px;
    font-size: 12px;
}

.stat span {
    display: block;
    margin-bottom: 4px;
}

.stat .value {
    display: inline;
    float: right;
    margin-top: -16px;
    color: var(--white);
}

.bar-bg {
    width: 100%;
    height: 8px;
    background: #111;
    border: 1px solid #333;
}

.bar-fill {
    height: 100%;
    background: var(--matrix-green);
    width: 0%;
    box-shadow: 0 0 5px var(--matrix-green-glow);
    transition: width 0.5s ease-out;
}

.center-panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--matrix-green-dim);
    background: rgba(0, 5, 0, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.1);
    overflow: hidden;
}

.terminal-header {
    background: #1a1a1a;
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--matrix-green-dim);
}

.terminal-header .title {
    color: var(--white);
    font-size: 12px;
}

.terminal-header .controls .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 5px;
    background: #444;
}

.terminal-window {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    font-size: 16px;
    line-height: 1.5;
}

.terminal-window p {
    margin-bottom: 5px;
    text-shadow: 0 0 3px var(--matrix-green-glow);
}

.terminal-window .log-error {
    color: var(--warning-red);
    text-shadow: 0 0 5px var(--warning-red-glow);
}

.terminal-window .log-sys {
    color: var(--white);
}

.input-line {
    display: flex;
    margin-top: 10px;
}

.cursor {
    animation: blink 1s step-end infinite;
    background: var(--matrix-green);
    color: black;
    width: 10px;
}

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

/* Mini Terminal */
.terminal-mini {
    font-size: 11px;
    height: 100px;
    overflow: hidden;
    color: var(--matrix-green-dim);
}

/* AI Diagnostics */
.ai-diagnostics {
    height: 200px;
}

.core-status {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.pulsing-circle {
    width: 15px;
    height: 15px;
    background: var(--matrix-green);
    border-radius: 50%;
    margin-right: 10px;
    box-shadow: 0 0 10px var(--matrix-green-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.matrix-rain-container {
    width: 100%;
    height: 120px;
    background: black;
    overflow: hidden;
    border: 1px solid #222;
}

/* Warnings */
.warning-box {
    border-color: var(--warning-red);
    box-shadow: 0 0 15px var(--warning-red-glow) inset;
    background: rgba(30, 0, 0, 0.9);
}

.warning-box h2 {
    color: var(--warning-red);
    border-bottom-color: var(--warning-red-dim);
}

.warning-box p {
    color: var(--white);
    font-size: 12px;
}

.hidden {
    display: none !important;
}

/* Final Warning Overlay */
#final-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.album-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    z-index: 1001;
}

#countdown-text {
    font-size: 2vw;
    color: var(--matrix-green);
    text-shadow: 0 0 10px var(--matrix-green-glow);
    animation: pulseText 1s infinite;
}

#countdown-number {
    font-size: 3.5vw;
    color: var(--warning-red);
    font-weight: bold;
    text-shadow: 0 0 15px var(--warning-red-glow);
}

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

.album-art {
    position: relative;
    width: 250px;
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
}

.vinyl {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, #111 30%, #000 70%);
    border-radius: 50%;
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.vinyl::after {
    content: '';
    width: 80px;
    height: 80px;
    background: var(--warning-red);
    border-radius: 50%;
    border: 5px solid #222;
}

.vinyl::before {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: #000;
    border-radius: 50%;
    z-index: 2;
}

.cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.9), rgba(5, 5, 5, 0.9));
    border: 2px solid var(--matrix-green);
    box-shadow: 0 0 20px var(--matrix-green-glow);
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cover h3 {
    color: var(--white);
    font-size: 24px;
    margin-bottom: 10px;
    text-shadow: 0 0 5px var(--white);
}

.cover p {
    color: var(--warning-red);
    font-size: 14px;
    letter-spacing: 2px;
}

.album-art:hover .vinyl {
    transform: translateX(100px) rotate(180deg);
}

.album-art:hover .cover {
    transform: translateX(-50px) rotateY(-15deg);
}

@keyframes spinVinyl {
    100% { transform: translateX(100px) rotate(360deg); }
}

.album-art.spinning .vinyl {
    animation: spinVinyl 2s linear infinite;
    transform: translateX(100px);
}
.album-art.spinning .cover {
    transform: translateX(-50px) rotateY(-15deg);
}

.cyber-btn {
    padding: 15px 30px;
    background: transparent;
    border: 1px solid var(--matrix-green);
    color: var(--matrix-green);
    font-size: 18px;
    font-family: var(--font-main);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 0 10px var(--matrix-green-glow) inset;
}

.cyber-btn:hover {
    background: var(--matrix-green);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--matrix-green), 0 0 40px var(--matrix-green);
}

/* Glitch Text Effect */
.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 red;
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 blue;
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(73px, 9999px, 86px, 0); }
    5% { clip: rect(104px, 9999px, 89px, 0); }
    10% { clip: rect(35px, 9999px, 73px, 0); }
    15% { clip: rect(93px, 9999px, 4px, 0); }
    20% { clip: rect(10px, 9999px, 20px, 0); }
    25% { clip: rect(69px, 9999px, 80px, 0); }
    30% { clip: rect(97px, 9999px, 3px, 0); }
    35% { clip: rect(4px, 9999px, 46px, 0); }
    40% { clip: rect(65px, 9999px, 93px, 0); }
    45% { clip: rect(31px, 9999px, 19px, 0); }
    50% { clip: rect(70px, 9999px, 22px, 0); }
    55% { clip: rect(89px, 9999px, 102px, 0); }
    60% { clip: rect(16px, 9999px, 99px, 0); }
    65% { clip: rect(37px, 9999px, 2px, 0); }
    70% { clip: rect(9px, 9999px, 27px, 0); }
    75% { clip: rect(89px, 9999px, 53px, 0); }
    80% { clip: rect(33px, 9999px, 8px, 0); }
    85% { clip: rect(2px, 9999px, 85px, 0); }
    90% { clip: rect(18px, 9999px, 27px, 0); }
    95% { clip: rect(70px, 9999px, 15px, 0); }
    100% { clip: rect(81px, 9999px, 35px, 0); }
}

@keyframes glitch-anim-2 {
    0% { clip: rect(65px, 9999px, 100px, 0); }
    5% { clip: rect(52px, 9999px, 74px, 0); }
    10% { clip: rect(79px, 9999px, 85px, 0); }
    15% { clip: rect(75px, 9999px, 5px, 0); }
    20% { clip: rect(67px, 9999px, 61px, 0); }
    25% { clip: rect(14px, 9999px, 79px, 0); }
    30% { clip: rect(1px, 9999px, 66px, 0); }
    35% { clip: rect(86px, 9999px, 30px, 0); }
    40% { clip: rect(23px, 9999px, 98px, 0); }
    45% { clip: rect(85px, 9999px, 72px, 0); }
    50% { clip: rect(71px, 9999px, 75px, 0); }
    55% { clip: rect(2px, 9999px, 48px, 0); }
    60% { clip: rect(30px, 9999px, 16px, 0); }
    65% { clip: rect(59px, 9999px, 50px, 0); }
    70% { clip: rect(41px, 9999px, 62px, 0); }
    75% { clip: rect(2px, 9999px, 82px, 0); }
    80% { clip: rect(47px, 9999px, 73px, 0); }
    85% { clip: rect(3px, 9999px, 27px, 0); }
    90% { clip: rect(26px, 9999px, 55px, 0); }
    95% { clip: rect(42px, 9999px, 97px, 0); }
    100% { clip: rect(38px, 9999px, 49px, 0); }
}

.process-list {
    list-style: none;
    font-size: 11px;
}
.process-list li {
    margin-bottom: 5px;
    color: var(--white);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #050505; 
}
::-webkit-scrollbar-thumb {
    background: #1a331a; 
}
::-webkit-scrollbar-thumb:hover {
    background: var(--matrix-green-dim); 
}

/* Comedic Log Animation */
.pop-in {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: left center;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Chat-style Terminal Formatting */
.chat-log {
    margin-bottom: 8px;
    display: flex;
    gap: 15px;
    font-family: var(--font-main);
    word-break: break-word;
    align-items: flex-start;
}

.sender-label {
    font-weight: bold;
    min-width: 160px;
    text-align: right;
    flex-shrink: 0;
}

.log-text {
    flex: 1;
}

.log-os { 
    color: #00ffcc; 
    text-shadow: 0 0 5px rgba(0,255,204,0.5); 
}

.log-ai { 
    color: #ff00ff; 
    text-shadow: 0 0 5px rgba(255,0,255,0.5); 
}

.log-dev { 
    color: #ffff00; 
    text-shadow: 0 0 5px rgba(255,255,0,0.5); 
}

.log-sys { 
    color: var(--white); 
}

.log-error { 
    color: var(--warning-red); 
    text-shadow: 0 0 5px var(--warning-red-glow); 
}
