/* assets/css/terminal.css */
/* CRT Terminal Overlay & Star Trek Theme console */

.terminal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 6, 8, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
}

.terminal-overlay.hidden {
    display: none;
}

/* CRT Screen Container */
.terminal-window {
    width: 90%;
    max-width: 800px;
    height: 520px;
    background: #040805;
    border: 2px solid #204020;
    border-radius: 12px;
    box-shadow: 
        0 0 30px rgba(72, 187, 120, 0.15), 
        inset 0 0 20px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    font-family: 'Share Tech Mono', 'Courier New', monospace;
    overflow: hidden;
    position: relative;
}

/* CRT Scanlines and Screen Curve Overlay */
.terminal-window::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

/* Flicker Animation */
@keyframes crt-flicker {
    0% { opacity: 0.978; }
    50% { opacity: 0.992; }
    100% { opacity: 0.985; }
}

.terminal-window {
    animation: crt-flicker 0.15s infinite;
}

/* Header styled with LCARS signature elements */
.terminal-header {
    background: #0f1c11;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #204020;
    z-index: 101;
}

.lcars-pill-group {
    display: flex;
    gap: 6px;
}

.lcars-pill {
    width: 32px;
    height: 12px;
    border-radius: 6px;
}
.lcars-pill.orange { background: #f6ad55; }
.lcars-pill.purple { background: #b794f4; }
.lcars-pill.blue { background: #63b3ed; }

.terminal-title {
    color: #48bb78;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.terminal-close {
    background: none;
    border: none;
    color: #48bb78;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}
.terminal-close:hover { 
    color: #f6ad55; 
}

/* Terminal Console Output Screen */
.terminal-output {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    color: #48bb78;
    text-shadow: 0 0 4px rgba(72, 187, 120, 0.6);
    font-size: 0.98rem;
    line-height: 1.5;
}

.terminal-output pre {
    color: #f6ad55;
    font-size: 0.58rem;
    line-height: 1.1;
    margin: 0 0 15px;
    text-shadow: 0 0 4px rgba(246, 173, 85, 0.4);
    white-space: pre-wrap;
}

.terminal-output p {
    margin: 6px 0;
    word-break: break-all;
}

.cmd-highlight {
    color: #f6ad55;
    font-weight: bold;
}

/* Prompt Line and Input */
.terminal-input-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: #020402;
    border-top: 1px solid #102010;
    z-index: 101;
}

.terminal-prompt {
    color: #b794f4;
    font-weight: bold;
    margin-right: 12px;
    letter-spacing: 1px;
}

#terminalInput {
    background: transparent;
    border: none;
    outline: none;
    color: #48bb78;
    text-shadow: 0 0 4px rgba(72, 187, 120, 0.6);
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

/* Mobile Responsiveness adjustments */
@media (max-width: 640px) {
    .terminal-window {
        width: 95%;
        height: 80vh; /* Adjusts height for on-screen touch keyboard */
    }
    
    .terminal-output {
        font-size: 0.85rem;
        padding: 12px;
    }
    
    .terminal-output pre {
        font-size: 0.4rem;
    }
    
    #terminalInput {
        font-size: 16px; /* Prevents Safari viewport auto-zoom */
    }
}
