/* ============================================
   Portfolio Terminal — Styles
   ============================================ */

:root {
    /* Backgrounds */
    --bg-primary: #0b0f14;
    --bg-panel: #11161c;
    --bg-input: #0d1117;

    /* Borders */
    --border: #1b2430;

    /* Text */
    --text: #e6edf3;
    --text-secondary: #8b949e;
    --text-dim: #484f58;

    /* Accents */
    --accent-blue: #58a6ff;
    --accent-green: #7ee787;
    --accent-purple: #bc8cff;
    --accent-cyan: #76d9e6;
    --accent-red: #f85149;

    /* Typography */
    --font: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    --text-size: 13.5px;
    --line-height: 1.7;
}


/* ── Reset ── */

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

html, body {
    height: 100%;
    background: #060a0f;
    overflow: hidden;
}

body {
    font-family: var(--font);
    font-size: var(--text-size);
    line-height: var(--line-height);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

::selection {
    background: rgba(88, 166, 255, 0.2);
    color: var(--text);
}


/* ── Terminal Window ── */

.terminal {
    width: 100%;
    max-width: 1080px;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.03);
    animation: terminal-appear 0.35s ease-out;
}

@keyframes terminal-appear {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* ── Header Bar ── */

.terminal-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    user-select: none;
}

.header-controls {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red    { background: #ff5f57; }
.dot.yellow { background: #febc2e; }
.dot.green  { background: #28c840; }

.header-title {
    flex: 1;
    text-align: center;
    color: var(--text-dim);
    font-size: 12px;
    letter-spacing: 0.5px;
}

.header-spacer {
    width: 52px;
}


/* ── Content Area (split layout) ── */

.terminal-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.terminal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* Webkit scrollbar */
.terminal-body::-webkit-scrollbar { width: 6px; }
.terminal-body::-webkit-scrollbar-track { background: transparent; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.terminal-body::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }


/* ── Sidebar ── */

.terminal-sidebar {
    width: 240px;
    padding: 20px 16px;
    border-left: 1px solid var(--border);
    background: var(--bg-panel);
    overflow-y: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}

.terminal-sidebar::-webkit-scrollbar { display: none; }

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-heading {
    color: var(--text-dim);
    font-size: 11px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.sidebar-row {
    display: flex;
    padding: 2px 0;
}

.sb-key {
    color: var(--text-dim);
    min-width: 80px;
}

.sb-val {
    color: var(--text-secondary);
}

.sb-val.green {
    color: var(--accent-green);
}

.sb-link {
    color: var(--accent-blue);
    text-decoration: none;
}

.sb-link:hover {
    text-decoration: underline;
}

.sidebar-activity {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 3px 0;
}

.sb-download-btn {
    width: 100%;
    margin-top: 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 12px;
    padding: 5px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.15s, background 0.15s;
    text-align: left;
}

.sb-download-btn:hover {
    border-color: var(--accent-green);
    background: rgba(126, 231, 135, 0.06);
    color: var(--text);
}

.sb-download-btn:active {
    background: rgba(126, 231, 135, 0.12);
}

.sb-download-btn .dim {
    color: var(--accent-green);
}

.sb-download-btn .sb-dl-accent {
    color: var(--accent-blue);
}

.sb-dl-arrow {
    color: var(--accent-green);
}


/* ── Input Line ── */

.terminal-input {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid var(--border);
    background: var(--bg-input);
    flex-shrink: 0;
    gap: 0;
}

.prompt-user  { color: var(--accent-green); font-weight: 700; }
.prompt-sep   { color: var(--text-dim); }
.prompt-host  { color: var(--accent-green); }
.prompt-dir   { color: var(--accent-blue); }
.prompt-dollar { color: var(--text-dim); margin-right: 10px; }

#cmd-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: var(--font);
    font-size: var(--text-size);
    caret-color: var(--accent-green);
}


/* ── Status Bar ── */

.terminal-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 16px;
    background: #0d1520;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    flex-shrink: 0;
    user-select: none;
}

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

.status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-green);
    flex-shrink: 0;
    animation: status-blink 3s ease-in-out infinite;
}

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

#status-mode {
    color: var(--text-dim);
    letter-spacing: 0.3px;
}

.status-right {
    color: var(--text-dim);
    font-size: 10.5px;
    opacity: 0.7;
}


/* ── Welcome Box ── */
/* CSS-border box so frame never relies on character counting.
   Unicode chars (─ ╭ ↑ █) vary slightly in render width; CSS borders don't. */

.wb {
    display: inline-block;
    border: 1px solid var(--text-dim);
    border-radius: 2px;
    position: relative;
    margin: 8px 0 4px;
}

.wb-title {
    position: absolute;
    top: -0.55em;
    left: 0;
    background: var(--bg-primary);
    padding-right: 8px;
    line-height: 1;
    white-space: nowrap;
}

.wb-body {
    display: flex;
    align-items: stretch;
}

.wb-col-l {
    width: 38ch;
    padding: 2px 0;
    text-align: center;
}

.wb-col-r {
    border-left: 1px solid var(--text-dim);
    width: 33ch;
    padding: 2px 0 2px 1ch;
}

.wb-l, .wb-r {
    line-height: var(--line-height);
}


/* ── Output Styling ── */

.output-line {
    padding: 1px 0;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* Echoed command with prompt */
.output-cmd {
    margin-top: 12px;
    margin-bottom: 6px;
}

.prompt-echo  { color: var(--accent-green); font-weight: 700; }
.cmd-text     { color: var(--text); }

/* Content utility classes */
.heading       { color: var(--accent-purple); }
.highlight     { color: var(--accent-green); font-weight: 700; }
.dim           { color: var(--text-dim); }
.secondary     { color: var(--text-secondary); }
.accent        { color: var(--accent-blue); }
.accent-cyan   { color: var(--accent-cyan); }
.error         { color: var(--accent-red); }

.output-spacer {
    height: 6px;
}

.output-link {
    color: var(--accent-blue);
    text-decoration: none;
}

.output-link:hover {
    text-decoration: underline;
}


/* ── Responsive ── */

@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .terminal {
        border-radius: 0;
        border: none;
        max-height: 100%;
        animation: none;
    }

    .terminal-sidebar {
        display: none;
    }

    .status-right {
        display: none;
    }

    :root {
        --text-size: 13px;
    }

    .terminal-body {
        padding: 16px;
    }

    .terminal-input {
        padding: 10px 16px;
    }
}
