:root {
    --bg-color: #0d0d0d;
    --text-color: #0f0;
    --prompt-color: #fff;
    --error-color: #f00;
    --glow-color: rgba(0, 255, 0, 0.5);
}

body {
    margin: 0;
    padding: 20px;
    /* Full width with slight breathing room */
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier New', Courier, monospace;
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* CRT Effects */
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: 100;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.screen-layer {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-shadow: 0 0 5px var(--glow-color);
}

/* Scanline Animation */
@keyframes scanline {
    0% {
        transform: translateY(-100vh);
    }

    100% {
        transform: translateY(100vh);
    }
}

.scanline {
    position: fixed;
    left: 0;
    top: 0;
    width: 100vw;
    height: 20px;
    background: linear-gradient(to bottom, rgba(0, 255, 0, 0), rgba(0, 255, 0, 0.2), rgba(0, 255, 0, 0));
    opacity: 0.1;
    animation: scanline 8s linear infinite;
    pointer-events: none;
    z-index: 101;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--text-color);
    border: 2px solid var(--bg-color);
}

/* Typography */
a {
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--text-color);
    cursor: pointer;
}

a:hover {
    background-color: var(--text-color);
    color: var(--bg-color);
}

.prompt {
    color: var(--prompt-color);
    font-weight: bold;
    margin-right: 10px;
    white-space: nowrap;
}

.command {
    color: #ff0;
}

.error {
    color: var(--error-color);
}

.dim {
    opacity: 0.6;
}

.highlight {
    color: #fff;
    font-weight: bold;
}

.status-ok {
    color: #0f0;
}

.status-archived {
    color: #888;
}

.tech-tag {
    color: #ff0;
    font-size: 0.9em;
}

/* Input Area */
#terminal-output {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.input-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

#cmd-input {
    opacity: 0;
    position: absolute;
    top: -1000px;
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: var(--text-color);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

.cursor.typing {
    animation: none;
    opacity: 1;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Grid Layout */
.file-grid-header {
    display: grid;
    grid-template-columns: 30px 1.3fr 1.2fr 4fr 0.8fr;
    gap: 15px;
    border-bottom: 1px solid var(--text-color);
    margin-bottom: 10px;
    padding-bottom: 5px;
    font-weight: bold;
    text-transform: uppercase;
}

.file-grid-row {
    display: grid;
    grid-template-columns: 30px 1.3fr 1.2fr 4fr 0.8fr;
    gap: 15px;
    margin-bottom: 15px;
    align-items: start;
    border-bottom: 1px dashed rgba(0, 255, 0, 0.1);
    padding-bottom: 10px;
}

.col-id {
    color: #fff;
    font-weight: bold;
}

.col-tech {
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
}

/* Mobile Optimization */
@media (max-width: 900px) {
    body {
        padding: 10px;
        font-size: 14px;
    }

    .file-grid-header {
        display: none;
    }

    .file-grid-row {
        grid-template-columns: 30px 1fr;
        gap: 5px;
        margin-bottom: 20px;
        border-bottom: 1px dashed rgba(0, 255, 0, 0.3);
        padding-bottom: 15px;
    }

    .col-id {
        grid-row: 1 / span 4;
        font-size: 1.2em;
        align-self: start;
        margin-top: 0;
    }

    .col-name {
        font-size: 1.2em;
        font-weight: bold;
        margin-bottom: 5px;
    }

    .col-tech {
        color: #ff0;
        margin-bottom: 5px;
    }

    .col-desc {
        font-style: italic;
        opacity: 0.9;
        margin-bottom: 5px;
        line-height: 1.4;
    }

    .col-status {
        text-align: left;
        font-size: 0.9em;
        opacity: 0.8;
    }

    .prompt {
        margin-right: 5px;
    }

    /* HIDE DESKTOP INPUT STUFF */
    #input-line,
    #cmd-input,
    .cursor {
        display: none !important;
    }

    /* SHOW MOBILE INPUT */
    #mobile-input-container {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #000;
        border-top: 1px solid var(--text-color);
        padding: 10px;
        box-sizing: border-box;
        z-index: 200;
        align-items: center;
    }

    #mobile-cmd-select {
        background-color: #000;
        color: var(--text-color);
        border: 1px solid var(--text-color);
        font-family: 'Courier New', monospace;
        font-size: 16px;
        padding: 5px;
        flex-grow: 1;
        margin-left: 10px;
        outline: none;
    }
}