/* =====================================
   Header & Footer Styles
   ===================================== */

/* تعطيل Smooth Scrolling بشكل نهائي */
html,
body,
* {
    scroll-behavior: auto !important;
}

/* منع أي overflow مخفي قد يسبب scrolling issues */
.container,
.container-fluid {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* إزالة تأثيرات row التي قد تسبب scrolling */
.row {
    animation: none !important;
    transition: none !important;
}

/* Grid بديل لـ row بدون أي تأثيرات */
.news-grid,
.services-grid,
.programs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    animation: none !important;
    transition: none !important;
}

.news-item {
    flex: 0 0 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
}

.services-grid > div,
.programs-grid > div {
    flex: 0 0 calc(33.333% - 1rem);
    max-width: calc(33.333% - 1rem);
}

@media (max-width: 992px) {
    .news-item,
    .services-grid > div,
    .programs-grid > div {
        flex: 0 0 calc(50% - 0.75rem);
        max-width: calc(50% - 0.75rem);
    }
}

@media (max-width: 768px) {
    .news-item,
    .services-grid > div,
    .programs-grid > div {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Header - Combined Topbar & Navbar */
.main-header {
    position: sticky;
    top: 0;
    z-index: 1050;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* إخفاء navbar-toggler على الشاشات الكبيرة */
@media (min-width: 992px) {
    .navbar-toggler {
        display: none !important;
    }
}

.topbar-info {
    border-bottom: 1px solid #e9ecef;
}

.topbar-info .social-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid #cf864b;
    color: #cf864b;
}

.topbar-info .social-icon:hover {
    background: #cf864b;
    color: white;
    transform: translateY(-2px);
}

/* Footer Styles - Modern & Centered */
.footer-modern {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
}

.footer-modern h5 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
}

.footer-modern h6 {
    font-size: 1rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 15px;
}

.footer-modern h6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: #cf864b;
}

.footer-modern .hover-link {
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-modern .hover-link:hover {
    opacity: 1 !important;
    color: #cf864b !important;
    transform: translateX(-3px);
}

.footer-modern .btn-outline-light {
    border-width: 2px;
    transition: all 0.3s ease;
}

.footer-modern .btn-outline-light:hover {
    background: #cf864b;
    border-color: #cf864b;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(207, 134, 75, 0.4);
}

/* Language Switcher Dropdown Fix */
.lang-switcher {
    position: static !important;
    z-index: 9999 !important;
    min-width: 150px;
    width: 100%;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
}

.lang-switcher:focus {
    border-color: #cf864b;
    box-shadow: 0 0 0 0.2rem rgba(207, 134, 75, 0.25);
    outline: none;
}

/* إصلاح موضع dropdown options */
.lang-switcher option {
    background: white;
    color: #212529;
    padding: 0.5rem;
}

/* للتأكد من ظهور dropdown بشكل صحيح */
#language-form {
    position: static !important;
    display: block;
    width: 100%;
}

.nav-item form {
    position: static !important;
    display: block;
    width: 100%;
}

/* إصلاح للموبايل - مهم جداً */
.navbar-nav .nav-item {
    position: static !important;
}

.navbar-collapse {
    overflow: visible !important;
    z-index: 1040 !important;
}

/* إصلاح خاص بـ select dropdown على الموبايل */
.navbar-collapse .nav-item:has(select),
.navbar-collapse .nav-item:has(form) {
    position: static !important;
    overflow: visible !important;
}

/* Responsive */
@media (max-width: 991px) {
    .topbar-info {
        font-size: 0.8rem;
    }
    
    /* إصلاح شامل للموبايل */
    .lang-switcher {
        min-width: 100%;
        width: 100%;
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.6rem 0.75rem;
        margin: 0.5rem 0;
        position: static !important;
        display: block !important;
        transform: none !important;
    }
    
    #language-form {
        width: 100%;
        padding: 0 1rem;
        position: static !important;
        overflow: visible !important;
    }
    
    .navbar-nav .nav-item form {
        width: 100%;
        position: static !important;
        overflow: visible !important;
    }
    
    /* التأكد من أن القائمة المنسدلة تظهر بشكل صحيح */
    .navbar-collapse,
    .main-navbar .navbar-collapse,
    .main-navbar .navbar-collapse.show {
        overflow: visible !important;
    }
    
    .navbar-collapse .nav-item,
    .navbar-nav .nav-item {
        position: static !important;
        width: 100%;
        overflow: visible !important;
    }
    
    /* إصلاح مهم جداً - منع أي transform */
    .navbar-nav,
    .navbar-collapse ul {
        transform: none !important;
        position: static !important;
    }
}

@media (max-width: 768px) {
    .footer h6::after {
        right: auto;
        left: 0;
    }
    
    .footer .col-md-6 {
        text-align: center !important;
    }
    
    .footer .col-md-6 ul {
        text-align: right;
    }
}

/* Ensure footer text is visible */
.footer .opacity-75 {
    opacity: 0.75 !important;
}

.footer .opacity-75:hover {
    opacity: 1 !important;
}

/* Copyright section */
.footer hr {
    border-color: rgba(255,255,255,0.1);
}

