/* ═══════════════════════════════════════════
   FPV Feed — Picture-in-Picture Window
   ═══════════════════════════════════════════ */

.fpv-container {
    position: fixed;
    right: 16px;
    top: 80px;
    z-index: 300;
    width: 482px;
    background: #000;
    border: 1px solid rgba(0, 229, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 229, 255, 0.08);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: opacity 0.25s, transform 0.25s;
    /* Resize */
    resize: both;
    overflow: hidden;
    min-width: 320px;
    min-height: 280px;
}
.fpv-container.fpv-visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* ─── Titlebar (drag handle) ─── */
.fpv-titlebar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(10, 14, 20, 0.95);
    border-bottom: 1px solid rgba(0, 229, 255, 0.15);
    cursor: grab;
    user-select: none;
}
.fpv-titlebar:active {
    cursor: grabbing;
}
.fpv-titlebar-icon {
    font-size: 12px;
}
.fpv-titlebar-text {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    color: var(--cyan);
    flex: 1;
}
.fpv-btn-close {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    width: 20px;
    height: 20px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}
.fpv-btn-close:hover {
    border-color: var(--red);
    color: var(--red);
}

/* ─── Viewport ─── */
.fpv-viewport {
    position: relative;
    width: 100%;
    /* Aspect ratio 4:3 */
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #000;
}
.fpv-map-wrap {
    position: absolute;
    inset: 0;
    /* Hidden but rendering — Mapbox needs visibility */
    opacity: 0;
    pointer-events: none;
}
.fpv-map-wrap .mapboxgl-canvas {
    width: 100% !important;
    height: 100% !important;
}
.fpv-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: auto;
}

/* ─── Scanline overlay (CSS-only, cheap) ─── */
.fpv-viewport::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 3px
    );
    pointer-events: none;
    z-index: 2;
}

/* ─── REC indicator blink ─── */
@keyframes fpv-rec-blink {
    0%, 60% { opacity: 1; }
    61%, 100% { opacity: 0; }
}

/* Responsive — see mobile.css for breakpoint overrides */
