/* ======================================
   ملف التنسيقات الرئيسي - النسخة النهائية المنظمة
   ====================================== */

/* المتغيرات الأساسية */
:root { 
    --p: #be185d; 
    --s: #6d28d9; 
    --bg: #0a0a0a; 
    --card-bg: #111111; 
    --text: #ffffff; 
}

/* ===== التنسيقات العامة ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: sans-serif; 
    background: var(--bg); 
    color: var(--text); 
    margin: 0; 
    transition: 0.3s; 
}

body.dark-mode {
    --bg: #09090b;
    --card-bg: #18181b;
    --text: #f9fafb;
}

.dark-mode h1, .dark-mode h2, .dark-mode h3 { color: #ffffff; }
.dark-mode aside, .dark-mode aside * { color: #e5e7eb; }
.dark-mode nav, .dark-mode aside, .dark-mode .card { 
    background: var(--card-bg) !important; 
    border-color: transparent !important; 
}

/* ===== تحسين التمرير ===== */
html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #1a1a1a; }
::-webkit-scrollbar-thumb { background: #be185d; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #ff3366; }

/* ===== كروت الفيديو ===== */
.video-card {
    display: flex;
    flex-direction: column;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.video-card .thumb-wrapper {
    position: relative;
    width: 100%;
    background: #000;
    overflow: hidden;
    border-radius: 12px;
    aspect-ratio: 16 / 9 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.video-card .thumb-wrapper img,
.video-card .thumb-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.video-card .thumb-wrapper img.portrait-thumb {
    object-fit: contain !important;
    background: #000;
    transform: none !important;
}

.video-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    z-index: 15;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(4px);
}

.video-title {
    font-size: 0.85rem !important;
    font-weight: 600;
    margin-top: 8px;
    line-height: 1.3;
    color: #e5e5e5;
}

/* ===== الشبكة الرئيسية ===== */
#gridBox {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    align-items: start;
}

@media (max-width: 1024px) {
    #gridBox { grid-template-columns: repeat(2, 1fr) !important; gap: 16px !important; }
}
@media (max-width: 768px) {
    #gridBox { gap: 12px !important; padding: 0 8px; }
    .video-card .thumb-wrapper { min-height: 108px; border-radius: 10px; }
    .video-title { font-size: 0.72rem !important; margin-top: 4px; }
}
@media (max-width: 480px) {
    #gridBox { gap: 8px !important; }
    .video-card .thumb-wrapper { min-height: 95px; }
    .video-title { font-size: 0.68rem !important; }
}

/* ===== زر الثلاث نقاط والقائمة ===== */
.card-menu-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(39, 39, 42, 0.9);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.card-menu-btn:hover { background: var(--p); }

.card-menu-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 8px;
    width: 180px;
    background: rgba(24, 24, 27, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    overflow: hidden;
    z-index: 100;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 35px -8px rgba(0,0,0,0.7);
}

.card-menu-dropdown.show { display: flex; }

.card-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #f0f0f0;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.card-menu-item:last-child { border-bottom: none; }
.card-menu-item:hover { background: rgba(190, 24, 93, 0.3); color: white; }
.card-menu-item.active { background: var(--p); color: white; }

/* ===== أزرار التفاعل ===== */
.action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(30, 30, 40, 0.8);
    padding: 8px 16px;
    border-radius: 50px;
    border: 1px solid rgba(255,255,255,0.1);
    color: #ddd;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.action-btn:hover { background: #2a2a35; border-color: var(--p); }
.action-btn.active { background: var(--p); color: white; border-color: var(--p); }
.fav-action-btn.active { background: #ff4d4d !important; }
.watch-later-btn.active { background: #8b5cf6 !important; }
.share-btn { background: #2563eb; }

/* ===== حاوية الفيديو الرئيسية ===== */
#vArea {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: black;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 30px -10px rgba(0,0,0,0.5);
}

#vArea iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

#vArea.image-mode {
    height: auto !important;
    min-height: 500px;
    max-height: 85vh;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#vArea.image-mode img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
}

#vTitle { font-size: 1.5rem !important; margin-bottom: 15px !important; }

@media (max-width: 768px) {
    #vArea { min-height: 320px; max-height: 400px; }
    #vTitle { font-size: 1.2rem !important; }
}

/* ===== الاقتراحات تحت الفيديو ===== */
#recBox {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 25px !important;
    margin-top: 20px !important;
    width: 100% !important;
    padding: 0 15px !important;
}

#recBox .suggestion-item {
    width: 100% !important;
    max-width: 450px !important;
    background: rgba(24, 24, 27, 0.5) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

#recBox .suggestion-item:hover {
    background: rgba(190, 24, 93, 0.25) !important;
    border-color: #be185d !important;
    transform: translateY(-3px) !important;
}

#recBox .relative.rounded-xl {
    background: #000 !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    border-radius: 20px 20px 0 0 !important;
}

#recBox .relative.rounded-xl:not(:has(img.portrait-thumb)) {
    aspect-ratio: 16 / 9 !important;
}

#recBox .relative.rounded-xl:not(:has(img.portrait-thumb)) img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#recBox .relative.rounded-xl:has(img.portrait-thumb) {
    aspect-ratio: 9 / 16 !important;
    min-height: 400px !important;
    max-height: 550px !important;
}

#recBox .relative.rounded-xl img.portrait-thumb {
    object-fit: contain !important;
    background: #000 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
}

#recBox h4 {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    margin: 15px 15px 8px 15px !important;
    text-align: right !important;
    line-height: 1.4 !important;
    color: #fff !important;
}

#recBox .text-pink-500 {
    font-size: 0.7rem !important;
    margin: 0 15px 18px 15px !important;
    display: inline-block !important;
    background: rgba(190, 24, 93, 0.4) !important;
    padding: 5px 14px !important;
    border-radius: 25px !important;
    color: #ffb3d9 !important;
}

/* للشاشات الكبيرة - شبكي */
@media (min-width: 1024px) {
    #recBox {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        flex-direction: row !important;
        gap: 20px !important;
        padding: 0 !important;
    }
    #recBox .suggestion-item { max-width: 100% !important; }
    #recBox .relative.rounded-xl:has(img.portrait-thumb) { min-height: 350px; max-height: 480px; }
}

@media (max-width: 550px) {
    #recBox .relative.rounded-xl:has(img.portrait-thumb) { min-height: 320px; max-height: 450px; }
    #recBox h4 { font-size: 0.85rem !important; margin: 12px 12px 6px 12px !important; }
    #recBox .text-pink-500 { font-size: 0.65rem !important; padding: 4px 12px !important; margin: 0 12px 15px 12px !important; }
}

/* ===== الاقتراحات الجانبية ===== */
#sideVerticalList {
    gap: 12px !important;
    display: flex;
    flex-direction: column;
}

#sideVerticalList .flex {
    display: flex;
    gap: 12px !important;
    align-items: center;
    padding: 10px !important;
    background: rgba(0,0,0,0.5);
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

#sideVerticalList .flex:hover {
    background: rgba(190, 24, 93, 0.3) !important;
    border-color: #be185d;
}

#sideVerticalList .w-16 {
    width: 100px !important;
    height: 70px !important;
    border-radius: 8px !important;
    overflow: hidden;
    background: #111;
    flex-shrink: 0;
}

#sideVerticalList .w-16 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#sideVerticalList .flex-1 h4 {
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    line-height: 1.3 !important;
    color: #ffffff;
}

/* ===== الإعلانات ===== */
#sideAdsContainer {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#sideAdsContainer a {
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    border-radius: 12px !important;
    background: #000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

#sideAdsContainer a img,
#sideAdsContainer a video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#adsBelowPagination {
    transition: all 0.5s ease;
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    margin: 20px auto;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== الترقيم ===== */
.pagination-btn {
    padding: 8px 15px;
    border-radius: 8px;
    background: #292929;
    cursor: pointer;
    transition: 0.3s;
}
.pagination-btn.active { background: var(--p); color: white; }

/* ===== الفوتر ===== */
#footerMainPage {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    position: relative !important;
    z-index: 10 !important;
}

footer {
    width: 100%;
    background: var(--card-bg);
    border-top: 1px solid rgba(0,0,0,0.1);
    padding: 30px 20px;
    margin-top: 50px;
    text-align: center;
}

/* ===== نافذة المشغل ===== */
#playWindow {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: black !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    display: none;
}

#playWindow:not(.hidden) { display: block !important; }

/* ===== نافذة المقالات ===== */
#articleView {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 110;
    display: none;
    overflow-y: auto;
}

/* ===== نافذة التحقق من العمر ===== */
#ageVerifyModal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(190, 24, 93, 0.5);
    backdrop-filter: blur(15px);
}

/* ===== القوائم الجانبية ===== */
#mainSidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 280px;
    background: #0a0a0a;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

#mainSidebar.translate-x-0 { transform: translateX(0); }

/* ===== أزرار التحكم ===== */
#nightBtn, #langBtn {
    position: fixed;
    bottom: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1f1f1f;
    border: none;
    cursor: pointer;
    z-index: 1000;
}
#nightBtn { left: 20px; }
#langBtn { right: 20px; }

/* ===== تنسيقات الهاتف ===== */
@media (max-width: 768px) {
    #mainSidebar { width: 260px; }
    .card-menu-btn { width: 28px; height: 28px; font-size: 14px; }
    .action-btn { padding: 5px 12px; font-size: 11px; }
    #sideVerticalList .w-16 { width: 70px !important; height: 50px !important; }
    #sideVerticalList .flex-1 h4 { font-size: 0.7rem !important; }
}

@media (max-width: 480px) {
    #mainSidebar { width: 240px; }
    .card-menu-btn { width: 24px; height: 24px; font-size: 12px; }
}

/* ===== إخفاء الإعلانات الجانبية في الهاتف ===== */
@media (max-width: 1023px) {
    aside.xl\:block { display: none !important; }
    #sideAdsContainer { display: none !important; }
    .vertical-ad-left { display: none !important; }
}

/* ===== تنسيقات إضافية ===== */
.grad { background: linear-gradient(135deg, var(--p), var(--s)); }
.card { background: var(--card-bg); border-radius: 12px; overflow: hidden; transition: 0.3s; cursor: pointer; }
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }

.profile-card {
    background: var(--p);
    color: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
}

.tab-btn {
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    font-size: 12px;
    flex: 1;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.2);
}
.tab-btn.active { background: white; color: var(--p); }

.db-switch-btn {
    background: linear-gradient(135deg, #917ee6, #6d28d9);
    color: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

/* ===== تحسينات الأداء ===== */
img { content-visibility: auto; }
.video-card { contain: content; }

/* إزالة تأثيرات hover */
.media-container:hover img,
.video-card .thumb-wrapper:hover img,
#recBox .suggestion-item:hover img {
    transform: none !important;
}

/* إخفاء شارة المدة في الاقتراحات */
#recBox .absolute.bottom-1.right-1,
#recBox .absolute { display: none !important; }

/* تنسيق زر تسجيل الدخول */
#userSection button {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 30px;
    background: linear-gradient(135deg, #be185d, #6d28d9);
    color: white;
    border: none;
    cursor: pointer;
}

/* تنسيق شريط التصنيفات العلوي */
#topCategoryBar button {
    font-size: 12px !important;
    padding: 6px 14px !important;
    white-space: nowrap;
    border-radius: 999px;
    background: #1f1f1f;
    color: white;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

#topCategoryBar button:hover {
    background: #be185d;
    border-color: #be185d;
}

@media (min-width: 1024px) {
    #topCategoryBar button {
        font-size: 14px !important;
        padding: 8px 20px !important;
    }
}


/* تخصيص حجم الحاوية للهواتف مع دعم الصور العمودية */
@media (max-width: 768px) {
    /* جعل الحاوية أكبر (نسبة 3:4) */
    .video-card .thumb-wrapper {
        aspect-ratio: 3 / 4 !important;
    }

    /* جعل الصور الأفقية تغطي الحاوية بشكل كامل */
    .video-card .thumb-wrapper img {
        object-fit: cover;
    }

    /* الصور العمودية تظهر بشكل كامل مع خلفية سوداء */
    .video-card .thumb-wrapper img.portrait-thumb {
        object-fit: contain !important;
        background: #000;
    }

    /* تحسين التباعد بين الكروت */
    #gridBox {
        gap: 16px !important;
        padding: 0 8px;
    }
}
/* تكبير الشبكة الرئيسية على الهواتف */
@media (max-width: 768px) {
    #gridBox {
        grid-template-columns: 1fr !important;  /* عمود واحد */
        gap: 20px !important;
        padding: 0 12px !important;
    }

    /* تكبير حاوية الصورة */
    .video-card .thumb-wrapper {
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;  /* نسبة طبيعية للصور الأفقية */
        background: #000;
        border-radius: 16px;
    }

    /* الصور الأفقية تغطي الحاوية */
    .video-card .thumb-wrapper img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* الصور العمودية تظهر بشكل مناسب */
    .video-card .thumb-wrapper img.portrait-thumb {
        object-fit: contain !important;
        background: #000;
    }

    /* تكبير عنوان الفيديو */
    .video-title {
        font-size: 1rem !important;
        margin-top: 8px;
    }
}
/* إخفاء الاقتراحات الجانبية في المشغل على الهواتف */
@media (max-width: 768px) {
    #sideVerticalList {
        display: none !important;
    }
}
@media (min-width: 1024px) {
    #sideVerticalList .w-16 {
        width: 100px !important;
        height: 80px !important;
    }

    #sideVerticalList .flex {
        gap: 16px !important;
    }

    #sideVerticalList .flex-1 h4 {
        font-size: 0.9rem !important;
    }

    #sideVerticalList .w-16 img.portrait-thumb {
        object-fit: contain !important;
        width: 100%;
        height: 100%;
    }
}

/* تكبير زر الثلاث خطوط (الدائرة الصفراء) على الكمبيوتر فقط */
@media (min-width: 1024px) {
    #menuToggleBtn {
        width: 56px !important;
        height: 56px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    #menuToggleBtn svg {
        width: 30px !important;
        height: 30px !important;
    }
}

/* تحريك محتوى القائمة الجانبية (الأقسام) إلى الأسفل قليلاً */
#mainSidebar .p-5 {
    padding-top: 4rem !important;   /* المسافة من الأعلى */
    margin-top: 0.5rem !important;
}

/* إخفاء النصوص في الأقسام الرئيسية داخل القائمة الجانبية */


/* إخفاء النصوص في العناصر الفرعية (فيديوهات، صور ثابتة، صور متحركة) */


/* للحفاظ على عرض الأيقونات فقط مع مسافة مناسبة */
#mainSidebar .main-section-header .flex.items-center {
    gap: 0.5rem !important;
}
#mainSidebar .submenu-item {
    justify-content: center !important;
    text-align: center !important;
}
/* ===== تثبيت زر الثلاث خطوط بشكل قاطع ===== */
html, body {
    transform: none !important;
    backdrop-filter: none !important;
}

#menuToggleBtn {
    position: fixed !important;
    top: 80px !important;
    right: 15px !important;
    transform: none !important;
    z-index: 100000 !important;
    background-color: #FFB800 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 50px !important;
    height: 50px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* تكبير الزر على الكمبيوتر فقط */
@media (min-width: 1024px) {
    #menuToggleBtn {
        width: 60px !important;
        height: 60px !important;
    }
    #menuToggleBtn svg {
        width: 50px !important;
        height: 50px !important;
    }
}
.video-duration-badge.bg-red-600 {
    background: #dc2626 !important;
    border-color: #ff4d4d;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; background: #ef4444; }
    100% { opacity: 0.7; }
}
/* إخفاء زر الثلاث خطوط عند ظهور المشغل */
body:has(#playWindow:not(.hidden)) #menuToggleBtn {
    display: none !important;
}
/* السماح بالزوم */
html, body {
    touch-action: manipulation;
    overflow-x: hidden;
}

/* منطقة المشغل */
#vArea {
    width: 100%;
    height: auto;
    position: relative;
    background: black;
    overflow: hidden;
}

/* الفيديو نفسه */
video {
    width: 100%;
    height: 100%;
    object-fit: contain;

    /* 👇 هذا المهم */
    touch-action: pinch-zoom !important;
}

/* iframe (حتى يكون مرن) */
iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* تحسين الموبايل */
#playWindow {
    touch-action: manipulation;
}
video::-webkit-media-controls-fullscreen-button {
    display: block;
}
/* زر التشغيل الكبير في المنتصف */
#centerPlayBtn {
    transition: transform 0.2s ease, background 0.2s ease;
}
#centerPlayBtn:active {
    transform: translate(-50%, -50%) scale(0.95);
    background: rgba(190, 24, 93, 0.8);
}
@media (max-width: 768px) {
    #centerPlayBtn {
        width: 60px !important;
        height: 60px !important;
    }
    #centerPlayBtn svg {
        width: 35px !important;
        height: 35px !important;
    }
}
@media (max-width: 480px) {
    #centerPlayBtn {
        width: 50px !important;
        height: 50px !important;
    }
    #centerPlayBtn svg {
        width: 30px !important;
        height: 30px !important;
    }
}
/* تحسين ظهور الاقتراحات تحت المشغل على الهواتف */
@media (max-width: 768px) {
    #recBox {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        margin-top: 20px !important;
        padding: 0 10px !important;
    }
    
    #recBox .suggestion-item {
        max-width: 100% !important;
        background: rgba(24, 24, 27, 0.7) !important;
    }
    
    #recBox .relative.rounded-xl {
        border-radius: 16px !important;
    }
    
    #recBox h4 {
        font-size: 0.85rem !important;
        margin: 12px 12px 8px 12px !important;
    }
    
    #recBox .text-pink-500 {
        margin: 0 12px 16px 12px !important;
        font-size: 0.7rem !important;
    }
}
/* رسالة التأكيد عند الضغط المزدوج */
#seekMessage {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: monospace;
    white-space: nowrap;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-shadow: 0 0 15px rgba(190,24,93,0.5);
    border: 1px solid rgba(255,255,255,0.2);
}

/* تأثير بسيط عند الضغط المزدوج */
.video-double-tap {
    transition: filter 0.1s ease;
    filter: brightness(0.9) drop-shadow(0 0 5px #be185d);
}
.video-card .thumb-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* هذا يمنع تمطط الصورة */
}

.video-card .thumb-wrapper img.portrait-thumb {
    object-fit: contain !important; /* للصور الطويلة جداً تظهر كاملة */
    background: #000;
} 
/* تخصيص شارة الأفلام */
.video-card .video-duration-badge:has(i:contains("🎞️")),
#recBox .absolute:has(i:contains("🎞️")) {
    background: #4b2e2e !important; /* لون مختلف */
    border-color: #ff9800 !important;
}
/* 🔥 تصغير شبكة الفيديوهات للموبايل */
@media (max-width: 768px) {

    #gridBox {
        grid-template-columns: repeat(2, 1fr) !important; /* خليها 2 بدل 3 */
        gap: 8px !important;
        padding: 0 6px !important;
    }

    .video-card .thumb-wrapper {
        min-height: 90px !important; /* تصغير ارتفاع الفيديو */
    }

    .video-title {
        font-size: 0.65rem !important;
        margin-top: 3px !important;
    }

}
/* 🔥 تصغير القائمة الجانبية للموبايل */
@media (max-width: 768px) {

    #mainSidebar {
        width: 75% !important;
        max-width: 260px;
    }

    #mainSidebar button {
        padding: 8px 10px !important;
        font-size: 13px !important;
    }

    #mainSidebar h2 {
        font-size: 16px !important;
    }

    #mainSidebar .menu-item {
        margin-bottom: 6px;
    }

}
/* 🔥 تثبيت شبكة الفيديوهات */
#gridBox {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
}

/* للموبايل */
@media (max-width: 768px) {
    #gridBox {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
/* تثبيت الشبكة */
#gridBox {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
}

/* جميع البطاقات والإعلانات داخل الشبكة */
#gridBox > * {
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

/* تنسيق الإعلانات لتطابق البطاقات */
.ad-card {
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.ad-card:hover {
    transform: translateY(-3px);
    border-color: #be185d;
}

/* التأكد من أن الصور داخل الإعلانات تحافظ على النسبة */
.ad-card img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* تحسينات للشاشات المتوسطة */
@media (max-width: 1024px) {
    #gridBox {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }
}

/* تحسينات للهواتف */
@media (max-width: 768px) {
    #gridBox {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .ad-card {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    #gridBox {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
}