/* ============================================
   NAS TV - IPTV Viewer
   Premium Dark Theme v2.0 - by 1Touch.Pro
   ============================================ */

/* === CSS Variables === */
:root {
    --bg-primary: #060a13;
    --bg-secondary: #0c1220;
    --bg-tertiary: #131c2e;
    --bg-card: #172038;
    --bg-hover: #1c2b4a;
    --bg-active: #1a3462;
    
    --text-primary: #edf2f7;
    --text-secondary: #8b9dc3;
    --text-muted: #536587;
    
    --accent-1: #6366f1;
    --accent-2: #818cf8;
    --accent-3: #a78bfa;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --accent-gradient-2: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --live-red: #ef4444;
    
    --glass: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    
    --sidebar-width: 350px;
    --topbar-height: 56px;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.2);
    
    --transition: 0.2s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Reset === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* === Loading Screen === */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    overflow: hidden;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.loading-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.tv-icon {
    display: inline-block;
    position: relative;
    animation: tvFloat 3s ease-in-out infinite;
}

.tv-screen {
    width: 88px;
    height: 60px;
    background: var(--accent-gradient);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.5), 0 0 80px rgba(139, 92, 246, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.tv-screen::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 53%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 20px solid rgba(255, 255, 255, 0.85);
    border-top: 13px solid transparent;
    border-bottom: 13px solid transparent;
    filter: drop-shadow(0 0 6px rgba(255,255,255,0.4));
}

.tv-scanline {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 30%, rgba(255,255,255,0.06) 50%, transparent 70%);
    animation: scanline 2s linear infinite;
}

@keyframes scanline {
    0% { top: -100%; }
    100% { top: 200%; }
}

.tv-stand {
    width: 28px;
    height: 8px;
    background: linear-gradient(to right, var(--accent-1), var(--accent-3));
    border-radius: 0 0 6px 6px;
    margin: 0 auto;
    opacity: 0.5;
}

@keyframes tvFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.02); }
}

.loading-title {
    font-size: 2.4rem;
    font-weight: 900;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 20px 0 8px;
    letter-spacing: -1px;
}

.loading-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 28px;
    font-weight: 400;
}

.loading-bar {
    width: 220px;
    height: 3px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    margin: 0 auto;
    overflow: hidden;
}

.loading-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    animation: loadingProgress 1.8s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 50%; margin-left: 25%; }
    100% { width: 0%; margin-left: 100%; }
}

/* === App Layout === */
.app {
    display: flex;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.app.hidden { display: none; }

/* === Sidebar === */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition-slow), min-width var(--transition-slow), width var(--transition-slow), opacity var(--transition-slow);
    z-index: 100;
    position: relative;
}

/* Glass overlay on sidebar */
.sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(99,102,241,0.03) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

.sidebar > * { position: relative; z-index: 1; }

.sidebar.collapsed {
    min-width: 0;
    width: 0;
    overflow: hidden;
    border-right: none;
    opacity: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--glass-border);
    min-height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border-radius: var(--radius-xs);
    color: white;
    box-shadow: var(--shadow-glow);
}

.brand-icon svg {
    width: 18px;
    height: 18px;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.sidebar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.sidebar-btn svg {
    width: 16px;
    height: 16px;
}

/* === Sidebar Open Button (in topbar) === */
.sidebar-open-btn {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-xs);
    color: white;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
    flex-shrink: 0;
}

.sidebar-open-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
}

.sidebar-open-btn svg {
    width: 18px;
    height: 18px;
}

/* Hide sidebar-open-btn when sidebar is visible (on desktop) */
.app:not(.sidebar-hidden) .sidebar-open-btn {
    display: none;
}

/* On mobile, always show it */
@media (max-width: 768px) {
    .sidebar-open-btn {
        display: flex !important;
    }
}

/* === Search === */
.search-container {
    padding: 12px 14px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 15px;
    height: 15px;
    color: var(--text-muted);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 11px 36px 11px 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.84rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

#search-input::placeholder {
    color: var(--text-muted);
}

#search-input:focus {
    border-color: var(--accent-1);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 0 0 1px rgba(99,102,241,0.1);
    background: var(--bg-card);
}

.clear-search {
    position: absolute;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition);
}

.clear-search:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.clear-search svg { width: 14px; height: 14px; }
.clear-search.hidden { display: none; }

/* === Groups === */
.groups-container {
    padding: 4px 14px 10px;
}

.groups-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.groups-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
}

.channel-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-2);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.groups-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 110px;
    overflow-y: auto;
    padding-right: 4px;
}

.group-chip {
    padding: 5px 13px;
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    user-select: none;
    font-family: inherit;
}

.group-chip:hover {
    background: var(--bg-hover);
    border-color: var(--glass-border-hover);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.group-chip.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
    transform: translateY(-1px);
}

/* === Channel List === */
.channel-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
    position: relative;
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.channel-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition);
    border-radius: 0 3px 3px 0;
}

.channel-item:hover {
    background: var(--bg-hover);
}

.channel-item:active {
    transform: scale(0.98);
}

.channel-item.active {
    background: var(--bg-active);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.channel-item.active::before {
    opacity: 1;
}

.channel-item.active .channel-name {
    color: var(--accent-2);
}

.channel-logo-wrapper {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: var(--radius-xs);
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

.channel-item.active .channel-logo-wrapper {
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 12px var(--accent-glow);
}

.channel-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-logo-placeholder {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.1;
    padding: 2px;
}

.channel-info {
    flex: 1;
    min-width: 0;
}

.channel-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color var(--transition);
}

.channel-group {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.channel-radio-badge {
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--warning);
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

/* === Sidebar Footer === */
.sidebar-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--glass-border);
}

.refresh-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}

.refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.refresh-btn.loading svg {
    animation: spin 1s linear infinite;
}

.refresh-btn svg { width: 15px; height: 15px; }

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

/* === Main Content === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    min-width: 0;
    background: var(--bg-primary);
}

/* === Top Bar === */
.topbar {
    display: flex;
    align-items: center;
    padding: 0 16px;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--glass-border);
    gap: 12px;
}

.now-playing-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.live-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--live-red);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 4px 10px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 5px;
    white-space: nowrap;
}

.live-indicator.visible { display: flex; }

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--live-red);
    border-radius: 50%;
    animation: livePulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.6); }
}

.now-playing-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    gap: 6px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.topbar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--glass-border-hover);
}

.topbar-btn svg { width: 17px; height: 17px; }

/* === Player Wrapper === */
.player-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
}

/* === Welcome Screen === */
.welcome-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.welcome-screen.hidden { display: none; }

.welcome-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.welcome-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-1);
    top: -100px;
    right: -100px;
    animation: orbFloat1 8s ease-in-out infinite;
}

.orb-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-3);
    bottom: -80px;
    left: -80px;
    animation: orbFloat2 10s ease-in-out infinite;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #3b82f6;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: orbFloat3 6s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-40px, 30px) scale(1.1); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.15); }
}

@keyframes orbFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.1; }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 0.2; }
}

.welcome-content {
    text-align: center;
    padding: 40px;
    position: relative;
    z-index: 2;
    animation: welcomeFadeIn 0.8s ease;
}

@keyframes welcomeFadeIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.welcome-icon-wrapper {
    width: 110px;
    height: 110px;
    margin: 0 auto 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
                var(--accent-gradient) border-box;
    animation: ringRotate 6s linear infinite;
}

@keyframes ringRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.welcome-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-2);
}

.welcome-icon svg {
    width: 64px;
    height: 64px;
    filter: drop-shadow(0 0 16px rgba(99, 102, 241, 0.4));
}

.welcome-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
}

.welcome-content > p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.welcome-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.brand-divider {
    width: 40px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--text-muted), transparent);
}

.brand-credit {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.brand-credit strong {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700;
}

/* === Video Container === */
.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-container.hidden { display: none; }

.video-player {
    width: 100%;
    height: 100%;
    background: #000;
    outline: none;
}

/* === Player Error === */
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
    z-index: 10;
    backdrop-filter: blur(8px);
}

.player-error.hidden { display: none; }

.error-content {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.error-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger);
    background: rgba(248, 113, 113, 0.08);
    border-radius: 50%;
    border: 1px solid rgba(248, 113, 113, 0.15);
}

.error-content h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.error-content p {
    margin-bottom: 22px;
    font-size: 0.85rem;
}

.retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 26px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-glow);
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

/* === Player Loading === */
.player-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    z-index: 5;
    gap: 18px;
    backdrop-filter: blur(4px);
}

.player-loading.hidden { display: none; }

.spinner-wrapper {
    width: 48px;
    height: 48px;
    position: relative;
}

.spinner {
    position: absolute;
    inset: 0;
    border: 3px solid rgba(255, 255, 255, 0.06);
    border-top: 3px solid var(--accent-1);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-inner {
    position: absolute;
    inset: 8px;
    border: 2px solid rgba(255, 255, 255, 0.04);
    border-bottom: 2px solid var(--accent-3);
    border-radius: 50%;
    animation: spin 1.2s linear infinite reverse;
}

.player-loading p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
}

/* === Channel Info Bar === */
.channel-info-bar {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--glass-border);
}

.channel-info-bar.hidden { display: none; }

.channel-info-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-info-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    background: var(--bg-tertiary);
    border: 1px solid var(--glass-border);
}

.channel-info-details {
    flex: 1;
    min-width: 0;
}

.channel-info-details h3 {
    font-size: 0.88rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-info-details p {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.channel-info-brand {
    font-size: 0.65rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* === Sidebar Overlay === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 90;
    backdrop-filter: blur(6px);
}

.sidebar-overlay.visible { display: block; }

/* === Responsive === */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 320px;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        opacity: 1;
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .app:not(.sidebar-hidden) .sidebar-open-btn {
        display: flex;
    }

    .topbar {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    :root {
        --sidebar-width: 290px;
    }

    .channel-item {
        padding: 7px 10px;
        gap: 10px;
    }

    .channel-logo-wrapper {
        width: 34px;
        height: 34px;
        min-width: 34px;
    }

    .channel-name {
        font-size: 0.78rem;
    }
}

/* === Video controls enhancement === */
video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
}

/* Empty state when no channels found */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
    gap: 8px;
}

.no-results svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
    margin-bottom: 4px;
}

.no-results p {
    font-size: 0.82rem;
}
