/* ════════════════════════════════════════════════════════════
   Company Header & Navigation
   ════════════════════════════════════════════════════════════ */

.company-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1050;
    background: rgba(10,15,26,0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: transform 0.35s ease;
}

    .company-header.header-hidden {
        transform: translateY(-100%);
    }

.w-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ════════════════════════════════════════════════════════════
   Logo
   ════════════════════════════════════════════════════════════ */
.w-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1001;
}

.w-logo-icon {
    font-size: 1.5rem;
    margin-right: 8px;
}

.w-logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

/* ════════════════════════════════════════════════════════════
   Navigation Links
   ════════════════════════════════════════════════════════════ */
.w-nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

    .w-nav-links a {
        text-decoration: none;
        transition: color 0.3s ease;
        font-size: 0.95rem;
        color: #ffffff;
    }

/* ════════════════════════════════════════════════════════════
   Buttons
   ════════════════════════════════════════════════════════════ */
.w-btn-ghost {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

    .w-btn-ghost:hover {
        background: rgba(255, 255, 255, 0.1);
    }


.w-btn-block {
    width: 100%;
    justify-content: center;
    margin-bottom: 10px;
}

/* ════════════════════════════════════════════════════════════
   Navigation Actions
   ════════════════════════════════════════════════════════════ */
.w-nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.w-desktop-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.w-mobile-actions {
    display: none;
}

/* Logout Form */
.nav-logout-form {
    display: contents;
}

/* ════════════════════════════════════════════════════════════
   Language Switcher — Container
   ════════════════════════════════════════════════════════════ */
.language-switcher {
    position: relative;
    margin-left: 1rem;
}

/* ════════════════════════════════════════════════════════════
   Language Trigger Buttons (Desktop + Mobile)
   ════════════════════════════════════════════════════════════ */
.lang-btn,
.mobile-lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

    .lang-btn:hover,
    .mobile-lang-btn:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .lang-btn:focus,
    .mobile-lang-btn:focus {
        outline: none;
    }

    .lang-btn:focus-visible,
    .mobile-lang-btn:focus-visible {
        outline: 2px solid var(--accent, #10b981);
        outline-offset: 2px;
    }

/* ════════════════════════════════════════════════════════════
   Language Dropdowns
   ════════════════════════════════════════════════════════════ */
.lang-dropdown,
.mobile-lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    min-width: 150px;
    margin-top: 0.5rem;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

    /* Show state — consistent naming */
    .lang-dropdown.show,
    .mobile-lang-dropdown.show {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    /* ════════════════════════════════════════════════════════════
   Dropdown Items — Link (a) + Button (button) unified
   ════════════════════════════════════════════════════════════ */
    .lang-dropdown a,
    .lang-dropdown button.dropdown-item,
    .mobile-lang-dropdown a,
    .mobile-lang-dropdown button.dropdown-item {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        color: white;
        text-decoration: none;
        background: transparent;
        border: none;
        width: 100%;
        font-family: inherit;
        font-size: 0.9rem;
        text-align: start;
        cursor: pointer;
        transition: background 0.2s ease;
    }

        .lang-dropdown a:hover,
        .lang-dropdown a.active,
        .lang-dropdown button.dropdown-item:hover,
        .lang-dropdown button.dropdown-item.active,
        .mobile-lang-dropdown a:hover,
        .mobile-lang-dropdown a.active,
        .mobile-lang-dropdown button.dropdown-item:hover,
        .mobile-lang-dropdown button.dropdown-item.active {
            background: rgba(255, 255, 255, 0.1);
        }

        /* Focus ring for keyboard users */
        .lang-dropdown button.dropdown-item:focus,
        .mobile-lang-dropdown button.dropdown-item:focus {
            outline: none;
        }

        .lang-dropdown button.dropdown-item:focus-visible,
        .mobile-lang-dropdown button.dropdown-item:focus-visible {
            outline: 2px solid var(--accent, #10b981);
            outline-offset: -2px;
        }

/* Flag emoji sizing */
.flag {
    font-size: 1.2rem;
    line-height: 1;
}

/* ════════════════════════════════════════════════════════════
   Hamburger Toggle
   ════════════════════════════════════════════════════════════ */
.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
    z-index: 1001;
    background: transparent;
    border: none;
    padding: 5px;
}

    .nav-toggle span {
        width: 28px;
        height: 3px;
        background-color: white;
        border-radius: 2px;
        transition: all 0.3s ease;
        display: block;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

/* ════════════════════════════════════════════════════════════
   Overlay Background
   ════════════════════════════════════════════════════════════ */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .nav-overlay.show {
        opacity: 1;
        visibility: visible;
    }

/* ════════════════════════════════════════════════════════════
   RTL Support — Language Dropdowns
   ════════════════════════════════════════════════════════════ */
[dir="rtl"] .language-switcher {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .lang-dropdown,
[dir="rtl"] .mobile-lang-dropdown {
    right: auto;
    left: 0;
}

    /* في RTL: النص يبدأ من اليمين */
    [dir="rtl"] .lang-dropdown a,
    [dir="rtl"] .lang-dropdown button.dropdown-item,
    [dir="rtl"] .mobile-lang-dropdown a,
    [dir="rtl"] .mobile-lang-dropdown button.dropdown-item {
        text-align: right;
    }

/* ════════════════════════════════════════════════════════════
   Mobile Responsive
   ════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .w-desktop-actions {
        display: none;
    }

    .w-nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 75%;
        height: 100vh;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        align-items: flex-start;
        padding-top: 6rem;
        padding-inline-start: 2rem;
        transition: right 0.3s ease-in-out;
        z-index: 1000;
        overflow-y: auto;
        gap: 0;
    }

        .w-nav-links.open {
            right: 0;
        }

    [dir="rtl"] .w-nav-links {
        right: auto;
        left: -100%;
        padding-inline-start: 0;
        padding-inline-end: 2rem;
    }

        [dir="rtl"] .w-nav-links.open {
            left: 0;
            right: auto;
        }

    .w-nav-links > a {
        padding: 1rem 1rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 1.1rem;
    }

    .w-mobile-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
        margin-top: 2rem;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .w-nav-links a {
        color: #ffffff;
    }

        .w-nav-links a.active::after {
            background: #0f1729;
        }

    /* ═══ Mobile Switcher — static positioning inside sidebar ═══ */
    .mobile-switcher {
        width: 100%;
        margin: 1.5rem 0 0 0;
    }

        .mobile-switcher .lang-btn,
        .mobile-switcher .mobile-lang-btn {
            width: 100%;
            justify-content: center;
        }

        .mobile-switcher .lang-dropdown,
        .mobile-switcher .mobile-lang-dropdown {
            position: static;
            display: none;
            width: 100%;
            margin-top: 0.5rem;
        }

            .mobile-switcher .lang-dropdown.show,
            .mobile-switcher .mobile-lang-dropdown.show {
                display: block;
            }
}

/* ════════════════════════════════════════════════════════════
   Animation
   ════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ════════════════════════════════════════════════════════════
   Reduced Motion
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    .company-header,
    .lang-btn,
    .mobile-lang-btn,
    .lang-dropdown,
    .mobile-lang-dropdown,
    .nav-toggle span,
    .w-nav-links {
        transition: none !important;
        animation: none !important;
    }
}
