@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    margin: 0;
    overflow: hidden;
    
    /* Clean Grid Background */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center top;
}

/* --- Loading Animation --- */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loader-ring {
    width: 50px; height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Custom Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* --- Glassmorphism Utilities --- */
.glass-panel {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
}

/* --- Sidebar --- */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 50;
}

.channel-item {
    transition: all 0.2s ease;
    border-radius: 8px;
    border: 1px solid transparent;
}

.channel-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.channel-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.channel-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* --- Video Player Area --- */
#video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- RESPONSIVE MOBILE LAYOUT --- */
@media (max-width: 768px) {
    body { flex-direction: column; }
    
    /* Sidebar becomes a slide-out drawer */
    #sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 280px;
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.8);
        background: #0f172a; /* Solid bg for mobile */
    }
    
    #sidebar.open {
        transform: translateX(0);
    }

    /* Backdrop when menu is open */
    #mobile-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        backdrop-filter: blur(4px);
        z-index: 40;
    }
    
    #mobile-backdrop.active {
        display: block;
    }

    /* Mobile Header (Menu Button) */
    #mobile-header {
        display: flex !important;
        position: absolute;
        top: 0; left: 0; right: 0;
        z-index: 30;
        padding: 1rem;
        background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
        pointer-events: none; /* Let clicks pass through to video */
    }
    
    #mobile-header button, #mobile-header a {
        pointer-events: auto; /* Re-enable clicks for buttons */
    }

    /* Hide Desktop specific elements */
    .desktop-only { display: none !important; }
}