/* ============================================================
   ChocoFly — Retro-futuristic CRT Terminal Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=VT323&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
    --amber:       #FFBF00;
    --amber-dim:   #cc9600;
    --amber-glow:  rgba(255,191,0,0.15);
    --amber-bright:#FFD740;
    --bg:          #0a0700;
    --bg-panel:    #0f0c00;
    --scanline:    rgba(0,0,0,0.18);
    --crt-flicker: rgba(255,191,0,0.03);
    --border:      rgba(255,191,0,0.35);
    --green:       #00ff80;
    --red:         #ff5050;
    --font-mono:   'Share Tech Mono', 'Courier New', monospace;
    --font-vt:     'VT323', monospace;
}

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

html, body {
    width: 100%; height: 100%;
    background: #000;
    overflow: hidden;
    font-family: var(--font-mono);
}

/* ── Main Layout ────────────────────────────────────────────── */
body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: radial-gradient(ellipse at center, #1a1000 0%, #000 70%);
}

/* ── Monitor Bezel ──────────────────────────────────────────── */
.monitor-wrap {
    width: 98vw;
    max-width: 1300px;
    height: 97vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #1c1505 0%, #0a0800 60%, #000 100%);
    border: 3px solid #3a2c00;
    border-radius: 18px;
    box-shadow:
        0 0 0 6px #1a1200,
        0 0 40px rgba(255,191,0,0.12),
        0 0 120px rgba(255,150,0,0.06),
        inset 0 0 30px rgba(0,0,0,0.8);
    padding: 12px;
    position: relative;
    overflow: hidden;
}

/* ── Scanline overlay ───────────────────────────────────────── */
.monitor-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 3px,
        var(--scanline) 3px,
        var(--scanline) 4px
    );
    pointer-events: none;
    z-index: 10;
    border-radius: 18px;
}

/* ── CRT phosphor glow edge ─────────────────────────────────── */
.monitor-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 50%,
        transparent 60%,
        rgba(0,0,0,0.5) 100%);
    pointer-events: none;
    z-index: 11;
    border-radius: 18px;
}

/* ── Header Bar ─────────────────────────────────────────────── */
.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px 10px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-brand .plane-icon {
    font-size: 1.4rem;
    animation: planePulse 3s ease-in-out infinite;
}

@keyframes planePulse {
    0%, 100% { opacity: 1; transform: translateX(0); }
    50%       { opacity: 0.7; transform: translateX(3px); }
}

.header-brand .brand-name {
    font-family: var(--font-vt);
    font-size: 1.6rem;
    color: var(--amber);
    letter-spacing: 4px;
    text-shadow: 0 0 10px var(--amber), 0 0 20px rgba(255,191,0,0.5);
}

.header-dots {
    display: flex;
    gap: 8px;
    align-items: center;
}

.dot {
    width: 11px; height: 11px;
    border-radius: 50%;
    display: inline-block;
}
.dot.red    { background: #ff5f57; box-shadow: 0 0 6px #ff5f57; }
.dot.yellow { background: #ffbd2e; box-shadow: 0 0 6px #ffbd2e; }
.dot.green  { background: #28c841; box-shadow: 0 0 6px #28c841; }

.status-text {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--amber-dim);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ── Terminal Container ─────────────────────────────────────── */
.terminal-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bg);
}

/* xterm.js host */
#terminal {
    width: 100%;
    height: 100%;
}

/* Fix xterm internal sizing */
.terminal-container .xterm {
    padding: 12px 16px;
}

/* ── Footer Bar ─────────────────────────────────────────────── */
.footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.footer-info {
    font-size: 0.62rem;
    color: var(--amber-dim);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* ── Execute Button ─────────────────────────────────────────── */
.btn-execute {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    background: transparent;
    border: 2px solid var(--amber);
    color: var(--amber);
    font-family: var(--font-vt);
    font-size: 1.25rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    box-shadow: 0 0 10px rgba(255,191,0,0.2), inset 0 0 10px rgba(255,191,0,0.03);
    overflow: hidden;
}

.btn-execute::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,191,0,0.08), transparent);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
}

.btn-execute:hover::before { transform: translateX(100%); }

.btn-execute:hover {
    background: rgba(255,191,0,0.12);
    box-shadow: 0 0 20px rgba(255,191,0,0.5), 0 0 40px rgba(255,191,0,0.2), inset 0 0 15px rgba(255,191,0,0.08);
    color: var(--amber-bright);
    border-color: var(--amber-bright);
}

.btn-execute:active {
    transform: scale(0.97);
    box-shadow: 0 0 8px rgba(255,191,0,0.4);
}

.btn-execute.running {
    border-color: var(--green);
    color: var(--green);
    animation: runningPulse 1s ease-in-out infinite;
    cursor: not-allowed;
}

@keyframes runningPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(0,255,128,0.3); }
    50%       { box-shadow: 0 0 25px rgba(0,255,128,0.7); }
}

.btn-icon { font-size: 1rem; }

/* ── Boot animation overlay ─────────────────────────────────── */
#boot-overlay {
    position: absolute;
    inset: 0;
    background: var(--bg);
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: opacity 0.6s ease;
    border-radius: 6px;
}

#boot-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.boot-logo {
    font-family: var(--font-vt);
    font-size: 3.5rem;
    color: var(--amber);
    text-shadow: 0 0 20px var(--amber), 0 0 50px rgba(255,191,0,0.5);
    letter-spacing: 6px;
    animation: logoBlink 0.8s step-end infinite;
}

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

.boot-msg {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--amber-dim);
    letter-spacing: 3px;
}

.boot-bar-wrap {
    width: 300px;
    height: 6px;
    background: rgba(255,191,0,0.1);
    border: 1px solid var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.boot-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--amber-dim), var(--amber));
    box-shadow: 0 0 8px var(--amber);
    transition: width 0.05s linear;
}

/* ── Flicker animation (subtle) ─────────────────────────────── */
@keyframes crtFlicker {
    0%   { opacity: 1; }
    92%  { opacity: 1; }
    93%  { opacity: 0.92; }
    94%  { opacity: 1; }
    96%  { opacity: 0.95; }
    100% { opacity: 1; }
}

.monitor-wrap { animation: crtFlicker 8s infinite; }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--amber-dim); border-radius: 3px; }
