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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

h1 {
    font-size: 28px;
    font-weight: 600;
}

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

.status-indicator {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
}

.status-indicator.connected {
    background: #4caf50;
}

.status-indicator.disconnected {
    background: #f44336;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
}

/* Panels */
.panel {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.panel h2 {
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Live Feed */
.live-feed {
    grid-column: span 2;
}

.video-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
}

#live-stream {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.overlay-controls button {
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.overlay-controls button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Status Grid */
.status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 5px;
}

.status-item .label {
    font-weight: 500;
    opacity: 0.8;
}

.status-item .value {
    font-weight: 600;
}

/* Statistics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    opacity: 0.8;
    text-transform: uppercase;
}

/* Detection List */
.detection-list {
    max-height: 300px;
    overflow-y: auto;
}

.detection-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detection-type {
    font-weight: 600;
    text-transform: capitalize;
}

.detection-time {
    font-size: 12px;
    opacity: 0.7;
}

.detection-zone {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    font-size: 12px;
}

/* Metrics */
.metrics-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metric label {
    min-width: 100px;
    font-size: 14px;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #8bc34a);
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: linear-gradient(90deg, #ff9800, #ffc107);
}

.progress-fill.danger {
    background: linear-gradient(90deg, #f44336, #ff5722);
}

/* Alerts */
.alert-list {
    max-height: 250px;
    overflow-y: auto;
}

.alert-item {
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 5px;
    border-left: 4px solid;
}

.alert-item.warning {
    background: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
}

.alert-item.critical {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

.alert-item.info {
    background: rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    opacity: 0.7;
    font-size: 14px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .live-feed {
        grid-column: span 1;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
    }
}