/**
 * إصلاح العناصر المنبثقة في صفحات المصادقة والاشتراكات
 * يخفي جميع العناصر المنبثقة التي قد تؤثر على عرض الصفحة
 */

/* إخفاء lightbox في جميع الصفحات المحددة - حل قوي */
body[class*="auth"] .image-lightbox,
body[class*="subscription"] .image-lightbox,
.image-lightbox {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    z-index: -9999 !important;
}

/* إخفاء lightbox في صفحات المصادقة */
body.auth-page .image-lightbox,
body.subscription-page .image-lightbox {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* إخفاء أي عناصر منبثقة أخرى */
body.auth-page .error-toast,
body.subscription-page .error-toast {
    display: none !important;
}

/* إخفاء أي عناصر تحتوي على رسائل خطأ الصور */
body.auth-page .image-error,
body.subscription-page .image-error {
    display: none !important;
}

/* إخفاء أي عناصر منبثقة في الزاوية السفلى */
body.auth-page [style*="position: fixed"][style*="bottom"],
body.subscription-page [style*="position: fixed"][style*="bottom"] {
    display: none !important;
}

/* إخفاء أي عناصر تحتوي على أيقونة إغلاق في الزاوية */
body.auth-page .fa-times:not(.modal .fa-times):not(.alert .fa-times),
body.subscription-page .fa-times:not(.modal .fa-times):not(.alert .fa-times) {
    display: none !important;
}

/* إخفاء أي عناصر منبثقة تحتوي على صور */
body.auth-page [class*="popup"]:has(img),
body.subscription-page [class*="popup"]:has(img),
body.auth-page [class*="tooltip"]:has(img),
body.subscription-page [class*="tooltip"]:has(img),
body.auth-page [class*="widget"]:has(img),
body.subscription-page [class*="widget"]:has(img) {
    display: none !important;
}

/* إخفاء أي عناصر تحتوي على نص "فشل في تحميل" */
body.auth-page *:contains("فشل في تحميل"),
body.subscription-page *:contains("فشل في تحميل") {
    display: none !important;
}

/* إخفاء أي عناصر منبثقة في الزاوية اليمنى السفلى */
body.auth-page [style*="position: fixed"][style*="right"][style*="bottom"],
body.subscription-page [style*="position: fixed"][style*="right"][style*="bottom"] {
    display: none !important;
}

/* إخفاء أي عناصر تحتوي على z-index عالي في الزاوية السفلى */
body.auth-page [style*="z-index: 999"][style*="bottom"],
body.subscription-page [style*="z-index: 999"][style*="bottom"],
body.auth-page [style*="z-index: 9999"][style*="bottom"],
body.subscription-page [style*="z-index: 9999"][style*="bottom"] {
    display: none !important;
}

/* منع إنشاء أي عناصر جديدة في هذه الصفحات */
body.auth-page .dynamic-element,
body.subscription-page .dynamic-element {
    display: none !important;
}

/* إخفاء أي عناصر تحتوي على أيقونات Font Awesome في الزاوية */
body.auth-page .fas.fa-times:not(.btn .fas):not(.modal .fas):not(.alert .fas),
body.subscription-page .fas.fa-times:not(.btn .fas):not(.modal .fas):not(.alert .fas),
body.auth-page .fa.fa-close:not(.btn .fa):not(.modal .fa):not(.alert .fa),
body.subscription-page .fa.fa-close:not(.btn .fa):not(.modal .fa):not(.alert .fa) {
    display: none !important;
}

/* إخفاء أي عناصر منبثقة تحتوي على صور مكسورة */
body.auth-page img[alt*="فشل"],
body.subscription-page img[alt*="فشل"],
body.auth-page img[src=""],
body.subscription-page img[src=""] {
    display: none !important;
}

/* حلول إضافية قوية لإخفاء العناصر المنبثقة */

/* إخفاء أي عنصر يحتوي على كلمة "lightbox" في أي مكان */
[class*="lightbox"],
[id*="lightbox"],
*[class*="popup"],
*[id*="popup"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* إخفاء العناصر في الزاوية السفلى اليمنى - قواعد شاملة */
*[style*="position: fixed"][style*="bottom: 0"],
*[style*="position: fixed"][style*="bottom:0"],
*[style*="position: fixed"][style*="right: 0"][style*="bottom"],
*[style*="position: fixed"][style*="right:0"][style*="bottom"],
*[style*="position: absolute"][style*="bottom: 0"],
*[style*="position: absolute"][style*="bottom:0"] {
    display: none !important;
}

/* إخفاء العناصر ذات z-index عالي - قواعد شاملة */
*[style*="z-index: 999"],
*[style*="z-index: 9999"],
*[style*="z-index:999"],
*[style*="z-index:9999"] {
    z-index: -9999 !important;
    display: none !important;
}

/* إخفاء أي أيقونة إغلاق منعزلة */
.fa-times:not(.btn *):not(.modal *):not(.alert *):not(.navbar *):not(.card *),
.fas.fa-times:not(.btn *):not(.modal *):not(.alert *):not(.navbar *):not(.card *),
.fa-close:not(.btn *):not(.modal *):not(.alert *):not(.navbar *):not(.card *),
i.fa-times:not(.btn i):not(.modal i):not(.alert i):not(.navbar i):not(.card i),
i.fas.fa-times:not(.btn i):not(.modal i):not(.alert i):not(.navbar i):not(.card i) {
    display: none !important;
    visibility: hidden !important;
}

/* إخفاء أي div فارغ أو مشبوه */
div:empty:not(.container):not(.row):not(.col):not([class*="bootstrap"]),
div:has(> .fa-times):not(.btn):not(.modal):not(.alert):not(.card):not(.navbar),
div:has(> img[alt*="فشل"]):not(.card):not(.media):not(.figure) {
    display: none !important;
}

/* منع ظهور أي عناصر جديدة بـ position fixed */
body.auth-page *[style*="position: fixed"],
body.subscription-page *[style*="position: fixed"] {
    position: static !important;
    display: none !important;
}

/* إخفاء شامل لأي عناصر مشبوهة في نهاية body */
body.auth-page > div:last-child:not(.container):not(.wrapper):not([id]):not([class*="bootstrap"]),
body.subscription-page > div:last-child:not(.container):not(.wrapper):not([id]):not([class*="bootstrap"]) {
    display: none !important;
}

/* إخفاء أي عنصر يحتوي على نص خطأ */
*[innerHTML*="فشل في تحميل"],
*[textContent*="فشل في تحميل"],
*[innerText*="فشل في تحميل"] {
    display: none !important;
}