:root {
    --primary-grad: linear-gradient(135deg, #ff416c, #ff4b2b);
    --bg-color: #0d1321;
    --card-bg: #172033;
    --text-white: #ffffff;
    --text-dim: #94a3b8;
}

/* 1. Reset & Horizontal Scroll Fix */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    overflow-x: hidden;
    background: var(--bg-color);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
}

body {
    padding-top: 77px !important;
}

/* 2. Sticky Modern Header */
header {
    background: rgba(10, 14, 23, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 15px 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 24px;
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

/* 🎯 বাম পাশের এলাইনমেন্ট (লোগোর নিচে প্রিমিয়াম লেখা) */
.header-left {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    /* সব সেন্টার */
    gap: 2px;
}

/* 🎯 ডান পাশের এলাইনমেন্ট (হোম বাটনের নিচে লাইট মোড বাটন) */
.header-right {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    /* সব সেন্টার */
    gap: 6px;
}

/* মেনু আইকন ও লোগো পাশাপাশি রাখার জন্য */
header .header-left>div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* প্রিমিয়াম স্ট্রিমিং লেখার জন্য */
.hdr-premium-text {
    text-align: center !important;
    font-size: 9px !important;
    color: var(--text-dim);
    margin-left: 0px !important;
    /* আগে ডানে চাপানো ছিল, এখন সেটা সরানো হলো */
}

/* মেনু আইকন পজিশন */
.menu-icon {
    font-size: 26px;
    cursor: pointer;
    color: white;
}

/* হোম বাটন বামের লোগোর সাথে এলাইনমেন্ট ফিক্স (সেন্টারে আনা হলো) */
header .header-left .header-home-btn {
    margin-left: 0px !important;
    align-self: center !important;
}

/* --- Sidebar Style (২৬০ পিক্সেল চওড়া) --- */
.side-menu {
    position: fixed;
    top: 0;
    left: -260px;
    width: 260px;
    height: 100%;
    background: #161e2e;
    z-index: 10000;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px 10px;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
}

.side-menu.active {
    left: 0;
}

.close-btn {
    font-size: 28px;
    text-align: right;
    cursor: pointer;
    margin-bottom: 15px;
    padding-right: 10px;
}

/* --- Dropdown Style --- */
.dropbtn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: white;
    padding: 15px 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-content {
    display: none;
    background: #0f172a;
    padding-left: 20px;
}

.dropdown-content.show {
    display: block;
}

/* --- Menu Links --- */
.side-menu nav a {
    display: block;
    color: white;
    padding: 15px 10px;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Overlay Style --- */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: none;
    z-index: 9999;
}

.menu-overlay.active {
    display: block;
}

/* 3. Capsule Search Box */
.search-box {
    display: flex;
    max-width: 400px;
    margin: 15px auto;
    background: var(--card-bg);
    border-radius: 50px;
    padding: 3px;
    border: 1px solid #334155;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 8px 15px;
    outline: none;
    font-size: 14px;
}

.search-box button {
    background: var(--primary-grad);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
}

/* 4. Category Buttons & Custom Scrollbar */
.categories {
    display: flex !important;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto !important;
    white-space: nowrap;
    padding: 15px 5% 25px 5%;
    scrollbar-width: thin;
    scrollbar-color: #64748b rgba(0,0,0,0.1); /* ডার্ক মোডের জন্য */
}

/* Chrome, Safari, Edge Scrollbar */
.categories::-webkit-scrollbar {
    height: 6px !important;
}

.categories::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1) !important;
    border-radius: 10px !important;
}

.categories::-webkit-scrollbar-thumb {
    background: #64748b !important;
    border-radius: 10px !important;
}

/* Light Mode Scrollbar Adjustment */
body.light-mode .categories {
    scrollbar-color: #cbd5e1 #f1f5f9;
}

body.light-mode .categories::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
}

/* Category Buttons */
.categories button {
    flex: 0 0 auto;
    padding: 8px 20px;
    border-radius: 12px;
    border: none;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s ease;
}

/* ফিক্সড কালার প্যালেট */
.cat-btn-1 { background: #f43f5e !important; } /* Rose */
.cat-btn-2 { background: #8b5cf6 !important; } /* Violet */
.cat-btn-3 { background: #06b6d4 !important; } /* Cyan */
.cat-btn-4 { background: #f59e0b !important; } /* Amber */
.cat-btn-5 { background: #10b981 !important; } /* Emerald */

.categories button:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
/* 5. Ultimate 3D Video Cards */
#videos,
#related {
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 25px 5%;
    min-height: 80vh;
    max-width: 760px;
    margin: 0 auto;
}

.video {
    position: relative;
    background: transparent;
    padding: 0;
    border-radius: 20px;
    box-shadow:
        0 15px 35px -5px rgba(0, 0, 0, 0.7),
        0 0 15px 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.video-inner {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.video:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow:
        0 30px 60px -15px rgba(0, 0, 0, 0.85),
        0 0 25px 3px rgba(255, 255, 255, 0.25);
}

.video img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.video-inner img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1e293b linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loadingPulse 1.5s infinite;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.video-inner img[src] {
    animation: none;
    background: #0f172a;
}

.video-inner:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.video h3 {
    margin: 18px 20px 6px 20px;
    padding: 0;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-white);
}

.video p {
    margin: 0 20px 20px 20px;
    padding: 0;
    font-size: 13px;
    color: #64748b;
}

@media (max-width: 600px) {

    #videos,
    #related {
        gap: 22px;
        padding: 20px 4%;
    }

    .video {
        border-radius: 16px;
    }

    .video-inner {
        border-radius: 16px;
    }

    .video h3 {
        font-size: 15px !important;
        margin: 14px 16px 4px 16px;
    }

    .video p {
        font-size: 12px !important;
        margin: 0 16px 16px 16px;
    }
}

/* 6. Modern Pagination */
#pagination {
    margin: 40px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

#pagination button {
    background: var(--card-bg);
    color: white;
    border: 1px solid #334155;
    min-width: 45px;
    height: 45px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

#pagination button.active {
    background: var(--primary-grad);
    border-color: transparent;
    box-shadow: 0 0 10px rgba(255, 75, 43, 0.5);
    transform: scale(1.1);
}

#pagination button:hover {
    background: var(--primary-grad);
    border-color: transparent;
}

#pagination span {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: var(--text-dim);
}

/* 7. Player Page Enhancements */
.player-container {
    width: 100% !important;
    max-width: 1100px !important;
    margin: 20px auto !important;
    padding: 0 10px !important;
    box-sizing: border-box;
}

.video-wrapper {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    background: #000;
    margin: 0 auto !important;
    border-radius: 12px !important;
    border: 2px solid #ff4b2b !important;
    overflow: hidden !important;
    box-shadow: 0 0 20px rgba(255, 75, 43, 0.6) !important;
}

#muxPlayer,
.video-wrapper mux-player {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

#loadMoreBtn {
    display: block;
    margin: 30px auto;
    padding: 14px 40px;
    background: var(--primary-grad);
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 5px 15px rgba(255, 75, 43, 0.3);
}

#loadMoreBtn:hover {
    transform: scale(1.05);
}

/* 8. Ad Styling */
.ad {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    border-radius: 12px;
    margin: 0 !important;
    padding: 0 !important;
}

.ad iframe {
    max-width: 100% !important;
}

.logo a {
    text-decoration: none;
    display: inline-block;
}

.logo a h1 {
    cursor: pointer;
}

.logo a:hover {
    opacity: 0.8;
}

/* --- Skeleton Loading Animation --- */
.skeleton {
    background: var(--card-bg);
    border-radius: 18px;
    height: 250px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skel-thumb {
    width: 100%;
    height: 160px;
    background: #1e293b;
}

.skel-text {
    height: 12px;
    background: #1e293b;
    margin: 15px;
    border-radius: 4px;
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes loadingPulse {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

footer {
    background: #0d121d;
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 50px;
}

.footer-content p {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
}

.footer-content p:first-child {
    background: var(--primary-grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

/* Custom Main Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-grad);
}

.menu-header {
    background: rgba(255, 255, 255, 0.03);
}

/* 🎬 Video Overlay Ads Fix */
#video-ad-overlay {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    display: none; /* ডিফল্ট হাইড */
    z-index: 9999999;
    border-radius: 12px;
    overflow: hidden; /* কন্টেন্ট যেন বাইরে না যায় */
}

#ad-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    display: block;
    /* স্ক্রলিং ইনেবল করার জন্য */
    overflow-y: auto !important; 
}

#skip-ad-btn {
    position: absolute !important;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8) !important;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: not-allowed;
    transition: all 0.2s ease;
    z-index: 10000000;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

#skip-ad-btn.enabled {
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* 💊 Capsule Buttons (Right Stacked Layout) */
.header-home-btn,
.header-theme-btn {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    width: fit-content;
}

/* 🎯 Premium SVG Icons Alignment */
.premium-home-icon,
.premium-theme-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.header-home-btn:hover .premium-home-icon {
    transform: scale(1.1);
}

.header-theme-btn:hover .premium-theme-icon {
    transform: scale(1.1) rotate(20deg);
}

/* 🛠️ Video Page Gap Fixes */
h3#title,
.player-container+h3,
#title {
    margin-top: -10px !important;
    margin-bottom: 4px !important;
    padding-top: 0 !important;
}

p#meta,
#meta {
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    padding: 0 !important;
}

.video-actions-container,
#mainLikeBtn,
#mainShareBtn {
    margin-bottom: 2px !important;
}

.ad iframe {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.related-title {
    font-size: 18px !important; /* সাইজ কিছুটা কমানো হলো যেন হিডিং এর সাথে ভারসাম্য থাকে */
    font-weight: 800;
    text-align: center;
    background: var(--primary-grad); /* এটি আপনার আগে ডিফাইন করা লিনিয়ার গ্র্যাডিয়েন্ট */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 30px 0 15px 0 !important; /* ওপরে এবং নিচে প্রপার স্পেসিং */
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* শিরোনামের পাশে ছোট ডেকরেশন লাইন যোগ করার জন্য */
.related-title::before, 
.related-title::after {
    content: "";
    width: 30px;
    height: 2px;
    background: #ff4b2b;
    border-radius: 2px;
}

/* ☀️ Light Mode Global & Components Overrides */
body.light-mode {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
    padding-top: 77px !important;
}

body.light-mode header {
    background-color: #ffffff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

body.light-mode header h1 {
    color: #0f172a !important;
}

body.light-mode .menu-icon {
    color: #0f172a !important;
}

body.light-mode .hdr-premium-text {
    color: #475569 !important;
}

body.light-mode header .header-right div:first-child {
    color: #475569 !important;
}

body.light-mode .header-home-btn,
body.light-mode .header-theme-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-mode #title,
body.light-mode .related-title {
    color: #0f172a !important;
}

body.light-mode #meta {
    color: #64748b !important;
}

body.light-mode #mainLikeBtn,
body.light-mode #mainShareBtn {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .side-menu {
    background-color: #ffffff !important;
    color: #0f172a !important;
}

body.light-mode .side-menu nav a,
body.light-mode .dropbtn {
    color: #334155 !important;
}


/* 🎯 বাম পাশের এলাইনমেন্ট ফিক্স (সবাইকে একদম সেন্টারে রাখার জন্য) */
.header-left {
    display: flex;
    flex-direction: column;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
}

/* 1. Header Container */
.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(13, 19, 33, 0.95);
    backdrop-filter: blur(15px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 9999;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15); /* বর্ডার স্পষ্ট করা হলো */
    height: 65px;
}

/* 2. Left Side (Logo & Text) */
.header-left-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 3. Right Side (Capsules) */
.header-right-section {
    display: flex;
    gap: 6px;
}

.header-capsule {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: #fff !important;
    font-size: 10px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s;
    height: 28px; /* বাটনগুলোর উচ্চতা ফিক্সড করা হলো */
}

/* বাটন ভেতরের আইকনের সাইজ */
.header-capsule svg {
    width: 12px !important;
    height: 12px !important;
}

.header-capsule:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 4. LIGHT MODE FIXES */
body.light-mode .main-header {
    background: rgba(255, 255, 255, 0.95);
    border-bottom: 1px solid #e2e8f0;
}

body.light-mode .logo-box h1 {
    color: #0f172a;
}

body.light-mode .header-capsule {
    background: rgba(0, 0, 0, 0.05); /* সাদা মোডে আরও হালকা কালার */
    border: 1px solid #cbd5e1;
    color: #0f172a !important;
}

body.light-mode .header-capsule:hover {
    background: rgba(0, 0, 0, 0.1);
}
/* ১. ভিডিও টাইটেলের সাইজ ছোট করা */
#title {
    font-size: 17px !important;
    line-height: 1.3;
    margin-bottom: 5px !important;
}

/* ২. মেটা ডেটা (Views & Reacts) ছোট করা */
#meta {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin-bottom: 10px !important;
}

/* ৩. বাটনগুলোর প্যাডিং ও ফন্ট সাইজ কমানো */
#mainLikeBtn, 
#mainShareBtn, 
#mainDownloadBtn {
    padding: 6px 12px !important; /* প্যাডিং কমানো হলো */
    font-size: 11px !important;   /* ফন্ট সাইজ ছোট করা হলো */
    border-radius: 15px !important; /* আরও রাউন্ডেড লুক */
}

/* ৪. বাটনের ভেতরে আইকনের সাইজ ছোট করা */
#mainLikeBtn svg, 
#mainShareBtn svg, 
#mainDownloadBtn svg {
    width: 13px !important;
    height: 13px !important;
}

/* ৫. বাটনগুলোর কন্টেইনারের গ্যাপ কমানো */
.video-actions {
    gap: 6px !important;
    margin: 10px 0 !important;
}

/* লোগো এবং টেক্সট হোল্ডার */
.logo-box a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.text-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* টেক্সট সেন্টারে আনার প্রধান চাবিকাঠি */
    justify-content: center;
}

.logo-box h1 {
    font-size: 18px;
    margin: 0;
    line-height: 1;
    color: #fff;
    white-space: nowrap;
}

.hdr-premium-text {
    font-size: 7px !important;
    color: #94a3b8;
    text-transform: uppercase;
    margin-top: 2px; /* টাইটেলের নিচে সামান্য গ্যাপ */
    text-align: center;
    display: block;
    width: 100%;
}