/* VOLLEDIGE OVERLAY LAYOUT */

.cctv-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;      /* neemt volledige viewport */
    max-height: 100%;  /* nooit hoger dan viewport */
    background: #000;
    z-index: 9999;
    box-sizing: border-box;
    min-height: 0;     /* belangrijk i.c.m. flex + scroll */
}

.cctv-overlay.active {
    display: flex;
    flex-direction: column;
    min-height: 0;     /* voorkomt “doorduwen” van de grid */
}

/* Header boven de grid */

.cctv-header {
    background: #1a1a1a;
    padding: 8px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 40px;
    box-sizing: border-box;
}

.cctv-title {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.cctv-timestamp {
    color: #999;
    font-size: 12px;
}

/* GRID zoals in popup: flex:1, scrollbaar, geen overlap */

.cctv-grid {
    flex: 1;
    max-height: 100%;
    display: grid;
    gap: 2px;
    background: #000;
    padding: 2px;
    overflow: auto;      /* scroll als er veel camera’s zijn */
    box-sizing: border-box;
    min-height: 0;
}

/* CAMERA TILE – zelfde gedrag als popup
   ⚠️ LET OP: aspect-ratio is HIER bewust WEG! */

.camera-feed {
    position: relative;
    background: #111;
    border: 1px solid #444;
    overflow: hidden;
    user-select: none;
}

.camera-feed:hover {
    border: 1px solid #2196F3;
}

/* Label & timestamp gelijk aan popup-stijl */

.camera-label {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    z-index: 3;
    border-radius: 2px;
}

.camera-timestamp {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    color: #fff;
    font-size: 11px;
    z-index: 3;
    border-radius: 2px;
}

.camera-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* NO SIGNAL hetzelfde als popup */

.no-signal {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0a;
    color: #333;
    font-size: 11px;
    flex-direction: column;
}

.no-signal-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.3;
}

/* REC-indicator */

.recording-indicator {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #f44336;
    border-radius: 50%;
    z-index: 3;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 45% { opacity: 1; }
    50%, 95% { opacity: 0.2; }
    100% { opacity: 1; }
}

/* Info-box kan blijven bestaan */

.info-box {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border-left: 4px solid #2196F3;
}

.info-box h3 {
    color: #2196F3;
    margin-bottom: 10px;
}

.info-box code {
    background: #000;
    padding: 2px 6px;
    border-radius: 3px;
    color: #4CAF50;
}

/* FULLSCREEN in overlay (met header-offset) */

.camera-feed.fullscreen {
    position: fixed;
    top: 52px;   /* zodat header zichtbaar blijft */
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    border: none;
}

.camera-feed.fullscreen .camera-label {
    font-size: 16px;
    padding: 6px 12px;
    top: 10px;
    left: 10px;
}

.camera-feed.fullscreen .camera-timestamp {
    font-size: 14px;
    padding: 6px 12px;
    bottom: 10px;
    left: 10px;
}

/* Actieknoppen */

.cctv-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.popup-btn,
.close-btn {
    padding: 6px 12px;
    background: #222;
    color: white;
    border: 1px solid #555;
    cursor: pointer;
    border-radius: 4px;
}

.popup-btn:hover,
.close-btn:hover {
    background: #444;
}

/* 🔄 LAADANIMATIE / LOADER ONDER DE HEADER */

.cctv-loading {
    flex: 1;                      /* neemt de ruimte onder de header in */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
    color: #ccc;
    font-size: 14px;
    box-sizing: border-box;
}

.cctv-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50% !important;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

/* draai-animatie voor de loader */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* generieke helper om iets te verbergen */
.hidden {
    display: none !important;
}

