/* ========================================
   domain - Terminal Emulator Design
   Color Palette from DESIGN.md:
   #0C0C0C - Terminal Black (background)
   #33FF33 - Matrix Green (primary text)
   #00FF00 - Prompt Green (command prompts)
   #FFFFFF - Highlight White (emphasis)
   #FF3333 - Error Red
   #666666 - Comment Gray
   #00CCCC - Link Cyan
   #1A1A1A - Title bar background
   #FF5F57 - Close button
   #FFBD2E - Minimize button
   #28C840 - Maximize button
   Font: Fira Code (all text)
   ======================================== */

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

html {
    font-size: 16px;
    overflow-x: hidden;
}

body {
    background: #0C0C0C;
    color: #33FF33;
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

/* CRT Scan Line Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 1px,
        rgba(0, 0, 0, 0.15) 1px,
        rgba(0, 0, 0, 0.15) 2px
    );
    pointer-events: none;
    z-index: 1000;
}

/* Terminal Window Chrome */
#terminal-chrome {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

#title-bar {
    height: 30px;
    background: #1A1A1A;
    display: flex;
    align-items: center;
    padding: 0 12px;
    position: relative;
}

#title-bar-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0;
}

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

.btn-close {
    background: #FF5F57;
}

.btn-minimize {
    background: #FFBD2E;
}

.btn-maximize {
    background: #28C840;
}

#title-bar-text {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #666666;
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 400;
}

/* Terminal Screen */
#terminal-screen {
    padding-top: 30px;
    min-height: 100vh;
}

#terminal-content {
    max-width: 800px;
    padding: 2rem 1.5rem 4rem 1.5rem;
}

/* Command Blocks */
.command-block {
    margin-bottom: 1.5rem;
}

.command-line {
    display: flex;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.7;
}

.prompt {
    color: #00FF00;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    white-space: pre;
}

.command-text {
    color: #33FF33;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
    white-space: pre;
}

/* Blinking Cursor */
.cursor {
    display: inline-block;
    width: 8px;
    height: 18px;
    background: #33FF33;
    vertical-align: middle;
    margin-left: 2px;
}

.cursor.blink {
    animation: cursorBlink 1s steps(1) infinite;
}

.cursor.hidden {
    display: none;
}

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

/* Command Output */
.command-output {
    margin-top: 0.5rem;
    margin-left: 0;
}

.output-line {
    color: #33FF33;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Text Variants */
.header-white {
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.highlight-white {
    color: #FFFFFF;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.comment {
    color: #666666;
    text-shadow: none;
}

.link-cyan {
    color: #00CCCC;
    text-decoration: underline;
    text-shadow: 0 0 5px rgba(0, 204, 204, 0.4);
}

.error-text {
    color: #FF3333;
    text-shadow: 0 0 5px rgba(255, 51, 51, 0.4);
}

/* Phosphor Glow on all green text */
.prompt,
.command-text,
.output-line,
.ascii-rule,
.ascii-art {
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
}

/* ASCII Art */
.ascii-art {
    color: #33FF33;
    font-family: 'Fira Code', monospace;
    font-size: 0.7rem;
    font-weight: 400;
    line-height: 1.5;
    overflow-x: auto;
}

/* ASCII Dividers */
.ascii-divider {
    margin: 1.5rem 0;
}

.ascii-rule {
    color: #33FF33;
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 300;
    line-height: 1.7;
}

/* Man Page Formatting */
.man-page {
    width: 100%;
}

.man-header {
    color: #FFFFFF;
    text-align: center;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.man-section {
    color: #33FF33;
    font-weight: 700;
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
}

.man-body {
    padding-left: 2.4rem;
    color: #33FF33;
    font-weight: 400;
    font-size: 0.95rem;
}

/* Hidden class */
.hidden {
    display: none;
}

/* Easter Egg */
#easter-egg {
    margin-top: 2rem;
}

#easter-egg-input {
    color: #33FF33;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.5);
}

#easter-egg-response {
    margin-top: 0.3rem;
}

/* Selection styling */
::selection {
    background: #33FF33;
    color: #0C0C0C;
}

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

::-webkit-scrollbar-track {
    background: #0C0C0C;
}

::-webkit-scrollbar-thumb {
    background: #333333;
    border-radius: 4px;
}

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

/* Responsive */
@media (max-width: 600px) {
    html {
        font-size: 14px;
    }

    #terminal-content {
        padding: 1.5rem 1rem 3rem 1rem;
    }

    .ascii-art {
        font-size: 0.5rem;
    }

    .man-header {
        font-size: 0.8rem;
    }

    #title-bar-text {
        font-size: 0.65rem;
    }
}
