/* T-800 Vision System - Authentic HUD */

@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    font-family: 'VT323', monospace;
    color: #ffffff;
    cursor: none;
}

/* Main HUD container */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
}

/* Video element (hidden, used as source) */
#video {
    display: none;
}

/* Main canvas for rendering */
#hudCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Center status message */
.center-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 50;
    padding: 30px 50px;
    background: rgba(10, 0, 0, 0.95);
    border: 2px solid rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6), inset 0 0 20px rgba(255, 0, 0, 0.2);
}

.status-text {
    font-size: 28px;
    letter-spacing: 3px;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.9), 0 0 5px rgba(255, 255, 255, 0.5);
    margin-bottom: 10px;
    animation: pulse 2s ease-in-out infinite;
}

.status-subtext {
    font-size: 20px;
    color: #ffffff;
    letter-spacing: 2px;
    opacity: 0.9;
}

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

/* Target acquisition text - hidden (text rendered on video frame instead) */
.target-box {
    display: none !important;
}

.target-label {
    color: #ffffff;
    font-size: 22px;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(255, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.target-data {
    color: #ffffff;
    font-size: 18px;
    line-height: 24px;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.7), 0 0 3px rgba(255, 255, 255, 0.4);
}


/* Scanlines effect */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(255, 0, 0, 0.05) 51%
    );
    background-size: 100% 3px;
    z-index: 90;
    pointer-events: none;
    animation: scanlineMove 6s linear infinite;
}

@keyframes scanlineMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 3px; }
}

/* CRT flicker effect */
@keyframes flicker {
    0% { opacity: 0.95; }
    2% { opacity: 1; }
    4% { opacity: 0.97; }
    8% { opacity: 1; }
    70% { opacity: 0.96; }
    72% { opacity: 1; }
    100% { opacity: 0.95; }
}

.hud-overlay::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(255, 0, 0, 0.15) 60%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: 80;
    animation: flicker 2.5s infinite;
}

/* Red vignette for danger/alert mode */
.hud-overlay::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 30%,
        rgba(255, 0, 0, 0.25) 100%
    );
    pointer-events: none;
    z-index: 5;
    mix-blend-mode: multiply;
}

/* Instructions hint */
.instructions-hint {
    position: fixed;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 150px);
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    z-index: 60;
    padding: 10px 20px;
    background: rgba(20, 0, 0, 0.85);
    border: 1px solid rgba(255, 0, 0, 0.6);
    animation: fadeOut 5s ease-out forwards;
}

@keyframes fadeOut {
    0% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* Glitch effect */
@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 {
    animation: glitch 0.3s ease-in-out;
}

/* Text glow effect */
.text-glow {
    animation: textGlow 2s ease-in-out infinite;
}

@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 10px rgba(255, 0, 0, 0.8), 0 0 5px rgba(255, 255, 255, 0.5);
    }
    50% {
        text-shadow: 0 0 20px rgba(255, 0, 0, 1), 0 0 10px rgba(255, 255, 255, 0.8);
    }
}

/* Loading state */
.loading {
    animation: loading 1s ease-in-out infinite;
}

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

/* Scanning line animation (Terminator-style) */
.scanning-line {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(to bottom, 
        transparent,
        rgba(255, 255, 255, 0.3),
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 1),
        rgba(255, 255, 255, 0.8),
        rgba(255, 255, 255, 0.3),
        transparent
    );
    box-shadow: 
        0 0 20px rgba(255, 255, 255, 0.8),
        0 0 40px rgba(255, 255, 255, 0.6),
        0 0 60px rgba(255, 255, 255, 0.4);
    z-index: 100;
    animation: scan 2s linear infinite;
    pointer-events: none;
}

@keyframes scan {
    0% {
        top: 0;
    }
    100% {
        top: 100%;
    }
}

/* Bottom status bar - unified status display */
.bottom-status-bar {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    text-align: center;
}

.bottom-status-bar .status-text {
    font-size: 32px;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.7), 0 0 3px rgba(255, 255, 255, 0.4);
}

.bottom-status-bar .status-text.blink {
    animation: blink 1s ease-in-out infinite;
}

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

/* Legacy conversation status - hidden, replaced by bottom bar */
.conversation-status {
    display: none !important;
}

.status-label {
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
    margin-bottom: 10px;
}

.status-action {
    font-size: 20px;
    color: #ffffff;
    letter-spacing: 2px;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8);
    animation: pulse 2s ease-in-out infinite;
}

/* Listening indicator - hidden, replaced by bottom status bar */
.listening-indicator {
    display: none !important;
}

.listening-indicator .pulse {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    animation: pulseBorder 1.5s ease-in-out infinite;
    position: relative;
}

.listening-indicator .pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

@keyframes pulseBorder {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }
}

.listening-indicator .text {
    font-size: 24px;
    color: #ffffff;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.9), 0 0 8px rgba(255, 255, 255, 0.6);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .readout {
        font-size: 14px;
        line-height: 20px;
        padding: 10px;
    }
    
    .status-text {
        font-size: 22px;
    }
    
    .capture-body {
        flex-direction: column;
    }
    
    #capturedImage {
        max-width: 100%;
    }
}
