@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500&display=swap');

:root {
    --bg-color: #050505;
    --terminal-green: #00ff41;
    --terminal-red: #ff0000;
    --terminal-dim-green: #003b00;
    --glow-color: rgba(0, 255, 65, 0.4);
}

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

body {
    background-color: var(--bg-color);
    color: var(--terminal-green);
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* CRT Effect Overlay */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}

.crt-overlay::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% {
        opacity: 0.27861;
    }

    5% {
        opacity: 0.34769;
    }

    10% {
        opacity: 0.23604;
    }

    15% {
        opacity: 0.90626;
    }

    20% {
        opacity: 0.18128;
    }

    25% {
        opacity: 0.83891;
    }

    30% {
        opacity: 0.65583;
    }

    35% {
        opacity: 0.57807;
    }

    40% {
        opacity: 0.26559;
    }

    45% {
        opacity: 0.84693;
    }

    50% {
        opacity: 0.96019;
    }

    55% {
        opacity: 0.08594;
    }

    60% {
        opacity: 0.20313;
    }

    65% {
        opacity: 0.41988;
    }

    70% {
        opacity: 0.53455;
    }

    75% {
        opacity: 0.37288;
    }

    80% {
        opacity: 0.71428;
    }

    85% {
        opacity: 0.70419;
    }

    90% {
        opacity: 0.7003;
    }

    95% {
        opacity: 0.36108;
    }

    100% {
        opacity: 0.24387;
    }
}

header {
    padding: 1rem;
    border-bottom: 2px solid var(--terminal-green);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-shadow: 0 0 5px var(--glow-color);
}

.system-title {
    font-size: 1.5rem;
    font-weight: bold;
    letter-spacing: 2px;
}

.countdown {
    color: var(--terminal-red);
    font-size: 2rem;
    font-weight: bold;
}

main {
    flex: 1;
    display: flex;
    padding: 1rem;
    gap: 1rem;
}

.editor-container {
    flex: 2;
    border: 1px solid var(--terminal-green);
    display: flex;
    flex-direction: column;
}

.editor-header {
    background: var(--terminal-dim-green);
    padding: 0.5rem;
    display: flex;
    justify-content: space-between;
}

#monaco-editor {
    flex: 1;
}

.sidebar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel {
    border: 1px solid var(--terminal-green);
    background: rgba(0, 255, 65, 0.05);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.panel h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--terminal-green);
}

.test-list {
    list-style: none;
}

.test-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.test-status {
    width: 20px;
    height: 20px;
    border: 1px solid var(--terminal-dim-green);
    display: inline-block;
}

.test-item.passed .test-status {
    background: var(--terminal-green);
    border-color: var(--terminal-green);
    box-shadow: 0 0 10px var(--terminal-green);
}

.test-item.failed .test-status {
    background: var(--terminal-red);
    border-color: var(--terminal-red);
    box-shadow: 0 0 10px var(--terminal-red);
}

.test-item.pending .test-status {
    background: transparent;
    border-color: var(--terminal-dim-green);
}

button {
    background: transparent;
    color: var(--terminal-green);
    border: 1px solid var(--terminal-green);
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-family: 'Fira Code', monospace;
    transition: all 0.3s;
    text-transform: uppercase;
    font-weight: bold;
}

button:hover {
    background: var(--terminal-green);
    color: var(--bg-color);
    box-shadow: 0 0 15px var(--terminal-green);
}

.alert-box {
    color: var(--terminal-red);
    border: 1px solid var(--terminal-red);
    padding: 1rem;
    margin-top: auto;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        background: rgba(255, 0, 0, 0);
    }

    50% {
        background: rgba(255, 0, 0, 0.1);
    }

    100% {
        background: rgba(255, 0, 0, 0);
    }
}

#boot-screen,
#success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

#success-screen {
    display: none;
    background: rgba(5, 5, 5, 0.9);
    border: 5px solid var(--terminal-green);
    box-shadow: 0 0 50px var(--terminal-green);
}

.success-content h1 {
    color: var(--terminal-green);
    font-size: 4rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px var(--terminal-green);
}

.success-content p {
    font-size: 1.5rem;
    color: var(--terminal-green);
}

#boot-btn {
    font-size: 1.5rem;
    padding: 1rem 2rem;
    margin-top: 2rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }

    100% {
        opacity: 1;
    }
}