/* ========== Reset ========== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0c0c0c;
    --terminal-bg: #1a1a2e;
    --green: #00ff41;
    --green-dim: #00cc33;
    --green-dark: #009922;
    --cyan: #00d4ff;
    --yellow: #ffdd00;
    --red: #ff4444;
    --magenta: #ff79c6;
    --white: #e0e0e0;
    --gray: #666;
    --comment: #6a737d;
    --font: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', 'SF Mono', monospace;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--green);
    color: var(--bg);
}

a {
    color: var(--cyan);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

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

/* ========== Terminal Window ========== */
.terminal {
    width: 90vw;
    max-width: 860px;
    height: 85vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0, 255, 65, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(0, 255, 65, 0.05);
}

/* ========== Title Bar ========== */
.terminal-bar {
    background: #2d2d3f;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    user-select: none;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #ffbd2e; }
.btn-maximize { background: #28c840; }

.terminal-title {
    flex: 1;
    text-align: center;
    font-size: 12px;
    color: #888;
    letter-spacing: 0.5px;
}

.terminal-bar-spacer {
    width: 52px; /* balance the buttons */
}

/* ========== Terminal Body ========== */
.terminal-body {
    background: var(--terminal-bg);
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 13.5px;
    line-height: 1.6;
    cursor: text;
    scrollbar-width: thin;
    scrollbar-color: var(--green-dark) transparent;
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb {
    background: var(--green-dark);
    border-radius: 3px;
}

/* ========== Output ========== */
#output .line {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.6em;
}

#output .line.cmd-echo {
    color: var(--white);
}

#output .line .prompt-echo {
    color: var(--green-dim);
}

/* Color classes */
.c-green { color: var(--green); }
.c-cyan { color: var(--cyan); }
.c-yellow { color: var(--yellow); }
.c-red { color: var(--red); }
.c-magenta { color: var(--magenta); }
.c-white { color: var(--white); }
.c-gray { color: var(--comment); }
.c-dim { color: var(--gray); }
.c-bold { font-weight: 700; }

/* ASCII art */
.ascii-art {
    color: var(--cyan);
    line-height: 1.2;
    font-size: 11px;
}

/* Neofetch two-column layout */
.neofetch {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.neofetch-logo {
    flex-shrink: 0;
}

.neofetch-logo .ascii-art {
    white-space: pre;
    line-height: 1.25;
    font-size: 12px;
}

.neofetch-info {
    white-space: pre;
    line-height: 1.6;
    font-size: 13.5px;
}

@media (max-width: 600px) {
    .neofetch {
        flex-direction: column;
        gap: 12px;
    }

    .neofetch-logo .ascii-art {
        font-size: 8px;
    }

    .neofetch-info {
        font-size: 12px;
    }
}

/* ========== Input Line ========== */
.input-line {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.prompt {
    color: var(--green-dim);
    flex-shrink: 0;
}

#cmdInput {
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-family: var(--font);
    font-size: 13.5px;
    flex: 1;
    caret-color: transparent;
    min-width: 0;
}

.cursor-blink {
    color: var(--green);
    animation: blink 1s step-end infinite;
    font-size: 13px;
    line-height: 1;
}

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

/* ========== Quick Commands ========== */
.quick-cmds {
    background: #2d2d3f;
    padding: 8px 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(0, 255, 65, 0.1);
    flex-shrink: 0;
}

.quick-cmds button {
    background: rgba(0, 255, 65, 0.08);
    border: 1px solid rgba(0, 255, 65, 0.2);
    color: var(--green);
    font-family: var(--font);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-cmds button:hover {
    background: rgba(0, 255, 65, 0.15);
    border-color: var(--green);
}

.quick-cmds button:active {
    transform: scale(0.95);
}

/* ========== Typing animation ========== */
.typing-line {
    overflow: hidden;
    border-right: 2px solid var(--green);
    animation: typing-cursor 0.7s step-end infinite;
}

@keyframes typing-cursor {
    0%, 100% { border-color: var(--green); }
    50% { border-color: transparent; }
}

/* ========== Responsive ========== */
@media (max-width: 600px) {
    .terminal {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .terminal-body {
        font-size: 12px;
        padding: 12px;
    }

    #cmdInput {
        font-size: 12px;
    }

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

    .quick-cmds {
        padding: 6px 8px;
    }

    .quick-cmds button {
        font-size: 10px;
        padding: 3px 8px;
    }

    .scanlines {
        display: none;
    }
}
