/* ============================================
   lrx.sh - Terminal Command Line Dev Aesthetic
   ============================================ */

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

/* Custom Properties */
:root {
    --bg: #0D0D0D;
    --chrome-bg: #1E1E1E;
    --chrome-border: #333333;
    --green-phosphor: #4AF626;
    --terminal-green: #27C93F;
    --text-white: #E0E0E0;
    --dim-gray: #666666;
    --error-red: #FF5F56;
    --warning-amber: #FFBD2E;
    --link-blue: #5FAFFF;
    --font-mono: 'JetBrains Mono', monospace;
}

/* Base */
html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-mono);
    font-weight: 400;
    line-height: 1.6;
    background: var(--bg);
    color: var(--green-phosphor);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollback fade effect */
body::before {
    content: '';
    position: fixed;
    top: 40px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.8) 0%, transparent 100%);
    z-index: 5;
    pointer-events: none;
}

/* ============================================
   Terminal Chrome Header
   ============================================ */
#terminal-chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: var(--chrome-bg);
    border-bottom: 1px solid var(--chrome-border);
    display: flex;
    align-items: center;
    z-index: 100;
    padding: 0 16px;
}

.chrome-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

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

.chrome-btn-red {
    background: var(--error-red);
}

.chrome-btn-amber {
    background: var(--warning-amber);
}

.chrome-btn-green {
    background: var(--terminal-green);
}

.chrome-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--dim-gray);
    font-weight: 400;
}

/* ============================================
   Main Terminal Body
   ============================================ */
#terminal-body {
    max-width: 80ch;
    margin: 0 auto;
    padding: 64px 20px 120px 20px;
}

/* ============================================
   Boot Sequence
   ============================================ */
#boot-sequence {
    margin-bottom: 24px;
}

.boot-line {
    color: var(--dim-gray);
    font-size: 15px;
    line-height: 1.6;
    min-height: 1.6em;
    white-space: pre;
}

/* ============================================
   ASCII Art Header
   ============================================ */
#ascii-header {
    margin-bottom: 32px;
    transition: opacity 300ms ease;
}

#ascii-header.hidden {
    opacity: 0;
}

#ascii-header.visible {
    opacity: 1;
}

.ascii-art {
    color: var(--green-phosphor);
    font-size: 13px;
    line-height: 1.2;
    font-weight: 400;
    white-space: pre;
    overflow: hidden;
}

.comment {
    color: var(--dim-gray);
    font-style: italic;
    margin-top: 8px;
}

/* ============================================
   Terminal Sections
   ============================================ */
.terminal-section {
    margin-bottom: 0;
}

/* Section Dividers */
.section-divider {
    color: var(--chrome-border);
    padding: 24px 0;
    font-size: 15px;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
}

/* ============================================
   Prompt Lines
   ============================================ */
.prompt-line {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
    white-space: nowrap;
}

.prompt-symbol {
    color: var(--terminal-green);
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.command-text {
    color: var(--text-white);
    font-weight: 700;
    white-space: pre;
}

/* Blinking Cursor */
.cursor {
    display: inline-block;
    width: 1px;
    height: 1.2em;
    background: var(--green-phosphor);
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 1px;
    flex-shrink: 0;
}

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

/* ============================================
   Output Blocks
   ============================================ */
.output-block {
    padding: 8px 0 16px 0;
    transition: opacity 200ms ease;
}

.output-block.hidden {
    opacity: 0;
    height: 0;
    overflow: hidden;
    padding: 0;
}

.output-block.visible {
    opacity: 1;
    height: auto;
    overflow: visible;
}

.output-text {
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--green-phosphor);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Syntax Highlighting Classes */
.hl-blue {
    color: var(--link-blue);
}

.hl-white {
    color: var(--text-white);
}

.hl-amber {
    color: var(--warning-amber);
}

.hl-green {
    color: var(--terminal-green);
}

.hl-red {
    color: var(--error-red);
}

.hl-dim {
    color: var(--dim-gray);
    font-style: italic;
}

/* ============================================
   Terminal Links
   ============================================ */
.terminal-link {
    color: var(--link-blue);
    text-decoration: none;
    transition: text-decoration 150ms;
}

.terminal-link:hover {
    text-decoration: underline;
    cursor: crosshair;
}

/* ============================================
   Bottom Fixed Prompt
   ============================================ */
#bottom-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 48px;
    background: var(--chrome-bg);
    border-top: 1px solid var(--chrome-border);
    z-index: 100;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.prompt-input-container {
    display: flex;
    align-items: center;
    max-width: 80ch;
    margin: 0 auto;
    width: 100%;
    height: 48px;
}

.prompt-input-container .prompt-symbol {
    color: var(--terminal-green);
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.prompt-prefix {
    color: var(--text-white);
    font-weight: 700;
    white-space: pre;
    flex-shrink: 0;
}

#command-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    font-family: var(--font-mono);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    width: 100%;
    caret-color: var(--green-phosphor);
}

#command-input::placeholder {
    color: var(--chrome-border);
    font-weight: 400;
    font-style: italic;
}

.input-cursor {
    display: none;
}

#command-error {
    max-width: 80ch;
    margin: 0 auto;
    width: 100%;
    padding-bottom: 8px;
    color: var(--error-red);
    font-size: 14px;
}

#command-error.hidden {
    display: none;
}

#command-error.visible {
    display: block;
}

/* ============================================
   Utility: Hidden
   ============================================ */
.hidden {
    opacity: 0;
}

.visible {
    opacity: 1;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--chrome-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dim-gray);
}

/* ============================================
   Selection
   ============================================ */
::selection {
    background: var(--terminal-green);
    color: var(--bg);
}

/* ============================================
   Responsive (small screens)
   ============================================ */
@media (max-width: 680px) {
    #terminal-body {
        padding: 56px 12px 100px 12px;
    }

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

    .output-text {
        font-size: 13px;
    }
}
