/* ==============================================
   JARVIS MARK 8 — Cinematic Overlay Styles
   Iron Man / Avengers film-accurate HUD aesthetic
   ============================================== */

/* --- Overlay Container --- */
#jarvis-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: none;
    background: rgba(0, 4, 12, 0.92);
}
#jarvis-overlay.active {
    display: block;
    animation: overlay-fade-in 0.6s ease-out;
}
@keyframes overlay-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Canvas (animated arcs, grid, scanline) --- */
#jarvis-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* --- Glass Panels --- */
.jarvis-panel {
    position: absolute;
    background: rgba(0, 15, 30, 0.6);
    border: 1px solid rgba(0, 170, 255, 0.4);
    border-radius: 6px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 16px;
    color: #c8e6ff;
    font-family: 'Segoe UI', 'Inter', sans-serif;
    font-size: 0.8em;
    line-height: 1.5;
    box-shadow:
        0 0 20px rgba(0, 170, 255, 0.08),
        inset 0 0 30px rgba(0, 170, 255, 0.03);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s, transform 0.5s;
}
#jarvis-overlay.active .jarvis-panel {
    opacity: 1;
    transform: translateY(0);
}

/* Panel positions */
.jarvis-panel.top-left {
    top: 60px; left: 40px;
    width: 280px;
    transition-delay: 0.2s;
}
.jarvis-panel.top-right {
    top: 60px; right: 40px;
    width: 300px;
    transition-delay: 0.4s;
}
.jarvis-panel.bottom-center {
    bottom: 60px; left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: min(700px, 80vw);
    transition-delay: 0.6s;
}
#jarvis-overlay.active .jarvis-panel.bottom-center {
    transform: translateX(-50%) translateY(0);
}
.jarvis-panel.mid-left {
    top: 50%; left: 40px;
    transform: translateY(-50%) translateY(10px);
    width: 240px;
    transition-delay: 0.3s;
}
#jarvis-overlay.active .jarvis-panel.mid-left {
    transform: translateY(-50%) translateY(0);
}

/* --- Panel Headers --- */
.jarvis-panel-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #0af;
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    padding-bottom: 8px;
    margin-bottom: 12px;
}
.jarvis-panel-header .accent {
    color: #f80;
}

/* --- Status Bars --- */
.jarvis-status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 6px 0;
    font-size: 0.85em;
}
.jarvis-status-row .label { color: #6a8fad; }
.jarvis-status-row .value { color: #0f0; font-weight: bold; }
.jarvis-status-row .value.warn { color: #f80; }

.jarvis-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(0, 170, 255, 0.1);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.jarvis-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #0af, #0ff);
    animation: bar-fill 2s ease-out forwards;
}
.jarvis-bar-fill.orange {
    background: linear-gradient(90deg, #f80, #fa0);
}
@keyframes bar-fill {
    from { width: 0%; }
}

/* --- Response Readout --- */
#jarvis-readout {
    font-family: 'Segoe UI', sans-serif;
    font-size: 0.9em;
    line-height: 1.7;
    color: #e0f0ff;
    min-height: 60px;
}
#jarvis-readout .cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #0af;
    margin-left: 2px;
    animation: blink 0.8s step-end infinite;
}
@keyframes blink {
    50% { opacity: 0; }
}

/* --- Waveform --- */
#jarvis-waveform {
    position: absolute;
    bottom: 180px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 40px;
    opacity: 0;
    transition: opacity 0.5s 0.8s;
}
#jarvis-overlay.active #jarvis-waveform { opacity: 1; }

.waveform-bar {
    width: 3px;
    background: linear-gradient(to top, #0af, #f80);
    border-radius: 1px;
    animation: wave 1.2s ease-in-out infinite;
}

@keyframes wave {
    0%, 100% { height: 4px; }
    50%      { height: var(--max-h, 30px); }
}

/* --- Close Button --- */
#jarvis-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #0af;
    background: rgba(0, 10, 20, 0.6);
    color: #0af;
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    z-index: 600;
}
#jarvis-close:hover {
    background: #0af;
    color: #000;
    box-shadow: 0 0 20px #0af;
}

/* --- Cinematic Title --- */
#jarvis-title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4em;
    letter-spacing: 12px;
    color: #0af;
    text-shadow: 0 0 20px rgba(0, 170, 255, 0.5);
    opacity: 0;
    transition: opacity 0.8s 0.3s;
}
#jarvis-overlay.active #jarvis-title { opacity: 1; }
