/* Retro CRT Monospaced Terminal Styling */
:root {
    --term-bg: #000000;
    --term-amber: #ffb000;
    --term-red: #ff3333;
    --term-cyan: #00e5ff;
    --term-white: #e6effa;
    --glow-amber: 0 0 5px rgba(255, 176, 0, 0.8);
    --glow-red: 0 0 5px rgba(255, 51, 51, 0.8);
    --font-term: 'JetBrains Mono', 'Courier New', Courier, monospace;
}

/* Theme Configurations */
body {
    --term-text: #20e241;
    --term-text-dim: rgba(32, 226, 65, 0.6);
    --glow-green: 0 0 5px rgba(32, 226, 65, 0.8), 0 0 10px rgba(32, 226, 65, 0.3);
    --term-prompt: #00e5ff;
    --glow-prompt: 0 0 4px #00e5ff;
    --refresh-color: rgba(32, 226, 65, 0.08);
    --scrollbar-color: rgba(32, 226, 65, 0.3);
}

body.theme-green {
    --term-text: #20e241;
    --term-text-dim: rgba(32, 226, 65, 0.6);
    --glow-green: 0 0 5px rgba(32, 226, 65, 0.8), 0 0 10px rgba(32, 226, 65, 0.3);
    --term-prompt: #00e5ff;
    --glow-prompt: 0 0 4px #00e5ff;
    --refresh-color: rgba(32, 226, 65, 0.08);
    --scrollbar-color: rgba(32, 226, 65, 0.3);
}

body.theme-amber {
    --term-text: #ffb000;
    --term-text-dim: rgba(255, 176, 0, 0.6);
    --glow-green: 0 0 5px rgba(255, 176, 0, 0.8), 0 0 10px rgba(255, 176, 0, 0.3);
    --term-prompt: #20e241;
    --glow-prompt: 0 0 4px #20e241;
    --refresh-color: rgba(255, 176, 0, 0.08);
    --scrollbar-color: rgba(255, 176, 0, 0.3);
}

body.theme-cyan {
    --term-text: #00e5ff;
    --term-text-dim: rgba(0, 229, 255, 0.6);
    --glow-green: 0 0 5px rgba(0, 229, 255, 0.8), 0 0 10px rgba(0, 229, 255, 0.3);
    --term-prompt: #ffb000;
    --glow-prompt: 0 0 4px #ffb000;
    --refresh-color: rgba(0, 229, 255, 0.08);
    --scrollbar-color: rgba(0, 229, 255, 0.3);
}

body.theme-classic {
    --term-text: #e6effa;
    --term-text-dim: rgba(230, 239, 250, 0.6);
    --glow-green: 0 0 5px rgba(230, 239, 250, 0.8), 0 0 10px rgba(230, 239, 250, 0.3);
    --term-prompt: #00e5ff;
    --glow-prompt: 0 0 4px #00e5ff;
    --refresh-color: rgba(230, 239, 250, 0.08);
    --scrollbar-color: rgba(230, 239, 250, 0.3);
}

body.theme-red {
    --term-text: #ff3333;
    --term-text-dim: rgba(255, 51, 51, 0.6);
    --glow-green: 0 0 5px rgba(255, 51, 51, 0.8), 0 0 10px rgba(255, 51, 51, 0.3);
    --term-prompt: #ffb000;
    --glow-prompt: 0 0 4px #ffb000;
    --refresh-color: rgba(255, 51, 51, 0.08);
    --scrollbar-color: rgba(255, 51, 51, 0.3);
}

body.theme-purple {
    --term-text: #d500f9;
    --term-text-dim: rgba(213, 0, 249, 0.6);
    --glow-green: 0 0 5px rgba(213, 0, 249, 0.8), 0 0 10px rgba(213, 0, 249, 0.3);
    --term-prompt: #00e5ff;
    --glow-prompt: 0 0 4px #00e5ff;
    --refresh-color: rgba(213, 0, 249, 0.08);
    --scrollbar-color: rgba(213, 0, 249, 0.3);
}

body.theme-blue {
    --term-text: #2979ff;
    --term-text-dim: rgba(41, 121, 255, 0.6);
    --glow-green: 0 0 5px rgba(41, 121, 255, 0.8), 0 0 10px rgba(41, 121, 255, 0.3);
    --term-prompt: #20e241;
    --glow-prompt: 0 0 4px #20e241;
    --refresh-color: rgba(41, 121, 255, 0.08);
    --scrollbar-color: rgba(41, 121, 255, 0.3);
}

/* Reset and Core Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #000000;
    color: var(--term-text);
    font-family: var(--font-term);
    overflow: hidden;
}

/* CRT Screen Frame Overlay */
.crt-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000000;
    overflow: hidden;
}

/* Phosphor Glow Mask - Disabled as requested to remove background green shade */
.crt-glow {
    display: none;
}

/* CRT Scanlines Grid & Crawling Refresh Line */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 20;
}

.scanlines::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 0%, var(--refresh-color) 10%, rgba(18, 16, 16, 0) 11%);
    animation: refresh-bar 8s linear infinite;
    pointer-events: none;
    z-index: 21;
}

@keyframes refresh-bar {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Vignette Screen Curvature shading */
.vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.85);
    background: radial-gradient(circle, transparent 60%, rgba(0, 0, 0, 0.7) 100%);
    pointer-events: none;
    z-index: 25;
}

/* Screen Flicker Animation (CRT Warmth) */
.screen-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.002);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    animation: flicker-seq 0.15s infinite;
}

@keyframes flicker-seq {
    0% { opacity: 0.15; }
    50% { opacity: 0.25; }
    100% { opacity: 0.15; }
}

/* Terminal Cabinet/Window container */
.terminal-container {
    width: 100%;
    height: 100%;
    background: #000000;
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 30;
}

/* Terminal Title Bar - Hidden in full screen TTY console mode */
.terminal-header {
    display: none !important;
}

.window-buttons {
    display: flex;
    gap: 6px;
}

.btn {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(32, 226, 65, 0.4);
    display: inline-block;
}

.btn.close { background-color: rgba(255, 51, 51, 0.2); }
.btn.minimize { background-color: rgba(255, 176, 0, 0.2); }
.btn.maximize { background-color: rgba(32, 226, 65, 0.2); }

.terminal-title {
    font-weight: bold;
    text-shadow: var(--glow-green);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.blink-dot {
    width: 6px;
    height: 6px;
    background-color: var(--term-text);
    border-radius: 50%;
    box-shadow: var(--glow-green);
    animation: status-blink 1.2s infinite ease-in-out;
}

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

/* Terminal Body Scroll Container */
.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.6;
    letter-spacing: 0.5px;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) transparent;
}

/* Custom Scrollbar for modern scroll browsers */
.terminal-body::-webkit-scrollbar {
    width: 6px;
}
.terminal-body::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 3px;
}
.terminal-body::-webkit-scrollbar-track {
    background: transparent;
}

/* Log lines formatting */
.log-row {
    margin-bottom: 3px;
    display: block;
    word-break: break-all;
    text-shadow: var(--glow-green);
    white-space: pre-wrap;
}

/* Color Tags */
.cyan-text {
    color: var(--term-cyan);
    text-shadow: 0 0 4px var(--term-cyan);
}

.amber-text {
    color: var(--term-amber);
    text-shadow: var(--glow-amber);
}

.red-text {
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

.white-text {
    color: var(--term-white);
    text-shadow: 0 0 4px rgba(230, 239, 250, 0.5);
}

/* Boot Badges */
.badge {
    display: inline-block;
    font-weight: bold;
    width: 65px;
}

.badge-ok {
    color: var(--term-text);
    text-shadow: var(--glow-green);
}

.badge-info {
    color: var(--term-cyan);
    text-shadow: 0 0 5px var(--term-cyan);
}

.badge-warn {
    color: var(--term-amber);
    text-shadow: var(--glow-amber);
}

.badge-fail {
    color: var(--term-red);
    text-shadow: var(--glow-red);
}

/* ASCII Logo styling */
.ascii-logo {
    display: block;
    white-space: pre;
    color: var(--term-text);
    font-size: 8.5px;
    line-height: 1.15;
    margin: 15px 0;
    text-shadow: var(--glow-green);
    animation: logo-glow 3s infinite alternate;
}

@keyframes logo-glow {
    0% { filter: drop-shadow(0 0 2px rgba(32, 226, 65, 0.6)); }
    100% { filter: drop-shadow(0 0 8px rgba(32, 226, 65, 0.9)); }
}


/* Responsive adjustments to prevent line wrapping of ASCII art & tables */

/* Large desktops and TV screens */
@media (min-width: 1400px) {
    .terminal-body {
        font-size: 16px;
        line-height: 1.6;
    }
    .ascii-logo {
        font-size: 10px;
    }
}

/* Medium/Standard Desktops */
@media (min-width: 992px) and (max-width: 1399px) {
    .terminal-body {
        font-size: 14px;
        line-height: 1.5;
    }
    .ascii-logo {
        font-size: 8.5px;
    }
}

/* Tablets (Portrait & Landscape) */
@media (min-width: 768px) and (max-width: 991px) {
    .terminal-body {
        font-size: 12px;
        line-height: 1.5;
        padding: 15px;
    }
    .ascii-logo {
        font-size: 7px;
    }
}

/* Small tablets and large mobile screens */
@media (min-width: 481px) and (max-width: 767px) {
    .terminal-body {
        font-size: 10px;
        line-height: 1.4;
        padding: 12px;
    }
    .ascii-logo {
        font-size: 5.5px;
    }
}

/* Standard Mobile screens */
@media (min-width: 360px) and (max-width: 480px) {
    .terminal-body {
        font-size: 8.2px;
        line-height: 1.35;
        padding: 10px;
    }
    .ascii-logo {
        font-size: 4.5px;
    }
}

/* Very narrow mobile screens (e.g. iPhone SE, Galaxy Fold) */
@media (max-width: 359px) {
    .terminal-body {
        font-size: 7px;
        line-height: 1.3;
        padding: 8px;
    }
    .ascii-logo {
        font-size: 3.8px;
    }
}

