:root {
    --bg-color: #0b0d12;
    --sidebar-bg: rgba(255, 255, 255, 0.02);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.4);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 20;
}

.mobile-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-left: 12px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: var(--hover-bg);
}

.close-btn {
    display: none; /* Only visible on mobile sidebar */
}

/* App Layout */
.app-container {
    display: flex;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.sidebar-backdrop {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 25;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.sidebar {
    width: 320px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 30;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.channel-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    padding: 16px;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 8px;
    border: 1px solid transparent;
}

.channel-item:hover {
    background-color: var(--hover-bg);
    transform: translateX(4px);
}

.channel-item.active {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: relative;
}

.channel-item.active::before {
    content: '';
    position: absolute;
    left: -16px;
    top: 50%;
    transform: translateY(-50%);
    height: 60%;
    width: 4px;
    background-color: var(--accent-color);
    border-radius: 0 4px 4px 0;
}

.channel-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 10px;
    margin-right: 16px;
    background: rgba(255,255,255,0.03);
    padding: 4px;
    border: 1px solid rgba(255,255,255,0.05);
}

.channel-name {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Player Area */
.player-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 32px;
    background: radial-gradient(circle at center top, #1e222b 0%, var(--bg-color) 100%);
    overflow-y: auto;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    aspect-ratio: 16/9;
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-color);
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    font-size: 1.2rem;
    font-weight: 500;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s;
    color: #fff;
    z-index: 5;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Channel Info and Controls Panel */
.channel-info-bar {
    max-width: 1200px;
    margin: 24px auto 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 32px;
}

.info-main h1 {
    font-size: 1.75rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-bottom: 4px;
}

.player-controls {
    display: flex;
    gap: 16px;
    background: rgba(255,255,255,0.03);
    padding: 12px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 600;
}

.custom-select {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%2394a3b8%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    transition: border-color 0.2s, background-color 0.2s;
}

.custom-select:hover:not(:disabled) {
    border-color: rgba(255,255,255,0.2);
    background-color: rgba(255,255,255,0.05);
}

.custom-select:focus {
    border-color: var(--accent-color);
}

.custom-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-select option {
    background: #1e222b;
    color: white;
}

/* Scrollbar styles */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-backdrop {
        display: block; /* It will be toggled via .hidden class */
    }

    .close-btn {
        display: flex;
    }

    .player-container {
        padding: 16px;
        height: calc(100vh - 57px); /* Subtract header height */
    }

    .video-wrapper {
        border-radius: 8px;
    }
    
    .channel-info-bar {
        margin: 16px auto 0;
        flex-direction: column;
        align-items: stretch;
    }

    .info-main h1 {
        font-size: 1.25rem;
    }
    
    .player-controls {
        flex-direction: row;
        width: 100%;
        padding: 12px;
    }
    
    .control-group {
        flex: 1;
    }
    
    .custom-select {
        min-width: 0;
        width: 100%;
    }
}
