/* ==========================================================================
   PURE MONOSPACE RETRO TERMINAL STYLE SYSTEM
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. COLOR SCHEMES & BASE VARIABLES
   -------------------------------------------------------------------------- */
:root {
    --bg-color: #000000;
    --text-color: #7ff709;      /* Default Classic Green */
    --font-mono: 'Roboto Mono', monospace;
}

/* Dynamic Class Theme Color Overrides */
body.theme-green {
    --text-color: #7ff709;
}

body.theme-cyan {
    --text-color: #00f2fe;
}

body.theme-amber {
    --text-color: #ffb000;
}

body.theme-white {
    --text-color: #ffffff;
}

body.theme-matrix {
    --text-color: #00c800;
}

/* --------------------------------------------------------------------------
   2. PURE CLEAN RESET & BASE LAYOUT
   -------------------------------------------------------------------------- */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.6;
    overflow: hidden; /* Prevent global scrollbar, terminal handles inner scrolling */
    box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   3. BACKGROUND MATRIX CANVAS (faint overlay, pointer events disabled)
   -------------------------------------------------------------------------- */
#matrix-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    opacity: 0.12; /* Subtle backdrop rain */
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. MONOSPACE TERMINAL VIEWPORT CONTAINER
   -------------------------------------------------------------------------- */
.terminal-container {
    position: relative;
    max-width: 1000px;
    height: 90vh;
    margin: 40px auto;
    padding: 20px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Inner scrolling console history log */
.terminal-history {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    margin-bottom: 12px;
}

.terminal-history > :first-child {
    margin-top: auto !important;
}

/* Thin styled monospace scrollbars */
.terminal-history::-webkit-scrollbar {
    width: 6px;
}

.terminal-history::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}

.terminal-history::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHY & OUTPUT STREAMS
   -------------------------------------------------------------------------- */
p, pre, ul, li {
    margin: 0;
    padding: 0;
    white-space: pre-wrap; /* Support multi-line outputs formatting */
}

a {
    color: var(--text-color);
    text-decoration: underline;
    font-weight: 700;
    transition: all 0.2s ease-in-out;
}

a:hover {
    color: var(--bg-color);
    background-color: var(--text-color);
    text-decoration: none;
}

.term-output-line {
    margin-bottom: 12px;
}

.term-command-echo {
    color: var(--text-color);
    font-weight: 700;
}

.term-result-box {
    margin-left: 20px;
    margin-top: 6px;
    margin-bottom: 16px;
    color: #e5edf9;
    font-size: 0.95rem;
}

/* Redundant color filters for system neofetch fields */
.neofetch-accent {
    color: var(--text-color);
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   6. MONOSPACE INPUT COMMAND PROMPT
   -------------------------------------------------------------------------- */
.prompt-row {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    box-sizing: border-box;
}

.prompt-sign {
    color: var(--text-color);
    font-weight: 700;
    margin-right: 14px;
    user-select: none;
}

#term-prompt {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 16px;
    caret-color: var(--text-color); /* Matches the retro theme caret */
}

/* ASCII Grid line formatting */
.ttt-grid-line {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   7. RESPONSIVE CLI SCALE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .terminal-container {
        height: 95vh;
        margin: 15px auto;
        padding: 10px;
    }
    
    html, body, #term-prompt {
        font-size: 14px;
    }
}

/* --------------------------------------------------------------------------
   8. CENTRAL PULSING TERMINAL LOGO
   -------------------------------------------------------------------------- */
#terminal-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    z-index: 99;
    pointer-events: none; /* Let clicks pass through */
    transition: opacity 0.8s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    opacity: 1;
}

#terminal-logo.vanished {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.9);
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-color);
    text-shadow: 0 0 15px var(--text-color);
    letter-spacing: 3px;
    margin-bottom: 6px;
    animation: logo-glow 1.5s infinite alternate ease-in-out;
}

.logo-sub {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.5;
    letter-spacing: 1px;
}

@keyframes logo-glow {
    from {
        text-shadow: 0 0 15px var(--text-color), 0 0 5px rgba(255, 255, 255, 0.2);
    }
    to {
        text-shadow: 0 0 25px var(--text-color), 0 0 10px rgba(255, 255, 255, 0.5);
        transform: scale(1.02);
    }
}
