/**
 * reels-ui-v85.css — واجهة المستخدم الموحدة
 * ═══════════════════════════════════════════════
 * يستبدل: reels83.css (أجزاء UI) + single.css + unified-desktop-v85.css
 * يعتمد على: custom.css (متغيرات + هيدر + فوتر) + vpc-v85.css (حاوية الفيديو)
 *
 * الأقسام:
 *   [1]  الهيكل العام: .reels-page, .reels-container, التخطيط الموحد
 *   [2]  أزرار التحكم العلوية: .top-controls
 *   [3]  لوحة الإجراءات الجانبية: .reels-actions-panel
 *   [4]  أزرار التنقل: .navigation-controls
 *   [5]  معلومات الفيديو داخل الريلز: .video-info (reels overlay)
 *   [6]  معلومات الفيديو — الوضع العادي + سطح المكتب: .video-info-section
 *   [7]  القائمة الجانبية: .sidebar-container, .sidebar-tabs
 *   [8]  اللوحات: بحث، فلاتر، قائمة، معلومات
 *   [9]  الموديلات: detail, grid, share
 *   [10] القائمة الرئيسية (ريلز): .reels-main-menu-panel
 *   [11] شريط المشترك: .reels-subscriber-bar
 *   [12] الفوتر (ريلز): .reels-footer
 *   [13] الإشعارات والتحميل والأخطاء
 *   [14] التخطيط الموحد (≥ 768px): .up-wrapper, .up-desktop-sidebar
 *   [15] الموبايل (≤ 768px): تعديلات
 *   [16] الثيم الداكن
 *   [17] إمكانية الوصول + طباعة
 */


/* ═══════════════════════════════════════════════════════════
   [1] الهيكل العام
   ═══════════════════════════════════════════════════════════ */

.reels-page {
    background: var(--yvs-bg-primary, #0a0a0a);
    min-height: 100vh;
    position: relative;
    overflow: hidden;
}

.reels-container {
    background: var(--yvs-bg-primary, #0a0a0a);
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh; height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
    cursor: grab;
}
.reels-container:active { cursor: grabbing; }

/* التخطيط الموحد — الأغلفة (مخفية افتراضياً = موبايل) */
.up-mainmenu-wrap       { display: none; }
.up-desktop-sidebar     { display: none; }
.up-footer-wrap         { display: none; }
.up-video-info-desktop  { display: none; }
.up-wrapper      { width: 100%; min-height: 100vh; }
.up-player-col   { width: 100%; }
.up-player-inner { width: 100%; height: 100vh; height: 100dvh; }


/* ═══════════════════════════════════════════════════════════
   [2] أزرار التحكم العلوية
   ═══════════════════════════════════════════════════════════ */

.top-controls {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 70px;
    padding: calc(12px + var(--safe-area-top, 0px)) 20px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    z-index: 60;
}
.top-left, .top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.page-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,.8);
}
.control-btn {
    width: 44px; height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--yvs-bg-overlay, rgba(0,0,0,.7));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .15s ease;
}
.control-btn:hover  { background: #2a2a2a; transform: scale(1.1); }
.control-btn:active { transform: scale(.95); }


/* ═══════════════════════════════════════════════════════════
   [3] لوحة الإجراءات الجانبية
   ═══════════════════════════════════════════════════════════ */

.reels-actions-panel {
    position: absolute;
    bottom: 200px; left: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 30;
}
.reels-action-btn {
    width: 50px; height: 50px;
    border: 0;
    border-radius: 50%;
    background: var(--yvs-bg-overlay, rgba(0,0,0,.7));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    transition: all .15s ease;
    position: relative;
}
.reels-action-btn:hover  { background: #2a2a2a; transform: scale(1.1); }
.reels-action-btn:active { transform: scale(.9); }
.reels-action-btn.active { background: var(--yvs-primary, #e53e3e); color: #fff; }
.action-count {
    margin-top: 4px;
    font-size: 11px; font-weight: 600;
    line-height: 1;
    min-height: 14px;
    text-align: center;
}


/* ═══════════════════════════════════════════════════════════
   [4] أزرار التنقل
   ═══════════════════════════════════════════════════════════ */

.navigation-controls {
    position: absolute;
    top: 50%; right: 20px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 30;
}
.nav-btn {
    width: 48px; height: 48px;
    border: 0;
    border-radius: 50%;
    background: var(--yvs-bg-overlay, rgba(0,0,0,.7));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .15s ease;
}
.nav-btn:hover:not(:disabled) { background: #2a2a2a; transform: scale(1.1); }
.nav-btn:disabled, .nav-btn.disabled {
    opacity: .3; cursor: not-allowed; pointer-events: none;
}

/* مؤشر المنصة */
.platform-indicator {
    position: absolute;
    top: 80px; right: 20px;
    display: flex; align-items: center; gap: 6px;
    padding: 8px 12px;
    background: var(--yvs-bg-overlay, rgba(0,0,0,.7));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    color: #fff;
    font-size: 12px; font-weight: 500;
    z-index: 20;
}
.platform-indicator i { font-size: 14px; }


/* ═══════════════════════════════════════════════════════════
   [5] معلومات الفيديو — داخل الريلز (overlay)
   ═══════════════════════════════════════════════════════════ */

/* هذا القسم يظهر فقط في وضع الريلز على الموبايل */
#reels-container .video-info {
    position: absolute;
    bottom: 0;
    left: 80px; right: 20px;
    z-index: 20;
    color: #fff;
}
#reels-container .video-info .video-title {
    font-size: 16px; font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,.8);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* القناة + الإحصائيات (ريلز) */
.video-channel-stats-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin-bottom: 8px;
}
.video-channel {
    flex: 1 1 auto;
    min-width: min(140px, 40%);
}
.channel-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #e2e8f0;
    font-size: 13px; font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s ease;
}
.channel-link:hover { color: #fff; }
.channel-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--yvs-primary, #e53e3e);
}
.channel-name {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    white-space: nowrap;
}
.video-stats-compact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
    direction: ltr;
    flex: 1 0 auto;
    min-width: min(140px, 50%);
}
.video-stats-compact span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

/* أزرار داخل overlay الريلز */
.video-info-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.action-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255,255,255,.9);
    text-decoration: none;
    font-size: 10px;
    padding: 4px 6px;
    background: rgba(255,255,255,.15);
    border-radius: 14px;
    transition: all .2s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.action-link:hover {
    background: rgba(255,255,255,.25);
    color: #fff;
    transform: translateY(-1px);
}
.action-link i { font-size: 9px; }

/* هاشتاجات inline (داخل الريلز) */
.video-hashtags-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.hashtag-mini-btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    color: var(--yvs-primary-light, #fc8181);
    font-size: 11px; font-weight: 500;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.hashtag-mini-btn:hover {
    background: var(--yvs-primary, #e53e3e);
    color: #fff;
    border-color: var(--yvs-primary, #e53e3e);
}
.hashtags-more {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    font-size: 10px;
    color: #94a3b8;
    background: rgba(255,255,255,.06);
    border-radius: 10px;
}


/* ═══════════════════════════════════════════════════════════
   [6] معلومات الفيديو — الوضع العادي + سطح المكتب
   ═══════════════════════════════════════════════════════════ */

/* بطاقة معلومات الفيديو */
.video-info-section,
.video-info-container {
    border-radius: var(--card-radius, 8px);
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg, #fff);
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    transition: background-color var(--transition-speed, .3s), box-shadow var(--transition-speed, .3s);
}
.video-info-section .video-title,
.video-info-container .video-title {
    color: var(--dark-text, #333);
    margin-bottom: 1rem;
    font-size: 1.5rem; font-weight: 700;
    line-height: 1.4;
}

/* شريط البيانات الوصفية */
.video-meta-bar {
    border-bottom: 1px solid var(--border-color, #eee);
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 0;
    display: flex;
}

/* معلومات المزوّد */
.provider-info-compact {
    flex: 1;
    align-items: center;
    min-width: 200px;
    display: flex;
}
.provider-link {
    color: inherit;
    transition: color var(--transition-speed, .3s);
    align-items: center;
    text-decoration: none;
    display: flex;
}
.provider-link:hover { color: var(--primary-color, #d32f2f); }
.provider-avatar {
    border: 2px solid var(--border-color, #eee);
    width: 48px; height: 48px;
    transition: border-color var(--transition-speed, .3s);
    border-radius: 50%;
    margin-left: 12px;
    object-fit: cover;
}
.provider-link:hover .provider-avatar { border-color: var(--primary-color, #d32f2f); }
.provider-details { flex-direction: column; display: flex; }
.provider-name { color: var(--dark-text, #333); }
.provider-subscribers { color: var(--light-text, #757575); font-size: .85rem; }

/* الإحصائيات (الوضع العادي) */
.video-stats {
    color: var(--light-text, #757575);
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: .9rem;
    display: flex;
}
.video-stats > span {
    white-space: nowrap;
    align-items: center;
    display: flex;
}
.video-stats i {
    color: var(--secondary-color, #455a64);
    margin-left: 6px;
}

/* زر الإعجاب */
.like-btn, #like-button {
    color: var(--light-text, #757575);
    border-radius: 4px;
    transition: all var(--transition-speed, .3s);
    cursor: pointer;
    background: transparent;
    border: 0;
    align-items: center;
    gap: 4px;
    padding: .25rem .5rem;
    display: flex;
}
.like-btn:hover, #like-button:hover {
    color: var(--primary-hover, #b71c1c);
    background-color: rgba(211,47,47,.1);
}
.like-btn.liked, #like-button.liked { color: var(--primary-color, #d32f2f); }
.like-btn i, #like-button i { margin: 0; font-size: 1.1rem; }
.like-animation { animation: likeAnimation .6s; }
@keyframes likeAnimation { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* الملخص التحريري */
.editorial-insight,
.video-summary {
    border-right: 4px solid var(--primary-color, #d32f2f);
    border-radius: var(--card-radius, 8px);
    color: var(--dark-text, #333);
    background: var(--light-bg, #f5f5f5);
    margin: 1rem 0;
    padding: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
}
.editorial-insight i {
    color: var(--primary-color, #d32f2f);
    opacity: .7;
    margin-left: 8px;
    font-size: 1.2rem;
}

/* شريط الإجراءات */
.action-bar {
    flex-wrap: wrap;
    gap: .75rem;
    margin: 1rem 0;
    display: flex;
}
.btn-action {
    border: 1px solid var(--border-color, #eee);
    color: var(--light-text, #757575);
    transition: all var(--transition-speed, .3s);
    background-color: var(--card-bg, #fff);
    border-radius: 20px;
    align-items: center;
    gap: 6px;
    padding: .5rem 1rem;
    font-size: .9rem;
    text-decoration: none;
    display: inline-flex;
}
.btn-action:hover {
    background-color: var(--primary-color, #d32f2f);
    border-color: var(--primary-color, #d32f2f);
    color: #fff;
    transform: translateY(-1px);
}

/* شريط التحكم السريع */
.video-controls-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0 6px;
    margin: 0 0 8px;
    border-bottom: 1px solid var(--border-color, #eee);
    flex-wrap: wrap;
}
.control-bar-btn {
    background: var(--light-bg, #f5f5f5);
    border: 1px solid var(--border-color, #eee);
    border-radius: 6px;
    padding: 5px 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 12.5px; font-weight: 500;
    color: var(--dark-text, #333);
    transition: all .2s;
}
.control-bar-btn:hover {
    background: var(--primary-color, #d32f2f);
    color: #fff;
    border-color: var(--primary-color, #d32f2f);
}

/* هاشتاجات (الوضع العادي) */
.hashtags-strip {
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1rem;
    display: flex;
}
.hashtag-badge {
    color: var(--primary-color, #d32f2f);
    transition: all var(--transition-speed, .3s);
    background: var(--light-bg, #f5f5f5);
    border: 1px solid var(--border-color, #eee);
    border-radius: 15px;
    padding: .35rem .75rem;
    font-size: .85rem; font-weight: 500;
    text-decoration: none;
    display: inline-block;
}
.hashtag-badge:hover {
    background: var(--primary-color, #d32f2f);
    border-color: var(--primary-color, #d32f2f);
    color: #fff;
}


/* ═══════════════════════════════════════════════════════════
   [7] القائمة الجانبية
   ═══════════════════════════════════════════════════════════ */

.sidebar-container {
    border-radius: var(--card-radius, 8px);
    box-shadow: var(--card-shadow);
    background-color: var(--card-bg, #fff);
    overflow: hidden;
    height: fit-content;
    position: sticky;
    top: calc(var(--header-height, 70px) + 15px);
}
.sidebar-tabs {
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--light-bg, #f5f5f5);
    margin: 0; padding: 0;
    display: flex;
}
.sidebar-tabs .nav-item { flex: 1; }
.sidebar-tabs .nav-link {
    color: var(--light-text, #757575);
    transition: all var(--transition-speed, .3s);
    text-align: center;
    border: 0; border-radius: 0;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    padding: .75rem .5rem;
    font-size: .85rem; font-weight: 500;
    display: flex;
}
.sidebar-tabs .nav-link i {
    color: var(--secondary-color, #455a64);
    margin-bottom: 4px;
    font-size: 1.1rem;
}
.sidebar-tabs .nav-link.active {
    color: var(--primary-color, #d32f2f);
    border-bottom: 3px solid var(--primary-color, #d32f2f);
    background-color: var(--card-bg, #fff);
}

/* قائمة الفيديوهات في الشريط */
.sidebar-videos-list {
    padding: 1rem;
    max-height: 600px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, #eee) transparent;
    -webkit-overflow-scrolling: touch;
}
.sidebar-videos-list::-webkit-scrollbar { width: 8px; }
.sidebar-videos-list::-webkit-scrollbar-thumb {
    background-color: var(--border-color, #eee);
    border-radius: 4px;
}

.sidebar-video-item {
    transition: all var(--transition-speed, .3s);
    border-bottom: 1px solid var(--border-color, #eee);
    margin-bottom: 1rem;
    padding-bottom: 1rem;
}
.sidebar-video-item:last-child { border-bottom: none; margin-bottom: 0; }
.sidebar-video-link {
    color: inherit;
    flex-direction: row-reverse;
    text-decoration: none;
    display: flex;
}
.sidebar-video-thumbnail {
    border-radius: var(--card-radius, 8px);
    background-color: var(--light-bg, #f5f5f5);
    width: 120px; height: 68px;
    flex-shrink: 0;
    margin-left: 12px;
    position: relative;
    overflow: hidden;
}
.sidebar-video-thumbnail img {
    object-fit: cover;
    width: 100%; height: 100%;
    transition: transform .5s;
}
.sidebar-video-link:hover .sidebar-video-thumbnail img { transform: scale(1.05); }
.video-duration-small {
    color: #fff;
    background-color: rgba(0,0,0,.8);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: .7rem; font-weight: 500;
    position: absolute;
    bottom: 4px; left: 4px;
}
.sidebar-video-info { flex: 1; min-width: 0; }
.video-title-small {
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--dark-text, #333);
    text-align: right;
    margin-bottom: 6px;
    font-size: .9rem; font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    overflow: hidden;
}
.sidebar-video-link:hover .video-title-small { color: var(--primary-color, #d32f2f); }
.related-video-meta {
    color: var(--light-text, #757575);
    font-size: .75rem;
    display: flex;
    flex-direction: column;
}


/* ═══════════════════════════════════════════════════════════
   [8] اللوحات: بحث، فلاتر، قائمة، معلومات
   ═══════════════════════════════════════════════════════════ */

.search-panel, .filters-panel, .menu-panel, .video-info-panel {
    position: absolute;
    top: 0; right: -100%;
    width: 100%; max-width: 400px;
    height: 100%;
    background: #1a1a1a;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid #2a2a2a;
    z-index: 100;
    overflow-y: auto;
    transition: right .3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--yvs-primary, #e53e3e) #2a2a2a;
}
.search-panel::-webkit-scrollbar, .filters-panel::-webkit-scrollbar,
.menu-panel::-webkit-scrollbar, .video-info-panel::-webkit-scrollbar { width: 8px; }
.search-panel::-webkit-scrollbar-thumb, .filters-panel::-webkit-scrollbar-thumb,
.menu-panel::-webkit-scrollbar-thumb, .video-info-panel::-webkit-scrollbar-thumb {
    background: var(--yvs-primary, #e53e3e); border-radius: 4px;
}
.search-panel.active, .filters-panel.active,
.menu-panel.active, .video-info-panel.active {
    right: 0;
    animation: slideInRight .4s ease-out;
}
@keyframes slideInRight { from { transform: translateX(100%); } to { transform: translateX(0); } }

/* رؤوس اللوحات */
.search-header, .filters-header, .menu-header {
    position: sticky; top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    z-index: 10;
}
.search-header h3, .filters-header h3, .menu-header h3 {
    font-size: 18px; font-weight: 700; color: #fff;
}
.close-btn {
    width: 36px; height: 36px;
    border: 0; border-radius: 50%;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all .15s ease;
}
.close-btn:hover { background: #f56565; transform: scale(1.1); }

.search-content, .filters-content, .menu-content, .video-info-content {
    padding: 20px;
}

/* حقل البحث */
.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid transparent;
    border-radius: 12px;
    background: #2a2a2a;
    color: #fff;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    transition: border-color .15s ease;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus { border-color: var(--yvs-primary, #e53e3e); outline: 0; }

/* عنصر في القائمة */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 0;
    border: 0;
    border-bottom: 1px solid #2a2a2a;
    background: transparent;
    color: #e2e8f0;
    font-size: 16px; font-weight: 500;
    text-align: right;
    text-decoration: none;
    cursor: pointer;
    transition: all .15s ease;
}
.menu-item:hover {
    color: #fff;
    background: #2a2a2a;
    padding-right: 12px;
    border-radius: 12px;
}
.menu-item i { width: 24px; color: var(--yvs-primary, #e53e3e); font-size: 18px; }

/* مجموعة الفلاتر */
.filter-group { margin-bottom: 24px; }
.filter-label {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 12px;
    font-size: 14px; font-weight: 600; color: #fff;
}
.filter-label i { color: var(--yvs-primary, #e53e3e); font-size: 16px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-option {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px;
    border: 0; border-radius: 12px;
    background: #2a2a2a;
    color: #e2e8f0;
    font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}
.filter-option:hover { background: #0a0a0a; color: #fff; }
.filter-option.active { background: var(--yvs-primary, #e53e3e); color: #fff; }

.filter-select, .filter-search {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    font-family: 'Tajawal', sans-serif;
    transition: border-color .15s ease;
}
.filter-select:focus, .filter-search:focus {
    border-color: var(--yvs-primary, #e53e3e);
    outline: 0;
    background: #1a1a1a;
}

.hashtags-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.hashtag-pill {
    padding: 6px 12px;
    border: 0; border-radius: 20px;
    background: #2a2a2a;
    color: #e2e8f0;
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}
.hashtag-pill:hover { background: var(--yvs-primary-light, #fc8181); color: #fff; }
.hashtag-pill.active { background: var(--yvs-primary, #e53e3e); color: #fff; }

.filter-actions {
    display: flex; gap: 12px;
    margin-top: 24px; padding-top: 24px;
    border-top: 1px solid #2a2a2a;
}
.btn-apply-filters, .btn-reset-filters {
    flex: 1;
    display: flex; justify-content: center; align-items: center; gap: 8px;
    padding: 12px 20px;
    border: 0; border-radius: 12px;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-apply-filters { background: var(--yvs-primary, #e53e3e); color: #fff; }
.btn-apply-filters:hover { background: var(--yvs-primary-dark, #c53030); transform: translateY(-2px); }
.btn-reset-filters { background: #2a2a2a; color: #e2e8f0; }
.btn-reset-filters:hover { background: #0a0a0a; color: #fff; }

/* البحث السريع */
.quick-search-section { margin-bottom: 20px; }
.section-label { color: #e2e8f0; margin-bottom: 10px; font-size: 14px; font-weight: 600; display: block; }
.quick-search-buttons { flex-wrap: wrap; gap: 8px; display: flex; }
.quick-search-btn {
    background: #2a2a2a;
    border: 1px solid #2a2a2a;
    color: #e2e8f0;
    cursor: pointer;
    transition: all .15s;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
}
.quick-search-btn:hover { background: var(--yvs-primary, #e53e3e); color: #fff; border-color: var(--yvs-primary, #e53e3e); }

/* نتائج البحث */
.search-results { min-height: 200px; margin-bottom: 20px; }
.search-welcome { text-align: center; color: #e2e8f0; padding: 40px 20px; }
.search-welcome i { color: var(--yvs-primary, #e53e3e); margin-bottom: 16px; font-size: 48px; display: block; }
.search-welcome h4 { color: #fff; margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.search-welcome p { margin: 0; font-size: 14px; line-height: 1.5; }

.search-result-item {
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
    background: rgba(255,255,255,.05);
    align-items: center;
    margin-bottom: 8px;
    padding: 12px;
    display: flex;
}
.search-result-item:hover { background: rgba(255,255,255,.1); transform: translateY(-1px); }
.result-thumbnail {
    background: #2a2a2a;
    border-radius: 6px;
    flex-shrink: 0;
    width: 60px; height: 45px;
    margin-left: 12px;
    overflow: hidden;
}
.result-thumbnail img { object-fit: cover; width: 100%; height: 100%; }
.result-info { flex: 1; min-width: 0; }
.result-title {
    color: #fff;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0 0 4px;
    font-size: 14px; font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    overflow: hidden;
}
.result-channel { color: #e2e8f0; margin: 0; font-size: 12px; }

.search-loading, .search-no-results, .search-error {
    text-align: center; color: #e2e8f0; padding: 30px 20px;
}
.search-loading i, .search-no-results i, .search-error i {
    margin-bottom: 12px; font-size: 36px; display: block;
}
.search-loading i { color: var(--yvs-primary, #e53e3e); animation: spin 1s linear infinite; }
.search-no-results i { color: #ed8936; }
.search-error i { color: #f56565; }

.search-actions { border-top: 1px solid #2a2a2a; padding-top: 15px; }
.btn-clear-search {
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    width: 100%;
    color: #e2e8f0;
    cursor: pointer;
    transition: all .15s;
    background: transparent;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px;
    font-size: 14px;
    display: flex;
}
.btn-clear-search:hover { background: #2a2a2a; color: #fff; }

/* Custom select */
.custom-select-container { position: relative; width: 100%; font-family: 'Tajawal', sans-serif; }
.custom-select__trigger {
    display: flex; justify-content: space-between; align-items: center;
    height: 45px; padding: 10px 15px;
    background-color: #2a2a2e; border: 1px solid #444; border-radius: 8px;
    color: #e0e0e0; font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s ease;
}
.custom-select-container.open .custom-select__trigger {
    border-color: var(--yvs-primary, #e53e3e);
    box-shadow: 0 0 0 2px rgba(229,62,62,.3);
}
.custom-select__trigger .arrow { position: relative; width: 10px; height: 10px; }
.custom-select__trigger .arrow::before,
.custom-select__trigger .arrow::after {
    content: ''; position: absolute; bottom: 0;
    width: 2px; height: 100%;
    background-color: #999; transition: all .2s ease;
}
.custom-select__trigger .arrow::before { left: 1px; transform: rotate(45deg); }
.custom-select__trigger .arrow::after  { left: 6px; transform: rotate(-45deg); }
.custom-select-container.open .arrow::before { transform: rotate(-45deg); }
.custom-select-container.open .arrow::after  { transform: rotate(45deg); }
.custom-select__options {
    position: absolute; top: 105%; left: 0; right: 0;
    max-height: 250px;
    background-color: #1e1e22; border: 1px solid #444; border-radius: 8px;
    box-shadow: 0 10px 20px rgba(0,0,0,.3);
    overflow-y: auto; display: none; z-index: 100;
}
.custom-select-container.open .custom-select__options { display: block; }
.custom-select__option {
    display: flex; align-items: center;
    padding: 12px 15px;
    color: #ccc; font-size: 14px;
    cursor: pointer; transition: background-color .2s ease;
}
.custom-select__option:hover { background-color: #2a2a2e; }
.custom-select__option.selected { color: #fff; background-color: var(--yvs-primary, #e53e3e); font-weight: 600; }
.option-avatar { width: 24px; height: 24px; margin-left: 10px; border-radius: 50%; object-fit: cover; border: 1px solid #555; }


/* ═══════════════════════════════════════════════════════════
   [9] الموديلات: share, detail, grid
   ═══════════════════════════════════════════════════════════ */

/* ─── المشاركة ─── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    display: flex;
    justify-content: center; align-items: center;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 200;
}
.modal-content {
    width: 90%; max-width: 500px; max-height: 80vh;
    background: #1a1a1a;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,.3);
    overflow-y: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #2a2a2a;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: #fff; }
.modal-body { padding: 20px; }
.modal-body p { text-align: center; color: #e2e8f0; margin-bottom: 16px; }

.share-icons { display: flex; justify-content: center; gap: 16px; margin: 20px 0; }
.share-icon {
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    font-size: 20px; color: #fff;
    text-decoration: none;
    transition: all .15s ease;
}
.share-icon.whatsapp  { background: #25d366; }
.share-icon.facebook  { background: #1877f2; }
.share-icon.twitter   { background: #1da1f2; }
.share-icon.telegram  { background: #08c; }
.share-icon.email     { background: #ea4335; }
.share-icon:hover { transform: scale(1.1) translateY(-2px); }

.share-or-text {
    position: relative;
    text-align: center;
    color: #94a3b8;
    font-size: 14px;
    margin: 20px 0 16px;
}
.share-or-text::before, .share-or-text::after {
    content: '';
    position: absolute; top: 50%;
    width: 30%; height: 1px;
    background: #2a2a2a;
}
.share-or-text::before { right: 0; }
.share-or-text::after  { left: 0; }

.share-link-container { display: flex; gap: 8px; }
.share-link-container input {
    flex: 1; padding: 12px;
    border: 0; border-radius: 12px;
    background: #2a2a2a;
    color: #fff;
    font-size: 14px;
    text-align: left; direction: ltr;
}
.btn-copy {
    display: flex; align-items: center; gap: 6px;
    padding: 12px 16px;
    border: 0; border-radius: 12px;
    background: var(--yvs-primary, #e53e3e);
    color: #fff;
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    transition: all .15s ease;
}
.btn-copy:hover { background: var(--yvs-primary-dark, #c53030); }

/* مشاركة الوضع العادي */
.share-platforms { grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1.5rem; display: grid; }
.btn-social {
    border-radius: var(--card-radius, 8px);
    color: #fff;
    transition: transform var(--transition-speed, .3s);
    border: 0;
    justify-content: center; align-items: center;
    gap: 8px; padding: .75rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
}
.btn-social:hover { color: #fff; transform: translateY(-2px); }
.btn-facebook { background-color: #1877f2; }
.btn-twitter  { background-color: #1da1f2; }
.btn-whatsapp { background-color: #25d366; }
.btn-telegram { background-color: #08c; }

/* ─── موديل التفاصيل ─── */
.reels-detail-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 190; display: none; }
.reels-detail-modal.active { display: block; }
.rdm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.rdm-sheet {
    position: absolute; bottom: 0; left: 0; right: 0;
    max-height: 80vh;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.22,1,.36,1);
    scrollbar-width: thin;
}
.reels-detail-modal.active .rdm-sheet { transform: translateY(0); }
.rdm-handle { display: flex; justify-content: center; padding: 10px 0 4px; }
.rdm-handle span { width: 36px; height: 4px; background: #2a2a2a; border-radius: 2px; }
.rdm-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px 12px; border-bottom: 1px solid #2a2a2a; }
.rdm-title { font-size: 16px; font-weight: 700; color: #fff; margin: 0; }
.rdm-body { padding: 16px 20px 32px; }
.rdm-video-title { font-size: 16px; font-weight: 600; color: #fff; line-height: 1.5; margin: 0 0 12px; }
.rdm-channel { margin-bottom: 14px; }
.rdm-channel-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; background: #2a2a2a; border-radius: 8px;
    text-decoration: none; color: #fff; transition: all .15s;
}
.rdm-channel-link:hover { background: rgba(255,255,255,.1); }
.rdm-channel-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--yvs-primary, #e53e3e); }
.rdm-channel-name { font-weight: 600; font-size: 14px; display: block; }
.rdm-channel-action { font-size: 12px; color: var(--yvs-primary-light, #fc8181); }
.rdm-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; color: #94a3b8; font-size: 13px; }
.rdm-stats span { display: inline-flex; align-items: center; gap: 5px; }
.rdm-stats i { color: var(--yvs-primary, #e53e3e); font-size: 12px; }
.rdm-category { margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.rdm-label { font-size: 13px; font-weight: 600; color: #94a3b8; margin: 0 0 8px; }
.rdm-category .rdm-label { margin: 0; }
.rdm-category-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 12px; background: #2a2a2a; border: 0; border-radius: 14px;
    color: #e2e8f0; font-size: 13px; font-family: 'Tajawal', sans-serif;
    cursor: pointer; transition: all .15s;
}
.rdm-category-btn:hover { background: var(--yvs-primary, #e53e3e); color: #fff; }
.rdm-summary { margin-bottom: 14px; }
.rdm-summary-text { font-size: 14px; line-height: 1.7; color: #e2e8f0; white-space: pre-wrap; word-wrap: break-word; max-height: 200px; overflow-y: auto; }
.rdm-hashtags { margin-bottom: 16px; }
.rdm-hashtags-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rdm-hashtag-btn {
    display: inline-flex; align-items: center;
    padding: 6px 14px; background: #2a2a2a; border: 0; border-radius: 16px;
    color: var(--yvs-primary-light, #fc8181); font-size: 13px; font-weight: 500;
    font-family: 'Tajawal', sans-serif; cursor: pointer; transition: all .15s;
}
.rdm-hashtag-btn:hover { background: var(--yvs-primary, #e53e3e); color: #fff; }
.rdm-external { margin-bottom: 12px; }
.rdm-external-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; background: #2a2a2a; border-radius: 12px;
    color: #e2e8f0; font-size: 14px; text-decoration: none; transition: all .15s;
}
.rdm-external-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.rdm-full-view { margin-top: 12px; }
.rdm-full-view-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px;
    background: var(--yvs-primary, #e53e3e); border-radius: 12px;
    color: #fff; font-size: 14px; font-weight: 600;
    text-decoration: none; transition: all .15s;
}
.rdm-full-view-btn:hover { background: var(--yvs-primary-dark, #c53030); transform: translateY(-2px); }

/* إغلاق الموديلات */
.reels-detail-modal.closing .rdm-sheet,
.reels-grid-modal.closing .rgm-sheet {
    transform: translateY(100%);
    transition: transform .25s ease-in;
}
body.reels-modal-open { overflow: hidden; }

/* ─── موديل الشبكة ─── */
.reels-grid-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 170; display: none; }
.reels-grid-modal.active { display: block; }
.rgm-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.rgm-sheet {
    position: absolute; bottom: 0; left: 0; right: 0;
    max-height: 85vh;
    background: #1a1a1a;
    border-radius: 20px 20px 0 0;
    overflow: hidden; display: flex; flex-direction: column;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.22,1,.36,1);
}
.reels-grid-modal.active .rgm-sheet { transform: translateY(0); }
.rgm-handle { display: flex; justify-content: center; padding: 10px 0 4px; }
.rgm-handle span { width: 36px; height: 4px; background: #2a2a2a; border-radius: 2px; }
.rgm-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px 12px; border-bottom: 1px solid #2a2a2a; flex-shrink: 0; }
.rgm-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.rgm-header-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--yvs-primary, #e53e3e); flex-shrink: 0; }
.rgm-title { font-size: 16px; font-weight: 700; color: #fff; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rgm-subtitle { font-size: 12px; color: #94a3b8; }
.rgm-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rgm-filter-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 14px; background: var(--yvs-primary, #e53e3e); border: 0; border-radius: 16px;
    color: #fff; font-size: 12px; font-weight: 600; font-family: 'Tajawal', sans-serif;
    cursor: pointer; transition: all .15s;
}
.rgm-filter-btn:hover { background: var(--yvs-primary-dark, #c53030); transform: scale(1.05); }
.rgm-body { flex: 1; overflow-y: auto; padding: 12px; scrollbar-width: thin; }
.rgm-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px; color: #94a3b8; font-size: 14px; }
.rgm-empty { text-align: center; padding: 40px 20px; color: #94a3b8; }
.rgm-empty i { font-size: 48px; margin-bottom: 12px; display: block; opacity: .5; }
.rgm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.rgm-grid-item {
    position: relative; aspect-ratio: 9/12;
    border-radius: 4px; overflow: hidden;
    cursor: pointer; background: #2a2a2a; transition: all .15s;
}
.rgm-grid-item:hover { opacity: .85; transform: scale(1.02); }
.rgm-grid-item:active { transform: scale(.97); }
.rgm-grid-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.rgm-grid-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 24px 6px 6px; background: linear-gradient(transparent, rgba(0,0,0,.8)); pointer-events: none; }
.rgm-grid-title { font-size: 11px; font-weight: 500; color: #fff; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rgm-grid-duration { position: absolute; top: 4px; left: 4px; padding: 2px 5px; background: rgba(0,0,0,.75); color: #fff; font-size: 10px; font-weight: 600; border-radius: 3px; }
.rgm-grid-views { display: flex; align-items: center; gap: 3px; font-size: 10px; color: rgba(255,255,255,.7); margin-top: 2px; }
.rgm-load-more { text-align: center; padding: 16px; }
.rgm-load-more-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 24px; background: #2a2a2a; border: 0; border-radius: 12px;
    color: #e2e8f0; font-size: 14px; font-weight: 500; font-family: 'Tajawal', sans-serif;
    cursor: pointer; transition: all .15s;
}
.rgm-load-more-btn:hover { background: var(--yvs-primary, #e53e3e); color: #fff; }


/* ═══════════════════════════════════════════════════════════
   [10] القائمة الرئيسية — ريلز
   ═══════════════════════════════════════════════════════════ */

.reels-main-menu-panel {
    position: absolute;
    top: 0; right: -100%;
    width: 100%; max-width: 400px;
    height: 100%;
    background: #1a1a1a;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid #2a2a2a;
    z-index: 100;
    overflow-y: auto;
    transition: right .3s ease;
    scrollbar-width: thin;
}
.reels-main-menu-panel.active { right: 0; animation: slideInRight .4s ease-out; }
.rmm-header {
    position: sticky; top: 0;
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    z-index: 10;
}
.rmm-brand { display: flex; align-items: center; gap: 8px; }
.rmm-brand i { color: var(--yvs-primary, #e53e3e); font-size: 22px; }
.rmm-brand h2 { font-size: 18px; font-weight: 700; color: #fff; margin: 0; }
.rmm-content { padding: 12px 20px 32px; }
.rmm-subscriber-section { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #2a2a2a; }
.rmm-subscriber-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: #2a2a2a; border-radius: 12px;
    text-decoration: none; color: #fff; transition: all .15s;
}
.rmm-subscriber-card:hover { background: rgba(255,255,255,.1); }
.rmm-subscriber-avatar { flex-shrink: 0; }
.rmm-subscriber-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--yvs-primary, #e53e3e); }
.rmm-subscriber-avatar i { font-size: 36px; color: #94a3b8; }
.rmm-subscriber-info { flex: 1; min-width: 0; }
.rmm-subscriber-name { display: block; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmm-subscriber-action { font-size: 12px; color: var(--yvs-primary-light, #fc8181); }
.rmm-subscriber-card > i { color: #94a3b8; font-size: 12px; }
.rmm-subscriber-links { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.rmm-quick-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 12px; background: #2a2a2a; border-radius: 16px;
    color: #e2e8f0; font-size: 12px; text-decoration: none; transition: all .15s;
}
.rmm-quick-link:hover { background: var(--yvs-primary, #e53e3e); color: #fff; }
.rmm-quick-link i { font-size: 11px; }
.rmm-login-prompt { text-align: center; padding: 20px 12px; background: #2a2a2a; border-radius: 12px; }
.rmm-login-prompt i { font-size: 32px; color: #94a3b8; margin-bottom: 8px; }
.rmm-login-prompt p { color: #94a3b8; font-size: 13px; margin-bottom: 12px; line-height: 1.5; }
.rmm-login-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 24px; background: var(--yvs-primary, #e53e3e); color: #fff;
    border-radius: 12px; text-decoration: none;
    font-size: 14px; font-weight: 600; transition: all .15s;
}
.rmm-login-btn:hover { background: var(--yvs-primary-dark, #c53030); transform: translateY(-2px); }
.rmm-section { margin-bottom: 16px; }
.rmm-section-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: .5px;
    margin-bottom: 8px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,.05);
}
.rmm-section-title i { color: var(--yvs-primary, #e53e3e); font-size: 14px; }
.rmm-section-items { display: flex; flex-direction: column; gap: 2px; }
.rmm-menu-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 8px; border: 0; border-radius: 8px;
    background: transparent; color: #e2e8f0;
    font-size: 15px; font-weight: 500; font-family: 'Tajawal', sans-serif;
    text-decoration: none; text-align: right;
    width: 100%; cursor: pointer; transition: all .15s;
}
.rmm-menu-item:hover { background: #2a2a2a; color: #fff; }
.rmm-menu-item i { width: 20px; text-align: center; color: var(--yvs-primary, #e53e3e); font-size: 16px; flex-shrink: 0; }


/* ═══════════════════════════════════════════════════════════
   [11] شريط المشترك
   ═══════════════════════════════════════════════════════════ */

.reels-subscriber-bar {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40px;
    display: flex; align-items: center; justify-content: flex-end;
    padding: 0 16px;
    padding-top: var(--safe-area-top, 0px);
    background: linear-gradient(to bottom, rgba(0,0,0,.5), transparent);
    z-index: 55;
    pointer-events: none;
}
.reels-subscriber-bar > * { pointer-events: auto; }
.subscriber-profile-link, .subscriber-login-link {
    display: flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: rgba(255,255,255,.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    color: #fff; text-decoration: none;
    font-size: 12px; font-weight: 500;
    transition: all .15s; white-space: nowrap;
}
.subscriber-profile-link:hover, .subscriber-login-link:hover { background: rgba(255,255,255,.2); }
.subscriber-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--yvs-primary, #e53e3e); }
.subscriber-avatar-icon { font-size: 20px; color: var(--yvs-primary-light, #fc8181); }
.subscriber-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.subscriber-arrow { font-size: 10px; opacity: .6; }
.subscriber-login-link i { font-size: 14px; color: var(--yvs-primary-light, #fc8181); }


/* ═══════════════════════════════════════════════════════════
   [12] الفوتر — ريلز
   ═══════════════════════════════════════════════════════════ */

.reels-footer { display: none; }
body.reels-footer-active .reels-footer {
    display: block;
    position: fixed; bottom: 0; left: 0; right: 0;
    max-height: 80vh;
    background: #1a1a1a;
    z-index: 200;
    overflow-y: auto;
    animation: slideUpFooter .4s ease;
    border-top: 1px solid #2a2a2a;
}
@keyframes slideUpFooter { 0% { opacity: 0; transform: translateY(100%); } 100% { opacity: 1; transform: translateY(0); } }
.reels-footer-inner { padding: 24px 20px 32px; max-width: 480px; margin: 0 auto; text-align: center; }
.reels-footer-brand { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.reels-footer-brand .brand-icon { color: var(--yvs-primary, #e53e3e); font-size: 22px; }
.reels-footer-brand .brand-name { font-size: 20px; font-weight: 700; color: #fff; }
.reels-footer-desc { color: #94a3b8; font-size: 13px; line-height: 1.6; margin-bottom: 20px; }
.reels-footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.reels-footer-nav a {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 8px 14px; background: #2a2a2a; color: #e2e8f0;
    border-radius: 20px; font-size: 13px; text-decoration: none; transition: all .15s;
}
.reels-footer-nav a:hover { background: var(--yvs-primary, #e53e3e); color: #fff; }
.reels-footer-social { display: flex; justify-content: center; gap: 12px; margin-bottom: 16px; }
.reels-footer-social .social-link {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: #2a2a2a; color: #e2e8f0; border-radius: 50%;
    font-size: 16px; text-decoration: none; transition: all .15s;
}
.reels-footer-social .social-link:hover { background: var(--yvs-primary, #e53e3e); color: #fff; transform: translateY(-2px); }
.reels-footer-copy { color: #94a3b8; font-size: 12px; padding-top: 16px; border-top: 1px solid #2a2a2a; }

.reels-footer-trigger {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,.95));
    text-align: center;
    pointer-events: none;
    transform: translateY(100%);
    transition: transform .3s ease;
    z-index: 50;
}
.reels-footer-trigger.visible { pointer-events: auto; transform: translateY(0); }
.reels-footer-trigger .footer-indicator {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    margin-bottom: 12px; font-size: 14px; color: rgba(255,255,255,.9);
}
.reels-footer-trigger .footer-indicator i { font-size: 16px; animation: bounce 2s ease-in-out infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.reels-footer-trigger .show-footer-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    color: #fff; font-size: 14px; cursor: pointer; transition: all .3s ease;
}
.reels-footer-trigger .show-footer-btn:hover {
    background: rgba(255,255,255,.25); border-color: rgba(255,255,255,.4); transform: translateY(-2px);
}


/* ═══════════════════════════════════════════════════════════
   [13] الإشعارات والتحميل والأخطاء
   ═══════════════════════════════════════════════════════════ */

.loading-indicator {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 20px;
    background: var(--yvs-bg-overlay, rgba(0,0,0,.7));
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-radius: 12px; color: #fff; z-index: 150;
}
.loading-spinner {
    width: 32px; height: 32px;
    border: 3px solid #2a2a2a;
    border-top-color: var(--yvs-primary, #e53e3e);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    z-index: 100;
}

/* Toast */
.toast-container {
    position: fixed; top: 80px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 300;
}
.toast {
    display: flex; align-items: center; gap: 8px;
    min-width: 200px; max-width: 300px;
    padding: 12px 16px;
    background: #1a1a1a; color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,.3);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-left: 4px solid #4299e1;
    font-size: 14px; font-weight: 500;
    opacity: 0; transform: translateX(100%);
    transition: all .3s ease;
}
.toast.show    { opacity: 1; transform: translateX(0); }
.toast.success { border-left-color: #48bb78; }
.toast.error   { border-left-color: #f56565; }
.toast.warning { border-left-color: #ed8936; }
.toast i { flex-shrink: 0; font-size: 16px; }
.toast.success i { color: #48bb78; }
.toast.error i   { color: #f56565; }
.toast.warning i { color: #ed8936; }

/* حالات الخطأ */
.error-state {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: none; flex-direction: column;
    justify-content: center; align-items: center;
    background: #1a1a1a; color: #e2e8f0;
    text-align: center; z-index: 30;
}
.error-state i { font-size: 48px; color: #f56565; margin-bottom: 16px; }
.error-state p { font-size: 16px; margin-bottom: 20px; }
.retry-btn {
    padding: 12px 24px; border: 0; border-radius: 12px;
    background: var(--yvs-primary, #e53e3e); color: #fff;
    font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 8px; transition: all .15s ease;
}
.retry-btn:hover { background: var(--yvs-primary-dark, #c53030); transform: translateY(-2px); }

.error-message, .no-videos-message, .init-error {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    height: 100%; padding: 40px 20px;
    text-align: center; color: #e2e8f0;
}
.error-message i, .no-videos-message i, .init-error i { font-size: 64px; color: #f56565; margin-bottom: 20px; }
.error-message h3, .no-videos-message h3, .init-error h3 { font-size: 24px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.error-message p, .no-videos-message p, .init-error p { font-size: 16px; line-height: 1.5; max-width: 300px; margin-bottom: 24px; }
.retry-button, .btn-reset {
    display: flex; align-items: center; gap: 8px;
    padding: 14px 28px; border: 0; border-radius: 12px;
    background: var(--yvs-primary, #e53e3e); color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
.retry-button:hover, .btn-reset:hover { background: var(--yvs-primary-dark, #c53030); transform: translateY(-2px); }

/* تحميل الفيديو (الوضع العادي) */
.video-loading {
    background-color: var(--light-bg, #f5f5f5);
    min-height: 300px;
    color: var(--light-text, #757575);
    border-radius: var(--card-radius, 8px);
    justify-content: center; align-items: center; display: flex;
}
.video-error-message {
    color: #856404;
    border-radius: var(--card-radius, 8px);
    text-align: center;
    background: #fff3cd; border: 1px solid #ffeeba;
    padding: 1rem; font-weight: 500;
}

/* العد التنازلي */
.next-video-countdown {
    z-index: 1000;
    justify-content: center; align-items: center;
    width: 100%; height: 100%;
    display: flex; position: absolute; top: 0; left: 0;
}
.countdown-overlay {
    backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    background-color: rgba(0,0,0,.8);
    width: 100%; height: 100%;
    position: absolute; top: 0; left: 0;
}
.countdown-content {
    border-radius: var(--card-radius, 8px);
    text-align: center;
    background: var(--card-bg, #fff);
    width: 90%; max-width: 400px;
    padding: 2rem; position: relative; z-index: 10;
    animation: slideInFromTop .5s;
}
@keyframes slideInFromTop { 0% { opacity: 0; transform: translateY(-50px); } 100% { opacity: 1; transform: translateY(0); } }

/* حالة السحب */
.touch-dragging { overflow: hidden; user-select: none; -webkit-user-select: none; }
.touch-dragging * { pointer-events: none; }
.touch-dragging .reels-actions-panel,
.touch-dragging .navigation-controls,
.touch-dragging .top-controls,
.touch-dragging .progress-bar,
.touch-dragging .reels-actions-panel *,
.touch-dragging .navigation-controls *,
.touch-dragging .top-controls *,
.touch-dragging .progress-bar * { pointer-events: auto; }


/* ═══════════════════════════════════════════════════════════
   [14] ★ التخطيط الموحد (≥ 768px)
   ═══════════════════════════════════════════════════════════ */

@media (min-width: 768px) {

    /* إظهار عناصر سطح المكتب */
    .view-mode-unified .up-mainmenu-wrap      { display: block; }
    .view-mode-unified .up-footer-wrap        { display: block; }
    .view-mode-unified .up-video-info-desktop { display: block; }

    /* التخطيط: flex row (RTL = الأول يمين) */
    .view-mode-unified .up-wrapper {
        display: flex;
        flex-direction: row;
        max-width: 100%;
        gap: 0;
    }

    /* عمود المشغل */
    .view-mode-unified .up-player-col {
        flex: 1 1 auto;
        min-width: 0;
		margin-right: 20px;
    }

    /* القائمة الجانبية */
    .view-mode-unified .up-desktop-sidebar {
        display: block;
        flex: 0 0 380px; width: 380px;
        height: 100vh;
        position: sticky; top: 0;
        overflow-y: auto;
        background: var(--card-bg, #fff);
        border-right: 1px solid var(--border-color, #eee);
        scrollbar-width: thin;
        scrollbar-color: var(--border-color, #ddd) transparent;
    }
    .view-mode-unified .up-desktop-sidebar::-webkit-scrollbar { width: 6px; }
    .view-mode-unified .up-desktop-sidebar::-webkit-scrollbar-thumb {
        background: var(--border-color, #ddd); border-radius: 3px;
    }
    .view-mode-unified .up-desktop-sidebar .sidebar-sticky-container { position: static !important; }
    .view-mode-unified .up-desktop-sidebar .sidebar-container { border-radius: 0; box-shadow: none; position: static; }
    .view-mode-unified .up-desktop-sidebar .sidebar-videos-list { max-height: none; }

    /* معلومات الفيديو أسفل المشغل */
    .up-video-info-desktop {
        background: var(--card-bg, #fff);
        border-top: 1px solid var(--border-color, #eee);
    }
    .up-video-info-desktop .video-info-container {
        max-width: 100%; padding: 24px 28px; margin: 0;
        border-radius: 0; box-shadow: none;
    }
    .up-video-info-desktop .video-title { font-size: 1.35rem; }
    .up-video-info-desktop .video-summary {
        border-right: 4px solid var(--primary-color, #d32f2f);
        background: var(--light-bg, #f5f5f5);
        border-radius: 8px;
        padding: 16px 20px;
    }

    /* ─── إخفاء عناصر الريلز المكررة على سطح المكتب ─── */

    /* معلومات الفيديو في overlay الريلز (← أسفل المشغل الآن) */
    .view-mode-unified #reels-container .video-info      { display: none !important; }
    .view-mode-unified #reels-container .video-hashtags-inline { display: none !important; }

    /* العنوان + زر الرجوع (← لدينا mainmenu) */
    .view-mode-unified .top-controls .top-left { display: none !important; }

    /* أزرار الإجراءات الجانبية (← أسفل المشغل) */
    .view-mode-unified .reels-actions-panel { display: none !important; }

    /* مؤشر الوضع */
    .view-mode-unified .view-mode-indicator { display: none !important; }

    /* شريط المشترك (← في mainmenu) */
    .view-mode-unified .reels-subscriber-bar { display: none !important; }

    /* أزرار التحكم العلوية: مصغّرة */
    .view-mode-unified .top-controls {
        height: 50px; padding: 8px 16px;
    }
    .view-mode-unified .top-controls .control-btn {
        width: 38px; height: 38px; font-size: 15px;
        background: rgba(0,0,0,.5);
    }

    /* أزرار التنقل: يسار (بعيداً عن القائمة الجانبية) */
    .view-mode-unified .navigation-controls {
        left: 16px; right: auto;
    }

    /* مؤشر المنصة: أصغر */
    .view-mode-unified .platform-indicator {
        top: 12px; right: 12px;
        opacity: .7; font-size: 11px; padding: 4px 8px;
    }

    /* اللوحات محدودة العرض */
    .search-panel, .filters-panel, .menu-panel, .video-info-panel { max-width: 350px; }
}

/* شاشات أكبر */
@media (min-width: 1200px) {
    .view-mode-unified .up-desktop-sidebar { flex: 0 0 420px; width: 420px; }
    .up-video-info-desktop .video-info-container { padding: 28px 32px; }
    .up-video-info-desktop .video-title { font-size: 1.5rem; }
}
@media (min-width: 1600px) {
    .view-mode-unified .up-desktop-sidebar { flex: 0 0 460px; width: 460px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .view-mode-unified .up-desktop-sidebar { flex: 0 0 300px; width: 300px; }
    .up-video-info-desktop .video-title { font-size: 1.15rem; }
}


/* ═══════════════════════════════════════════════════════════
   [15] الموبايل (≤ 768px): تعديلات UI
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .top-controls { padding: calc(10px + var(--safe-area-top, 0px)) 16px 10px; }
    .page-title { font-size: 16px; }
    .control-btn { width: 40px; height: 40px; font-size: 16px; }
    .reels-actions-panel { left: 16px; gap: 12px; bottom: 190px; }
    .reels-action-btn { width: 48px; height: 48px; font-size: 18px; }
    .action-count { font-size: 10px; }
    .navigation-controls { right: 16px; gap: 8px; }
    .nav-btn { width: 44px; height: 44px; font-size: 16px; }
    #reels-container .video-info { left: 70px; right: 16px; }
    #reels-container .video-info .video-title { font-size: 15px; }
    .video-stats-compact { gap: 12px; font-size: 11px; }
    .platform-indicator { top: 70px; right: 16px; padding: 6px 10px; font-size: 11px; }
    .search-panel, .filters-panel, .menu-panel, .video-info-panel { max-width: 100%; }
    .reels-main-menu-panel { max-width: 100%; }
    .toast-container { left: 16px; right: 16px; }
    .toast { min-width: auto; max-width: 100%; }
    .modal-content { width: 95%; margin: 0 16px; }
    .share-icons { gap: 12px; }
    .share-icon { width: 45px; height: 45px; font-size: 18px; }
    .search-panel .search-header, .search-panel .search-content { padding: 16px; }

    /* الوضع العادي — موبايل */
    .video-info-section, .video-info-container { padding: 1rem; margin-bottom: 1rem; }
    .video-info-section .video-title,
    .video-info-container .video-title { font-size: 1.2rem; }
    .video-meta-bar { flex-direction: column; align-items: flex-start; gap: .75rem; }
    .sidebar-video-link { flex-direction: column; }
    .sidebar-video-thumbnail { width: 100%; height: 0; padding-bottom: 56.25%; margin-left: 0; margin-bottom: 10px; }
    .video-duration-small { bottom: 10px; left: 10px; }
    .video-title-small { font-size: 1rem; }
    .share-platforms { grid-template-columns: 1fr; }
    .sidebar-container { position: static; margin-top: 1.5rem; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .reels-actions-panel { gap: 8px; bottom: 60px; }
    .reels-action-btn { width: 40px; height: 40px; font-size: 16px; }
    #reels-container .video-info { bottom: 50px; }
    #reels-container .video-info .video-title { -webkit-line-clamp: 1; font-size: 14px; }
    .video-stats-compact { display: none; }
    .top-controls { height: 50px; }
}

@media (max-width: 360px) {
    .video-channel-stats-row { flex-direction: column; align-items: flex-start; }
    .video-stats-compact { justify-content: flex-start; width: 100%; }
}


/* ═══════════════════════════════════════════════════════════
   [16] الثيم الداكن
   ═══════════════════════════════════════════════════════════ */

body.dark-theme .video-info-section,
body.dark-theme .video-info-container,
body.dark-theme .sidebar-container,
body.dark-theme .modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}
body.dark-theme .video-info-section .video-title,
body.dark-theme .video-info-container .video-title,
body.dark-theme .provider-name,
body.dark-theme .video-title-small { color: var(--dark-text); }
body.dark-theme .video-stats,
body.dark-theme .provider-subscribers,
body.dark-theme .related-video-meta { color: var(--light-text); }
body.dark-theme .editorial-insight,
body.dark-theme .video-summary {
    background: rgba(255,255,255,.05);
    border-right-color: var(--primary-color);
}
body.dark-theme .sidebar-tabs { background-color: #252525; border-bottom-color: var(--border-color); }
body.dark-theme .sidebar-tabs .nav-link.active { background-color: var(--card-bg); }
body.dark-theme .btn-action { background-color: #333; border-color: #444; color: #ccc; }
body.dark-theme .btn-action:hover { background-color: var(--primary-color); color: #fff; }
body.dark-theme .hashtag-badge { background: #333; color: var(--primary-color); border-color: #444; }
body.dark-theme .hashtag-badge:hover { background: var(--primary-color); color: #fff; }

@media (min-width: 768px) {
    body.dark-theme .up-video-info-desktop {
        background: var(--card-bg, #1e1e22);
        border-top-color: var(--border-color, #2a2a2e);
    }
    body.dark-theme .view-mode-unified .up-desktop-sidebar {
        background: var(--card-bg, #1e1e22);
        border-right-color: var(--border-color, #2a2a2e);
    }
}


/* ═══════════════════════════════════════════════════════════
   [17] إمكانية الوصول + طباعة
   ═══════════════════════════════════════════════════════════ */

.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

button:focus-visible, a:focus-visible, input:focus-visible {
    outline: 2px solid var(--yvs-primary, #e53e3e);
    outline-offset: 2px;
}

.reels-action-btn, .nav-btn, .control-btn {
    will-change: transform, background-color;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    .reels-container,
    .reels-actions-panel,
    .navigation-controls,
    .top-controls,
    .toast-container,
    .reels-footer,
    .reels-footer-trigger,
    .up-mainmenu-wrap { display: none !important; }
    .up-video-info-desktop { display: block !important; }
    .up-desktop-sidebar {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
        position: static !important;
    }
}

/* أيقونة يوتيوب */
i.fab.fa-youtube { font-size: 20px; }
