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

:root {
    --terminal-green: #0f0;
    --terminal-dark-green: #0a0;
    --terminal-bg: #0a0a0a;
    --glow-color: rgba(0, 255, 0, 0.5);
}

body {
    background-color: #000;
    font-family: 'VT323', monospace;
    font-size: 18px;
    color: var(--terminal-green);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* CRT Monitor Effect */
.crt {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.crt::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        to bottom,
        rgba(18, 16, 16, 0) 50%,
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 2;
    pointer-events: none;
}

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

/* Scanlines */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 10;
}

/* Terminal Container */
#terminal {
    position: relative;
    z-index: 1;
    padding: 20px;
    height: 100vh;
    overflow-y: auto;
    background: var(--terminal-bg);
}

#output {
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

#output .line {
    margin-bottom: 2px;
}

#output a {
    color: #0ff;
    text-decoration: none;
}

#output a:hover {
    text-decoration: underline;
    text-shadow: 0 0 10px #0ff;
}

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

.prompt {
    color: var(--terminal-green);
    margin-right: 10px;
    text-shadow: 0 0 5px var(--glow-color);
}

#command-input {
    background: transparent;
    border: none;
    color: var(--terminal-green);
    font-family: 'VT323', monospace;
    font-size: 18px;
    outline: none;
    flex: 1;
    caret-color: transparent;
    text-shadow: 0 0 5px var(--glow-color);
}

.cursor {
    animation: blink 1s step-end infinite;
    text-shadow: 0 0 5px var(--glow-color);
}

/* Text glow effect */
.glow {
    text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
}

/* ASCII Art styling */
.ascii-art {
    color: var(--terminal-green);
    font-size: 14px;
    line-height: 1.2;
}

/* Service list styling */
.service-item {
    margin-left: 20px;
}

.service-name {
    color: #0ff;
    font-weight: bold;
}

.service-desc {
    color: #888;
}

/* Category header */
.category {
    color: #ff0;
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Animations */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@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.67807; }
    40% { opacity: 0.26559; }
    45% { opacity: 0.84693; }
    50% { opacity: 0.96019; }
    55% { opacity: 0.08594; }
    60% { opacity: 0.20313; }
    65% { opacity: 0.71988; }
    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; }
}

@keyframes textShadow {
    0% { text-shadow: 0.4389924193300864px 0 1px rgba(0,30,255,0.5), -0.4389924193300864px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    5% { text-shadow: 2.7928974010788217px 0 1px rgba(0,30,255,0.5), -2.7928974010788217px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    10% { text-shadow: 0.02956275843481219px 0 1px rgba(0,30,255,0.5), -0.02956275843481219px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    15% { text-shadow: 0.40218538552878136px 0 1px rgba(0,30,255,0.5), -0.40218538552878136px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    20% { text-shadow: 3.4794037899852017px 0 1px rgba(0,30,255,0.5), -3.4794037899852017px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    25% { text-shadow: 1.6125630401149584px 0 1px rgba(0,30,255,0.5), -1.6125630401149584px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    30% { text-shadow: 0.7015590085143956px 0 1px rgba(0,30,255,0.5), -0.7015590085143956px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    35% { text-shadow: 3.896914047650351px 0 1px rgba(0,30,255,0.5), -3.896914047650351px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    40% { text-shadow: 3.870905614848819px 0 1px rgba(0,30,255,0.5), -3.870905614848819px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    45% { text-shadow: 2.231056963361899px 0 1px rgba(0,30,255,0.5), -2.231056963361899px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    50% { text-shadow: 0.08084290417898504px 0 1px rgba(0,30,255,0.5), -0.08084290417898504px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    55% { text-shadow: 2.3758461067427543px 0 1px rgba(0,30,255,0.5), -2.3758461067427543px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    60% { text-shadow: 2.202193051050636px 0 1px rgba(0,30,255,0.5), -2.202193051050636px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    65% { text-shadow: 2.8638780614874975px 0 1px rgba(0,30,255,0.5), -2.8638780614874975px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    70% { text-shadow: 0.48874025155497314px 0 1px rgba(0,30,255,0.5), -0.48874025155497314px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    75% { text-shadow: 1.8948491305757957px 0 1px rgba(0,30,255,0.5), -1.8948491305757957px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    80% { text-shadow: 0.0833037308038857px 0 1px rgba(0,30,255,0.5), -0.0833037308038857px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    85% { text-shadow: 0.09769827255241735px 0 1px rgba(0,30,255,0.5), -0.09769827255241735px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    90% { text-shadow: 3.443339761481782px 0 1px rgba(0,30,255,0.5), -3.443339761481782px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    95% { text-shadow: 2.1841838852799786px 0 1px rgba(0,30,255,0.5), -2.1841838852799786px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
    100% { text-shadow: 2.6208764473832513px 0 1px rgba(0,30,255,0.5), -2.6208764473832513px 0 1px rgba(255,0,80,0.3), 0 0 3px; }
}

/* Glitch effect class */
.glitch {
    animation: textShadow 1.6s infinite;
}

/* Screen Shake Animation */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-5px) translateY(2px); }
    20% { transform: translateX(5px) translateY(-2px); }
    30% { transform: translateX(-5px) translateY(2px); }
    40% { transform: translateX(5px) translateY(-2px); }
    50% { transform: translateX(-3px) translateY(1px); }
    60% { transform: translateX(3px) translateY(-1px); }
    70% { transform: translateX(-3px) translateY(1px); }
    80% { transform: translateX(3px) translateY(-1px); }
    90% { transform: translateX(-1px); }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Random Glitch Effect */
@keyframes randomGlitch {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-2px, 2px);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(2px, -2px);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(2px, -2px);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(0);
    }
}

.random-glitch {
    animation: randomGlitch 0.3s linear;
}

/* Idle Cursor Animation */
@keyframes idlePulse {
    0%, 100% {
        opacity: 1;
        text-shadow: 0 0 5px var(--glow-color);
    }
    50% {
        opacity: 0.3;
        text-shadow: 0 0 15px var(--glow-color), 0 0 25px var(--glow-color);
    }
}

.cursor.idle {
    animation: idlePulse 1.5s ease-in-out infinite;
}

/* Delete effect for rm -rf */
@keyframes deleteEffect {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.98); }
    100% { opacity: 0; transform: scale(0.95); }
}

.deleting .line {
    animation: deleteEffect 0.1s ease-out forwards;
}

/* Reboot flash */
@keyframes rebootFlash {
    0% { background-color: #000; }
    50% { background-color: #111; }
    100% { background-color: #000; }
}

.reboot-flash {
    animation: rebootFlash 0.3s ease-in-out;
}

/* Matrix Canvas */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#matrix-canvas.active {
    opacity: 1;
    pointer-events: auto;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    #command-input {
        font-size: 14px;
    }

    .ascii-art {
        font-size: 10px;
    }

    #terminal {
        padding: 10px;
    }
}
