/* Terminal Portfolio - Ultimate Enhanced Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #141414;
    --text-primary: #00dd00;
    --text-secondary: #00bb00;
    --text-dim: #006600;
    --accent: #00ff41;
    --warning: #ffee00;
    --error: #ff6b6b;
    --info: #6699ff;
    --border: #1a1a1a;
    --glow: rgba(0, 221, 0, 0.3);
    --glow-strong: rgba(0, 255, 65, 0.5);
}

/* Amber Theme */
.theme-amber {
    --text-primary: #ffb000;
    --text-secondary: #cc8800;
    --text-dim: #664400;
    --accent: #ffc000;
    --glow: rgba(255, 176, 0, 0.3);
    --glow-strong: rgba(255, 192, 0, 0.5);
}

/* Blue Theme */
.theme-blue {
    --text-primary: #00aaff;
    --text-secondary: #0088cc;
    --text-dim: #004466;
    --accent: #00ccff;
    --glow: rgba(0, 170, 255, 0.3);
    --glow-strong: rgba(0, 204, 255, 0.5);
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow: hidden;
}

/* ========== BOOT SCREEN ========== */
.boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.boot-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-content {
    text-align: center;
    max-width: 90%;
}

.boot-ascii {
    color: var(--accent);
    font-size: 8px;
    line-height: 1.1;
    text-shadow: 0 0 20px var(--glow);
    animation: bootGlow 1.5s ease-in-out infinite;
    white-space: pre;
    overflow: hidden;
}

@keyframes bootGlow {
    0%, 100% { text-shadow: 0 0 20px var(--glow); opacity: 0.8; }
    50% { text-shadow: 0 0 40px var(--glow-strong); opacity: 1; }
}

.boot-text {
    color: var(--text-primary);
    font-size: 12px;
    margin: 30px 0 20px;
    min-height: 20px;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.boot-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.progress-bar-container {
    width: 300px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--text-dim), var(--accent));
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--glow);
}

.progress-percent {
    color: var(--text-dim);
    font-size: 12px;
    min-width: 40px;
}

.boot-skip {
    color: var(--text-dim);
    font-size: 11px;
}

.boot-skip .key {
    background: var(--border);
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--text-secondary);
}

/* ========== SCANLINES & CRT ========== */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.3;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.25) 100%);
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 0.97; }
    50% { opacity: 1; }
}

/* Glitch Effect */
.glitch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    opacity: 0;
}

.glitch-overlay.active {
    animation: glitch 0.3s ease;
}

@keyframes glitch {
    0% { opacity: 0; }
    10% { opacity: 0.8; background: rgba(255, 0, 0, 0.1); transform: translateX(-5px); }
    20% { opacity: 0; transform: translateX(5px); }
    30% { opacity: 0.5; background: rgba(0, 255, 0, 0.1); transform: translateX(-3px); }
    40% { opacity: 0; transform: translateX(0); }
    50% { opacity: 0.3; background: rgba(0, 0, 255, 0.1); transform: translateY(-2px); }
    100% { opacity: 0; transform: translate(0); }
}

/* ========== TERMINAL ========== */
.terminal {
    width: 100%;
    height: calc(100vh - 28px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    position: relative;
}

.terminal-header {
    padding: 10px 20px;
    background: linear-gradient(90deg, #0d0d0d 0%, #151515 50%, #0d0d0d 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.terminal-buttons {
    display: flex;
    gap: 8px;
}

.terminal-buttons span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: block;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
}

.terminal-buttons span:hover {
    transform: scale(1.2);
    filter: brightness(1.2);
}

.btn-close { background: #ff5f57; }
.btn-minimize { background: #febc2e; }
.btn-maximize { background: #28c840; }

.terminal-title {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
}

.terminal-title .user { color: var(--accent); font-weight: 600; }
.terminal-title .separator { color: #444; }
.terminal-title .path { color: var(--info); }
.terminal-title .dot { 
    color: var(--accent); 
    margin-left: 8px;
    animation: pulse 1.5s ease-in-out infinite; 
}

.terminal-info {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    gap: 8px;
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Terminal Content */
.terminal-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    white-space: pre-wrap;
    scroll-behavior: smooth;
}

.terminal-content::-webkit-scrollbar { width: 6px; }
.terminal-content::-webkit-scrollbar-track { background: var(--bg-primary); }
.terminal-content::-webkit-scrollbar-thumb { background: #222; border-radius: 3px; }
.terminal-content::-webkit-scrollbar-thumb:hover { background: #333; }

/* Lines */
.line {
    margin-bottom: 2px;
    animation: lineIn 0.2s ease-out;
}

.line.no-animate { animation: none; }

@keyframes lineIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Text Styles */
.prompt {
    color: var(--accent);
    font-weight: 700;
    margin-right: 8px;
    text-shadow: 0 0 10px var(--glow);
}

.text { color: var(--text-primary); }
.success { color: var(--accent); font-weight: 600; }
.error { color: var(--error); }
.warning { color: var(--warning); }
.info { color: var(--info); }

.cmd {
    color: var(--warning);
    font-weight: 600;
    text-shadow: 0 0 8px rgba(255, 238, 0, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

.cmd:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

.section-title {
    color: var(--accent);
    font-weight: 700;
    margin-top: 12px;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
    display: block;
}

.tag {
    color: var(--text-secondary);
    background: rgba(0, 221, 0, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    display: inline-block;
    margin-right: 4px;
    margin-bottom: 4px;
    border: 1px solid rgba(0, 221, 0, 0.15);
    transition: all 0.2s;
}

.tag:hover {
    background: rgba(0, 221, 0, 0.15);
    transform: translateY(-1px);
}

.hint {
    color: var(--text-dim);
    font-size: 12px;
    font-style: italic;
    margin-top: 8px;
    display: block;
}

.link {
    color: var(--info);
    text-decoration: none;
    transition: all 0.2s;
}

.link:hover {
    text-decoration: underline;
    filter: brightness(1.3);
}

.progress-bar {
    display: inline-block;
    color: var(--accent);
    letter-spacing: -2px;
}

/* ========== INPUT LINE ========== */
.input-line {
    padding: 12px 20px 15px;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    margin-left: 8px;
    caret-color: transparent;
}

.terminal-input::placeholder { color: #333; }

.cursor-blink {
    color: var(--accent);
    animation: blink 1s step-end infinite;
    font-weight: bold;
    margin-left: -2px;
}

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

.input-hint {
    position: absolute;
    right: 20px;
    color: var(--text-dim);
    font-size: 11px;
    pointer-events: none;
}

/* ========== SUGGESTIONS ========== */
.suggestions {
    position: absolute;
    bottom: 60px;
    left: 20px;
    right: 20px;
    max-width: 400px;
    background: rgba(15, 15, 15, 0.98);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 0;
    display: none;
    z-index: 100;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    max-height: 300px;
    overflow-y: auto;
}

.suggestions.show {
    display: block;
    animation: slideUp 0.2s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.suggestion-item:hover,
.suggestion-item.active {
    background: rgba(0, 221, 0, 0.1);
}

.suggestion-item .cmd-name {
    color: var(--warning);
    font-weight: 600;
}

.suggestion-item .cmd-desc {
    color: var(--text-dim);
    font-size: 11px;
    text-align: right;
}

.suggestion-category {
    padding: 6px 16px;
    color: var(--text-dim);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

/* ========== STATUS BAR ========== */
.status-bar {
    height: 28px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    font-size: 11px;
    color: var(--text-dim);
    user-select: none;
}

.status-left,
.status-center,
.status-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.status-item.clickable {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}

.status-item.clickable:hover {
    background: rgba(0, 221, 0, 0.1);
    color: var(--text-primary);
}

.theme-toggle,
.sound-toggle {
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s;
}

.theme-toggle:hover,
.sound-toggle:hover {
    transform: scale(1.2);
}

.sound-toggle.muted { opacity: 0.5; }

/* ========== ASCII BANNER ========== */
.ascii-banner {
    margin-bottom: 15px;
}

.banner-text {
    color: var(--accent);
    font-size: 9px;
    line-height: 1.1;
    text-shadow: 0 0 20px var(--glow), 0 0 40px rgba(0, 255, 65, 0.2);
    animation: glowPulse 3s ease-in-out infinite;
    white-space: pre;
    overflow-x: auto;
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 20px var(--glow), 0 0 40px rgba(0, 255, 65, 0.2); }
    50% { text-shadow: 0 0 30px var(--glow), 0 0 60px rgba(0, 255, 65, 0.3); }
}

/* ========== TYPING ANIMATION ========== */
.typing-text {
    overflow: hidden;
    white-space: nowrap;
    animation: typewriter 2s steps(40) forwards;
}

@keyframes typewriter {
    from { width: 0; }
    to { width: 100%; }
}

/* ========== SHAKE EFFECT ========== */
.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    html, body { font-size: 12px; }
    .terminal-header { padding: 8px 15px; }
    .terminal-buttons { display: none; }
    .terminal-content { padding: 15px; }
    .input-line { padding: 10px 15px; }
    .banner-text, .boot-ascii { font-size: 5px; }
    .status-bar { font-size: 10px; padding: 0 10px; }
    .status-center { display: none; }
    .suggestions { left: 10px; right: 10px; }
}

@media (max-width: 480px) {
    .banner-text, .boot-ascii { font-size: 3.5px; }
    .terminal-info { display: none; }
    .status-left { display: none; }
}

/* ========== SELECTION ========== */
::selection {
    background: rgba(0, 221, 0, 0.3);
    color: #fff;
}

/* ========== FOCUS ========== */
.terminal-input:focus { outline: none; }

/* ========== SCROLLBAR FIREFOX ========== */
.terminal-content {
    scrollbar-color: #222 var(--bg-primary);
    scrollbar-width: thin;
}
