/*==================================================================================
    Custom Stylesheet (Any custom styling you want to apply should be defined here).
====================================================================================*/

/* Enhanced spacing for fixed header - prevent content overlap */
.primary-bg {
    padding-top: 150px !important;
}

.pt-70 {
    padding-top: 120px !important;
}

.pt-80 {
    padding-top: 130px !important;
}

.pt-90 {
    padding-top: 140px !important;
}

.pt-100 {
    padding-top: 150px !important;
}

.pt-110 {
    padding-top: 160px !important;
}

.pt-120 {
    padding-top: 170px !important;
}

.pt-130 {
    padding-top: 180px !important;
}

.pt-140 {
    padding-top: 190px !important;
}

.pt-150 {
    padding-top: 200px !important;
}

.pb-50 {
    padding-bottom: 70px !important;
}

.pb-80 {
    padding-bottom: 100px !important;
}

/* Ensure content doesn't overlap with fixed header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

body {
    padding-top: 120px;
    min-height: 100vh;
}

/* Main content sections spacing */
section:first-of-type {
    margin-top: 100px;
}

/* Contact form specific spacing */
.contact-form {
    margin-top: 60px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

/* Ensure all form sections have proper spacing */
.container .row .col-lg-8 {
    margin-top: 40px;
}

/* Footer spacing adjustment */
.footer {
    margin-top: 100px;
}

/* Mobile responsiveness for spacing */
@media (max-width: 768px) {
    body {
        padding-top: 100px;
    }
    
    .pt-100, .pt-150, .pt-80, .pt-90, .pt-110, .pt-120, .pt-130, .pt-140 {
        padding-top: 120px !important;
    }
    
    section:first-of-type {
        margin-top: 80px;
    }
    
    .contact-form {
        margin-top: 40px;
        padding: 20px;
    }
}

/* Clean, Solid, Accessible Dropdown - Aligned with site */
.header-menu > ul > li {
    position: relative;
}

.header-menu > ul > li > ul {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(8, 19, 64, 0.12);
    padding: 12px;
    border: 1px solid #e6ecf7;
    min-width: 280px;
    transform: translateY(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 140ms ease, transform 140ms ease;
    z-index: 10000;
    top: 100% !important; /* تقليل المسافة من الأعلى */
    margin-top: 5px !important; /* مسافة صغيرة فقط */
}

.header-menu > ul > li:hover > ul,
.header-menu > ul > li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* تحسين موضع القائمة المنسدلة لكلمة مواءمة تحديداً */
.header-menu > ul > li.has-sub-item > ul {
    top: calc(100% + 2px) !important; /* مسافة أقل بكثير */
    margin-top: 0 !important;
    position: absolute !important;
}

/* ضمان عدم تأثر القائمة بإعدادات إمكانية الوصول */
.accessibility-large-text .header-menu > ul > li > ul,
.accessibility-extra-large-text .header-menu > ul > li > ul {
    top: calc(100% + 5px) !important;
    min-width: 320px;
}

.accessibility-letter-spacing .header-menu > ul > li > ul {
    min-width: 300px;
}

.accessibility-line-height .header-menu > ul > li > ul {
    top: calc(100% + 8px) !important;
}

.header-menu ul ul {
    right: 0; /* RTL alignment */
}

.header-menu ul ul li {
    display: block;
    margin: 6px 0;
}

.header-menu ul ul li + li {
    border-top: 1px solid #eef2f9;
}

.header-menu ul ul li a {
    display: block;
    padding: 16px 18px;
    color: #162044 !important; /* dark navy body text */
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    border-radius: 10px;
    background: #ffffff;
    border: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.header-menu ul ul li a:hover,
.header-menu ul ul li a:focus {
    background: #f2f7ff;             /* subtle highlight */
    /* border removed for cleaner look */
    color: #081340 !important;        /* brand dark */
}

.header-menu ul ul li a:focus-visible {
    outline: 2px solid #00C3EE;       /* accessible focus */
    outline-offset: 2px;
}

/* Remove heavy transforms/shadows for calmer motion */
.header-menu ul ul li a,
.header-menu > ul > li > ul {
    will-change: auto;
}

/* Compact responsive refinements */
@media (max-width: 768px) {
    .header-menu > ul > li > ul {
        min-width: 220px;
        padding: 10px;
        border-radius: 10px;
    }
    .header-menu ul ul li {
        margin: 4px 0;
    }
    .header-menu ul ul li a {
        padding: 12px 14px;
        font-size: 14px;
    }
}

/* Keep dropdown style fixed (no darkening) when header becomes sticky/scrolled */
.header.sticky .header-menu > ul > li > ul,
.header.is-sticky .header-menu > ul > li > ul,
.main-header.sticky .header-menu > ul > li > ul,
.main-header.is-sticky .header-menu > ul > li > ul,
.header.header-style2.sticky .header-menu > ul > li > ul,
.header.header-style2.is-sticky .header-menu > ul > li > ul,
.header.fixed .header-menu > ul > li > ul,
.header.scrolled .header-menu > ul > li > ul {
    background: #ffffff !important;
    border: 1px solid #e6ecf7 !important;
    box-shadow: 0 8px 24px rgba(8, 19, 64, 0.12) !important;
}

.header.sticky .header-menu ul ul li a,
.header.is-sticky .header-menu ul ul li a,
.main-header.sticky .header-menu ul ul li a,
.main-header.is-sticky .header-menu ul ul li a,
.header.header-style2.sticky .header-menu ul ul li a,
.header.header-style2.is-sticky .header-menu ul ul li a,
.header.fixed .header-menu ul ul li a,
.header.scrolled .header-menu ul ul li a {
    background: #ffffff !important;
    color: #162044 !important;
}

/* Ensure hover remains light in sticky state */
.header.sticky .header-menu ul ul li a:hover,
.header.is-sticky .header-menu ul ul li a:hover,
.main-header.sticky .header-menu ul ul li a:hover,
.main-header.is-sticky .header-menu ul ul li a:hover,
.header.header-style2.sticky .header-menu ul ul li a:hover,
.header.header-style2.is-sticky .header-menu ul ul li a:hover,
.header.fixed .header-menu ul ul li a:hover,
.header.scrolled .header-menu ul ul li a:hover {
    background: #f2f7ff !important;
    color: #081340 !important;
}

/* Specific safeguard for the "مواءمة" submenu item */
.header-menu > ul > li.has-sub-item > ul {
    background: #ffffff !important;
    border: 1px solid #e6ecf7 !important;
    box-shadow: 0 8px 24px rgba(8, 19, 64, 0.12) !important;
}

/* إضافة تحسينات إضافية للقائمة المنسدلة */
.header-menu > ul > li {
    position: relative;
}

/* تحسين الانتقال السلس للقائمة */
.header-menu > ul > li > ul {
    transition: all 0.2s ease-in-out !important;
}

/* ضمان عدم وجود مسافات إضافية غير مرغوب فيها */
.header-menu > ul > li > ul li {
    margin: 0 !important;
    padding: 0 !important;
}

.header-menu > ul > li > ul li:first-child {
    border-top: none !important;
}

/* تحسين الاستجابة للشاشات الصغيرة */
@media (max-width: 991px) {
    .header-menu > ul > li.has-sub-item > ul {
        top: calc(100% + 3px) !important;
        min-width: 250px;
        right: 0 !important;
        left: auto !important;
    }
}

@media (max-width: 576px) {
    .header-menu > ul > li.has-sub-item > ul {
        min-width: 220px;
        font-size: 14px;
    }
    
    .header-menu ul ul li a {
        padding: 12px 16px !important;
    }
}

/* ضمان عمل القائمة مع جميع حالات إمكانية الوصول */
body.accessibility-high-contrast .header-menu > ul > li > ul {
    border: 2px solid #000 !important;
    background: #fff !important;
}

body.accessibility-high-contrast .header-menu ul ul li a {
    color: #000 !important;
    background: #fff !important;
}

body.accessibility-high-contrast .header-menu ul ul li a:hover {
    background: #000 !important;
    color: #fff !important;
}