/* ==============================================
   JARVIS MARK 8 — Holographic Window System
   Draggable, resizable, floating glassmorphic windows
   ============================================== */

#holo-window-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none; /* Let clicks pass through if not on a window */
    z-index: 9000; /* Above HUD, below full overlays */
}

.holo-window {
    position: absolute;
    width: 400px;
    height: 500px;
    background: rgba(4, 10, 18, 0.7);
    border: 1px solid rgba(0, 170, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 170, 255, 0.15), inset 0 0 30px rgba(0, 170, 255, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    pointer-events: auto; /* Catch events on the window itself */
    animation: holo-spawn 0.4s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
    overflow: hidden;
    resize: both;
}

@keyframes holo-spawn {
    0% { transform: scale(0.9) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.holo-window.closing {
    animation: holo-close 0.3s cubic-bezier(0.8, 0, 0.9, 0.5) forwards;
}

@keyframes holo-close {
    100% { transform: scale(0.95); opacity: 0; }
}

/* Window Header / Drag Handle */
.holo-window-header {
    height: 32px;
    background: rgba(0, 170, 255, 0.1);
    border-bottom: 1px solid rgba(0, 170, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: grab;
    user-select: none;
}

.holo-window-header:active {
    cursor: grabbing;
}

.holo-window-title {
    color: #0af;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.holo-window-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: #0af;
    box-shadow: 0 0 8px #0af;
}

.holo-window-close {
    color: rgba(0, 170, 255, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
}

.holo-window-close:hover {
    color: #fff;
    text-shadow: 0 0 10px #0af;
    transform: scale(1.1);
}

/* Window Content (Iframe) */
.holo-window-content {
    flex: 1;
    position: relative;
    background: #000;
}

.holo-window-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.3s;
}

/* Loading Spinner */
.holo-window-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0, 170, 255, 0.2);
    border-top-color: #0af;
    border-radius: 50%;
    animation: holo-spin 1s linear infinite;
}

@keyframes holo-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* The transparent drag overlay to prevent iframe stealing mouse events during drag/resize */
.holo-drag-overlay {
    position: absolute;
    top: 32px;
    left: 0;
    width: 100%;
    height: calc(100% - 32px);
    z-index: 10;
    display: none;
}
.holo-window.dragging .holo-drag-overlay {
    display: block;
}
