
        /* ===== RESET & BASE ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            background: #0a0e1a;
            color: #f8fafc;
            font-family: 'Inter', system-ui, -apple-system, sans-serif;
            min-height: 100vh;
            overflow: hidden;
            padding-bottom: 70px;
            transition: background 0.3s ease, color 0.3s ease;
        }
        body.light-mode {
            background: #f1f5f9;
            color: #0f172a;
        }
        body.light-mode .glass {
            background: rgba(255, 255, 255, 0.7);
            border: 1px solid rgba(0, 0, 0, 0.08);
        }
        body.light-mode .channel-card {
            background: rgba(255, 255, 255, 0.8);
            border-color: rgba(0, 0, 0, 0.1);
        }
        body.light-mode .channel-card:hover {
            background: rgba(255, 255, 255, 0.95);
            border-color: #0ea5e9;
        }
        body.light-mode .bottom-nav {
            background: rgba(241, 245, 249, 0.95);
            border-top: 1px solid rgba(0, 0, 0, 0.08);
        }
        body.light-mode .nav-item {
            color: #64748b;
        }
        body.light-mode .nav-item.active {
            color: #0ea5e9;
        }
        body.light-mode .nav-item.active span {
            color: #0ea5e9;
        }
        body.light-mode .category-btn {
            background: rgba(0, 0, 0, 0.05);
            color: #64748b;
            border-color: rgba(0, 0, 0, 0.08);
        }
        body.light-mode .category-btn:hover {
            background: rgba(0, 0, 0, 0.1);
            color: #0f172a;
        }
        body.light-mode .category-btn.active {
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            color: #ffffff;
        }
        body.light-mode header {
            background: rgba(241, 245, 249, 0.95) !important;
            border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
        }
        body.light-mode .settings-panel {
            background: rgba(255, 255, 255, 0.95);
            border: 1px solid rgba(0, 0, 0, 0.1);
        }
        body.light-mode .settings-panel .setting-item {
            border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        }
        body.light-mode .settings-panel .setting-item:hover {
            background: rgba(0, 0, 0, 0.03);
        }
        body.light-mode .search-bar {
            background: rgba(0, 0, 0, 0.05) !important;
            border-color: rgba(0, 0, 0, 0.1) !important;
            color: #0f172a !important;
        }
        body.light-mode .search-bar::placeholder {
            color: #94a3b8 !important;
        }
        body.light-mode .toast {
            background: rgba(255, 255, 255, 0.95);
            color: #0f172a;
            border-color: rgba(0, 0, 0, 0.1);
        }
        body.loaded {
            overflow: auto;
        }

        /* ===== PAGE LOADER ===== */
        #pageLoader {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: radial-gradient(circle at center, #0f172a, #020617);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 99999;
            transition: opacity 0.8s ease, visibility 0.8s ease;
        }
        #pageLoader.hidden {
            opacity: 0;
            visibility: hidden;
            pointer-events: none;
        }
        .loader-logo {
            width: 100px;
            height: 100px;
            border-radius: 25px;
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 60px rgba(14, 165, 233, 0.4);
            animation: logoPulse 2s ease-in-out infinite;
            margin-bottom: 25px;
            padding: 10px;
        }
        .loader-logo img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 15px;
        }
        @keyframes logoPulse {
            0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(14, 165, 233, 0.4); }
            50% { transform: scale(1.05); box-shadow: 0 0 80px rgba(14, 165, 233, 0.6); }
        }
        .loader-title {
            font-size: 24px;
            font-weight: 800;
            background: linear-gradient(to right, #38bdf8, #818cf8);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin-bottom: 5px;
        }
        .loader-sub {
            color: #64748b;
            font-size: 11px;
            letter-spacing: 4px;
            text-transform: uppercase;
            margin-bottom: 25px;
        }
        .loader-bars {
            display: flex;
            gap: 8px;
            align-items: center;
        }
        .loader-bars span {
            width: 5px;
            height: 25px;
            border-radius: 10px;
            background: #1e293b;
            animation: barGrow 1.2s ease-in-out infinite;
        }
        .loader-bars span:nth-child(1) { animation-delay: 0s; background: #0ea5e9; }
        .loader-bars span:nth-child(2) { animation-delay: 0.15s; background: #2563eb; }
        .loader-bars span:nth-child(3) { animation-delay: 0.3s; background: #7c3aed; }
        .loader-bars span:nth-child(4) { animation-delay: 0.45s; background: #2563eb; }
        .loader-bars span:nth-child(5) { animation-delay: 0.6s; background: #0ea5e9; }
        @keyframes barGrow {
            0%, 100% { height: 25px; opacity: 0.4; }
            50% { height: 50px; opacity: 1; }
        }
        .loader-progress {
            width: 180px;
            max-width: 70%;
            height: 3px;
            background: #1e293b;
            border-radius: 10px;
            overflow: hidden;
            margin-top: 20px;
        }
        .loader-progress-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #0ea5e9, #7c3aed);
            border-radius: 10px;
            transition: width 0.3s ease;
        }
        .loader-percent {
            color: #64748b;
            font-size: 11px;
            margin-top: 8px;
            font-weight: 600;
        }

        /* ===== MAIN CONTENT ===== */
        #mainContent {
            opacity: 0;
            transition: opacity 0.8s ease;
        }
        #mainContent.visible {
            opacity: 1;
        }

        /* ===== GLASS EFFECT ===== */
        .glass {
            background: rgba(255, 255, 255, 0.03);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.05);
            transition: all 0.3s ease;
        }

        /* ===== CHANNEL CARD ===== */
        .channel-card {
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            background: rgba(15, 23, 42, 0.7);
            border: 2px solid transparent;
            position: relative;
            overflow: hidden;
            cursor: pointer;
            animation: fadeInUp 0.4s ease forwards;
            border-radius: 16px;
        }
        .channel-card::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, #0ea5e9, #7c3aed);
            transform: scaleX(0);
            transition: transform 0.3s ease;
        }
        .channel-card:hover::after {
            transform: scaleX(1);
        }
        .channel-card:hover {
            transform: translateY(-4px);
            border-color: rgba(14, 165, 233, 0.3);
            background: rgba(30, 41, 59, 0.85);
            box-shadow: 0 8px 30px rgba(14, 165, 233, 0.15);
        }
        .channel-card.active-channel {
            border-color: #0ea5e9;
            background: rgba(30, 41, 59, 0.9);
            box-shadow: 0 0 40px rgba(14, 165, 233, 0.15);
        }
        .channel-card.active-channel::after {
            transform: scaleX(1);
        }

        /* ===== CHANNEL LOGO ===== */
        .channel-logo-wrapper {
            position: relative;
            width: 100%;
            aspect-ratio: 1/1;
            max-width: 80px;
            overflow: hidden;
            border-radius: 14px;
            background: rgba(15, 23, 42, 0.8);
            border: 1px solid rgba(51, 65, 85, 0.3);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
        }
        .channel-logo-wrapper img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            padding: 8px;
            transition: transform 0.3s ease;
        }
        .channel-card:hover .channel-logo-wrapper img {
            transform: scale(1.1);
        }
        .channel-logo-wrapper .fallback-logo {
            font-size: 24px;
            font-weight: 800;
            color: white;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
        }

        /* ===== CATEGORY BUTTONS ===== */
        .category-btn {
            transition: all 0.2s ease;
            background: rgba(30, 41, 59, 0.4);
            color: #94a3b8;
            border: 1px solid rgba(51, 65, 85, 0.3);
            cursor: pointer;
            user-select: none;
            padding: 6px 14px;
            border-radius: 20px;
            font-size: 11px;
            font-weight: 600;
        }
        .category-btn:hover {
            background: rgba(51, 65, 85, 0.6);
            color: #fff;
            transform: translateY(-1px);
        }
        .category-btn.active {
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            color: #ffffff;
            border-color: transparent;
            box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
        }

        /* ===== BOTTOM NAVIGATION ===== */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(10, 14, 26, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-top: 1px solid rgba(255, 255, 255, 0.06);
            padding: 8px 0 env(safe-area-inset-bottom, 8px) 0;
            z-index: 999;
            display: flex;
            justify-content: space-around;
            align-items: center;
            height: 65px;
            transition: all 0.3s ease;
        }
        .nav-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            color: #64748b;
            transition: all 0.2s ease;
            cursor: pointer;
            padding: 4px 16px;
            border-radius: 12px;
            position: relative;
            min-width: 60px;
            background: transparent;
            border: none;
        }
        .nav-item i {
            font-size: 20px;
            transition: all 0.2s ease;
        }
        .nav-item span {
            font-size: 9px;
            font-weight: 600;
            letter-spacing: 0.3px;
            transition: all 0.2s ease;
        }
        .nav-item:hover {
            color: #94a3b8;
        }
        .nav-item.active {
            color: #0ea5e9;
        }
        .nav-item.active::before {
            content: '';
            position: absolute;
            top: -1px;
            left: 50%;
            transform: translateX(-50%);
            width: 20px;
            height: 3px;
            background: linear-gradient(90deg, #0ea5e9, #7c3aed);
            border-radius: 0 0 4px 4px;
        }
        .nav-item.active i {
            transform: scale(1.1);
        }
        .nav-item.active span {
            color: #0ea5e9;
        }
        .nav-play-btn {
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 22px;
            box-shadow: 0 4px 20px rgba(14, 165, 233, 0.4);
            transition: all 0.3s ease;
            margin-top: -20px;
            border: none;
            cursor: pointer;
        }
        .nav-play-btn:hover {
            transform: scale(1.08);
            box-shadow: 0 6px 30px rgba(14, 165, 233, 0.5);
        }
        .nav-play-btn i {
            font-size: 22px;
            margin-left: 4px;
        }

        /* ===== PLAYER CONTROL BUTTONS ===== */
        .player-controls {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        .player-control-btn {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.06);
            color: #94a3b8;
            padding: 6px 12px;
            border-radius: 10px;
            font-size: 11px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 5px;
        }
        .player-control-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
            border-color: rgba(14, 165, 233, 0.3);
        }
        .player-control-btn i {
            font-size: 13px;
        }

        /* ===== SETTINGS PANEL ===== */
        .settings-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 1000;
            display: none;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .settings-overlay.open {
            display: flex;
            animation: fadeInUp 0.3s ease;
        }
        .settings-panel {
            background: rgba(10, 14, 26, 0.95);
            backdrop-filter: blur(20px);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 24px;
            max-width: 500px;
            width: 100%;
            max-height: 85vh;
            overflow-y: auto;
            padding: 24px;
            box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
            animation: slideUp 0.3s ease;
        }
        @keyframes slideUp {
            from { transform: translateY(30px); opacity: 0; }
            to { transform: translateY(0); opacity: 1; }
        }
        .settings-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }
        .settings-header h2 {
            font-size: 18px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .settings-header h2 i {
            color: #0ea5e9;
        }
        .settings-close {
            background: rgba(255, 255, 255, 0.05);
            border: none;
            color: #94a3b8;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
        }
        .settings-close:hover {
            background: rgba(255, 255, 255, 0.1);
            color: #fff;
        }
        .setting-group {
            margin-bottom: 20px;
        }
        .setting-group-title {
            font-size: 11px;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 1px;
            margin-bottom: 8px;
        }
        .setting-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.03);
            margin-bottom: 6px;
            transition: all 0.2s ease;
            cursor: pointer;
            border: 1px solid transparent;
        }
        .setting-item:hover {
            background: rgba(255, 255, 255, 0.06);
            border-color: rgba(255, 255, 255, 0.05);
        }
        .setting-item-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .setting-item-left i {
            font-size: 16px;
            color: #0ea5e9;
            width: 24px;
            text-align: center;
        }
        .setting-item-left .label {
            font-size: 13px;
            font-weight: 500;
        }
        .setting-item-left .desc {
            font-size: 11px;
            color: #64748b;
            margin-top: 1px;
        }
        .setting-value {
            font-size: 12px;
            color: #94a3b8;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .setting-value i {
            font-size: 12px;
            color: #64748b;
        }
        .toggle-switch {
            width: 40px;
            height: 22px;
            background: #1e293b;
            border-radius: 12px;
            position: relative;
            cursor: pointer;
            transition: all 0.3s ease;
            flex-shrink: 0;
        }
        .toggle-switch.active {
            background: linear-gradient(135deg, #0ea5e9, #2563eb);
        }
        .toggle-switch .toggle-knob {
            position: absolute;
            top: 2px;
            left: 2px;
            width: 18px;
            height: 18px;
            background: white;
            border-radius: 50%;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
        .toggle-switch.active .toggle-knob {
            left: 20px;
        }

        /* ===== DEVICE BADGES ===== */
        .device-badges {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-top: 4px;
        }
        .device-badge {
            background: rgba(14, 165, 233, 0.1);
            border: 1px solid rgba(14, 165, 233, 0.15);
            padding: 4px 12px;
            border-radius: 20px;
            font-size: 10px;
            color: #0ea5e9;
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 500;
        }
        .device-badge i {
            font-size: 12px;
        }

        /* ===== VIDEOJS ===== */
        .video-js {
            font-family: 'Inter', sans-serif;
            border-radius: 16px;
            overflow: hidden;
            background: #000;
        }
        .video-js .vjs-big-play-button {
            background: rgba(14, 165, 233, 0.9) !important;
            border: none !important;
            border-radius: 50% !important;
            width: 3.5em !important;
            height: 3.5em !important;
            line-height: 3.5em !important;
            margin-top: -1.75em !important;
            margin-left: -1.75em !important;
            box-shadow: 0 0 40px rgba(14, 165, 233, 0.6);
            transition: all 0.3s ease;
        }
        .video-js:hover .vjs-big-play-button {
            background: #0ea5e9 !important;
            transform: scale(1.15);
        }
        .video-js .vjs-control-bar {
            background: rgba(0, 0, 0, 0.85) !important;
            backdrop-filter: blur(10px);
        }

        /* ===== LOADING OVERLAY ===== */
        #streamLoadingOverlay {
            background: rgba(10, 14, 26, 0.92);
            backdrop-filter: blur(16px);
        }
        .loading-ripple {
            position: relative;
            width: 60px;
            height: 60px;
        }
        .loading-ripple div {
            position: absolute;
            border: 3px solid #0ea5e9;
            border-radius: 50%;
            animation: ripple 1.5s ease-out infinite;
        }
        .loading-ripple div:nth-child(2) { animation-delay: 0.5s; }
        @keyframes ripple {
            0% { width: 0; height: 0; opacity: 1; top: 30px; left: 30px; }
            100% { width: 60px; height: 60px; opacity: 0; top: 0; left: 0; }
        }
        .loading-dots {
            display: flex;
            gap: 12px;
            align-items: center;
        }
        .loading-dots span {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: #0ea5e9;
            animation: dotPulse 1.4s ease-in-out infinite;
        }
        .loading-dots span:nth-child(2) { animation-delay: 0.2s; }
        .loading-dots span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes dotPulse {
            0%, 80%, 100% { transform: scale(0.5); opacity: 0.3; }
            40% { transform: scale(1); opacity: 1; }
        }

        /* ===== TOAST ===== */
        .toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: rgba(10, 14, 26, 0.95);
            backdrop-filter: blur(16px);
            border: 1px solid rgba(14, 165, 233, 0.2);
            padding: 12px 24px;
            border-radius: 14px;
            color: white;
            font-size: 13px;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            z-index: 9999;
            max-width: 90%;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
            pointer-events: none;
            text-align: center;
        }
        .toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ===== PROGRESS BAR ===== */
        .progress-bar-wrapper {
            width: 100%;
            height: 3px;
            background: rgba(51, 65, 85, 0.3);
            border-radius: 10px;
            overflow: hidden;
        }
        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #0ea5e9, #7c3aed);
            width: 0%;
            border-radius: 10px;
            transition: width 0.3s ease;
        }

        /* ===== ANIMATIONS ===== */
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(15px) scale(0.95); }
            to { opacity: 1; transform: translateY(0) scale(1); }
        }

        /* ===== SCROLLBAR ===== */
        ::-webkit-scrollbar { width: 4px; height: 4px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: #0ea5e9; }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 640px) {
            #channel-list { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
            .channel-card { padding: 6px; }
            .channel-logo-wrapper { max-width: 55px; border-radius: 10px; }
            .channel-logo-wrapper img { padding: 4px; }
            .channel-logo-wrapper .fallback-logo { font-size: 16px; }
            .nav-item { padding: 4px 8px; min-width: 44px; }
            .nav-item i { font-size: 16px; }
            .nav-item span { font-size: 7px; }
            .nav-play-btn { width: 38px; height: 38px; font-size: 16px; }
            .nav-play-btn i { font-size: 16px; }
            .bottom-nav { height: 56px; padding: 6px 0 env(safe-area-inset-bottom, 6px) 0; }
            body { padding-bottom: 56px; }
            .toast { bottom: 68px; font-size: 11px; padding: 8px 16px; }
            .settings-panel { padding: 16px; margin: 10px; max-height: 80vh; }
            .settings-header h2 { font-size: 16px; }
            .setting-item { padding: 10px 12px; }
            .device-badge { font-size: 8px; padding: 3px 8px; }
            .category-btn { font-size: 9px; padding: 4px 10px; }
            .channel-card h4 { font-size: 9px !important; }
            .player-control-btn { padding: 4px 8px; font-size: 9px; }
            .player-control-btn i { font-size: 10px; }
        }
        @media (min-width: 641px) and (max-width: 1024px) {
            #channel-list { grid-template-columns: repeat(3, 1fr) !important; }
        }
        @media (min-width: 1025px) {
            #channel-list { grid-template-columns: repeat(3, 1fr) !important; }
        }

        /* ===== STICKY PLAYER ===== */
        .sticky-player-wrapper {
            position: sticky;
            top: 70px;
            z-index: 30;
        }

        /* ===== CHANNEL LIST HEIGHT ===== */
        #channel-list {
            max-height: 50vh !important;
        }
        @media (max-width: 640px) {
            #channel-list {
                max-height: 42vh !important;
            }
        }
        
        .search-bar {
            background: rgba(255, 255, 255, 0.05) !important;
            border: 1px solid rgba(255, 255, 255, 0.06) !important;
            color: white !important;
        }
        .search-bar::placeholder {
            color: #64748b !important;
        }
        .search-bar:focus {
            border-color: #0ea5e9 !important;
            box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1) !important;
        }

        /* ===== REFRESHED WELCOME POPUP CSS ===== */
        #welcomePopup {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(3, 7, 18, 0.9);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            display: none; 
            align-items: center;
            justify-content: center;
            z-index: 999999; 
            padding: 20px;
        }
        #welcomePopup.show {
            display: flex;
        }
        .popup-card {
            background: #0b1329;
            border: 1px solid #1e293b;
            border-radius: 24px;
            max-width: 330px;
            width: 100%;
            padding: 32px 24px 20px 24px;
            text-align: center;
            box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9);
            transform: scale(0.95);
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        #welcomePopup.show .popup-card {
            transform: scale(1);
        }
   