/* Terminal Styling */
:root {
    --bg-color: #0c0c0c;
    --text-color: #00ff00;
    --font-family: 'Courier New', Courier, monospace;
    --font-size: 24px;
}

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

body,
html {
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    overflow: hidden;
    /* Prevent body scroll, everything is inside .terminal */
}

.terminal {
    width: 100%;
    height: 100%;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    font-size: var(--font-size);
}

#output {
    flex: 0 0 auto;
    white-space: pre-wrap;
    /* Preserve whitespace and wrap text */
    word-wrap: break-word;
}

.input-line {
    display: block;
    /* Use block for full width */
    position: relative;
    /* Context for absolute prompt */
    margin-top: 5px;
    width: 100%;
}

/* Active prompt (input line) - Absolute to handle wrap indent */
.input-line .prompt {
    position: absolute;
    /* Take out of flow */
    top: 0;
    left: 0;
    margin-right: 0;
    z-index: 5;
    pointer-events: none;
}

/* Prompt Styles (Shared) */
.prompt {
    white-space: nowrap;
    font-weight: bold;
    font-size: var(--font-size);
    line-height: 1.5;
}

.prompt .user {
    color: #4af626;
}

.prompt .white {
    color: #ffffff;
}

.prompt .blue {
    color: #4444ff;
}

@keyframes blink {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 0;
    }
}

/* Response styling to look distinct */
.response {
    margin-bottom: 10px;
    margin-top: 5px;
    color: #cccccc;
    /* Slightly different color for responses */
}

.command {
    color: #ffffff;
    /* User commands in white */
}

.loading {
    color: #aaaaaa;
    font-style: italic;
    margin-bottom: 10px;
}

.btc-line {
    color: #ffd700;
    /* Gold for Bitcoin */
    margin-top: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}

#command-input {
    background: transparent;
    border: none;
    color: transparent;
    /* Hide text, we see cursor, actually we need text visible? No, cursor is mix-blend-mode. Text MUST be visible. */
    color: #ffffff;
    font-family: var(--font-family);
    font-size: var(--font-size);
    font-weight: 900;
    width: 100%;
    /* Full width */
    box-sizing: border-box;
    /* Include padding/border in width */
    flex-grow: 1;
    min-width: 0;
    outline: none;
    caret-color: transparent;
    position: relative;
    z-index: 1;
    resize: none;
    overflow: hidden;
    padding: 0;
    margin: 0;
    line-height: 1.5;
    /* Explicit line height for calcs */
}

/* Custom Box Cursor */
.cursor-block {
    position: absolute;
    width: 0.6em;
    /* Approx char width */
    height: 1em;
    /* Match text height exactly */
    background-color: white;
    animation: blink 1s step-end infinite;
    pointer-events: none;
    z-index: 2;
    /* Above text? Box cursor usually inverts. */
    mix-blend-mode: difference;
    top: 0;
    /* Top alignment */
    left: 0;
}

/* Mirror Div for Cursor Calc */
.cursor-mirror {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-family);
    font-size: var(--font-size);
    font-weight: 900;
    line-height: 1.5;
    padding: 0;
    margin: 0;
    width: 100%;
    /* Match textarea width */
    box-sizing: border-box;
    pointer-events: none;
}


/* Mobile responsiveness */
@media (max-width: 600px) {
    .terminal {
        padding: 10px;
    }

    :root {
        --font-size: 21px;
    }
}