/* Terminal Portfolio — CSS */

:root {
    --bg: #0a0a0a;
    --fg: #e0e0e0;
    --accent: #00ff88;
    --dim: #666666;
    --border: #333333;
    --error: #ff4444;
    --success: #44ff44;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 14px;
    overflow: hidden;
    overflow-x: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100%;
}

/* Terminal container — full screen */
#terminal-container {
    width: 100%;
    height: 100%;
    padding: 16px;
}

#terminal {
    width: 100%;
    height: 100%;
}

/* Overlay — shown before WS connect */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

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

.overlay-card {
    width: min(600px, 100% - 24px);
    max-width: 600px;
    max-height: 100%;
    overflow-y: auto;
    padding: clamp(20px, 5vw, 40px);
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
}

.overlay-card h1 {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 8px;
}

.overlay-card .subtitle {
    font-size: 16px;
    color: var(--dim);
    margin-bottom: 32px;
}

.overlay-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.opt {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
    font-family: inherit;
    font-size: 14px;
    min-height: 44px;
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s ease;
    text-align: left;
}

.opt:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 255, 136, 0.05);
}

.theme-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.theme-row span {
    color: var(--dim);
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--dim);
    font-family: inherit;
    font-size: 12px;
    min-height: 40px;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 2px;
}

.theme-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.footer {
    font-size: 12px;
    color: var(--dim);
}

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

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dim);
}


/* ---------- MC 2061: a real window, not a full-bleed black page ---------- */
html, body { height: 100%; }
body {
    display: flex; align-items: center; justify-content: center;
    padding: clamp(0px, 2.4vw, 32px);
    padding-left: max(clamp(0px, 2.4vw, 32px), env(safe-area-inset-left));
    padding-right: max(clamp(0px, 2.4vw, 32px), env(safe-area-inset-right));
    background: radial-gradient(1100px 560px at 50% -12%, #15181e 0%, transparent 62%), var(--bg);
}
#app {
    width: 100%; max-width: 1120px; height: min(88vh, 820px);
    display: flex; flex-direction: column; overflow: hidden;
    background: #0d0f12; border: 1px solid #23262c; border-radius: 10px;
    box-shadow: 0 30px 70px -30px rgba(0,0,0,.9);
}
.titlebar {
    flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 14px; background: linear-gradient(#15181d, #111318);
    border-bottom: 1px solid #23262c; font-size: 12.5px; color: #8a93a0;
}
.titlebar .path { color: #b9c2cf; }
.titlebar .path b { color: var(--accent); font-weight: 600; }
.titlebar .hint kbd {
    font: inherit; background: #1b1f26; border: 1px solid #2b3038; border-radius: 3px;
    padding: 1px 5px; color: #c3cbd6;
}
.status { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.status .led { width: 8px; height: 8px; border-radius: 50%; background: #b4871f; box-shadow: 0 0 0 3px rgba(180,135,31,.14); }
.status[data-state="online"] .led { background: var(--accent); box-shadow: 0 0 0 3px rgba(0,255,136,.14); }
.status[data-state="offline"] .led { background: #d0453b; box-shadow: 0 0 0 3px rgba(208,69,59,.14); }
#terminal-container { flex: 1 1 auto; min-height: 0; min-width: 0; padding: 12px 14px 14px; overflow: hidden; }
#terminal { width: 100%; height: 100%; }

/* ---------- MC 2318.8: phone-friendly — chip row, full-height app, no sideways scroll ---- */
.chips {
    flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px;
    padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid #23262c; background: #0f1115;
}
.chip {
    flex: 0 0 auto; white-space: nowrap; /* "just nu" is two words — never break inside a chip */
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    background: #15181e; border: 1px solid #2b3038; color: #c3cbd6;
    font: inherit; font-size: 13px; cursor: pointer; touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.chip:hover, .chip:focus-visible { border-color: var(--accent); color: var(--accent); outline: none; }
.chip:active { background: rgba(0, 255, 136, 0.08); }
@media (max-width: 760px) {
    body { padding: 0; }
    #app { height: 100%; max-width: none; border: 0; border-radius: 0; }
    .titlebar .hint { display: none; }
    .chips { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
    /* MC 2318.9: nine chips no longer fit two tidy rows at 360 px (the ninth sat alone on a
       third). One row that scrolls sideways INSIDE the nav — the page itself never scrolls
       horizontally; the chip cut off at the right edge is the affordance. */
    .chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
             -webkit-overflow-scrolling: touch; scrollbar-width: none; }
    .chips::-webkit-scrollbar { display: none; }
}
@media (min-width: 900px) {
    /* A keyboard is at hand: keep the row for discoverability, but make it quieter. */
    .chips { gap: 4px; padding: 5px 12px; }
    .chip { min-height: 26px; padding: 0 10px; font-size: 11.5px; color: #8a93a0; }
}
/* No hover on touch screens — a chip must not stay "hovered" after a tap. */
@media (hover: none) {
    .chip:hover { border-color: #2b3038; color: #c3cbd6; }
}
