/* تصميم الهيدر الأبيض - نسخة مبسطة */

/* Header - أبيض مع نص داكن */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(46, 0, 86, 0.1) !important;
    z-index: 1000;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 10px rgba(46, 0, 86, 0.1);
}

.header.sticky-top {
    box-shadow: 0 4px 20px rgba(46, 0, 86, 0.15) !important;
}

/* Navigation Brand */
.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: #2e0056 !important;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.nav-brand .logo img,
.logo-img {
    height: 40px;
    width: auto;
    vertical-align: middle;
    transition: all 0.3s ease;
}

/* Logo size for larger screens */
@media (min-width: 1024px) {
    .nav-brand .logo img,
    .logo-img {
        height: 50px;
    }
}

@media (min-width: 1400px) {
    .nav-brand .logo img,
    .logo-img {
        height: 55px;
    }
}

.nav-brand .logo:hover {
    color: #57078d !important;
}

/* Navigation */
.navbar {
    padding: 15px 0;
}

/* Adjust navbar padding for larger screens with bigger logo */
@media (min-width: 1024px) {
    .navbar {
        padding: 18px 0;
    }
}

@media (min-width: 1400px) {
    .navbar {
        padding: 20px 0;
    }
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* RTL Support for navbar */
[dir="rtl"] .navbar .container {
    direction: rtl;
}

[dir="ltr"] .navbar .container {
    direction: ltr;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* RTL/LTR adjustments for nav-menu */
[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

[dir="ltr"] .nav-menu {
    flex-direction: row;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 30px;
    margin: 0;
    padding: 0;
    align-items: center;
}

/* RTL navigation list */
[dir="rtl"] .nav-list {
    direction: rtl;
    flex-direction: row;
}

[dir="ltr"] .nav-list {
    direction: ltr;
    flex-direction: row;
}

.nav-language {
    display: flex;
    align-items: center;
}

.nav-link {
    color: #2e0056 !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #57078d !important;
    background: rgba(87, 7, 141, 0.1);
}

.nav-link.active {
    color: #57078d !important;
    background: rgba(87, 7, 141, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: #57078d;
    border-radius: 2px;
}

/* Navigation Toggle (Mobile) */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    padding: 10px;
    border-radius: 6px;
    background: rgba(46, 0, 86, 0.05);
    transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    border: none;
    outline: none;
    z-index: 1000;
}

.nav-toggle:hover {
    background: rgba(46, 0, 86, 0.1);
}

.nav-toggle:active {
    transform: scale(0.95);
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #2e0056 !important;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* منع التمرير عندما تكون القائمة مفتوحة */
body.nav-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        top: 0 !important;
    }

    .nav-toggle {
        display: flex;
        position: relative;
        z-index: 1001;
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid rgba(46, 0, 86, 0.1);
        box-shadow: 0 5px 20px rgba(46, 0, 86, 0.15);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        flex-direction: column;
        gap: 0;
        padding: 20px;
    }

    /* RTL/LTR adjustments for mobile menu */
    [dir="rtl"] .nav-menu {
        text-align: right;
        direction: rtl;
    }

    [dir="ltr"] .nav-menu {
        text-align: left;
        direction: ltr;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-list {
        flex-direction: column;
        gap: 0;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* RTL/LTR adjustments for mobile nav list */
    [dir="rtl"] .nav-list {
        direction: rtl;
    }

    [dir="ltr"] .nav-list {
        direction: ltr;
    }

    .nav-language {
        padding: 15px 0;
        border-top: 1px solid rgba(46, 0, 86, 0.1);
        justify-content: center;
        margin-top: 10px;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        margin-bottom: 8px;
        border-radius: 8px;
        padding: 12px 16px;
        display: block;
        color: #2e0056 !important;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    /* RTL/LTR text alignment for mobile links */
    [dir="rtl"] .nav-link {
        text-align: center;
    }

    [dir="ltr"] .nav-link {
        text-align: center;
    }

    .nav-link:hover, .nav-link.active {
        background: rgba(87, 7, 141, 0.1);
        color: #57078d !important;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 12px 0;
    }

    .nav-brand .logo img {
        height: 35px;
    }

    .nav-menu {
        top: 60px;
        max-height: calc(100vh - 60px);
    }
}

/* تحسينات إضافية للقائمة المحمولة */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 0;
    }

    .nav-brand .logo img {
        height: 35px;
    }

    .nav-toggle {
        background: rgba(46, 0, 86, 0.08);
        border: 1px solid rgba(46, 0, 86, 0.1);
    }

    .nav-toggle:hover {
        background: rgba(46, 0, 86, 0.15);
    }

    .nav-toggle:active {
        background: rgba(46, 0, 86, 0.2);
    }

    .nav-menu {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .nav-menu.active {
        animation: slideDown 0.3s ease-out;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* تحسينات إضافية للمس على الأجهزة المحمولة */
@media (max-width: 768px) {
    .nav-toggle {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .nav-toggle:focus {
        outline: 2px solid #57078d;
        outline-offset: 2px;
    }

    .nav-toggle:active {
        transform: scale(0.9);
    }

    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: #ffffff;
        border-top: 1px solid rgba(46, 0, 86, 0.1);
        box-shadow: 0 5px 30px rgba(46, 0, 86, 0.2);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .nav-link {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* تحسينات إضافية للهيدر الأبيض */
.header {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.98) !important;
    box-shadow: 0 2px 20px rgba(46, 0, 86, 0.12) !important;
}

/* تحسينات للنافذة الصغيرة */
@media (max-width: 320px) {
    .nav-brand .logo img {
        height: 30px;
    }

    .navbar {
        padding: 10px 0;
    }

    .nav-menu {
        top: 50px;
        max-height: calc(100vh - 50px);
    }
}
