/* ========================================
   Fernando Ferreira Lima — Terminal Portfolio
   Linux Terminal / CRT Green Phosphor Theme
   ======================================== */

/* --- Custom Properties --- */
:root {
    --bg: #0a0a0a;
    --bg-terminal: #0d0d0d;
    --bg-titlebar: #1a1a1a;
    --green: #00ff41;
    --green-dim: #00cc33;
    --green-dark: #009926;
    --green-glow: rgba(0, 255, 65, 0.15);
    --green-glow-strong: rgba(0, 255, 65, 0.4);
    --amber: #ffb000;
    --amber-dim: #cc8d00;
    --red: #ff3333;
    --cyan: #00ffff;
    --cyan-dim: #00cccc;
    --magenta: #ff66ff;
    --blue: #6666ff;
    --white: #e0e0e0;
    --gray: #666666;
    --gray-dim: #444444;
    --border-terminal: #333333;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Source Code Pro', 'Consolas', monospace;
    --glow-text: 0 0 10px var(--green-glow-strong), 0 0 20px var(--green-glow);
    --glow-box: 0 0 20px var(--green-glow);
}

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

html {
    font-size: 15px;
}

body {
    font-family: var(--font-mono);
    background: var(--bg);
    color: var(--green);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
}

::selection {
    background: var(--green);
    color: var(--bg);
}

/* --- CRT Effect --- */
.crt-overlay {
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.03) 0px,
        rgba(0, 0, 0, 0.03) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
}

.scanlines {
    position: fixed;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0),
        rgba(255, 255, 255, 0) 50%,
        rgba(0, 0, 0, 0.08) 50%,
        rgba(0, 0, 0, 0.08)
    );
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 9998;
    animation: scanline-move 8s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* --- Terminal Window --- */
.terminal-window {
    width: 100%;
    max-width: 900px;
    height: 85vh;
    max-height: 700px;
    background: var(--bg-terminal);
    border: 1px solid var(--border-terminal);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 
        0 0 40px rgba(0, 255, 65, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Flicker animation */
.terminal-window::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    z-index: 1;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.97; }
    5% { opacity: 0.95; }
    10% { opacity: 0.98; }
    15% { opacity: 0.96; }
    20% { opacity: 0.99; }
    50% { opacity: 0.98; }
    80% { opacity: 0.97; }
    100% { opacity: 0.99; }
}

/* Vignette */
.terminal-window::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
    pointer-events: none;
    z-index: 1;
}

/* --- Title Bar --- */
.title-bar {
    background: var(--bg-titlebar);
    border-bottom: 1px solid var(--border-terminal);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    -webkit-app-region: drag;
}

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

.btn-close {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff5f57;
    display: block;
}

.btn-minimize {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffbd2e;
    display: block;
}

.btn-maximize {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #28c840;
    display: block;
}

.title-bar-text {
    color: var(--gray);
    font-size: 0.75rem;
    text-align: center;
    flex: 1;
    user-select: none;
}

/* --- Terminal Body --- */
.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
    scrollbar-width: thin;
    scrollbar-color: var(--green-dark) var(--bg-terminal);
}

.terminal-body::-webkit-scrollbar {
    width: 6px;
}

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

.terminal-body::-webkit-scrollbar-thumb {
    background: var(--green-dark);
    border-radius: 3px;
}

/* --- Terminal Lines --- */
.t-line {
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 1.6em;
}

.t-line.empty {
    min-height: 1.6em;
}

/* Prompt */
.t-prompt {
    color: var(--green);
    text-shadow: var(--glow-text);
}

.t-path {
    color: var(--amber);
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

.t-user {
    color: var(--cyan);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

/* Command input echo */
.t-command {
    color: var(--white);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
}

/* Output text */
.t-output {
    color: var(--green-dim);
}

/* Headers / Titles */
.t-header {
    color: var(--green);
    text-shadow: var(--glow-text);
    font-weight: bold;
}

/* Accent / Highlight */
.t-accent {
    color: var(--amber);
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

.t-cyan {
    color: var(--cyan);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.t-magenta {
    color: var(--magenta);
    text-shadow: 0 0 8px rgba(255, 102, 255, 0.3);
}

.t-red {
    color: var(--red);
    text-shadow: 0 0 8px rgba(255, 51, 51, 0.3);
}

.t-dim {
    color: var(--gray);
}

.t-link {
    color: var(--cyan);
    text-decoration: underline;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.2s;
}

.t-link:hover {
    color: var(--white);
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

/* ASCII Art */
.t-ascii {
    color: var(--green);
    text-shadow: var(--glow-text);
    line-height: 1.2;
    font-size: 0.75rem;
}

/* Progress bar */
.t-progress-bar {
    display: inline-block;
}

.t-progress-fill {
    color: var(--green);
    text-shadow: 0 0 6px var(--green-glow-strong);
}

.t-progress-empty {
    color: var(--gray-dim);
}

/* Separator */
.t-separator {
    color: var(--gray-dim);
}

/* --- Input Line --- */
.input-line {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--border-terminal);
    background: rgba(0, 0, 0, 0.3);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.prompt {
    color: var(--green);
    text-shadow: var(--glow-text);
    white-space: nowrap;
    font-size: 0.9rem;
}

.prompt .path {
    color: var(--amber);
    text-shadow: 0 0 8px rgba(255, 176, 0, 0.3);
}

#cmd-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    flex: 1;
    caret-color: transparent;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
    padding: 0;
    margin-left: 4px;
}

.cursor-block {
    color: var(--green);
    animation: blink-block 1s step-end infinite;
    text-shadow: var(--glow-text);
    font-size: 0.9rem;
    margin-left: 1px;
}

@keyframes blink-block {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

