/* MediaServer - Modern Dashboard Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* Statistics Dashboard */
.statistics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h3 {
    font-size: 0.9em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    color: #667eea;
}

.stat-card.alert .stat-value {
    color: #e74c3c;
}

/* Navigation Tabs */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
    padding: 0 30px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 30px;
    font-size: 1em;
    cursor: pointer;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.controls h2 {
    color: #333;
}

.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filters select,
.filters button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9em;
    cursor: pointer;
}

.filters button {
    background: #667eea;
    color: white;
    border: none;
    transition: background 0.3s;
}

.filters button:hover {
    background: #5568d3;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.card h3 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.card .info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #666;
    font-size: 0.9em;
}

.card .status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: bold;
    margin-top: 10px;
}

.status.active {
    background: #d4edda;
    color: #155724;
}

.status.inactive {
    background: #f8d7da;
    color: #721c24;
}

/* Video Card */
.video-card {
    position: relative;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f0f0f0;
}

.event-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
    font-weight: bold;
}

/* List View (for events) */
.list-view {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.event-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-left: 4px solid #667eea;
    border-radius: 5px;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.event-item:hover {
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.event-item.severity-critical {
    border-left-color: #e74c3c;
}

.event-item.severity-high {
    border-left-color: #f39c12;
}

.event-item.severity-medium {
    border-left-color: #3498db;
}

.event-item.severity-low {
    border-left-color: #95a5a6;
}

.event-info {
    flex: 1;
}

.event-header {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
}

.event-type {
    font-weight: bold;
    color: #333;
    text-transform: capitalize;
}

.event-severity {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
}

.event-severity.critical {
    background: #e74c3c;
    color: white;
}

.event-severity.high {
    background: #f39c12;
    color: white;
}

.event-severity.medium {
    background: #3498db;
    color: white;
}

.event-severity.low {
    background: #95a5a6;
    color: white;
}

.event-details {
    color: #666;
    font-size: 0.9em;
}

.event-actions button {
    padding: 8px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.event-actions button:hover {
    background: #5568d3;
}

.event-actions button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 2em;
    cursor: pointer;
    color: #999;
}

.close:hover {
    color: #333;
}

#video-player {
    width: 100%;
    border-radius: 8px;
    margin: 20px 0;
}

.details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.details h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.details .info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.details .info-item {
    display: flex;
    flex-direction: column;
}

.details .info-item strong {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8em;
    }
    
    .statistics {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .event-item {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
}

/* Notification Badge */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s;
    z-index: 2000;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

