@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0066cc;
    --primary-dark: #0052a3;
    --primary-light: #e6f2ff;
    --secondary: #1a1a2e;
    --accent: #00a8e8;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --dark-bg: #0f1419;
    --card-bg: #1a1f2e;
    --border-color: #2d3748;
    --text-primary: #f0f2f5;
    --text-secondary: #a8b0c0;
    --text-muted: #6b7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--secondary) 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 2000px;
    margin: 0 auto;
}

.header {
    background: linear-gradient(135deg, var(--card-bg) 0%, #232d3e 100%);
    padding: 28px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
    border: 1px solid var(--border-color);
}

.header h1 {
    font-size: 26px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent) 0%, #00d4ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.status {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 14px;
    background: rgba(46, 204, 113, 0.15);
    color: var(--success);
    border-radius: 6px;
    border: 1px solid rgba(46, 204, 113, 0.3);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 5px rgba(46, 204, 113, 0);
        transform: scale(1.1);
    }
}

.timestamp {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
}

.cameras-section h2 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.camera-feed {
    position: relative;
    background: linear-gradient(135deg, var(--card-bg) 0%, #1f2633 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    aspect-ratio: 16 / 9;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
}

.camera-feed:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 168, 232, 0.2);
    border-color: var(--accent);
}

.camera-feed img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #000;
}

.camera-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(10, 10, 20, 0.85);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 11px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 168, 232, 0.3);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.camera-status {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    background: rgba(46, 204, 113, 0.2);
    color: var(--success);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(46, 204, 113, 0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
}

.camera-status::before {
    content: '●';
    font-size: 6px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 49%, 100% { opacity: 1; }
    50%, 99% { opacity: 0.4; }
}

.camera-status.alert {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
    border-color: rgba(231, 76, 60, 0.4);
}


.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stats-panel,
.notifications-panel {
    background: linear-gradient(135deg, var(--card-bg) 0%, #1f2633 100%);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
}

.stats-panel h3,
.notifications-panel h3 {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#stats-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stats-item {
    padding: 10px;
    background: rgba(26, 31, 46, 0.5);
    border-radius: 6px;
    border-left: 3px solid var(--primary);
    font-size: 11px;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    border: 1px solid var(--border-color);
}

.stats-item:hover {
    background: rgba(0, 102, 204, 0.1);
    border-left-color: var(--accent);
}

.stats-item.active {
    background: rgba(46, 204, 113, 0.1);
    border-left-color: var(--success);
    color: var(--success);
}

.stats-item.alert {
    background: rgba(231, 76, 60, 0.1);
    border-left-color: var(--danger);
    color: var(--danger);
}

.stats-item-name {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 3px;
    color: var(--text-primary);
}

.stats-item-status {
    font-size: 10px;
    opacity: 0.8;
    margin-top: 2px;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.notifications-header h3 {
    margin: 0;
}

.clear-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.clear-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 102, 204, 0.3);
}

.clear-btn:active {
    transform: translateY(0);
}

.notifications-list {
    max-height: 500px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.notifications-list::-webkit-scrollbar {
    width: 5px;
}

.notifications-list::-webkit-scrollbar-track {
    background: rgba(45, 55, 72, 0.3);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb {
    background: rgba(0, 168, 232, 0.4);
    border-radius: 3px;
}

.notifications-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 168, 232, 0.6);
}

.notification-item {
    padding: 10px;
    background: rgba(0, 102, 204, 0.1);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.5;
    animation: slideIn 0.3s ease;
    border: 1px solid var(--border-color);
}

.notification-item.person {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--warning);
}

.notification-item.equipment {
    background: rgba(46, 204, 113, 0.1);
    border-left-color: var(--success);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification-message {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    font-size: 10px;
}

.notification-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px 15px;
    font-size: 11px;
    font-weight: 500;
}


/* Responsive */
@media (max-width: 1600px) {
    .camera-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 100%;
        flex-direction: row;
    }

    .stats-panel,
    .notifications-panel {
        flex: 1;
    }

    .camera-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        padding: 20px;
    }

    .header h1 {
        font-size: 20px;
    }

    .sidebar {
        flex-direction: column;
    }

    #stats-container {
        grid-template-columns: 1fr;
    }

    .camera-grid {
        grid-template-columns: 1fr;
    }

    .stats-panel,
    .notifications-panel {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 16px;
        margin-bottom: 16px;
    }

    .header h1 {
        font-size: 16px;
    }

    .main-content {
        gap: 16px;
    }

    .stats-panel,
    .notifications-panel {
        padding: 14px;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
}
