/* Retro Terminal Theme - Matrix / Hacker Style */
:root {
    /* Default - Matrix Green */
    --bg-color: #000000;
    --text-color: #00ff00;
    --prompt-color: #00ff00;
    --command-color: #00cc00;
    --error-color: #ff3333;
    --glow-color: rgba(0, 255, 0, 0.7);
    --dir-color: #0088ff;
    --font-family: 'Fira Code', monospace;
}

/* Theme: Amber */
.theme-amber {
    --text-color: #ffb000;
    --prompt-color: #ffb000;
    --command-color: #cc8800;
    --glow-color: rgba(255, 176, 0, 0.7);
    --dir-color: #ffb000;
    /* Amber dirs too */
}

/* Theme: Cyan (Cyberpunk) */
.theme-cyan {
    --text-color: #00ffff;
    --prompt-color: #00ffff;
    --command-color: #00cccc;
    --glow-color: rgba(0, 255, 255, 0.7);
    --dir-color: #ff00ff;
    /* Pink dirs for contrast */
}

/* Theme: Pink (Love) */
.theme-pink {
    --text-color: #ff69b4;
    --prompt-color: #ff69b4;
    --command-color: #ff1493;
    --glow-color: rgba(255, 105, 180, 0.7);
    --dir-color: #ffffff;
}

body {
    background-color: #000000;
    /* Fallback */
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    text-shadow: 0 0 5px var(--glow-color);
}

/* Scanline effect */
body::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.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: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

/* Window Container */
.terminal-window {
    width: 80%;
    height: 80vh;
    background-color: var(--bg-color);
    border: 1px solid #333;
    border-radius: 16px;
    box-shadow: 0 0 20px var(--glow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 10;
    /* Above scanlines */
}

/* Header */
.terminal-header {
    background-color: #1a1a1a;
    /* Slight contrast */
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.red {
    background-color: #ff5f56;
}

.dot.yellow {
    background-color: #ffbd2e;
}

.dot.green {
    background-color: #27c93f;
}

.window-title {
    color: #888;
    font-size: 0.9rem;
    margin-left: auto;
    margin-right: auto;
    /* Center roughly */
    position: absolute;
    left: 0;
    right: 0;
    text-align: center;
    pointer-events: none;
}

/* Footer */
.terminal-footer {
    background-color: #1a1a1a;
    height: 25px;
    border-top: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 0.8rem;
    color: var(--command-color);
    flex-shrink: 0;
}

.terminal {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
}

/* Scrollbar customization for WebKit browsers */
::-webkit-scrollbar {
    display: none;
}

.prompt {
    color: var(--prompt-color);
    font-weight: bold;
    margin-right: 10px;
}

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

input {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    flex-grow: 1;
    outline: none;
    text-shadow: 0 0 5px var(--glow-color);
    caret-color: var(--text-color);
    /* Blinking cursor color */
}

.system-msg {
    color: var(--command-color);
    text-shadow: 0 0 2px var(--glow-color);
}

.error {
    color: var(--error-color);
    text-shadow: 0 0 4px var(--error-color);
}

.success {
    color: var(--text-color);
    font-weight: bold;
}

.warning {
    color: #ffff00;
}

/* Yellow for warnings */
.file-output {
    color: var(--command-color);
}

.dir-name {
    color: var(--dir-color);
    font-weight: bold;
}

.proposal-text {
    color: #ff00ff;
    font-weight: bold;
    text-shadow: 0 0 5px #ff00ff;
}

/* Hot Pink for the question */
.prompt-line {
    color: var(--text-color);
}

.markdown-header {
    color: var(--text-color);
    font-weight: bold;
    text-decoration: underline;
}

.markdown-list {
    color: var(--command-color);
    margin-left: 20px;
}

.code {
    color: var(--text-color);
    font-style: italic;
    opacity: 0.8;
}

.output-text {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: var(--font-family);
}


/* Scrollbar customization for WebKit browsers */
::-webkit-scrollbar {
    width: 10px;
}

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

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

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }

    .terminal-window {
        width: 85vw;
        height: 75vh;
        border-radius: 12px;
        border: none;
    }

    .terminal {
        padding: 8px;
        font-size: 0.9rem;
        overflow-x: hidden;
        word-break: break-word;
    }

    .terminal-header {
        height: 40px;
        padding: 0 12px;
    }

    .window-title {
        font-size: 0.75rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dot {
        width: 14px;
        height: 14px;
    }

    .terminal-footer {
        height: 30px;
        font-size: 0.7rem;
        padding: 0 8px;
    }

    .hints {
        display: none;
        /* Hide hints on mobile to save space */
    }

    .status {
        font-size: 0.65rem;
    }

    input {
        font-size: 0.9rem;
    }

    .prompt {
        font-size: 0.85rem;
        margin-right: 5px;
        word-break: keep-all;
        flex-shrink: 0;
    }

    /* Make sure text wraps properly on mobile */
    .output-text {
        font-size: 0.85rem;
        line-height: 1.4;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }

    .system-msg,
    .error,
    .success,
    .warning,
    .proposal-text {
        word-break: break-word;
        overflow-wrap: break-word;
    }

    /* Larger tap target for input */
    .input-line {
        padding: 5px 0;
        flex-wrap: nowrap;
        overflow-x: hidden;
    }
}

/* Extra small devices (phones in portrait) */
@media (max-width: 480px) {
    .terminal {
        padding: 5px;
        font-size: 0.7rem;
    }

    .terminal-header {
        height: 30px;
    }

    .window-title {
        font-size: 0.6rem;
    }

    .dot {
        width: 9px;
        height: 9px;
    }

    input {
        font-size: 0.7rem;
    }

    .prompt {
        font-size: 0.65rem;
    }

    .output-text {
        font-size: 0.65rem;
        line-height: 1.3;
    }

    .terminal-footer {
        font-size: 0.55rem;
        height: 22px;
    }

    .status {
        font-size: 0.55rem;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .terminal-window {
        height: 100vh;
    }

    .terminal-header {
        height: 30px;
    }

    .terminal-footer {
        height: 25px;
    }
}