/* =========================================
   CCTV Command Center - Dark Modern Theme
   File: assets/grid.css
   ========================================= */

:root {
    --bg-color: #050507;
    --card-bg: #121216;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00d2ff;
    --success-color: #00ff88;
    --danger-color: #ff3b3b;
    --glass: rgba(20, 20, 25, 0.7);
    --border: 1px solid rgba(255, 255, 255, 0.08);
}

/* 🌙 Global Styles */
body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding-top: 80px; /* Space for fixed header */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-image: radial-gradient(circle at 50% 0%, #1a1a2e 0%, #050507 60%);
}

/* 🛸 Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
    box-sizing: border-box;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.site-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.menu-buttons a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 20px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.menu-buttons a.active, .menu-buttons a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 📹 Grid Layout */
.content {
    flex: 1;
    padding: 30px 5%;
    width: 100%;
    box-sizing: border-box;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

/* 🃏 CCTV Card */
.cctv-card {
    background: var(--card-bg);
    border: var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.cctv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.cctv-header {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e0e0;
    border-bottom: var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
}

/* 🎞️ Video Container */
.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
}

video {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
}

/* 🔴🟢 Status Badges */
.status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    z-index: 2;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.status-badge.online {
    background: rgba(0, 255, 136, 0.15);
    color: var(--success-color);
    border: 1px solid rgba(0, 255, 136, 0.3);
    animation: pulse-green 2s infinite;
}

.status-badge.offline {
    background: rgba(255, 59, 59, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(255, 59, 59, 0.3);
}

/* ⚠️ Error Overlay */
.error-msg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #08080a;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.error-msg img {
    width: 50px;
    opacity: 0.5;
    margin-bottom: 10px;
}

.error-msg span {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* 🔢 Pagination */
.pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.pagination a {
    color: var(--text-secondary);
    padding: 8px 14px;
    text-decoration: none;
    background: var(--card-bg);
    border: var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.pagination a:hover, .pagination a.active {
    background: var(--text-primary);
    color: #000;
    border-color: var(--text-primary);
}

/* 🦶 Footer & Global Bar */
footer {
    margin-top: auto;
    border-top: var(--border);
    background: #08080a;
    padding: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.global-status-bar {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 8px 20px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    font-weight: 500;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}
.dot.green { background: var(--success-color); box-shadow: 0 0 8px var(--success-color); }
.dot.red { background: var(--danger-color); }

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 136, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* Toast Notification */
.toast-status {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #fff;
    color: #000;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease-out;
    z-index: 9999;
}
@keyframes slideIn { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Mobile Tweaks */
@media (max-width: 768px) {
    .site-header { padding: 0 20px; }
    .site-header h2 { display: none; }
    .site-header::before { content: 'CCTV BANJAR'; font-weight: bold; color: #fff; } 
    .grid { grid-template-columns: 1fr; }
}