/* ============================================================
   CEVOX AI — Interactive System Terminal Stylesheet
   S-TIER Retro-Futuristic Cyber Shell
   ============================================================ */

.terminal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 3, 0.9);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.terminal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.terminal-container {
    width: 900px;
    max-width: 95%;
    height: 600px;
    max-height: 85vh;
    background: rgba(8, 8, 8, 0.95);
    border: 1px solid rgba(255, 77, 0, 0.25);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 40px 100px rgba(0, 0, 0, 0.85),
        0 0 40px rgba(255, 77, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    font-family: 'JetBrains Mono', monospace;
}

/* CRT Scanline & Screen Effects */
.terminal-container::before {
    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: 30;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

/* Matrix Backdrop Canvas */
#terminal-matrix-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0.12;
    pointer-events: none;
}

/* Header */
.terminal-header {
    padding: 1rem 1.25rem;
    background: rgba(15, 15, 15, 0.9);
    border-bottom: 1px solid rgba(255, 77, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 10;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.terminal-title {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 0.1em;
    font-weight: 500;
}

.terminal-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.terminal-skip-btn {
    font-size: 0.65rem;
    font-weight: 700;
    color: #FF4D00;
    border: 1px solid rgba(255, 77, 0, 0.3);
    background: rgba(255, 77, 0, 0.05);
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.terminal-skip-btn:hover {
    background: #FF4D00;
    color: #000;
    box-shadow: 0 0 12px rgba(255, 77, 0, 0.3);
}

.terminal-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.terminal-close-btn:hover {
    color: #ef4444;
}

/* Body */
.terminal-body {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    position: relative;
    z-index: 5;
    background: rgba(5, 5, 5, 0.85);
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.85);
}

/* Log Colors */
.term-log {
    margin: 0;
}
.term-log.info { color: rgba(255, 255, 255, 0.5); }
.term-log.success { color: #10b981; }
.term-log.warn { color: #f59e0b; }
.term-log.error { color: #ef4444; }
.term-log.accent { color: #FF4D00; }
.term-log.cyan { color: #00d9ff; }
.term-log.purple { color: #a855f7; }

/* Custom prompt line */
.terminal-input-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
}

.terminal-prompt {
    color: #FF4D00;
    font-weight: bold;
    font-size: 0.85rem;
}

.terminal-input-line input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.85rem;
    outline: none;
    caret-color: #FF4D00;
}

/* Footer */
.terminal-footer {
    padding: 0.75rem 1.25rem;
    background: rgba(10, 10, 10, 0.9);
    border-top: 1px solid rgba(255, 77, 0, 0.15);
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.25);
    position: relative;
    z-index: 10;
}

.terminal-status {
    color: #10b981;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* Custom Scrollbar for Terminal */
.terminal-body::-webkit-scrollbar,
.terminal-output::-webkit-scrollbar {
    width: 4px;
}
.terminal-body::-webkit-scrollbar-track,
.terminal-output::-webkit-scrollbar-track {
    background: transparent;
}
.terminal-body::-webkit-scrollbar-thumb,
.terminal-output::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 0, 0.2);
    border-radius: 4px;
}
.terminal-body::-webkit-scrollbar-thumb:hover,
.terminal-output::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 0, 0.4);
}

@media (max-width: 640px) {
    .terminal-container {
        height: 100%;
        max-height: 96vh;
        border-radius: 8px;
    }
    .terminal-body {
        padding: 1rem;
        gap: 0.75rem;
    }
    .terminal-output {
        font-size: 0.75rem;
    }
    .terminal-input-line input {
        font-size: 0.75rem;
    }
    .terminal-prompt {
        font-size: 0.75rem;
    }
    .terminal-header {
        padding: 0.75rem 1rem;
    }
    .terminal-footer {
        padding: 0.5rem 1rem;
    }
}
