:root {
    --primary: #007bff;
    --secondary: #00d4ff;
    --dark-bg: #0d1117;
    --light-bg: #f5f7fb;
    --online: #28a745;
    --offline: #dc3545;
}

/* ✅ Global */
body {
    margin: 0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: var(--light-bg);
}
body.dark { background: var(--dark-bg); color: #fff; }

.site-header {
    position: fixed; top: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.7); color: #fff;
    backdrop-filter: blur(12px);
    padding: 12px; text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    z-index: 1000;
}
.site-header h2 { margin: 0; font-size: 1.6rem; font-weight: 600; }
.menu-buttons { margin-top: 6px; }
.menu-buttons a {
    text-decoration: none;
    padding: 6px 16px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 25px;
    font-weight: 500;
    margin: 0 6px;
    transition: all 0.3s ease;
}
.menu-buttons a.active, .menu-buttons a:hover { background: rgba(255,255,255,0.3); }

.mode-toggle {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,0.2);
    border: none; color: #fff;
    border-radius: 50%; width: 40px; height: 40px;
    cursor: pointer; font-size: 18px;
}

/* ✅ Content */
main.content {
    padding: 110px 20px 60px;
    max-width: 1400px;
    margin: auto;
}

/* ✅ Grid CCTV */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cctv-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
body.dark .cctv-card { background: #1e2228; }

.cctv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.cctv-header {
    padding: 10px;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    background: var(--primary);
    color: #fff;
    position: relative;
}

/* ✅ Status Badge dalam video */
.video-wrapper {
    position: relative;
    background: #000;
    aspect-ratio: 16/9;
    width: 100%;
    overflow: hidden;
}

.status-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    z-index: 10;
}
.status-badge.online { background: var(--online); }
.status-badge.offline { background: var(--offline); }

/* ✅ Video & Error */
video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

/* ✅ Error Overlay */
.error-msg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.7);
}
.error-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: drop-shadow(2px 2px 6px rgba(0,0,0,0.8));
}

/* ✅ Pagination */
.pagination {
    text-align: center;
    margin-top: 30px;
}
.pagination a {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 3px;
    background: #fff;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.3s;
}
.pagination a.active {
    background: var(--primary);
    color: #fff;
    font-weight: bold;
}
.pagination a:hover { background: var(--secondary); color: #fff; }

footer {
    text-align: center;
    padding: 12px;
    font-size: 0.9rem;
    color: #666;
    background: #f1f1f1;
    margin-top: 30px;
}
body.dark footer { background: #1b1f24; color: #bbb; }


.video-wrapper {
    position: relative;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
}
/* ✅ Logo Watermark */
.video-wrapper .watermark {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 60px;          /* ukuran logo */
    opacity: 0.6;         /* transparansi */
    pointer-events: none; /* biar tidak ganggu klik video */
}

/* ✅ Jika mau pojok kanan bawah */
.video-wrapper .watermark.bottom-right {
    top: auto;
    left: auto;
    bottom: 10px;
    right: 10px;
}
