/*
Theme Name: Video Tube
Theme URI: https://sharmotasex.com
Author: Sharmota
Author URI: https://sharmotasex.com
Description: قالب ووردبريس لعرض الفيديوهات مبني على تصميم موقع الفيديوهات الأصلي، يدعم أنواع محتوى مخصصة، تصنيفات، وسوم، بحث، وعداد مشاهدات.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: video-tube
Tags: dark, one-column, custom-menu, featured-images, right-to-left-language-support, translation-ready
*/
 
/* ==========================================================================
   الفهرس
   1.  المتغيرات والتصفير (Root & Reset)
   2.  الهيدر والتنقل
   3.  مساحات الإعلانات
   4.  الحاوية الرئيسية وعناوين الأقسام
   5.  شبكة الفيديوهات والبطاقات
   6.  الترقيم (Pagination)
   7.  صفحة الفيديو المفردة
       7.1 التخطيط: المحتوى + السايدبار
       7.2 المشغل
       7.3 المتغيرات وعنوان الفيديو
       7.4 شريط الإجراءات: التبويبات + التصويت
       7.5 صف المحتوى: الإحصائيات + الوصف/المشاركة
       7.6 التاريخ والوسوم
       7.7 الاستجابة للشاشات
   8.  مظهر مشغل Plyr
   9.  صفحة التصنيفات
   10. نموذج الاتصال
   11. الفوتر
   12. زر العودة للأعلى
 
   ملاحظة اتجاه: الموقع RTL، لذلك أول عمود في الـ grid / أول عنصر في الـ flex
   يظهر على اليمين.
   ========================================================================== */
 
 
/* ==========================================================================
   1. المتغيرات والتصفير
   ========================================================================== */
:root {
    --bg-main: #121212;
    /* --bg-main: #111827; */
    --bg-surface: #1e1e1e;
    --bg-accent: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --brand-color: #e50914;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --max-width: 1300px;
    --sidebar-width: 300px;
    --plyr-color-main: #ff3333;
}
 
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
 
body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-family);
}
 
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 2px;
}
 
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}
 
 
/* ==========================================================================
   2. الهيدر والتنقل
   ========================================================================== */
.main-header-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 15px;
}
 
/* الشريط العلوي: لوجو + بحث + همبرجر (flex-wrap ينزّل البحث لسطر مستقل في الشاشات الصغيرة) */
.top-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    background-color: var(--bg-surface);
    min-height: 90px;
    padding: 12px 25px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.top-header .ad-slot {
    flex: 0 0 100%; /* يأخذ سطراً كاملاً أسفل البحث */
    margin: 0 auto;
}
 
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
 
.logo img {
    height: 86px;
    max-height: 86px;
    width: auto;
    max-width: 310px;
    object-fit: contain;
    display: block;
}
 
.logo img:hover {
    transform: scale(1.03);
}
 
/* مربع البحث */
.search-box {
    display: flex;
    flex: 1 1 300px;
    max-width: 300px;
    min-width: 0;
}
 
.search-box form {
    display: flex;
    align-items: center;
    width: 100%;
}
 
.search-box input {
    background-color: var(--bg-main);
    border: 1px solid var(--brand-color);
    color: var(--text-primary);
    padding: 10px 15px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    width: 100%;
    min-width: 0;
    transition: border-color 0.3s;
}
 
.search-box button {
    background-color: var(--brand-color);
    color: #fff;
    border: none;
    padding: 10px;
    margin-right: 5px;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.3s;
}
 
.search-box button:hover {
    background-color: #b80710;
}
 
/* زر الهمبرجر (مخفي افتراضياً، يظهر في التابلت والموبايل) */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: var(--bg-accent);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.3s ease;
}
 
.burger-menu:hover {
    background-color: var(--brand-color);
}
 
.burger-menu span {
    width: 20px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}
 
.burger-menu.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
 
.burger-menu.open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
 
.burger-menu.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
 
/* شريط التنقل الرئيسي */
.navbar {
    background-color: var(--bg-surface);
    border-radius: 4px;
}
 
.nav-links {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    padding: 0 10px;
    flex-wrap: wrap;
}
 
.nav-links li{
    border-left: 1px solid var(--bg-main);
}
 
.nav-links li a {
    display: block;
    color: var(--text-primary);
    text-decoration: none;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 500;
    transition: background-color 0.2s, color 0.2s;
}
 
.nav-links li a:hover {
    background-color: var(--brand-color);
    /* color: var(--brand-color); */
}
 
.nav-links li a.active,
.nav-links li.current-menu-item a {
    background-color: var(--brand-color);
    color: #ffffff;
    font-weight: bold;
}
 
/* تابلت: اللوجو في سطر، ثم الهمبرجر (أقصى اليمين)، ثم البحث؛ والهمبرجر يفتح القائمة */
@media (max-width: 992px) {
    .top-header {
        flex-direction: column;
        align-items: center;
        padding: 15px;
        min-height: auto;
    }

    /* إعلان الهيدر: رابعاً بعد اللوجو ثم الهمبرجر ثم البحث */
    .top-header .ad-slot {
        order: 4;
        margin: 0 auto;
    }
 
    .logo {
        order: 1;
        width: 100%;
        justify-content: center;
    }
 
    .burger-menu {
        order: 2;
        display: flex;
        align-self: flex-start; /* أقصى اليمين في RTL */
    }
 
    .search-box {
        order: 3;
        flex-basis: auto;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .main-header-wrapper {
        position: relative; /* لضمان تمركز القائمة بالنسبة للإطار العام */
    }
 
    .navbar {
        display: none;
        margin-top: 10px;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 999;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    }
 
    .navbar.active {
        display: block;
        animation: fadeIn 0.3s ease-in-out;
    }
 
    .nav-links {
        flex-direction: column;
        padding: 0;
    }
 
    .nav-links li a {
        padding: 12px 20px;
        border-bottom: 1px solid var(--bg-accent);
    }
}
 
@media (max-width: 1100px) {
    .main-header-wrapper {
        padding: 0px;
    }
}
 
/* موبايل */
@media (max-width: 576px) {
    .main-header-wrapper {
        padding: 10px;
    }
 
    .top-header {
        padding: 10px 15px;
        gap: 10px;
    }
 
    .burger-menu {
        width: 36px;
        height: 36px;
    }
 
    .search-box input,
    .search-box button {
        font-size: 13px;
        padding: 9px 12px;
    }
}
 
/* هواتف صغيرة جداً */
@media (max-width: 500px) {
    .logo img {
        height: 60px;
        max-height: 60px;
    }
 
    .burger-menu {
        width: 30px;
        height: 30px;
    }
 
    .search-box {
        max-width: 270px;
    }
}
 
 
/* ==========================================================================
   3. مساحات الإعلانات
   --------------------------------------------------------------------------
   نقطة التحوّل بين الشاشات الكبيرة والصغيرة: 1100px (نفس نقطة تحوّل تخطيط صفحة الفيديو).
     - صغيرة: حتى 1100px  |  كبيرة: أكثر من 1100px
   لماذا 1100 وليس 990؟ عند 1100px يتبقى للمشغل عمود بعرض ~745px فيتسع إعلان 728x90،
   أما عند 1024px (آيباد أفقي) فلا يتسع.
 
   الأحجام (تُحدَّد بكلاس المقاس):
     .ad-slot--728x90 | .ad-slot--300x250 | .ad-slot--300x100
   الظهور (تُحدَّد بكلاس الشاشة):
     .ad-slot--large-only | .ad-slot--small-only
   الموضع المخفي بـ display:none لا يُحمَّل إعلانه أبداً (انظر video_tube_lazy_ad_script).
   نحجز المساحة بـ min-height (وليس height) فلا يقفز المحتوى (CLS) ولا يُقصّ الإعلان.
   ========================================================================== */
:root {
    --ad-label-h: 18px;
}
 
.ad-slot {
    --ad-h: 90px;
    --ad-gap: 25px;                 /* المسافة بين إعلانين متتاليين */
    --ad-count: 1;                  /* عدد الودجات (تُضبط من PHP) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ad-gap);
    width: 100%;
    max-width: 728px;
    min-height: calc(var(--ad-count) * (var(--ad-h) + var(--ad-label-h)) + (var(--ad-count) - 1) * var(--ad-gap));
    margin: 12px auto;
    overflow: hidden;
    contain: layout;
}
 
/* كل ودجت = إعلان واحد بتسمية "إعلان" فوقه */
.ad-slot .widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-height: calc(var(--ad-h) + var(--ad-label-h));
    margin: 0;
    text-align: center;
}

.ad-slot .widget iframe {
    width: 300px !important;
    height: 250px !important;
    max-width: 100% !important;
    object-fit: contain;
}
 
.ad-slot .widget::before {
    content: attr(data-label);
    display: block;
    height: var(--ad-label-h);
    line-height: var(--ad-label-h);
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: .5px;
}
 
.ad-slot img,
.ad-slot iframe,
.ad-slot ins,
.ad-slot video {
    max-width: 100%;
}
 
.ad-slot img {
    height: auto;
}
 
/* المقاسات */
.ad-slot--728x90  { --ad-h: 90px;  max-width: 728px; }
.ad-slot--300x250 { --ad-h: 250px; max-width: 300px; }
.ad-slot--300x100 { --ad-h: 100px; max-width: 300px; }
 
/* داخل الفوتر: مسافة سفلية فقط */
.main-footer .ad-slot {
    margin: 0 auto 25px;
}
 
/* معاينة المدير فقط (حين لا توجد ودجات في منطقة الشريط الجانبي) */
.ad-slot--preview {
    justify-content: center;
    border: 1px dashed var(--bg-accent);
    background-color: var(--bg-surface);
    color: var(--text-secondary);
    font-size: 14px;
}
 
/* الظهور حسب الشاشة (يجب أن يأتي بعد القواعد أعلاه) */
@media (max-width: 1100px) {
    .ad-slot--large-only {
        display: none;
    }
}
 
@media (min-width: 1007px) {
    .ad-slot--small-only {
        display: none;
    }
}
 
/* وصول لقارئات الشاشة فقط (عناوين الودجات غير المرئية) */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
 
 
/* ==========================================================================
   4. الحاوية الرئيسية وعناوين الأقسام
   ========================================================================== */
.main-content-wrapper {
    width: 100%;
    max-width: var(--max-width);
    margin: 20px auto;
    padding: 0 15px;
}
 
.section-header {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    margin-bottom: 20px;
    padding: 10px;
    background-color: var(--bg-surface);
    border-right: 4px solid var(--brand-color);
}
 
.main-content-wrapper > .section-header:first-child {
    margin-top: 0;
}
 
.section-header--centered {
    margin-top: 40px;
    justify-content: center;
}
 
.section-title {
    font-size: 20px;
    font-weight: 400;
    text-align: center;
    flex-grow: 1;
}

.section-title-icon {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-inline-end: 6px;
}

.section-title-icon svg {
    display: block;
    width: 22px;
    height: 22px;
    transform: scaleX(-1); /* لقلب الأيقونة أفقياً لتتجه نحو اليمين */
}

.section-title-icon--folder svg {
    transform: none;
}
 
.more-btn {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 6px 14px;
    border: 1px solid var(--brand-color);
    border-radius: 20px;
    background-color: var(--brand-color);
    white-space: nowrap;
    transition: all 0.2s ease;
}
 
.more-btn:hover {
    background-color: transparent;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
}
 
.more-btn--lg {
    padding: 12px 35px;
    font-size: 16px;
}
 
.video-more-wrap {
    text-align: center;
    margin: 35px 0 15px;
}
 
@media (max-width: 400px) {
    .section-title {
        font-size: 18px;
    }
}
 
 
/* ==========================================================================
   5. شبكة الفيديوهات والبطاقات
   ========================================================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}
 
.no-videos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}
 
.video-card {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
 
.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}
 
 .video-card:hover .video-title a {
    color: var(--brand-color);
}

/* الصورة المصغّرة بنسبة 16:9 */
.thumbnail-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}
 
.thumbnail-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
 
/* معاينة الفيديو عند المرور بالماوس */
.thumbnail-wrapper .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
    z-index: 2;
}
 
.thumbnail-wrapper .video-overlay video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
 
.video-card.has-preview:hover .video-overlay {
    opacity: 1;
    visibility: visible;
}
 
/* الشارات (المشاهدات / المدة) */
.thumbnail-wrapper .badge {
    position: absolute;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    border-radius: 4px;
    font-size: 0.875rem;
    backdrop-filter: blur(2px);
}
 
.thumbnail-wrapper .views-badge {
    left: 8px;
    flex-direction: row-reverse;
    gap: 6px;
    direction: ltr;
}
 
.thumbnail-wrapper .views-badge .eye-icon,
.thumbnail-wrapper .views-badge .views-count {
    display: inline-block;
    line-height: 1;
}
 
/* معلومات البطاقة */
.video-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    padding: 12px 7px;
}
 
.video-title {
    height: 3.5em;
    margin-bottom: 10px;
    font-size: .875em;
    font-weight: 400;
    line-height: 1.8;
    text-align: center;
    overflow: hidden;
}
 
.video-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}
 
.video-title a:hover {
    color: var(--brand-color);
}
 
.video-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}
 
 
/* ==========================================================================
   6. الترقيم (Pagination)
   ========================================================================== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 35px 0 20px;
}
 
.pagination a,
.pagination span {
    display: block;
    padding: 8px 14px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}
 
.pagination a:hover {
    background-color: var(--bg-accent);
}
 
.pagination .current,
.pagination a.active {
    background-color: var(--brand-color);
    font-weight: bold;
}
 
 
/* ==========================================================================
   7. صفحة الفيديو المفردة
   ========================================================================== */
 
/* 7.1 التخطيط: المحتوى + السايدبار
   --------------------------------------------------------------------------
   الافتراضي (موبايل/تابلت): عمود واحد، والسايدبار مخفي (إعلاناته تظهر أسفل الصفحة).
   الشاشات الكبيرة: عمودان — السايدبار على اليمين، المحتوى على اليسار.
 
   لماذا كان يتخرّب التخطيط سابقاً؟
   عناصر الـ grid تُوضع حسب ترتيبها في HTML: المحتوى أولاً ثم السايدبار.
   وفي RTL أول عمود هو اليمين؛ فعند قلب قيم grid-template-columns فقط
   كان المحتوى يقع داخل العمود الضيق (300px) والسايدبار داخل العمود الواسع.
   الحل: تسمية المناطق (grid-template-areas) وربط كل عنصر بمنطقته،
   فلا يعتمد المكان على ترتيب الـ HTML.
 
   لنقل السايدبار لليسار: اجعل "main sidebar" بدل "sidebar main"
   واجعل أعمدة الشبكة minmax(0, 1fr) var(--sidebar-width).
   -------------------------------------------------------------------------- */
.video-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 25px;
    align-items: start;
    width: 100%;
}
 
.video-layout__main {
    width: 100%;
    min-width: 0;
}
 
.video-sidebar {
    display: none;   /* في الشاشات الصغيرة تظهر الإعلانات أسفل الصفحة بدلاً منه */
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 100%;
    min-width: 0;
    margin-top: 20px;
}

/* إزالة الهامش العلوي لأول إعلان ليكون محاذياً لأعلى المشغل */
.video-sidebar .ad-slot:first-child {
    margin-top: 0;
}
 
.video-sidebar .widget {
    width: 100%;
    margin: 0;
    text-align: center;
}
 
.video-sidebar img,
.video-sidebar iframe {
    max-width: 100%;
    height: auto;
}
 
@media (min-width: 1101px) {
    .video-layout.has-sidebar {
        grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
        grid-template-areas: "sidebar main";
    }
 
    .video-layout.has-sidebar .video-layout__main {
        grid-area: main;
    }
 
    .video-layout.has-sidebar .video-sidebar {
        grid-area: sidebar;
        display: flex;
        align-items: stretch;
        margin-top: 0;
    }
}
 
 
/* 7.2 المشغل
   الحاوية ثابتة 16:9 دائماً، والفيديو يُعرض بداخلها كاملاً بنسبته الأصلية
   (أشرطة سوداء على الجانبين أو أعلى/أسفل عند اختلاف النسبة) */
.player-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}
 
/* منع Plyr من فرض نسبته الخاصة على الحاوية */
.player-wrapper .plyr,
.player-wrapper .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
    aspect-ratio: auto !important;
    background: #000;
}
 
.player-wrapper video,
.player-wrapper .plyr video {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;   /* يحافظ على النسبة الأصلية بلا تشويه ولا قص */
    object-position: center;
    background: #000;
    margin: 0 !important;
    padding: 0 !important;
}
 
 
/* 7.3 المتغيرات وعنوان الفيديو
   --------------------------------------------------------------------------
   كل أحجام الخطوط والمسافات داخل تفاصيل الفيديو متغيّرات (--vd-*) على
   .video-details-wrapper، وتتغيّر فقط داخل media queries في 7.7.
   -------------------------------------------------------------------------- */
.video-details-wrapper {
    --vd-padding: 24px;
    --vd-title-size: 1.75rem;
    --vd-tab-size: 18px;
    --vd-tab-gap: 28px;
    --vd-views-size: 26px;
    --vd-views-label-size: 16px;
    --vd-numbers-size: 15px;
    --vd-desc-size: 18px;
    --vd-desc-line: 1.9;
    --vd-readmore-size: 16px;
    --vd-date-size: 16px;
    --vd-tag-size: 15px;
    --vd-tag-padding: 8px 16px;
    --vd-share-size: 44px;
    --vd-share-font: 17px;
    --vd-row-gap: 90px;
    --vd-stats-width: 240px;
 
    width: 100%;
    margin-top: 15px;
}
 
.video-header-wrapper {
    background-color: #282828;
    border-left: 4px solid var(--brand-color);
    border-radius: 8px;
}
 
.video-main-title {
    margin-bottom: 20px;
    padding: 12px 10px 12px 16px;
    font-size: var(--vd-title-size);
    line-height: 1.5;
    color: #ffffff;
    border-radius: 4px;
    overflow-wrap: anywhere;
}
 
 
/* 7.4 شريط الإجراءات: التبويبات + الإعجاب/عدم الإعجاب
   أول عنصر في الكود يظهر يميناً (RTL).
   -------------------------------------------------------------------------- */
.video-actions-bar {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding: 12px var(--vd-padding);
    border-bottom: 1px solid #333;
}
 
/* التبويبات: "وصف الفيديو" / "مشاركة الفيديو" */
.video-tabs {
    display: flex;
    align-items: center;
    gap: var(--vd-tab-gap);
}
 
.video-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 4px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: var(--vd-tab-size);
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}
 
.video-tab-btn:hover {
    color: #ffffff;
}
 
.video-tab-btn.is-active {
    color: #ffffff;
    border-bottom-color: var(--brand-color);
}
 
/* التصويت */
.video-vote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
}
 
.video-vote-group {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 8px 18px;
    border-radius: 25px;
}
 
.video-vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    outline: none;
    line-height: 1.4;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}
 
.video-vote-btn svg {
    display: block;
    fill: currentColor;
    transition: transform 0.2s ease, filter 0.2s ease;
}
 
.video-vote-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
 
.video-vote-label {
    padding: 3px 2px 0;
    color: #888888;
    font-size: 18px;
    font-weight: 500;
    opacity: 0.85;
    user-select: none;
    transition: color 0.2s ease, opacity 0.2s ease, font-weight 0.2s ease;
}
 
/* زر الإعجاب + النص يتفاعلان معاً */
.video-like-btn {
    color: #ffffff;
}
 
.video-like-btn:hover .video-vote-icon svg {
    transform: scale(1.15);
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.3));
    color: var(--brand-color);
}
 
.video-like-btn:hover .video-vote-label {
    color: #ffffff;
    opacity: 1;
    font-weight: 700;
}
 
/* زر عدم الإعجاب */
.video-dislike-btn {
    color: #888888;
    opacity: 0.6;
}
 
.video-dislike-btn:hover {
    color: var(--brand-color);
    opacity: 0.85;
}
 
.video-dislike-btn:hover svg {
    transform: scale(1.1);
}
 
.video-vote-btn:focus-visible,
.video-tab-btn:focus-visible,
.read-more-btn:focus-visible {
    outline: 2px solid var(--brand-color);
    outline-offset: 3px;
}
 
/* رسالة الشكر: مخفية افتراضياً، وسكربت التصويت يُظهرها عبر style.display */
.video-thank-you-msg {
    display: none;
    color: #888888;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-align: center;
    animation: fadeIn 0.3s ease-in-out;
}
 
/* محاذاة مركز التصويت مع صندوق الإحصائيات أسفله (ديسكتوب فقط) */
@media (min-width: 769px) {
    .video-vote-container {
        width: 360px;
    }
}
 
 
/* 7.5 صف المحتوى: صندوق الإحصائيات + لوحة (وصف أو مشاركة)
   -------------------------------------------------------------------------- */
.video-main-card {
    padding: var(--vd-padding);
    background-color: #1a1a1a;
    border-radius: 8px;
    color: #fff;
}
 
.video-content-row {
    display: flex;
    flex-direction: row-reverse;
    gap: var(--vd-row-gap);
    padding: 5px 0;
}
 
/* لوحتا "الوصف" و"المشاركة": تظهر فقط مع الكلاس .is-active (يبدّله player.js) */
.video-tab-panel {
    display: none;
}
 
.video-tab-panel.is-active {
    flex: 1;
    min-width: 0;
}
 
.video-description-panel.is-active {
    display: block;
}
 
.video-description-col {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
 
/* لوحة المشاركة: أيقونات دائرية ملوّنة */
.video-share-panel.is-active {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 12px;
    padding: 5px 0 15px;
}
 
.tab-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor; /* يرث لون النص تلقائياً */
}
 
.tab-icon svg {
    display: block;
    transition: transform 0.2s ease, stroke 0.2s ease;
}
 
/* تفاعل لطيف عند التحويم على التبويب */
.video-tab-btn:hover .tab-icon svg {
    transform: scale(1.1);
}
 
.share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--vd-share-size);
    height: var(--vd-share-size);
    background-color: var(--bg-accent);
    border-radius: 50%;
    color: #ffffff;
    font-size: var(--vd-share-font);
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.15s ease;
}
 
.share-icon:hover {
    opacity: 0.85;
    transform: translateY(-2px);
}
 
.share-email    { background-color: #555555; }
.share-whatsapp { background-color: #25D366; }
.share-telegram { background-color: #229ED9; }
.share-twitter  { background-color: #000000; }
.share-facebook { background-color: #1877F2; }
.share-linkedin { background-color: #0A66C2; }
.share-reddit   { background-color: #FF4500; }
.share-tumblr   { background-color: #34526f; }
 
/* صندوق الإحصائيات: المشاهدات + شريط الإعجاب + الأرقام */
.video-stats-box {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--vd-stats-width);
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid #333;
}
 
.video-views-count {
    display: flex;
    flex-direction: column;
    font-size: var(--vd-views-label-size);
    color: var(--text-secondary);
}
 
.video-views-count strong {
    font-size: var(--vd-views-size);
    font-weight: 600;
    line-height: 1.3;
    color: #ffffff;
}
 
.video-like-bar {
    width: 100%;
    height: 10px;
    background-color: #3a3a3a;
    border-radius: 2px;
    overflow: hidden;
}
 
.video-like-bar-fill {
    height: 100%;
    background-color: var(--brand-color);
    transition: width 0.3s ease;
}
 
.video-like-numbers {
    font-size: var(--vd-numbers-size);
    font-weight: 600;
    color: var(--text-secondary);
}
 
.video-dislike-count-bar {
    padding-right: 6px;
}
 
.video-like-percentage {
    float: left;
}
 
.count-svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #aaaaaa;
}
 
.count-svg-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: currentColor;
}
 
/* الوصف وزر "عرض المزيد"
   الأنماط تُورَّث للعناصر الداخلية دون !important، ليبقى أي تنسيق
   يضيفه المدير داخل المحتوى (روابط، نص عريض) ظاهراً. */
.video-description {
    color: #e0e0e0;
    font-family: inherit;
    font-size: var(--vd-desc-size);
    font-weight: 200;
    line-height: var(--vd-desc-line);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
 
.video-description p {
    margin: 0 0 10px;
}
 
.video-description p:last-child {
    margin-bottom: 0;
}
 
.video-description a {
    color: var(--brand-color);
    font-weight: 500;
    text-decoration: none;
}
 
.video-description a:hover {
    color: #777777;
}
 
.video-description strong,
.video-description b {
    font-weight: 700;
}
 
/* حالة الطي: معاينة سطرين فقط */
.video-description.collapsed {
    position: relative;
    max-height: calc(var(--vd-desc-line) * 2em);
    overflow: hidden;
}
 
.video-description.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.4em;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0), #1a1a1a);
    pointer-events: none;
}
 
.video-readmore-row {
    display: flex;
    justify-content: center;
}
 
.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    margin-top: 14px;
    padding: 0 10px;
    background: none;
    border: none;
    color: var(--brand-color);
    font-family: inherit;
    font-size: var(--vd-readmore-size);
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease;
}
 
.read-more-btn:hover {
    color: #ffffff;
}
 
 
/* 7.6 التاريخ والوسوم
   -------------------------------------------------------------------------- */
.video-date-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 15px;
    padding-top: 15px;
    /* border-top: 1px solid #262626; */
    font-size: var(--vd-date-size);
    /* font-weight: 500; */
    color: var(--text-primary);
}
 
.video-date-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}
 
.video-date-icon svg {
    display: block;
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}
 
.video-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
 
.tag-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: var(--vd-tag-padding);
    background-color: var(--brand-color);
    border: 1px solid var(--bg-accent);
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
    font-size: var(--vd-tag-size);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s ease-in-out;
}
 
.tag-item:hover {
    background-color: var(--bg-accent);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.35);
    color: #ffffff;
}

/* تنسيق أيقونة الوسم */
.tag-item .tag-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tag-item .tag-icon svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    transform: scaleX(-1); /* لتدوير الأيقونة لليمين لتناسب العربية */
}

 
/* 7.7 الاستجابة للشاشات (تغيير قيم المتغيرات + قواعد التخطيط)
   --------------------------------------------------------------------------
   التدرّج: ديسكتوب (الافتراضي) ← تابلت ≤992 ← تابلت صغير ≤768 (عمود واحد)
   ← موبايل ≤576 ← أصغر الهواتف ≤400.
   كل نقطة تغيّر الفروق فقط، والباقي يُورَّث من التي قبلها.
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .video-details-wrapper {
        --vd-padding: 20px;
        --vd-title-size: 1.5rem;
        --vd-tab-size: 17px;
        --vd-tab-gap: 22px;
        --vd-views-size: 24px;
        --vd-views-label-size: 15px;
        --vd-desc-size: 17px;
        --vd-date-size: 15px;
        --vd-tag-size: 14px;
        --vd-tag-padding: 8px 15px;
        --vd-share-size: 42px;
        --vd-share-font: 16px;
        --vd-row-gap: 50px;
        --vd-stats-width: 210px;
    }
}
 
@media (max-width: 768px) {
    /* الأعمدة تتحول لعمود واحد */
    .video-content-row {
        flex-direction: column;
        gap: 15px;
    }
 
    .video-stats-box {
        flex: none;
        width: 100%;
        padding-left: 0;
        padding-bottom: 15px;
        border-left: none;
        border-bottom: 1px solid #333;
    }
 
    .video-date-row {
        text-align: center;
    }
 
    /* الشريط عمودي بالمنتصف: التصويت أولاً ثم التبويبات */
    .video-actions-bar {
        flex-direction: column;
        align-items: center;
    }
 
    .video-vote-group {
        order: 1;
        justify-content: center;
        width: 100%;
        padding-left: 0;
    }
 
    .video-tabs {
        order: 2;
        justify-content: center;
        width: 100%;
    }
}
 
@media (max-width: 576px) {
    .video-details-wrapper {
        --vd-padding: 14px;
        --vd-title-size: 1.3rem;
        --vd-tab-size: 16px;
        --vd-tab-gap: 8px;
        --vd-views-size: 22px;
        --vd-desc-size: 16px;
        --vd-tag-padding: 7px 14px;
    }
 
    .video-main-title {
        padding: 12px 10px;
        text-align: center;
    }
 
    /* التبويبان يتقاسمان العرض بالتساوي (أهداف لمس كبيرة) */
    .video-tab-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 6px;
    }
 
    .video-share-panel.is-active,
    .video-tags {
        justify-content: center;
    }
}
 
@media (max-width: 400px) {
    .video-details-wrapper {
        --vd-padding: 12px;
        --vd-title-size: 1.2rem;
        --vd-tab-size: 15px;
        --vd-views-size: 21px;
        --vd-date-size: 14px;
        --vd-tag-size: 13px;
        --vd-share-size: 40px;
    }
 
    .video-tab-btn {
        gap: 5px;
    }
}
 
 
/* ==========================================================================
   8. مظهر مشغل Plyr
   (الـ !important هنا ضرورية لتغلب على أنماط مكتبة Plyr نفسها)
   ========================================================================== */
.plyr__control--overlaid {
    width: 60px !important;
    height: 60px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 3px solid #ffffff !important;
    background: rgba(229, 9, 20, 0.9) !important;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5) !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}
 
.plyr__control--overlaid svg {
    position: absolute !important;
    top: 50% !important;
    left: 53% !important;
    width: 30px !important;
    height: 30px !important;
    transform: translate(-50%, -50%) !important;
    fill: #ffffff !important;
}
 
.plyr__control--overlaid:hover,
.plyr__control--overlaid:focus {
    background: #ff0000 !important;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.95), 0 0 50px rgba(255, 0, 0, 0.6) !important;
}
 
/* وضع ملء الشاشة: الفيديو يبقى بنسبته الأصلية (contain) داخل خلفية سوداء */
:is(.plyr--fullscreen-active, :-webkit-full-screen, :-moz-full-screen, :fullscreen) {
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    background: #000 !important;
}
 
:is(.plyr--fullscreen-active, :-webkit-full-screen, :-moz-full-screen, :fullscreen) video {
    object-fit: contain !important;
}
 
/* صورة الغلاف (poster): تُعرض كاملة دون قص مهما كانت أبعادها.
   كانت background-size: cover وهذا يقصّ الصورة مع الفيديوهات العمودية. */
.plyr__poster {
    background-color: #000 !important;
    background-size: contain !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}
 
 
/* ==========================================================================
   9. صفحة التصنيفات
   ========================================================================== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    margin-top: 25px;
}
 
.category-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--bg-accent);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease;
}
 
.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-color);
}
 
.cat-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
}
 
.cat-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
 
.category-card:hover .cat-thumb {
    transform: scale(1.03);
}
 
.cat-info {
    padding: 12px 10px;
    text-align: center;
    display: flex;
    justify-content: center;
}
 
.cat-name {
    font-size: 20px;
    font-weight: 600;
    color: #f1f1f1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
 
.category-card:hover .cat-name {
    color: var(--brand-color);
}
 
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
 
@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
 
 
/* ==========================================================================
   10. نموذج الاتصال
   ========================================================================== */
.contact-form-wrapper {
    max-width: 650px;
    margin: 30px auto;
    padding: 30px;
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-family: inherit;
}
 
.contact-row-flex {
    display: flex;
    gap: 15px;
}
 
.contact-form-group {
    flex: 1;
    margin-bottom: 20px;
}
 
.contact-form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}
 
.contact-form-group input,
.contact-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background-color: var(--bg-accent);
    border: 1px solid #333333;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}
 
.contact-form-group input::placeholder,
.contact-form-group textarea::placeholder {
    color: #888888;
}
 
.contact-form-group textarea {
    height: 180px;
    resize: vertical;
}
 
.recaptcha-center {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}
 
.contact-submit-btn {
    display: block;
    margin: 0 auto;
    padding: 12px 35px;
    background-color: var(--brand-color);
    border: none;
    border-radius: 20px;
    color: #ffffff;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
 
.contact-submit-btn:hover {
    background-color: #b80710;
}
 
.contact-alert {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: 4px;
    color: #ffffff;
    text-align: center;
}
 
.contact-alert-success {
    background-color: #1e4620;
}
 
.contact-alert-error {
    background-color: #5a1a1a;
}
 
/* حقل Honeypot (فخّ الروبوتات): يُخفى بصرياً بنمط visually-hidden وليس
   display:none لأن بعض الروبوتات تتجاهل ذلك. لا تغيّر الاسم أو الأسلوب دون
   تحديث contact-us.php المطابق له. */
.vt-hp-field {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}
 
 
/* ==========================================================================
   11. الفوتر
   ========================================================================== */
.main-footer {
    width: 100%;
    max-width: calc(var(--max-width) - 30px);
    margin: 40px auto 0;
    padding: 30px 0 20px;
    background-color: #1e1e1e;
    border-radius: 6px;
    color: #aaaaaa;
    font-family: inherit;
    direction: rtl;
}
 
.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}
 
/* إعلان الفوتر: الشكل والأحجام من القاعدة العامة .ad-slot--footer (القسم 3) */
 
/* المواقع الصديقة */
.friendly-sites {
    margin-bottom: 30px;
    text-align: center;
}
 
.friendly-sites h3 {
    margin-bottom: 15px;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}
 
.footer-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
}
 
.footer-widget li a {
    color: #ff9900;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}
 
/* روابط الفوتر السفلية (أفقية) */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 40px;
    width: 100%;
    margin: 30px 0;
}
 
/* قائمة ووردبريس: بدون نقاط وبمحاذاة أفقية (الـ !important لتغلب على أنماط القوائم) */
.footer-links ul,
.footer-links .footer-menu-list {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 25px;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
}
 
.footer-links li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}
 
.footer-links a {
    padding: 0 15px;
    color: #ff9900;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: opacity 0.2s;
}
 
.footer-widget li a:hover,
.footer-links a:hover {
    opacity: 0.8;
}
 
.footer-bottom {
    width: 100%;
    padding: 20px 15px;
    border-top: 1px solid #2e2e2e;
}
 
.footer-bottom p {
    margin: 0;
    color: #ddd;
    font-size: 14px;
    line-height: 1.6;
}
 
.footer-bottom strong {
    color: #aaaaaa;
}
 
.footer-bottom strong a {
    color: #ddd;
    text-decoration: none;
}
 
@media (max-width: 768px) {
    .footer-links {
        gap: 12px;
    }
}
 
 
/* ==========================================================================
   12. زر العودة للأعلى
   ========================================================================== */
#back-to-top {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background-color: var(--brand-color);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    color: #ffffff;
    font-size: 16px;
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
 
/* يظهر عند التمرير للأسفل */
#back-to-top.show {
    opacity: 1;
    visibility: visible;
}
 
#back-to-top:hover {
    background-color: #b80710;
    transform: translateY(-3px);
}
 
#back-to-top img {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}
/* ==========================================================================
   شعار نصي احتياطي (عند عدم وجود شعار مرفوع ولا ملف assets/images/logo.png)
   ========================================================================== */
.logo-text {
    color: var(--text-primary);
    font-size: 1.6rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
