/* =========================================================================
   Unicorn TV — Premium Glassmorphism Dark Theme
   Layout: Sidebar (search + categories + channels) | Full Player
   ========================================================================= */

:root {
    --bg-main: #06070a;
    --bg-sidebar: #0b0d16;
    --bg-card: rgba(18, 20, 32, 0.6);
    --bg-glass: rgba(20, 24, 40, 0.55);
    --bg-glass-active: rgba(30, 38, 64, 0.85);
    
    --border-glass: rgba(255, 255, 255, 0.06);
    --border-glass-bright: rgba(255, 255, 255, 0.12);
    
    --primary: #0ea5e9;
    --primary-glow: rgba(14, 165, 233, 0.35);
    --secondary: #8b5cf6;
    --secondary-glow: rgba(139, 92, 246, 0.3);
    --favorite: #ff477e;
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dark: #6b7280;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-body);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* =========================================================================
   MAIN LAYOUT — 2 COLUMN: SIDEBAR | PLAYER
   ========================================================================= */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background-image: 
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(14, 165, 233, 0.1) 0px, transparent 50%);
}

/* =========================================================================
   SIDEBAR — Contains everything: logo, search, menu, categories, channels
   ========================================================================= */
.sidebar {
    width: 320px;
    min-width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 100vh;
    overflow: hidden;
}

/* Logo */
.sidebar-header {
    padding: 16px 20px 12px 20px;
    flex-shrink: 0;
}

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

.logo-icon {
    font-size: 28px;
    color: var(--primary);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.logo-highlight {
    color: var(--secondary);
    filter: drop-shadow(0 0 8px var(--secondary-glow));
}

/* Unified Sidebar Search */
.sidebar-search-box {
    margin: 0 16px 10px 16px;
    position: relative;
    flex-shrink: 0;
}

.sidebar-search-box input {
    width: 100%;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 10px 36px 10px 36px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.sidebar-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
    background: var(--bg-glass-active);
}

.sidebar-search-box .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    pointer-events: none;
}

.sidebar-search-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 24px;
    height: 24px;
}

.sidebar-search-clear:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

/* Sidebar Menu (All Channels / Favorites) */
.sidebar-menu {
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.menu-item {
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    width: 100%;
    text-align: left;
}

.menu-item i {
    font-size: 18px;
}

.menu-item:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(2px);
}

.menu-item.active {
    color: var(--text-main);
    background: var(--primary-glow);
    border: 1px solid rgba(14, 165, 233, 0.25);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.1);
}

.favorite-color {
    color: var(--favorite);
}

.badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 20px;
}

/* Category Section */
.category-section {
    flex-shrink: 0;
    padding: 0 16px;
    margin-bottom: 8px;
    max-height: 160px;
    display: flex;
    flex-direction: column;
}

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

.category-header {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dark);
    white-space: nowrap;
}

.category-search-box {
    position: relative;
    flex: 1;
    max-width: 160px;
}

.category-search-box .search-icon {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dark);
    font-size: 13px;
    pointer-events: none;
}

.category-search-box input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 5px 8px 5px 26px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 11px;
    outline: none;
    transition: var(--transition);
}

.category-search-box input:focus {
    border-color: var(--primary);
    background: var(--bg-glass);
}

/* Category List */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
    flex: 1;
}

.category-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    text-align: left;
}

.category-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(3px);
}

.category-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.25) 0%, rgba(139, 92, 246, 0.2) 100%);
    font-weight: 600;
}

.category-btn .cat-count {
    font-size: 10px;
    color: var(--text-dark);
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 5px;
    border-radius: 10px;
    transition: var(--transition);
}

.category-btn.active .cat-count {
    color: var(--primary);
    background: rgba(14, 165, 233, 0.15);
}

/* =========================================================================
   CHANNEL LIST IN SIDEBAR (scrollable, fills remaining space)
   ========================================================================= */
.sidebar-channel-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid var(--border-glass);
    margin-top: 4px;
}

.channel-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 6px 16px;
    flex-shrink: 0;
}

.channel-list-title {
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.channel-list-count {
    font-size: 11px;
    color: var(--text-dark);
    font-weight: 500;
}

.channel-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 4px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Channel Card — Compact sidebar row style */
.channel-card {
    background: rgba(20, 24, 40, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.channel-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--primary);
    opacity: 0;
    transition: var(--transition);
}

.channel-card:hover {
    background: rgba(26, 31, 52, 0.65);
    border-color: var(--border-glass-bright);
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.channel-card:hover::before {
    opacity: 1;
}

.channel-card.playing {
    background: rgba(14, 165, 233, 0.08);
    border-color: rgba(14, 165, 233, 0.3);
}

.channel-card.playing::before {
    opacity: 1;
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

.channel-logo-container {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

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

.channel-logo-fallback {
    font-size: 18px;
    color: var(--text-dark);
}

.channel-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex-grow: 1;
}

.channel-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.channel-group {
    font-size: 10px;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-fav-btn {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-dark);
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    opacity: 0;
    flex-shrink: 0;
}

.channel-card:hover .card-fav-btn,
.card-fav-btn.active {
    opacity: 1;
}

.card-fav-btn:hover {
    color: var(--favorite);
    background: rgba(255, 255, 255, 0.05);
}

.card-fav-btn.active {
    color: var(--favorite);
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 8px 10px;
    flex-shrink: 0;
}

.load-more-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    outline: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    width: 100%;
    justify-content: center;
}

.load-more-btn:hover {
    background: var(--bg-glass-active);
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* =========================================================================
   MAIN CONTENT — FULL HEIGHT VIDEO PLAYER
   ========================================================================= */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100vh;
    background: #000;
}

.player-fullarea {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
}

.video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
}

#video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Hide cursor when controls are hidden */
.video-wrapper.hide-cursor {
    cursor: none;
}

/* =========================================================================
   NOW PLAYING INFO BAR (overlaid on video top)
   ========================================================================= */
.now-playing-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 12;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, transparent 100%);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.video-wrapper.show-controls .now-playing-bar {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.npb-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.npb-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.npb-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.npb-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.badge-group {
    background: rgba(139, 92, 246, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.badge-engine {
    background: rgba(14, 165, 233, 0.2);
    color: var(--primary);
    border: 1px solid rgba(14, 165, 233, 0.3);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
}

.action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    backdrop-filter: blur(8px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.action-btn.active {
    background: rgba(255, 71, 126, 0.15);
    color: var(--favorite);
    border-color: rgba(255, 71, 126, 0.3);
}

/* =========================================================================
   PLAYER OVERLAYS — Welcome / Loader / Error
   ========================================================================= */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 7, 10, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.player-overlay * {
    pointer-events: auto;
}

.player-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.welcome-icon {
    font-size: 72px;
    color: var(--primary);
    filter: drop-shadow(0 0 15px var(--primary-glow));
    animation: pulse 2s infinite ease-in-out;
}

.welcome-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
}

.welcome-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

.loader {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 10px var(--primary-glow);
}

.loader-text {
    font-size: 14px;
    color: var(--text-main);
    font-weight: 500;
}

.player-error {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
    text-align: center;
}

.error-icon {
    font-size: 54px;
    color: var(--favorite);
}

.error-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
}

.error-msg {
    color: var(--text-muted);
    font-size: 13px;
    max-width: 400px;
    margin-bottom: 6px;
}

.retry-btn {
    background: var(--favorite);
    border: none;
    outline: none;
    color: white;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.retry-btn:hover {
    background: #e12d64;
    box-shadow: 0 0 15px rgba(255, 71, 126, 0.4);
}

/* =========================================================================
   CENTER PLAY/PAUSE FLASH BUTTON
   ========================================================================= */
.center-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.center-play-btn.animate {
    animation: center-flash-animation 0.7s forwards;
}

@keyframes center-flash-animation {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6);
    }
    40% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* =========================================================================
   CUSTOM VIDEO CONTROLS (bottom overlay)
   ========================================================================= */
.video-controls-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 12;
    padding: 30px 28px 20px 28px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-wrapper.show-controls .video-controls-container {
    opacity: 1;
    transform: translateY(0);
}

.controls-gradient-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Control Buttons */
.control-btn {
    background: transparent;
    border: none;
    outline: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.control-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.1);
}

/* Data Saver Badge Button */
.control-btn.btn-badge {
    border-radius: 30px;
    width: auto;
    padding: 0 16px;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.control-btn.btn-badge i {
    font-size: 18px;
}

.control-btn.btn-badge.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.4);
}

/* Volume Slider */
.volume-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.volume-slider {
    width: 0;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s ease;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.volume-container:hover .volume-slider,
.volume-slider:active {
    width: 90px;
}

.volume-container:hover .volume-slider::-webkit-slider-thumb {
    opacity: 1;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.volume-container:hover .volume-slider::-moz-range-thumb {
    opacity: 1;
}

/* LIVE Indicator Badge */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 5px 12px;
    background: rgba(255, 71, 126, 0.15);
    border: 1px solid rgba(255, 71, 126, 0.25);
    border-radius: 6px;
    pointer-events: none;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--favorite);
    border-radius: 50%;
    animation: live-pulse-animation 1.5s infinite;
}

.live-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--favorite);
    letter-spacing: 1px;
    font-family: var(--font-heading);
}

@keyframes live-pulse-animation {
    0% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(255, 71, 126, 0.7); }
    70% { transform: scale(1.1); opacity: 1; box-shadow: 0 0 0 6px rgba(255, 71, 126, 0); }
    100% { transform: scale(0.9); opacity: 0.7; box-shadow: 0 0 0 0 rgba(255, 71, 126, 0); }
}

/* =========================================================================
   QUALITY SETTINGS POPUP
   ========================================================================= */
.player-settings-popup {
    position: absolute;
    bottom: 80px;
    right: 28px;
    background: rgba(11, 13, 22, 0.95);
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border: 1px solid var(--border-glass-bright);
    border-radius: var(--radius-md);
    width: 210px;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.05) inset;
    padding: 8px 0;
}

.player-settings-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.popup-title {
    padding: 10px 16px 6px 16px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.options-list {
    max-height: 240px;
    overflow-y: auto;
}

.options-list::-webkit-scrollbar {
    width: 4px;
}
.options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.option-item {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 16px;
    text-align: left;
    color: rgba(255,255,255,0.75);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.option-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    padding-left: 20px;
}

.option-item.active {
    color: var(--primary);
    background: rgba(14, 165, 233, 0.08);
}

.option-item.active::after {
    content: '\eb8e';
    font-family: 'boxicons';
    font-size: 18px;
    font-weight: normal;
}

/* =========================================================================
   EPG PROGRAM GUIDE TIMELINE (in now-playing-bar)
   ========================================================================= */
.epg-timeline-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.epg-program {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 140px;
    max-width: 200px;
    backdrop-filter: blur(6px);
}

.epg-label {
    font-size: 9px;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: var(--font-heading);
}

.next-program .epg-label {
    color: var(--text-dark);
}

.epg-program-details {
    display: flex;
    flex-direction: column;
}

.epg-title {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.epg-progress-bar {
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1.5px;
    margin-top: 3px;
    overflow: hidden;
}

.epg-progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 1.5px;
}

/* =========================================================================
   SKELETON LOADERS
   ========================================================================= */
.skeleton-category {
    height: 28px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 25%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.02) 75%);
    background-size: 200% 100%;
    animation: skeleton-glow 1.5s infinite;
    border-radius: 6px;
}

.skeleton-card {
    height: 58px;
    background: linear-gradient(90deg, rgba(18, 20, 32, 0.3) 25%, rgba(18, 20, 32, 0.6) 50%, rgba(18, 20, 32, 0.3) 75%);
    background-size: 200% 100%;
    animation: skeleton-glow 1.5s infinite;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-glass);
}

/* No results */
.no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--text-dark);
    text-align: center;
}

.error-text {
    color: var(--favorite);
    padding: 20px;
    text-align: center;
    font-size: 13px;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.05); opacity: 1; filter: drop-shadow(0 0 15px var(--primary)); }
    100% { transform: scale(1); opacity: 0.8; }
}

@keyframes skeleton-glow {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================================================
   ANDROID TV D-PAD SPATIAL FOCUS STYLES
   ========================================================================= */
.tv-focus {
    outline: 3px solid #00f0ff !important;
    outline-offset: 1px !important;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.5) !important;
    transform: scale(1.02) !important;
    z-index: 10 !important;
}

.channel-card.tv-focus {
    background: rgba(0, 240, 255, 0.08) !important;
    border-color: rgba(0, 240, 255, 0.3) !important;
    transform: translateX(4px) scale(1.01) !important;
}

.menu-item.tv-focus, .category-btn.tv-focus {
    background: rgba(0, 240, 255, 0.08) !important;
    color: #fff !important;
    transform: translateX(4px) !important;
}

.control-btn.tv-focus {
    background: rgba(0, 240, 255, 0.2) !important;
    color: #fff !important;
}

/* =========================================================================
   NATIVE BROWSER FULLSCREEN OVERRIDES
   ========================================================================= */
.video-wrapper:fullscreen {
    width: 100vw;
    height: 100vh;
}

.video-wrapper:fullscreen .video-controls-container {
    bottom: 20px;
    padding: 30px 40px;
    z-index: 2147483647;
}

.video-wrapper:fullscreen .player-settings-popup {
    bottom: 90px;
    right: 40px;
    z-index: 2147483647;
}

.video-wrapper:fullscreen .center-play-btn {
    z-index: 2147483647;
}

.video-wrapper:fullscreen .now-playing-bar {
    z-index: 2147483647;
}

/* Chrome/Safari native fullscreen */
.video-wrapper:-webkit-full-screen .video-controls-container {
    bottom: 20px;
    padding: 30px 40px;
    z-index: 2147483647;
}

.video-wrapper:-webkit-full-screen .player-settings-popup {
    bottom: 90px;
    right: 40px;
    z-index: 2147483647;
}

.video-wrapper:-webkit-full-screen .now-playing-bar {
    z-index: 2147483647;
}

/* =========================================================================
   RESPONSIVE: Small screens
   ========================================================================= */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        min-width: 100%;
        height: 50vh;
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }

    .app-container {
        flex-direction: column;
    }

    .main-content {
        height: 50vh;
    }
}
