:root {
            --bg-main: #0b0f19; /* Deep Midnight Navy */
            --bg-surface: #131b2c; /* Slate Surface */
            --header-sidebar-bg: linear-gradient(135deg, rgba(30, 27, 75, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%); /* Deep Violet to Navy */
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --primary: #3b82f6; /* Premium Royal Blue */
            --primary-hover: #2563eb;
            --border-color: rgba(255, 255, 255, 0.05);
            --glow-border: rgba(59, 130, 246, 0.25);
            --shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.7);
            --transition: all 0.3s ease;
            --sidebar-width: 240px;
        }

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

        body {
            font-family: 'Tajawal', sans-serif;
            background-color: var(--bg-main);
            color: var(--text-main);
            line-height: 1.6;
            -webkit-font-smoothing: antialiased;
            overflow-x: hidden;
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        a {
            color: var(--text-main);
            text-decoration: none;
            transition: var(--transition);
        }

        a:hover {
            color: var(--primary);
        }

        /* --- Navbar (Premium Cinematic) - Full Width at Top --- */
        .navbar {
            position: sticky;
            top: 0;
            z-index: 1000;
            background: var(--header-sidebar-bg);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-bottom: 1px solid var(--glow-border);
            padding: 1rem 5%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15); /* Blue glow shadow */
            min-height: 75px;
        }

        .navbar-brand {
            display: flex;
            align-items: center;
        }

        .navbar-brand a {
            font-size: 1.8rem;
            font-weight: 800;
            color: var(--primary);
            letter-spacing: 1px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .navbar-menu {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
            margin-right: 3rem;
        }

        .nav-item {
            position: relative;
        }

        .nav-link {
            font-weight: 700;
            font-size: 1.1rem;
            padding: 0.5rem 1rem;
            border-radius: 8px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            transition: var(--transition);
        }

        .nav-link:hover {
            background-color: rgba(255, 255, 255, 0.05);
            color: var(--primary);
        }

        .dropdown-menu {
            position: absolute;
            top: 100%;
            right: 0;
            background: var(--header-sidebar-bg);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border: 1px solid var(--glow-border);
            border-radius: 12px;
            min-width: 220px;
            padding: 0.5rem 0;
            margin-top: 15px;
            box-shadow: 0 15px 30px rgba(0,0,0,0.8);
            opacity: 0;
            visibility: hidden;
            transform: translateY(10px);
            transition: all 0.3s ease;
            z-index: 1000;
        }

        .nav-item.show .dropdown-menu {
            opacity: 1;
            visibility: visible;
            transform: translateY(0);
            margin-top: 5px;
        }

        .dropdown-item {
            display: block;
            padding: 0.8rem 1.5rem;
            color: var(--text-main);
            font-weight: 600;
            transition: var(--transition);
            border-bottom: 1px solid rgba(255,255,255,0.03);
        }

        .dropdown-item:last-child {
            border-bottom: none;
        }

        .dropdown-item:hover {
            background-color: rgba(255, 255, 255, 0.08);
            color: var(--primary);
            padding-right: 2rem;
        }
        
        .navbar-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .navbar-actions form {
            display: flex;
            align-items: center;
            background: rgba(255,255,255,0.05);
            border-radius: 50px;
            padding: 0.2rem 0.5rem;
            border: 1px solid var(--border-color);
        }

        /* Mobile Menu Toggle Button */
        .mobile-menu-btn {
            display: none;
            background: transparent;
            border: none;
            color: var(--text-main);
            font-size: 2rem;
            cursor: pointer;
            margin-left: 15px; /* Spacing between button and logo in RTL */
            line-height: 1;
            transition: var(--transition);
        }
        
        .mobile-menu-btn:hover {
            color: var(--primary);
        }

        /* Sidebar Overlay */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100vh;
            background: rgba(0, 0, 0, 0.2);
            backdrop-filter: blur(1px);
            z-index: 1040; /* Below sidebar (1050) */
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .sidebar-overlay.active {
            display: block;
            opacity: 1;
        }

        @media (min-width: 993px) {
            .sidebar-overlay.active, .sidebar-overlay {
                display: none !important;
            }
        }

        /* --- Layout: Sidebar + Main Content --- */
        .main-wrapper {
            display: flex;
            flex: 1;
            width: 100%;
            max-width: 1400px;
            margin: 0 auto;
        }

        /* --- Sidebar (Premium Design) --- */
        .sidebar {
            width: var(--sidebar-width);
            flex-shrink: 0;
            background: var(--header-sidebar-bg);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-left: 1px solid var(--glow-border);
            padding: 2rem 1rem;
            position: sticky;
            top: 75px; 
            height: calc(100vh - 75px);
            overflow-y: auto;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        }

        .sidebar::-webkit-scrollbar {
            width: 4px;
        }
        .sidebar::-webkit-scrollbar-thumb {
            background: rgba(59, 130, 246, 0.5); /* Blue scrollbar */
            border-radius: 4px;
        }

        .sidebar-menu {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }

        .sidebar-item {
            display: flex;
            align-items: center;
            padding: 0.8rem 1.2rem;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-muted);
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.03);
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }

        .sidebar-item::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 4px;
            height: 100%;
            background: var(--primary);
            transform: scaleY(0);
            transition: transform 0.3s ease;
            transform-origin: bottom;
        }

        .sidebar-item:hover {
            background: rgba(59, 130, 246, 0.1);
            color: #fff;
            border-color: rgba(59, 130, 246, 0.3);
            transform: translateX(-5px); /* RTL Shift */
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.15);
        }

        .sidebar-item:hover::before {
            transform: scaleY(1);
        }

        .sidebar-heading {
            font-size: 0.8rem;
            color: var(--primary);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin: 1.5rem 1rem 0.8rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .sidebar-heading::after {
            content: '';
            flex: 1;
            height: 1px;
            background: linear-gradient(270deg, rgba(59, 130, 246, 0.3) 0%, transparent 100%);
        }

        /* Sidebar Accordion (Collapsible) */
        .sidebar-accordion {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.8rem 1.2rem;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-main);
            background: rgba(255, 255, 255, 0.05);
            cursor: pointer;
            transition: all 0.3s ease;
            margin-top: 0.5rem;
            border: 1px solid rgba(255,255,255,0.02);
        }

        .sidebar-accordion:hover {
            background: rgba(59, 130, 246, 0.15);
            color: #fff;
            border-color: rgba(59, 130, 246, 0.3);
        }

        .sidebar-accordion .acc-icon {
            font-size: 0.7rem;
            transition: transform 0.3s ease;
        }

        .sidebar-accordion.open .acc-icon {
            transform: rotate(180deg);
        }

        .sidebar-accordion-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.4s ease-out;
            padding-right: 0.5rem;
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }

        .sidebar-accordion-content .sidebar-item {
            padding: 0.7rem 1rem;
            font-size: 0.95rem;
            font-weight: 600;
            background: transparent;
            border: none;
            margin-top: 0.2rem;
            border-radius: 8px;
        }
        
        .sidebar-accordion-content .sidebar-item:hover {
            background: rgba(255,255,255,0.03);
            transform: translateX(-5px);
        }

        .browse-all-btn {
            background: rgba(59, 130, 246, 0.1) !important;
            color: #fff !important;
            border: 1px solid rgba(59, 130, 246, 0.2) !important;
            justify-content: center;
            font-weight: 800 !important;
            margin-bottom: 0.5rem;
            margin-top: 0.5rem !important;
        }

        .browse-all-btn:hover {
            background: var(--primary) !important;
            color: #fff !important;
            transform: translateY(-2px) !important;
            box-shadow: 0 4px 15px rgba(59,130,246,0.3);
        }

        /* --- Page Content --- */
        .page-container {
            flex: 1;
            min-width: 0; /* Ensures grid can shrink */
            padding: 2.5rem 2%;
            display: flex;
            flex-direction: column;
        }

        .footer {
            background-color: var(--bg-surface);
            text-align: center;
            padding: 2rem;
            border-top: 1px solid var(--border-color);
            color: var(--text-muted);
            margin-top: auto;
            width: 100%;
        }

        /* --- Reusable UI Components --- */
        .section-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.5rem;
        }

        .section-title {
            font-size: 1.6rem;
            font-weight: 800;
            border-right: 5px solid var(--primary);
            padding-right: 12px;
            display: inline-block;
            margin: 0;
            color: #fff;
        }

        /* Grid System - Strictly 4 items per row */
        .card-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1.2rem;
            margin-bottom: 3rem;
        }

        /* Modern Card Component */
        .card {
            background-color: var(--bg-surface);
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow);
            transition: var(--transition);
            border: 1px solid var(--border-color);
            position: relative;
            display: flex;
            flex-direction: column;
        }

        .card:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
            border-color: rgba(255, 255, 255, 0.15);
            z-index: 10;
        }

        .card-img-wrapper {
            position: relative;
            padding-top: 145%;
            overflow: hidden;
            background-color: #2a3441;
        }

        .card-img-wrapper img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.5s ease;
        }

        .card-img-placeholder {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-surface);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 0.9rem;
        }



        .card:hover .card-img-wrapper img {
            transform: scale(1.08);
        }

        .card-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(15, 23, 42, 0.6);
            opacity: 0;
            transition: var(--transition);
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .card:hover .card-overlay {
            opacity: 1;
        }

        .play-icon {
            width: 40px;
            height: 40px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: scale(0.5);
            transition: var(--transition);
        }

        .card:hover .play-icon {
            transform: scale(1);
        }

        .play-icon::after {
            content: '';
            width: 0;
            height: 0;
            border-style: solid;
            border-width: 6px 0 6px 10px;
            border-color: transparent transparent transparent white;
            margin-left: 4px;
        }

        .card-body {
            padding: 0.6rem 0.4rem;
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
        }

        .card-title {
            font-size: 0.9rem;
            font-weight: 700;
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            margin-bottom: 0;
            color: var(--text-main);
            line-height: 1.4;
        }

        .card-meta {
            display: none;
        }

        .btn {
            display: inline-block;
            background-color: var(--primary);
            color: white;
            padding: 0.7rem 1.8rem;
            border-radius: 8px;
            font-weight: 700;
            text-align: center;
            cursor: pointer;
            border: none;
            transition: var(--transition);
        }

        .btn:hover {
            background-color: var(--primary-hover);
            transform: translateY(-2px);
        }

        /* --- Details Pages --- */
        .details-container {
            background-color: var(--bg-surface);
            border-radius: 16px;
            overflow: hidden;
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
            box-shadow: var(--shadow);
        }

        .details-header {
            display: flex;
            gap: 2.5rem;
            padding: 2.5rem;
            position: relative;
        }

        .details-poster {
            flex: 0 0 280px;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 10px 20px rgba(0,0,0,0.6);
            border: 2px solid rgba(255,255,255,0.1);
        }
        
        .details-poster img {
            width: 100%;
            height: auto;
            display: block;
        }

        .details-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .details-title {
            font-size: 2.8rem;
            font-weight: 800;
            margin-bottom: 1rem;
            color: #fff;
            line-height: 1.2;
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1.5rem;
            background: rgba(0,0,0,0.2);
            border-radius: 8px;
            font-size: 0.95rem;
        }

        .data-table th, .data-table td {
            padding: 0.6rem 1rem;
            text-align: right;
            border-bottom: 1px solid var(--border-color);
        }

        .data-table th {
            color: var(--text-muted);
            width: 110px;
            font-weight: 700;
            background: rgba(255,255,255,0.02);
        }
        
        .data-table tr:last-child th,
        .data-table tr:last-child td {
            border-bottom: none;
        }

        .server-list {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        .server-btn {
            background-color: var(--bg-surface);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 0.8rem 1.5rem;
            border-radius: 8px;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: bold;
            transition: var(--transition);
        }

        .server-btn:hover {
            background-color: rgba(255,255,255,0.1);
            border-color: rgba(255,255,255,0.3);
            transform: translateY(-2px);
        }
        
        .video-container {
            width: 100%;
            aspect-ratio: 16/9;
            background-color: #000;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: var(--shadow);
            margin-bottom: 2rem;
            border: 1px solid var(--border-color);
        }
        
        .video-container iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .empty-state {
            padding: 3rem;
            text-align: center;
            color: var(--text-muted);
            background: var(--bg-surface);
            border-radius: 12px;
            border: 1px dashed var(--border-color);
            font-size: 1.2rem;
        }

        /* --- Horizontal Slider (Netflix Style) --- */
        .slider-wrapper {
            position: relative;
            margin-bottom: 3rem;
            width: 100%;
        }

        .slider-container {
            width: 100%;
            position: relative;
        }
        
        .slider-track {
            display: flex;
            gap: 1rem;
            overflow-x: auto;
            padding-bottom: 1.5rem; /* Space for hover effect */
            scroll-behavior: smooth;
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
        
        .slider-track::-webkit-scrollbar {
            display: none;
        }

        .slider-item {
            flex: 0 0 auto;
            width: 160px; /* Much smaller */
        }

        .slider-arrow {
            position: absolute;
            top: 40%;
            transform: translateY(-50%);
            width: 45px;
            height: 45px;
            background: rgba(15, 23, 42, 0.9);
            border: 1px solid var(--border-color);
            border-radius: 50%;
            color: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
            cursor: pointer;
            z-index: 10;
            transition: var(--transition);
            box-shadow: 0 4px 15px rgba(0,0,0,0.8);
            backdrop-filter: blur(5px);
        }

        .slider-arrow:hover {
            background: var(--primary);
            border-color: var(--primary);
            transform: translateY(-50%) scale(1.1);
        }

        @media (max-width: 768px) {
            .slider-item {
                width: 120px; /* Even smaller on mobile */
            }
            .slider-arrow {
                display: none; /* Hide arrows on touch devices */
            }
        }

        /* --- Pagination Styling --- */
        nav .pagination {
            display: flex;
            justify-content: center;
            align-items: center;
            list-style: none;
            gap: 0.5rem;
            padding: 0;
            margin: 2rem 0;
            flex-wrap: wrap;
        }
        
        .page-item {
            display: inline-block;
        }
        
        .page-link, .page-item span {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 40px;
            height: 40px;
            padding: 0 0.8rem;
            border-radius: 8px;
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-main);
            font-weight: 700;
            text-decoration: none;
            transition: var(--transition);
            border: 1px solid var(--border-color);
        }
        
        .page-item.active .page-link, .page-item.active span {
            background: var(--primary);
            color: #fff;
            border-color: var(--primary);
            box-shadow: 0 4px 15px var(--glow-border);
        }
        
        .page-link:hover {
            background: rgba(59, 130, 246, 0.2);
            color: #fff;
            border-color: rgba(59, 130, 246, 0.4);
        }
        
        .page-item.disabled .page-link, .page-item.disabled span {
            opacity: 0.5;
            cursor: not-allowed;
            pointer-events: none;
        }

        /* Responsive Design */
        @media (max-width: 1100px) {
            .card-grid {
                grid-template-columns: repeat(3, 1fr);
            }
            .sidebar {
                width: 220px;
            }
        }
        
        @media (max-width: 992px) {
            /* Hide top menu items on mobile */
            .navbar-menu {
                display: none !important;
            }
            
            /* Show Hamburger */
            .mobile-menu-btn {
                display: block;
            }
            
            /* Transform Sidebar to Off-canvas Drawer */
            .sidebar {
                position: fixed;
                top: 0;
                right: -300px; /* Hide off screen */
                height: 100vh;
                width: 280px;
                z-index: 1050;
                transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            }
            
            .sidebar.active {
                right: 0;
            }

            .main-wrapper {
                flex-direction: column;
            }
            
            .navbar {
                flex-wrap: wrap;
                height: auto;
                padding: 1rem 5%;
            }

            .navbar-brand {
                width: 100%;
                justify-content: flex-start;
            }

            .navbar-actions {
                width: 100%;
                margin-top: 1rem;
            }
            
            .navbar-actions form {
                width: 100%;
                margin-bottom: 0.5rem;
            }
            .navbar-actions form input {
                width: 100% !important;
                font-size: 16px; /* Prevents iOS auto-zoom */
            }
        }

        @media (max-width: 768px) {
            .page-container {
                padding: 1rem 4%;
            }
            .card-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.8rem;
                margin-bottom: 2rem;
            }
            .details-container {
                margin-bottom: 1.5rem;
            }
            .details-header {
                flex-direction: column;
                align-items: center;
                text-align: center;
                padding: 1.2rem;
                gap: 1.2rem;
            }
            /* Fix huge poster issue on mobile */
            .details-header > div:first-child {
                flex: none;
                width: 100%;
                max-width: 220px; /* Instead of full screen */
                margin: 0 auto;
            }
            .details-poster {
                width: 100%;
                max-width: 100%;
            }
            .details-title {
                font-size: 1.5rem;
                margin-bottom: 0.5rem;
            }
            .data-table th, .data-table td {
                padding: 0.6rem;
                font-size: 0.85rem;
            }
            .data-table th {
                width: 80px;
            }
            .server-list {
                justify-content: center;
            }
            .server-btn {
                font-size: 0.9rem;
                padding: 0.6rem 1rem;
                flex: 1 1 calc(50% - 0.5rem);
                justify-content: center;
                text-align: center;
            }
            .video-container {
                border-radius: 8px;
            }
            /* Fix pagination size on mobile */
            .page-link, .page-item span {
                min-width: 35px;
                height: 35px;
                padding: 0 0.5rem;
                font-size: 0.9rem;
            }
        }
        
        @media (max-width: 480px) {
            .card-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 0.6rem;
            }
            .card-title {
                font-size: 0.8rem;
            }
            .section-title {
                font-size: 1.3rem;
            }
            .server-btn {
                flex: 1 1 100%;
            }
        }
        
        select option {
            background-color: var(--bg-main);
            color: var(--text-main);
        }