/* ================================
   Header Height Fix - إصلاح شامل للارتفاع
   ================================ */

/* إزالة أي margin أو padding من body و html */
html, body {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box;
}

/* ضمان أن الهيدر يبدأ من أعلى الصفحة تماماً */
.header-desktop,
.header-desktop-custom {
    margin: 0 !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
    top: 0 !important;
    position: fixed !important;
    min-height: 50px !important;
    max-height: 60px !important;
    height: auto !important;
}

/* تقليل padding الداخلي لكل العناصر */
.header-desktop .logo-section-desktop,
.header-desktop .nav-section-desktop,
.header-desktop .action-section-desktop {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* تقليل حجم الشعار أكثر */
.header-desktop .logo-wrapper-desktop {
    width: 45px !important;
    height: 45px !important;
}

.header-desktop .logo-inner-desktop img {
    width: 28px !important;
    height: 28px !important;
}

/* تقليل padding عناصر التنقل */
.header-desktop .nav-item-desktop {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.9rem !important;
}

/* تقليل padding أزرار الإجراءات */
.header-desktop .language-selector-trigger {
    padding: 0.35rem 0.5rem !important;
    height: 2rem !important;
    font-size: 0.8rem !important;
}

.header-desktop .user-dropdown-trigger-desktop {
    padding: 0.4rem 0.6rem !important;
}

.header-desktop .user-avatar-desktop {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.9rem !important;
}

/* تقليل ارتفاع action divider */
.header-desktop .action-divider-desktop {
    height: 30px !important;
}

/* تقليل gap بين العناصر */
.header-desktop .nav-links-container-desktop {
    gap: 1.5rem !important;
}

.header-desktop .action-section-desktop {
    gap: 1rem !important;
}

.header-desktop .auth-buttons-group-desktop {
    gap: 0.75rem !important;
}

/* إزالة أي margin علوي من container */
.header-desktop-custom::before,
.header-desktop::before {
    display: none !important;
}

/* ضمان عدم وجود مساحة علوية */
* {
    margin-top: 0;
    padding-top: 0;
}

*:first-child {
    margin-top: 0 !important;
}

/* إصلاحات خاصة للشاشات المختلفة */
@media (min-width: 1280px) {
    .header-desktop {
        padding: 0.6rem 3rem !important;
        min-height: 55px !important;
        max-height: 65px !important;
    }
}

@media (min-width: 1440px) {
    .header-desktop {
        padding: 0.7rem 4rem !important;
        min-height: 60px !important;
        max-height: 70px !important;
    }
}

@media (min-width: 1920px) {
    .header-desktop {
        padding: 0.8rem 5rem !important;
        min-height: 65px !important;
        max-height: 75px !important;
    }
}

/* إصلاح موضع الرصيد تحت الهيدر */
.balance-display-below-header {
    top: 60px !important;
}

@media (min-width: 1280px) {
    .balance-display-below-header {
        top: 65px !important;
    }
}

@media (min-width: 1440px) {
    .balance-display-below-header {
        top: 70px !important;
    }
}

@media (min-width: 1920px) {
    .balance-display-below-header {
        top: 75px !important;
    }
}

/* التأكد من أن المحتوى يبدأ بعد الهيدر مباشرة */
body {
    padding-top: 60px !important;
}

@media (min-width: 1280px) {
    body {
        padding-top: 65px !important;
    }
}

@media (min-width: 1440px) {
    body {
        padding-top: 70px !important;
    }
}

@media (min-width: 1920px) {
    body {
        padding-top: 75px !important;
    }
}

/* إزالة أي border أو outline قد يسبب مساحة إضافية */
.header-desktop {
    border: none !important;
    outline: none !important;
    border-bottom: 2px solid var(--color-game-purple-600) !important;
}

/* ضمان عدم وجود مساحة من الـ viewport */
html {
    scroll-padding-top: 0 !important;
}

/* إصلاح أي مساحة من الـ layout */
.header-desktop * {
    vertical-align: top !important;
}

/* إصلاح مشاكل flexbox */
.header-desktop {
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
}

/* ضمان عدم وجود مساحة من العناصر المضافة */
.header-desktop > * {
    margin: 0 !important;
    vertical-align: middle !important;
}

/* إصلاح مشاكل الـ line-height */
.header-desktop,
.header-desktop * {
    line-height: 1.2 !important;
}

/* إزالة أي transform قد يسبب مساحة */
.header-desktop {
    transform: none !important;
}

/* إصلاح الـ z-index والطبقات */
.header-desktop {
    z-index: 9999 !important;
    isolation: isolate !important;
}

/* إصلاحات إضافية للـ containment */
.header-desktop {
    contain: layout style !important;
    will-change: auto !important;
}
