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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0d0d0d;
    color: #e0e0e0;
    min-height: 100vh;
}

header {
    background: #1a1a2e;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid #e63946;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left h1 { font-size: 1.5rem; color: #fff; }

nav { display: flex; gap: 0.5rem; }

.tab {
    background: #2a2a3e;
    border: 1px solid #444;
    color: #ccc;
    padding: 0.6rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tab:hover { background: #3a3a4e; color: #fff; }
.tab.active { background: #e63946; border-color: #e63946; color: #fff; }

main { max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem; }

.tab-content { display: none; }
.tab-content.active { display: block; }

.player-wrapper { max-width: 960px; margin: 0 auto; }

.player-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

video { width: 100%; display: block; max-height: 70vh; }

.status {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status.live { background: #e63946; color: #fff; animation: pulse 2s infinite; }
.status.offline { background: rgba(80, 80, 80, 0.8); color: #aaa; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

.stream-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #1a1a2e;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #aaa;
}

.recordings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.recordings-header h2 { font-size: 1.3rem; }

.btn-refresh {
    background: #2a2a3e;
    border: 1px solid #444;
    color: #ccc;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-refresh:hover { background: #3a3a4e; color: #fff; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.2rem;
}

.video-card {
    background: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #2a2a3e;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    border-color: #e63946;
}

.video-card .thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #1a1a2e, #2a2a3e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #e63946;
}

.video-card .info { padding: 1rem; }
.video-card .info h3 { font-size: 0.95rem; margin-bottom: 0.4rem; color: #fff; }
.video-card .info p { font-size: 0.8rem; color: #888; }

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.modal.active { display: flex; }

.modal-content { position: relative; width: 90vw; max-width: 1100px; }
.modal-content video { width: 100%; max-height: 80vh; border-radius: 8px; }

.modal-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.modal-close:hover { color: #e63946; }

.modal-title { margin-top: 0.8rem; color: #aaa; font-size: 0.9rem; text-align: center; }

.empty-state { text-align: center; padding: 3rem; color: #666; }
.empty-state p { font-size: 1.1rem; margin-top: 0.5rem; }

@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; }
    .video-grid { grid-template-columns: 1fr; }
    main { padding: 0 1rem; }
}
