/* تنسيق أزرار تغيير اللغة في القائمة الرئيسية */
.lang-menu-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: auto;
}

.lang-title {
    display: none; /* إخفاء عنوان اللغة في وضع سطح المكتب */
}

.lang-btns-container {
    display: flex;
    gap: 5px;
    justify-content: center;
    width: auto;
}

.lang-menu-item .lang-btn {
    padding: 5px 10px;
    background-color: rgba(0, 91, 159, 0.2);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    min-width: 60px;
}

.lang-menu-item .lang-btn:hover {
    background-color: rgba(0, 91, 159, 0.5);
    transform: translateY(-2px);
}

.lang-menu-item .lang-btn.active {
    background-color: rgba(0, 91, 159, 0.9);
    box-shadow: 0 0 5px rgba(0, 176, 255, 0.5);
}

/* إزالة تنسيق زر تغيير اللغة القديم */
.language-switcher {
    display: none !important;
}

/* زر القائمة للأجهزة المحمولة */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1003;
    background-color: rgba(0, 91, 159, 0.7);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background-color: rgba(0, 91, 159, 0.9);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* تحسين تنسيق القائمة الرئيسية للتوافق مع أزرار اللغة */
@media (max-width: 768px) {
    /* إظهار زر القائمة */
    .menu-toggle {
        display: block;
    }
    
    /* تنسيق زر القائمة عند فتح القائمة */
    .menu-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .menu-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* تنسيق القائمة الرئيسية لتكون قابلة للطي */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.9);
        z-index: 1001;
        transition: all 0.3s ease;
        overflow-y: auto;
        padding: 20px;
    }
    
    nav.active {
        right: 0;
    }
    
    /* تحسين تنسيق القائمة الرئيسية */
    nav ul {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 70px;
        gap: 20px;
    }
    
    /* تحسين حجم وتباعد عناصر القائمة */
    nav ul li {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
    }
    
    nav ul li a {
        padding: 12px 20px;
        font-size: 18px;
        display: block;
        width: 100%;
        margin: 0;
    }
    
    /* تنسيق قسم اللغة في القائمة المنسدلة */
    .lang-menu-item {
        margin-top: 30px !important;
        flex-direction: column;
        width: 100%;
    }
    
    .lang-title {
        display: block;
        margin-bottom: 15px;
        color: white;
        font-size: 18px;
        font-weight: 600;
    }
    
    .lang-btns-container {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
    }
    
    .lang-menu-item .lang-btn {
        padding: 10px 20px;
        font-size: 16px;
        min-width: 100px;
    }
    
    /* تحسين موضع الشعار */
    .logo {
        position: fixed;
        top: 10px;
        right: 70px;
        z-index: 1002;
        display: flex;
        align-items: center;
    }
    
    .logo img {
        height: 50px;
        width: auto;
    }
    
    /* تحسين تنسيق العنوان الرئيسي */
    .hero h1 {
        font-size: 24px;
        margin-top: 20px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    /* تحسين تنسيق زر التواصل */
    .contact-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    /* إخفاء شريط اللغة في أسفل الصفحة على الأجهزة المحمولة */
    .language-bar {
        display: none;
    }
}

/* تنسيق خاص للشاشات الكبيرة */
@media (min-width: 769px) {
    /* تحسين أزرار اللغة في القائمة الرئيسية في الشاشات الكبيرة */
    .lang-menu-item {
        display: flex;
        flex-direction: row;
        margin-right: 0;
    }
    
    /* تحسين موضع الشعار وزر القائمة */
    .logo {
        display: flex;
        align-items: center;
    }
    
    .logo img {
        height: 60px;
        width: auto;
        margin-left: 15px;
    }
    
    /* إظهار زر القائمة بجانب الشعار في الشاشات الكبيرة */
    .menu-toggle {
        display: none;
    }
    
    /* تنسيق القائمة الرئيسية في الشاشات الكبيرة */
    nav ul {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    /* تنسيق عناصر القائمة في الشاشات الكبيرة */
    nav ul li {
        margin: 0 10px;
    }
    
    /* تنسيق أزرار اللغة في الشاشات الكبيرة */
    .lang-menu-item {
        margin-left: auto;
    }
}

/* تحسينات إضافية للأجهزة الصغيرة جداً */
@media (max-width: 480px) {
    /* تعديل موضع زر القائمة للأجهزة الصغيرة */
    .menu-toggle {
        right: 15px;
        top: 15px;
        padding: 6px 8px;
    }
    
    .menu-toggle .bar {
        width: 22px;
        height: 2px;
        margin: 4px 0;
    }
    
    /* تعديل حجم الشعار للأجهزة الصغيرة */
    .logo img {
        height: 45px;
    }
    
    /* تعديل حجم عناصر القائمة للأجهزة الصغيرة */
    nav ul li a {
        font-size: 16px;
        padding: 10px 15px;
    }
    
    /* تعديل حجم أزرار اللغة للأجهزة الصغيرة */
    .lang-menu-item .lang-btn {
        padding: 8px 15px;
        font-size: 14px;
        min-width: 80px;
    }
}

/* تنسيق شريط اللغة في أسفل الصفحة */
.language-bar {
    background-color: rgba(0, 91, 159, 0.7);
    padding: 5px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.language-bar .lang-btn {
    padding: 5px 15px;
    margin: 0 5px;
    background-color: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
}

.language-bar .lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.language-bar .lang-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}
