/* PROMPT Terminal Mode - CRT Terminal Overlay */

@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

/* ========================================
   Terminal Overlay Container
   ======================================== */

.terminal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.terminal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.terminal-overlay.closing {
    opacity: 0;
}

/* ========================================
   CRT Monitor Container
   ======================================== */

.terminal-crt {
    position: relative;
    width: 95vw;
    height: 90vh;
    max-width: 1400px;
    background: #0a0a0a;
    border-radius: 20px;
    padding: 30px;
    box-shadow:
        0 0 0 4px #1a1a1a,
        0 0 0 8px #0d0d0d,
        0 0 60px rgba(0, 255, 65, 0.15),
        inset 0 0 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.terminal-overlay.active .terminal-crt {
    transform: scale(1);
}

/* CRT Curvature Effect */
.terminal-crt::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: radial-gradient(
        ellipse 120% 120% at 50% 50%,
        transparent 0%,
        transparent 70%,
        rgba(0, 0, 0, 0.3) 100%
    );
    pointer-events: none;
    z-index: 10;
}

/* Scanline Effect */
.terminal-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.3) 1px,
        rgba(0, 0, 0, 0.3) 2px
    );
    pointer-events: none;
    z-index: 11;
    animation: scanline-flicker 0.1s infinite;
}

@keyframes scanline-flicker {
    0%, 100% { opacity: 0.95; }
    50% { opacity: 1; }
}

/* Screen Flicker */
.terminal-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: #050505;
    border-radius: 10px;
    overflow: hidden;
    animation: screen-flicker 8s infinite;
}

@keyframes screen-flicker {
    0%, 100% { filter: brightness(1); }
    92% { filter: brightness(1); }
    93% { filter: brightness(0.95); }
    94% { filter: brightness(1.02); }
    95% { filter: brightness(0.98); }
    96% { filter: brightness(1); }
}

/* ========================================
   Terminal Theme Colors
   ======================================== */

:root {
    --terminal-green: #00ff41;
    --terminal-green-glow: rgba(0, 255, 65, 0.4);
    --terminal-amber: #ffb000;
    --terminal-amber-glow: rgba(255, 176, 0, 0.4);
    --terminal-text: var(--terminal-green);
    --terminal-glow: var(--terminal-green-glow);
    --terminal-dim: rgba(0, 255, 65, 0.5);
    --terminal-bg: #050505;
    --terminal-accent: #ff00ff;
}

.terminal-theme-amber {
    --terminal-text: var(--terminal-amber);
    --terminal-glow: var(--terminal-amber-glow);
    --terminal-dim: rgba(255, 176, 0, 0.5);
}

/* ========================================
   Terminal Content Area
   ======================================== */

.terminal-content {
    width: 100%;
    height: calc(100% - 50px);
    overflow-y: auto;
    padding: 20px;
    color: var(--terminal-text);
    font-size: 14px;
    line-height: 1.6;
    text-shadow: 0 0 10px var(--terminal-glow);
    scrollbar-width: thin;
    scrollbar-color: var(--terminal-text) transparent;
}

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

.terminal-content::-webkit-scrollbar-track {
    background: transparent;
}

.terminal-content::-webkit-scrollbar-thumb {
    background: var(--terminal-dim);
    border-radius: 3px;
}

/* ========================================
   Terminal Output Lines
   ======================================== */

.terminal-line {
    margin-bottom: 4px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.terminal-line.command {
    color: var(--terminal-text);
}

.terminal-line.output {
    color: var(--terminal-dim);
}

.terminal-line.error {
    color: #ff4444;
    text-shadow: 0 0 10px rgba(255, 68, 68, 0.4);
}

.terminal-line.success {
    color: #44ff44;
    text-shadow: 0 0 10px rgba(68, 255, 68, 0.4);
}

.terminal-line.info {
    color: #44aaff;
    text-shadow: 0 0 10px rgba(68, 170, 255, 0.4);
}

.terminal-line.highlight {
    color: #ff00ff;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
}

.terminal-line.ascii-art {
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0;
}

/* ========================================
   Terminal Input Area
   ======================================== */

.terminal-input-wrapper {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.terminal-prompt {
    color: var(--terminal-text);
    text-shadow: 0 0 10px var(--terminal-glow);
    margin-right: 10px;
    font-weight: 500;
    white-space: nowrap;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-text);
    font-family: inherit;
    font-size: 14px;
    text-shadow: 0 0 10px var(--terminal-glow);
    caret-color: var(--terminal-text);
}

.terminal-input::placeholder {
    color: var(--terminal-dim);
    opacity: 0.5;
}

/* Blinking Cursor */
.terminal-cursor {
    display: inline-block;
    width: 10px;
    height: 18px;
    background: var(--terminal-text);
    animation: cursor-blink 1s step-end infinite;
    box-shadow: 0 0 10px var(--terminal-glow);
    margin-left: 2px;
    vertical-align: text-bottom;
}

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

/* ========================================
   Boot Sequence Animation
   ======================================== */

.terminal-boot {
    animation: boot-flicker 0.15s ease-out;
}

@keyframes boot-flicker {
    0% { opacity: 0; transform: scale(1.02); }
    20% { opacity: 1; }
    40% { opacity: 0.8; }
    60% { opacity: 1; }
    80% { opacity: 0.9; }
    100% { opacity: 1; transform: scale(1); }
}

.boot-line {
    opacity: 0;
    animation: boot-line-appear 0.05s ease-out forwards;
}

@keyframes boot-line-appear {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========================================
   Typing Animation
   ======================================== */

.typing-text {
    overflow: hidden;
    white-space: nowrap;
    animation: typing-reveal 0.5s steps(30) forwards;
}

@keyframes typing-reveal {
    from { width: 0; }
    to { width: 100%; }
}

/* ========================================
   Glitch Effect
   ======================================== */

.glitch-effect {
    animation: glitch 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) infinite;
}

@keyframes glitch {
    0% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
    100% { transform: translate(0); }
}

.glitch-line {
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--terminal-text);
    opacity: 0.8;
    z-index: 10000;
    animation: glitch-line-move 0.1s linear infinite;
}

@keyframes glitch-line-move {
    0% { top: 0; }
    100% { top: 100%; }
}

/* Page-wide glitch effect */
body.page-glitch {
    animation: page-glitch 0.5s ease-out;
}

@keyframes page-glitch {
    0% { filter: hue-rotate(0deg) saturate(1); }
    10% { filter: hue-rotate(90deg) saturate(2); transform: translateX(5px); }
    20% { filter: hue-rotate(-90deg) saturate(0.5); transform: translateX(-5px); }
    30% { filter: hue-rotate(180deg) saturate(1.5); transform: translateY(3px); }
    40% { filter: hue-rotate(-180deg) saturate(2); transform: translateY(-3px); }
    50% { filter: hue-rotate(0deg) saturate(1); transform: translate(0); }
    60% { filter: hue-rotate(45deg) saturate(1.2); transform: skewX(2deg); }
    70% { filter: hue-rotate(-45deg) saturate(0.8); transform: skewX(-2deg); }
    80% { filter: hue-rotate(0deg) saturate(1); transform: skewX(0); }
    100% { filter: none; transform: none; }
}

/* ========================================
   Matrix Rain Effect
   ======================================== */

.matrix-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1;
    color: #00ff41;
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.8);
    white-space: nowrap;
    writing-mode: vertical-rl;
    animation: matrix-fall linear infinite;
}

@keyframes matrix-fall {
    0% { transform: translateY(0); }
    100% { transform: translateY(200vh); }
}

/* ========================================
   Tab Completion Dropdown
   ======================================== */

.terminal-autocomplete {
    position: absolute;
    bottom: 100%;
    left: 20px;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid var(--terminal-dim);
    border-radius: 4px;
    padding: 5px 0;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 0 20px var(--terminal-glow);
}

.terminal-autocomplete.visible {
    display: block;
}

.terminal-autocomplete-item {
    padding: 5px 15px;
    cursor: pointer;
    color: var(--terminal-dim);
}

.terminal-autocomplete-item.selected,
.terminal-autocomplete-item:hover {
    background: rgba(0, 255, 65, 0.1);
    color: var(--terminal-text);
}

/* ========================================
   Help Command Styling
   ======================================== */

.help-command {
    display: inline-block;
    min-width: 180px;
    color: #ff00ff;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.4);
}

.help-description {
    color: var(--terminal-dim);
}

/* ========================================
   Bio Card Styling
   ======================================== */

.bio-card {
    border: 1px solid var(--terminal-dim);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    background: rgba(0, 255, 65, 0.02);
}

.bio-name {
    color: #ff00ff;
    font-size: 16px;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    margin-bottom: 5px;
}

.bio-role {
    color: #44aaff;
    margin-bottom: 10px;
}

/* ========================================
   Lyrics Display
   ======================================== */

.lyrics-section {
    color: #ffb000;
    text-shadow: 0 0 10px rgba(255, 176, 0, 0.4);
    margin-top: 10px;
}

.lyrics-text {
    color: var(--terminal-dim);
    margin-left: 20px;
}

/* ========================================
   Header Bar (Optional decorative)
   ======================================== */

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    margin-bottom: 10px;
}

.terminal-title {
    color: var(--terminal-text);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

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

.terminal-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--terminal-text);
    box-shadow: 0 0 10px var(--terminal-glow);
    animation: status-pulse 2s ease-in-out infinite;
}

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .terminal-crt {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
        padding: 10px;
    }

    .terminal-content {
        font-size: 12px;
        padding: 10px;
    }

    .terminal-input {
        font-size: 12px;
    }

    .terminal-line.ascii-art {
        font-size: 6px;
    }

    .help-command {
        min-width: 120px;
    }
}

/* ========================================
   Close Button
   ======================================== */

.terminal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: 1px solid var(--terminal-dim);
    color: var(--terminal-dim);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    z-index: 12;
}

.terminal-close:hover {
    color: var(--terminal-text);
    border-color: var(--terminal-text);
    box-shadow: 0 0 10px var(--terminal-glow);
}

/* ========================================
   Accent Color Themes
   ======================================== */

body[data-accent="magenta"] {
    --accent-color: #ff00ff;
}

body[data-accent="cyan"] {
    --accent-color: #00ffff;
}

body[data-accent="orange"] {
    --accent-color: #ff8800;
}

body[data-accent="violet"] {
    --accent-color: #8800ff;
}

body[data-accent="teal"] {
    --accent-color: #00ffaa;
}
