/* reels.css */

.reels-scroll-container {
    top: 0;
    bottom: 4rem;

    /* 🛑 FIX: إضافة قواعد إخفاء شريط التمرير إلى حاوية الريلز فقط 🛑 */
    overflow-y: scroll;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.reels-scroll-container::-webkit-scrollbar {
    display: none; /* WebKit (Chrome, Safari) */
}

/* 🛑 تم إزالة قاعدة الفلترة الرمادية من هنا 🛑 */
.video-reel-item .interaction-icon {
    width: 32px;
    height: 32px;
    filter: none; /* تم التأكد من عدم وجود فلتر رمادي */
    opacity: 1;
    margin: 0;
    transition: all 0.2s;
}
.video-reel-item .reel-comment-btn .interaction-icon,
.video-reel-item .reel-share-btn .interaction-icon,
.video-reel-item .report-post-btn .interaction-icon,
.video-reel-item .reel-favorite-btn .interaction-icon {
    filter: none;
    opacity: 1;
}

.video-reel-item .reel-heart-btn.like-active {
    background-color: transparent !important;
}

.video-reel-item .reel-heart-btn.like-active .interaction-icon {
    filter: invert(30%) sepia(90%) saturate(7000%) hue-rotate(330deg) !important;
    transform: scale(1.1);
}

.video-reel-item .dislike-active .interaction-icon {
    filter: none !important;
    opacity: 1 !important;
    color: #f87171 !important;
}
.video-reel-item .favorite-active .interaction-icon {
    filter: none !important;
    opacity: 1 !important;
    color: #fcd34d !important;
}
.video-reel-item.opacity-50 {
    opacity: 0.5;
    transition: opacity 0.5s;
}
.video-reel-item .video-iframe-wrapper {
    position: absolute;
    inset: 0;
    background-color: #000;
}
.video-reel-item .video-iframe-wrapper .reel-video-element {
    object-fit: contain;
}

.reel-background-gradient {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0) 100%);
}

.video-reel-item .custom-controls-overlay {
    opacity: 0;
    position: absolute;
    inset: 0;
    z-index: 100;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2) !important;
}
.video-reel-item .custom-controls-overlay .controls-center {
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    margin-top: 0;
    gap: 20px;
}
.video-reel-item .custom-controls-overlay .seek-btn {
    pointer-events: auto;
    border: none;
    cursor: pointer;
    background-color: transparent;
    border: none;
    box-shadow: none;
    color: white;
    border-radius: 9999px;
    width: 70px;
    height: 70px;
    padding: 0;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.video-reel-item .custom-controls-overlay .seek-btn:hover {
     background-color: rgba(255, 255, 255, 0.1);
     transform: scale(1.05);
}
.video-reel-item .custom-controls-overlay .play-pause-btn-center {
    pointer-events: auto;
    width: 70px;
    height: 70px;
    background-color: transparent;
    border: none;
    margin: 0;
    padding: 0;
    flex-direction: row;
    font-size: 50px;
    z-index: 100;
    border-radius: 9999px;
}

.video-reel-item .custom-controls-overlay .play-pause-btn-center img {
    width: 50px;
    height: 50px;
    filter: brightness(0) invert(1);
    display: block;
    margin: auto;
}

.video-reel-item .custom-controls-overlay.opacity-100 {
     transition: opacity 0.2s ease-in-out;
     opacity: 1;
}
/* 🛑 FIX 1: تعديل موضع شريط التقدم لجعله أكثر قربًا من الأسفل 🛑 */
.video-reel-item .progress-bar-container {
    position: absolute;
    bottom: 4rem; /* تم تقليله من 5rem ليكون أقرب للشريط السفلي */
    left: 0;
    right: 0;
    z-index: 99;
    padding: 0 1rem;
    pointer-events: none;
    /* 🛑 NEW: إضافة ارتفاع محدد لمعالجة الفراغ 🛑 */
    height: 1.5rem; 
}
/* 🛑 NEW: إخفاء عناصر الوقت لمنع ظهورها فوق شريط التقدم 🛑 */
.video-reel-item .progress-time-display {
    display: none; 
}

.video-reel-item .progress-line {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 9999px;
    overflow: hidden;
    pointer-events: auto;
}
.video-reel-item .progress-fill {
    height: 100%;
    width: 0%;
    background-color: #3b82f6;
    transition: width 0.1s linear;
}
/* 🛑 FIX 2: إزالة الفراغات العمودية في المحتوى النصي 🛑 */
.video-reel-item h2.reel-content-title {
    font-size: 1.15rem;
    margin: 0; /* إزالة الهامش العلوي والسفلي */
}
.video-reel-item .text-sm.text-white.mb-2.whitespace-pre-line.inline {
    margin: 0; /* إزالة الهامش السفلي للوصف */
    display: block; /* لضمان أخذ الوصف مساحة كاملة */
    line-height: 1.4;
}
/* 🛑 FIX 3: تقليل حشو الحاوية السفلية 🛑 */
.video-reel-item .relative.z-10.w-full.p-4.pb-28 {
    padding-bottom: 6.5rem; /* تقليل الحشو لتقليل الفراغ */
}
/* 🛑 FIX 4: تنسيق مجموعة صورة القناة والمتابعة (لتجنب الالتصاق) 🛑 */
.video-reel-item .publisher-follow-group {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* مسافة بسيطة بين الصورة وزر المتابعة */
    margin-top: 0.5rem; /* مسافة بسيطة أسفل الوصف */
}
/* 🛑 NEW FIX 6: تصغير حجم الصورة والخط في مجموعة القناة 🛑 */
.video-reel-item .publisher-follow-group .publisher-avatar {
    width: 2rem; /* w-8 */
    height: 2rem; /* h-8 */
}
.video-reel-item .publisher-follow-group .publisher-name-text {
    font-size: 0.9rem; /* تصغير اسم القناة */
    font-weight: 700;
}
/* 🛑 NEW FIX 7: تنسيق زر المتابعة ليتناسب مع الحجم الصغير 🛑 */
.follow-reel-btn-small-styled {
     font-size: 0.7rem !important; /* تصغير خط الزر */
     font-weight: 600 !important;
     padding: 0.2rem 0.5rem !important; /* تصغير حشو الزر */
     border-radius: 9999px;
     transition: all 0.2s;
     flex-shrink: 0;
     margin-right: 0.5rem;
}
.follow-reel-btn-small-styled.following {
    background-color: white !important;
    color: #3b82f6 !important; /* لون أزرق لـ 'تتابع' */
    border: 1px solid #3b82f6;
}
.follow-reel-btn-small-styled:not(.following) {
    background-color: #3b82f6 !important; /* لون أزرق لـ 'متابعة' */
    color: white !important;
    border: 1px solid #3b82f6;
}

.follow-reel-btn-small {
    transition: all 0.2s;
    background-color: #ef4444;
}

.follow-reel-btn-small img {
    filter: none;
}

.follow-reel-btn-small.following {
    /* 🛑 FIX: إذا كان يتابع، يجب أن يختفي هذا الزر */
    display: none !important;
}

.follow-reel-btn-small:hover {
    background-color: #ef4444 !important;
    transform: scale(1.1) translate(-50%, 0);
}

#comments-sheet-modal.hidden {
    display: none;
}

.comments-sheet-content {
    height: 70vh;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transition: transform 0.3s ease-out;
    transform: translateY(100%);
    flex-shrink: 0;
}

#comments-sheet-modal:not(.hidden) .comments-sheet-content {
    transform: translateY(0);
}

#reel-comment-form-wrapper #reel-comment-text-area {
    background-color: #f1f1f1;
    border-color: transparent;
}
/* 🛑 الإصلاح النهائي: هنا يتم ضمان بقاء الأيقونات بألوانها الأصلية 🛑 */
body.reels-active nav.fixed.bottom-0 {
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s, border-color 0.3s;
    /* 🛑 الإصلاح: رفع Z-Index لضمان استقبال النقرات 🛑 */
    z-index: 150 !important;
}

body.reels-active .nav-icon,
body.reels-active .center-nav-icon {
    filter: none; /* إزالة أي فلتر قد يغير اللون */
    opacity: 1; /* التأكد من أن الأيقونة غير باهتة */
}
/* 🛑 FIX 5: تنسيق الأزرار الجانبية التفاعلية (لتكون متقاربة) 🛑 */
.video-reel-item .flex-shrink-0.flex.flex-col.items-center.space-y-4 {
     gap: 1.25rem; /* تقليل الفراغ بين الأزرار */
}