/* Mobile Menu Fix - إصلاحات إضافية للقائمة المحمولة */

/* إصلاح عرض الهامبرغر */
@media (max-width: 768px) {
    .hamburger {
        display: flex !important;
        flex-direction: column;
        justify-content: space-around;
        width: 30px;
        height: 25px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1000;
        position: relative;
    }
    
    .hamburger span {
        width: 100%;
        height: 3px;
        background: #ffffff;
        border-radius: 2px;
        transition: all 0.3s ease;
        transform-origin: center;
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* إصلاح القائمة */
    .nav-menu {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 80% !important;
        max-width: 300px !important;
        height: 100vh !important;
        background: rgba(10, 11, 14, 0.98) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 5rem 2rem 2rem !important;
        transition: right 0.3s ease !important;
        z-index: 999 !important;
        border-left: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin: 0 !important;
        list-style: none !important;
    }
    
    .nav-menu.active {
        right: 0 !important;
    }
    
    /* إصلاح عناصر القائمة */
    .nav-item {
        width: 100% !important;
        margin: 0.5rem 0 !important;
        opacity: 0;
        transform: translateX(20px);
        animation: slideInFromRight 0.3s ease forwards;
        list-style: none !important;
    }
    
    .nav-menu.active .nav-item {
        animation: slideInFromRight 0.3s ease forwards;
    }
    
    .nav-item:nth-child(1) { animation-delay: 0.1s; }
    .nav-item:nth-child(2) { animation-delay: 0.2s; }
    .nav-item:nth-child(3) { animation-delay: 0.3s; }
    .nav-item:nth-child(4) { animation-delay: 0.4s; }
    .nav-item:nth-child(5) { animation-delay: 0.5s; }
    
    .nav-item a {
        display: block !important;
        padding: 1rem 0 !important;
        font-size: 1.1rem !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        width: 100% !important;
        color: rgba(255, 255, 255, 0.8) !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
        background: none !important;
        border-radius: 0 !important;
        text-align: right !important;
    }
    
    .nav-item a::after {
        display: none !important;
    }
    
    .nav-item a:hover {
        color: #78dbe2 !important;
        background: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
    
    .nav-item a.active {
        color: #78dbe2 !important;
        background: none !important;
        border-color: rgba(255, 255, 255, 0.1) !important;
        box-shadow: none !important;
    }
    
    @keyframes slideInFromRight {
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* إصلاح الهيدر */
    .header {
        padding: 0.5rem 0 !important;
    }
    
    .nav-container {
        padding: 0 1rem !important;
    }
    
    .logo {
        font-size: 1.5rem !important;
        padding: 4px 8px !important;
    }
}

/* إصلاحات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    .nav-menu {
        width: 90% !important;
        padding: 4rem 1.5rem 2rem !important;
    }
    
    .hamburger {
        width: 25px !important;
        height: 20px !important;
    }
    
    .hamburger span {
        height: 2px !important;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px) !important;
    }
}

    /* إصلاحات للشاشات المتوسطة */
    @media (min-width: 769px) and (max-width: 1024px) {
        .hamburger {
            display: none !important;
        }
        
        .nav-menu {
            position: static !important;
            width: auto !important;
            height: auto !important;
            background: none !important;
            -webkit-backdrop-filter: none !important;
            backdrop-filter: none !important;
            flex-direction: row !important;
            justify-content: flex-end !important;
            align-items: center !important;
            padding: 0 !important;
            transition: none !important;
            z-index: auto !important;
            border-left: none !important;
        }
    
    .nav-item {
        width: auto !important;
        margin: 0 1rem !important;
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    
    .nav-item a {
        display: inline-block !important;
        padding: 0.5rem 1rem !important;
        font-size: 1rem !important;
        border-bottom: none !important;
        width: auto !important;
        color: rgba(255, 255, 255, 0.8) !important;
        text-decoration: none !important;
        font-weight: 500 !important;
        transition: all 0.3s ease !important;
        text-align: center !important;
    }
    
    .nav-item a::after {
        display: block !important;
    }
}

/* إصلاحات عامة */
* {
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
}

/* إصلاح z-index */
.header {
    z-index: 1000 !important;
}

.nav-menu {
    z-index: 999 !important;
}

.hamburger {
    z-index: 1000 !important;
}

/* تأكد من أن الشريط العلوي يبقى ثابتاً دائماً - إصلاح شامل */
.header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
    background: rgba(10, 11, 14, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    padding: 1rem 0 !important;
    transition: all 0.3s ease !important;
}

/* منع أي تأثيرات قد تخفي الشريط العلوي */
.header,
.header *,
.nav-container,
.nav-container * {
    pointer-events: auto !important;
}

/* تأكد من أن الشريط العلوي لا يتأثر بأي تحولات */
@media (max-width: 768px) {
    .header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 1000 !important;
        transform: translateY(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
}

/* إصلاح التمرير عند فتح القائمة */
body.menu-open {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
}

/* تحسين الأداء */
.nav-menu,
.hamburger {
    will-change: transform;
}

/* إصلاح التفاعل باللمس */
@media (hover: none) and (pointer: coarse) {
    .hamburger {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .nav-item a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
} 