@import url('https://fonts.googleapis.com/css2?family=Courier+Prime&display=swap');

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

body {
    background-color: #000;
    font-family: 'Courier Prime', 'Courier New', monospace;
    color: #00ff00;
    font-size: 16px;
    line-height: 1.4;
    overflow: hidden;
}

#terminal {
    width: 100vw;
    height: 100vh;
    background-color: #000;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transition: opacity 1s ease-in;
}

#terminal.loaded {
    opacity: 1;
}

#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: #000;
}

#matrix-canvas.fade-out {
    animation: fadeOut 1s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

#terminal-header {
    border-bottom: 2px solid #00ff00;
    padding-bottom: 10px;
    margin-bottom: 20px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.blink {
    animation: blink 1s step-end infinite;
}

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

#terminal-output {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 20px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.output-line {
    margin-bottom: 10px;
}

.user-input {
    color: #00ff00;
}

.assistant-response {
    color: #00ff00;
    margin-left: 20px;
}

.error {
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
}

.system {
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
}

.download-link {
    color: #00ffff;
    text-decoration: none;
    background-color: #003333;
    padding: 4px 8px;
    border: 1px solid #00ffff;
    cursor: pointer;
    text-shadow: 0 0 10px #00ffff;
    display: inline-block;
    margin: 5px 0;
}

.download-link:hover {
    background-color: #006666;
    box-shadow: 0 0 15px #00ffff;
}

#terminal-input-line {
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt {
    color: #00ff00;
    font-weight: bold;
    white-space: nowrap;
}

#terminal-input {
    flex: 1;
    background-color: transparent;
    border: none;
    outline: none;
    color: #00ff00;
    font-family: 'Courier Prime', 'Courier New', monospace;
    font-size: 16px;
    caret-color: #00ff00;
}

#terminal-input::selection {
    background-color: #00ff00;
    color: #000;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #00ff00;
    border: 1px solid #000;
}

::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}

/* CRT screen 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.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Scan line animation */
body::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 9999;
    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.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;
    }
}
