:root {
    --primary-color: #00ff41;
    --primary-glow: rgba(0, 255, 65, 0.5);
    --terminal-bg: #1a1a1a;
    --body-bg: #0c0c0c;
}

body.theme-amber {
    --primary-color: #ffb000;
    --primary-glow: rgba(255, 176, 0, 0.5);
}

body.theme-blue {
    --primary-color: #00ccff;
    --primary-glow: rgba(0, 204, 255, 0.5);
}

body {
    background-color: var(--body-bg);
    color: var(--primary-color);
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#terminal {
    width: 80%;
    height: 80%;
    background-color: var(--terminal-bg);
    padding: 20px;
    border: 2px solid #333;
    border-radius: 8px;
    box-shadow: 0 0 20px var(--primary-glow);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

#terminal::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%),
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    z-index: 10;
    pointer-events: none;
}

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

#input-line {
    display: flex;
    align-items: center;
}


.prompt {
    margin-right: 10px;
    user-select: none;
}

#user-input {
    background-color: transparent;
    border: none;
    color: var(--primary-color);
    font-family: inherit;
    font-size: inherit;
    outline: none;
    flex-grow: 1;
    caret-color: var(--primary-color);
}

#user-input:focus {
    animation: cursor-blink 1s step-end infinite;
}

@keyframes cursor-blink {
    from, to { caret-color: var(--primary-color); }
    50% { caret-color: transparent; }
}

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

.ai-text {
    color: var(--primary-color);
    text-shadow: 0 0 5px var(--primary-glow);
}

.prompt, #user-input {
    text-shadow: 0 0 5px var(--primary-glow);
}

.user-text {
    color: #fff;
    font-weight: bold;
}

#output::-webkit-scrollbar {
    width: 8px;
}

#output::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

#output::-webkit-scrollbar-thumb:hover {
    background: #444;
}

@media (max-width: 600px) {
    #terminal {
        width: 95%;
        height: 90%;
        padding: 10px;
    }
}
