/* ========================================
   Header & Navigation Styles
   ======================================== */

/* ----------------------------------------
   Header
   ---------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background-color: transparent;
    backdrop-filter: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.scrolled {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    background-color: rgba(255, 255, 255, 1);
    backdrop-filter: blur(12px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ----------------------------------------
   Navigation
   ---------------------------------------- */
.nav-links {
    display: flex;
    gap: 32px;
}

/*
body[data-lang="ar"] .nav-links {
    flex-direction: row-reverse;
}*/


.nav-link {
    color: #fff;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.header.scrolled .nav-link {
    color: var(--text-color);
    text-shadow: none;
}

.header.scrolled .nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(-50%);
}

.header.scrolled .nav-link::after {
    background: var(--gradient-primary);
}

.nav-link:hover::after {
    width: 100%;
}

/* ----------------------------------------
   Header Actions
   ---------------------------------------- */
.header-actions {
    display: flex;
    gap: 16px;
    align-items: center;
}

/* ----------------------------------------
   Language Selector
   ---------------------------------------- */
.language-selector {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.15);
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.language-selector:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background-color: rgba(255, 255, 255, 0.25);
}

.header.scrolled .language-selector {
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.header.scrolled .language-selector:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lang-current {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
}

.header.scrolled .lang-current {
    color: var(--text-color);
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
}

.language-selector.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background-color: var(--background-light);
    color: var(--primary-color);
}

.lang-option:first-child {
    border-radius: 10px 10px 0 0;
}

.lang-option:last-child {
    border-radius: 0 0 10px 10px;
}

.language-icon {
    width: 20px;
    height: 20px;
}

.language-icon path {
    stroke: #fff;
    transition: stroke 0.3s ease;
}

.header.scrolled .language-icon path {
    stroke: var(--text-color);
}

/* RTL Support for Language Selector */
/*
body[data-lang="ar"] .language-selector {
    direction: ltr;
}

body[data-lang="ar"] .language-selector select {
    direction: ltr;
    text-align: left;
}


body[data-lang="ar"] .header {
    direction: ltr;
}

body[data-lang="ar"] .header-container {
    direction: ltr;
}*/

/* ----------------------------------------
   Mobile Menu Button
   ---------------------------------------- */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
    padding: 8px;
}

.mobile-menu-btn svg path {
    stroke: #fff;
    transition: stroke 0.3s ease;
}

.header.scrolled .mobile-menu-btn svg path {
    stroke: var(--text-color);
}

/* ----------------------------------------
   Mobile Left Group
   ---------------------------------------- */
.mobile-left-group {
    display: none;
}

.mobile-lang-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: #fff;
    padding: 8px;
    position: relative;
}

.mobile-lang-btn svg path {
    stroke: #fff;
    transition: stroke 0.3s ease;
}

.header.scrolled .mobile-lang-btn svg path {
    stroke: var(--text-color);
}

.current-lang-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--primary-color);
    color: white;
    font-size: 0.6rem;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 600;
}

/* ----------------------------------------
   Mobile Language Wrapper
   ---------------------------------------- */
.mobile-lang-wrapper {
    position: relative;
}

.mobile-lang-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 10000;
    min-width: 140px;
}

.mobile-lang-wrapper.active .mobile-lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-lang-dropdown .lang-option {
    color: var(--text-color);
}

/* ----------------------------------------
   Mobile Menu
   ---------------------------------------- */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    background-color: white;
    z-index: 9999;
    padding: 24px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: visible;
    overflow-x: hidden;
    box-shadow: 5px 0 20px rgba(0, 0, 0, 0.1);
}
/*
body[data-lang="ar"] .mobile-menu {
    left: -320px;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}*/

.mobile-menu.active {
    left: 0;
}
/*
body[data-lang="ar"] .mobile-menu.active {
    left: 0;
}*/

.mobile-menu-content {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
/*
body[data-lang="ar"] .mobile-menu-header {
    flex-direction: row-reverse;
}*/

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mobile-menu-close:hover {
    background-color: var(--background-light);
}

.mobile-nav-links {
    list-style: none;
    margin-bottom: 30px;
}

.mobile-nav-link {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav-link a {
    display: block;
    color: var(--text-color);
}

.mobile-nav-link:hover {
    color: var(--primary-color);
    padding-left: 10px;
}

/*
body[data-lang="ar"] .mobile-nav-link:hover {
    padding-left: 0;
    padding-right: 10px;
}*/

.mobile-header-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 310;
}

.mobile-header-actions .language-selector {
    position: relative;
    z-index: 10001;
    width: 100%;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.mobile-header-actions .language-selector .lang-current {
    color: var(--text-color);
}

.mobile-header-actions .language-selector .language-icon path {
    stroke: var(--text-color);
}

.mobile-header-actions .lang-dropdown {
    position: absolute;
    z-index: 10002;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-top: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* RTL Support for Mobile Menu */
/*
body[data-lang="ar"] .mobile-menu-header,
body[data-lang="ar"] .mobile-nav-links,
body[data-lang="ar"] .mobile-header-actions {
    direction: ltr;
}*/

/*
body[data-lang="ar"] .mobile-menu-btn {
    margin-left: auto;
    margin-right: 0;
}*/

/* ----------------------------------------
   Responsive Header
   ---------------------------------------- */
@media (max-width: 768px) {
    .mobile-left-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: -8px;
    }
    
    .mobile-lang-btn {
        display: block;
    }

    .header-actions .mobile-menu-btn {
        display: none !important;
    }

    .mobile-left-group .mobile-menu-btn {
        display: block !important;
    }

    .header-container {
        height: 64px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links,
    .header-actions .btn,
    .header-actions .language-selector {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .lang-dropdown {
        z-index: 350;
    }

    .lang-option {
        padding: 16px 20px;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .language-selector {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .mobile-lang-dropdown {
        left: auto;
        right: -40px;
    }
}

@media (min-width: 769px) {
    .mobile-left-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-lang-btn {
        display: none !important;
    }
}