/* ============================================
   MSUG-DOS Terminal — Retro CRT Styles
   ============================================ */

@font-face {
    font-family: 'Perfect DOS VGA 437';
    src: url('../fonts/PerfectDOSVGA437.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: #0a0a0a;
    color: #33ff33;
    font-family: 'Perfect DOS VGA 437', 'Consolas', 'Courier New', monospace;
}

/* --- Boot loader --- */
.boot-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 18px;
    color: #33ff33;
    font-family: 'Perfect DOS VGA 437', 'Consolas', monospace;
    background: #000;
}

.boot-text {
    margin-right: 4px;
}

/* --- Page layout --- */
.page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 16px;
}

/* --- Header branding --- */
.header-brand {
    text-align: center;
    padding: 8px 0;
    flex-shrink: 0;
}

.header-brand .brand-title {
    font-size: 14px;
    color: #888;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-brand .brand-title span {
    color: #33ff33;
}

/* --- CRT Monitor container --- */
.crt-monitor {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: 3px solid #333;
    border-radius: 16px;
    background: #000;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 20px rgba(51, 255, 51, 0.05),
        inset 0 0 60px rgba(0, 0, 0, 0.8),
        0 0 80px rgba(0, 0, 0, 0.6);
    min-height: 0;
    animation: flicker 8s infinite;
}

/* Scanline overlay */
.crt-monitor::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15) 0px,
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 10;
}

/* Vignette */
.crt-monitor::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 11;
}

/* --- Terminal screen --- */
.terminal-screen {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 20px;
    font-size: 16px;
    line-height: 1.35;
    color: #33ff33;
    position: relative;
    z-index: 1;
    cursor: text;
    min-height: 0;
}

.terminal-screen::-webkit-scrollbar { width: 8px; }
.terminal-screen::-webkit-scrollbar-track { background: #111; }
.terminal-screen::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
.terminal-screen::-webkit-scrollbar-thumb:hover { background: #555; }

/* --- Terminal text --- */
.terminal-line {
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 1.35em;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.4);
}

.terminal-line.color-white { color: #ccc; text-shadow: 0 0 5px rgba(204,204,204,0.3); }
.terminal-line.color-yellow { color: #ffff55; text-shadow: 0 0 5px rgba(255,255,85,0.4); }
.terminal-line.color-cyan { color: #55ffff; text-shadow: 0 0 5px rgba(85,255,255,0.4); }
.terminal-line.color-red { color: #ff5555; text-shadow: 0 0 5px rgba(255,85,85,0.4); }
.terminal-line.color-magenta { color: #ff55ff; text-shadow: 0 0 5px rgba(255,85,255,0.4); }
.terminal-line.color-bright-green { color: #55ff55; text-shadow: 0 0 8px rgba(85,255,85,0.5); }
.terminal-line.color-bright-white { color: #fff; text-shadow: 0 0 6px rgba(255,255,255,0.4); }

/* --- Input line --- */
.input-line {
    display: flex;
    align-items: center;
    white-space: pre;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.4);
}

.input-prompt { flex-shrink: 0; color: #33ff33; }
.input-text { color: #33ff33; }

/* --- Blinking cursor --- */
.blink-cursor {
    animation: blink 1s step-end infinite;
    color: #33ff33;
    text-shadow: 0 0 5px rgba(51, 255, 51, 0.6);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes flicker {
    0%   { opacity: 0.98; }
    5%   { opacity: 1; }
    10%  { opacity: 0.98; }
    15%  { opacity: 1; }
    100% { opacity: 1; }
}

/* --- Hidden input --- */
.hidden-input {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    width: 1px;
    height: 1px;
    border: none;
    outline: none;
    background: transparent;
    color: transparent;
    font-size: 16px;
}

/* --- Footer --- */
.footer-bar {
    text-align: center;
    padding: 6px 0;
    flex-shrink: 0;
}

.footer-bar span {
    font-size: 11px;
    color: #444;
    letter-spacing: 1px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .page-wrapper { padding: 6px 8px; }
    .terminal-screen { font-size: 13px; padding: 10px 12px; }
    .crt-monitor { border-radius: 10px; border-width: 2px; }
    .header-brand .brand-title { font-size: 11px; }
}

@media (max-width: 480px) {
    .terminal-screen { font-size: 11px; padding: 8px; line-height: 1.3; }
}

/* --- Blazor error UI --- */
#blazor-error-ui {
    background: darkred;
    color: white;
    padding: 8px;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

code {
    color: #c02d76;
}
