        * {
            box-sizing: border-box;
        }

        /* Dark root: avoids white/flash above body during full page loads. */
        html {
            background-color: #050505;
        }
        html:has(body[data-theme="light"]) {
            background-color: #f1f5f9;
        }

        :root {
            /* Base Colors - Dark Theme (Default) */
            --bg-color: #050505;
            --glass-bg: rgba(20, 20, 20, 0.6);
            --glass-border: rgba(255, 255, 255, 0.08);
            --text-color: #ffffff;
            --text-muted: #a0a0a0;
            --accent-color: #3b82f6;
            --accent-glow: #3b82f666;
            
            /* Dimensions */
            --header-height: 70px;
            --sidebar-width: 260px;
        }

        [data-theme="light"] {
            --bg-color: #f1f5f9;
            --glass-bg: rgba(255, 255, 255, 0.88);
            --glass-border: rgba(15, 23, 42, 0.1);
            --text-color: #0f172a;
            --text-muted: #64748b;
            --accent-color: #2563eb;
            --accent-glow: rgba(37, 99, 235, 0.28);
        }

        body {
            font-family: var(--font-sans);
            background-color: var(--bg-color);
            background-image: 
                radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(255, 0, 150, 0.05) 0%, transparent 40%);
            color: var(--text-color);
            margin: 0;
            padding: 0;
            display: flex;
            min-height: 100vh;
            overflow-x: hidden;
            /* Avoid animating background on navigation (theme is set before paint; no cross-fade needed). */
            transition: color 0.3s;
        }

        body[data-theme="light"] {
            background-image:
                radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(99, 102, 241, 0.06) 0%, transparent 40%);
        }

        /* Glassmorphism Sidebar */
        .sidebar {
            width: var(--sidebar-width);
            background: var(--glass-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            overflow-y: auto;
            z-index: 1000;
            border-right: 1px solid var(--glass-border);
            display: flex;
            flex-direction: column;
            transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .logo-area {
            padding: 25px 30px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            font-size: 20px;
            font-weight: 700;
            color: var(--text-color);
            text-decoration: none;
            letter-spacing: -0.5px;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            transform-origin: center;
        }

        .logo:hover {
            text-shadow: 0 0 10px var(--accent-glow);
        }

        .logo:active {
            transform: scale(0.9) rotate(-2deg);
            filter: drop-shadow(0 0 12px var(--accent-color));
        }

        .nav-scroll {
            flex: 1;
            padding: 20px 15px;
            overflow-y: auto;
        }
        
        .sidebar::-webkit-scrollbar { width: 5px; }
        .sidebar::-webkit-scrollbar-track { background: transparent; }
        .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }

        .nav-category {
            font-size: 12px;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 600;
            margin: 20px 15px 10px;
            letter-spacing: 1px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            padding: 14px 20px;
            color: var(--text-muted);
            text-decoration: none;
            border-radius: 12px;
            margin-bottom: 5px;
            transition: all 0.2s ease;
            font-weight: 500;
            font-size: 15px;
        }

        .nav-item:hover {
            background: rgba(255,255,255,0.05);
            color: var(--text-color);
            transform: translateX(5px);
        }

        .nav-item:active {
            transform: scale(0.98) translateX(5px);
        }

        [data-theme="light"] .nav-item:hover {
            background: rgba(59, 130, 246, 0.08);
        }

        .nav-item.active {
            background: rgba(59, 130, 246, 0.15);
            color: #60a5fa;
            border: 1px solid rgba(59, 130, 246, 0.2);
            box-shadow: 0 0 15px var(--accent-glow);
        }

        [data-theme="light"] .nav-item.active {
            background: rgba(59, 130, 246, 0.12);
            color: #1d4ed8;
            border: 1px solid rgba(37, 99, 235, 0.25);
        }

        .nav-item i {
            width: 24px;
            margin-right: 12px;
            font-size: 18px;
            text-align: center;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            margin-left: var(--sidebar-width);
            padding: 30px 40px;
            width: calc(100% - var(--sidebar-width));
            transition: margin-left 0.3s ease;
        }

        /* Mobile Header */
        .mobile-header {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 60px;
            background: var(--bg-color); /* Fallback */
            background: rgba(10, 10, 10, 0.8);
            backdrop-filter: blur(15px);
            z-index: 900;
            align-items: center;
            justify-content: space-between;
            padding: 0 15px;
            box-sizing: border-box;
            border-bottom: 1px solid var(--glass-border);
        }

        [data-theme="light"] .mobile-header {
            background: rgba(255, 255, 255, 0.92);
            border-bottom: 1px solid var(--glass-border);
        }

        .mobile-actions {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        /* 3D Icon Button Style */
        .icon-btn {
            background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
            border: 1px solid var(--glass-border);
            color: var(--text-color);
            width: 40px;
            height: 40px;
            border-radius: 50%; /* Circle */
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 4px 4px 8px rgba(0,0,0,0.6), -2px -2px 6px rgba(255,255,255,0.08);
            transition: all 0.2s ease;
            font-size: 16px;
            position: relative;
            overflow: hidden;
        }

        .icon-btn::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 100%);
        }

        [data-theme="light"] .icon-btn {
            background: linear-gradient(145deg, #ffffff, #e2e8f0);
            color: var(--accent-color);
            box-shadow: 2px 2px 8px rgba(15, 23, 42, 0.08);
            border: 1px solid var(--glass-border);
        }

        .icon-btn:active {
            box-shadow: inset 3px 3px 6px rgba(0,0,0,0.5), inset -2px -2px 4px rgba(255,255,255,0.05);
            transform: translateY(2px);
        }

        [data-theme="light"] .icon-btn:active {
            box-shadow: inset 2px 2px 6px rgba(15, 23, 42, 0.12);
        }

        /* Search Bar (Desktop) */
        .search-container {
            margin: 0 15px 25px;
            position: relative;
        }
        
        .search-input {
            width: 100%;
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--glass-border);
            padding: 12px 20px 12px 45px;
            border-radius: 12px;
            color: var(--text-color);
            font-family: var(--font-sans);
            font-size: 14px;
            box-sizing: border-box;
            transition: all 0.3s;
        }

        [data-theme="light"] .search-input {
            background: rgba(0,0,0,0.05);
            color: var(--text-color);
        }

        .search-input:focus {
            outline: none;
            background: rgba(255,255,255,0.08);
            border-color: var(--accent-color);
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
        }

        .search-icon {
            position: absolute;
            left: 15px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-muted);
            pointer-events: none;
        }

        /* Search Results Dropdown */
        .search-results {
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            background: var(--bg-color);
            border: 1px solid var(--glass-border);
            border-radius: 12px;
            margin-top: 5px;
            max-height: 300px;
            overflow-y: auto;
            z-index: 1001;
            box-shadow: 0 10px 25px rgba(0,0,0,0.5);
            display: none;
        }
        
        .search-result-item {
            padding: 10px 15px;
            border-bottom: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            text-decoration: none;
            color: var(--text-color);
            transition: background 0.2s;
        }
        
        .search-result-item:last-child {
            border-bottom: none;
        }
        
        .search-result-item:hover {
            background: rgba(255,255,255,0.05);
        }

        /* Mobile Search Overlay */
        .search-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.95); /* Darker background */
            backdrop-filter: blur(15px);
            z-index: 9999; /* Max Z-Index */
            display: none;
            flex-direction: column;
            padding: 20px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .search-overlay.active {
            display: flex;
            opacity: 1;
            visibility: visible;
        }

        .search-box-wrapper {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
            position: relative;
            z-index: 10000;
        }
        
        .search-box-wrapper input {
            flex: 1;
            background: rgba(255,255,255,0.1);
            border: none;
            padding: 15px;
            border-radius: 10px;
            color: white;
            font-size: 16px;
        }
        
        .search-box-wrapper button {
            background: var(--accent-color);
            border: none;
            color: white;
            width: 50px;
            border-radius: 10px;
            cursor: pointer;
            font-size: 18px;
        }

        /* Mobile Responsive */
        @media (max-width: 992px) {
            .desktop-only {
                display: none !important;
            }
            .mobile-only {
                display: flex !important;
            }
            
            .sidebar {
                transform: translateX(-100%);
                box-shadow: 5px 0 30px rgba(0,0,0,0.5);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .main-content {
                margin-left: 0;
                width: 100%;
                padding: 80px 20px 20px;
            }
            .mobile-header {
                display: flex;
            }
            .nav-toggle-btn {
                background: none;
                border: none;
                color: var(--text-color);
                font-size: 24px;
                cursor: pointer;
                padding: 5px;
            }
            /* Center Logo on Mobile */
            .mobile-header .logo {
                position: absolute;
                left: 0;
                right: 0;
                margin: 0 auto;
                width: fit-content;
                justify-content: center;
            }
        }

        /* Common Utility Classes for Content */
        .mobile-only { display: none; }
        
        .glass-panel {
            background: rgba(30, 30, 30, 0.4);
            border: 1px solid var(--glass-border);
            border-radius: 16px;
            padding: 20px;
            backdrop-filter: blur(10px);
        }

        [data-theme="light"] .glass-panel {
            background: rgba(255, 255, 255, 0.6);
        }

        /* Category Pills (New) */
        .category-pills {
            display: flex;
            gap: 10px;
            overflow-x: auto;
            padding-bottom: 10px;
            margin-bottom: 25px;
            scrollbar-width: none;
        }
        .category-pills::-webkit-scrollbar { display: none; }
        
        .pill {
            background: rgba(255,255,255,0.05);
            border: 1px solid var(--glass-border);
            padding: 8px 16px;
            border-radius: 50px;
            color: var(--text-muted);
            white-space: nowrap;
            font-size: 13px;
            font-weight: 500;
            transition: 0.2s;
            text-decoration: none;
        }

        [data-theme="light"] .pill {
            background: rgba(255, 255, 255, 0.85);
            color: var(--text-muted);
        }
        
        .pill:hover, .pill.active {
            background: var(--accent-color);
            color: white;
            border-color: var(--accent-color);
            box-shadow: 0 4px 15px var(--accent-glow);
        }

        [data-theme="light"] .pill:hover,
        [data-theme="light"] .pill.active {
            color: #fff;
        }
        
        .overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(3px);
            z-index: 950;
            opacity: 0;
            visibility: hidden;
            transition: 0.3s;
        }

        .overlay.active {
            opacity: 1;
            visibility: visible;
        }

        /* Mobile Search Results Independent Styling */
        .mobile-search-results {
            display: none; /* Controlled by JS */
            width: 100%;
            margin-top: 5px;
            max-height: calc(100vh - 100px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            background: transparent;
            z-index: 10000;
            position: relative;
        }

        .mobile-search-results .search-result-item {
            background: rgba(255, 255, 255, 0.08);
            margin-bottom: 8px;
            padding: 12px;
            border-radius: 12px;
            border: 1px solid var(--glass-border);
            display: flex;
            align-items: center;
            text-decoration: none;
            color: var(--text-color);
            transition: background 0.2s;
        }
        
        .mobile-search-results .search-result-item:hover {
            background: rgba(255, 255, 255, 0.15);
        }

        .mobile-search-results .search-result-item:active {
            background: rgba(255, 255, 255, 0.2);
            transform: scale(0.98);
        }

        [data-theme="light"] .mobile-search-results .search-result-item {
            background: rgba(255, 255, 255, 0.95);
            border-color: rgba(15, 23, 42, 0.1);
            color: var(--text-color);
        }

        /* --- GLOBAL CLICKY VIBE & INTERACTIVE FEEDBACK --- */
        
        /* 1. Universal Interaction Reset */
        button, a, .btn, .icon-btn, .nav-item, .pill, input[type="submit"], input[type="button"], .video-card, .video-card-premium, .trending-card, .trending-card-v2, .series-card {
            cursor: pointer;
            -webkit-tap-highlight-color: transparent; /* Remove blue overlay on mobile */
            transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), background 0.2s, color 0.2s, box-shadow 0.2s, opacity 0.2s;
        }

        /* 2. Tactile Press Effect (Scale Down) */
        button:active, a:active, .btn:active, .icon-btn:active, .pill:active {
            transform: scale(0.92) !important; /* Noticeable press */
        }

        .nav-item:active {
            transform: scale(0.96) translateX(5px) !important; /* Keep the sidebar slide but compress */
            background: rgba(255,255,255,0.1);
        }

        /* 3. Card Press Effects (Subtle to avoid jumping) */
        .video-card:active, .video-card-premium:active, .trending-card:active, .trending-card-v2:active, .series-card:active {
            transform: scale(0.98) !important;
            filter: brightness(0.9);
        }

        /* 4. Focus States for Accessibility & Visuals */
        input:focus, textarea:focus, select:focus {
            transform: scale(1.005);
            box-shadow: 0 0 0 3px var(--accent-glow);
        }

        /* 5. Scrollbar Polish */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: var(--bg-color);
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.3);
        }
