/* Language selector styled like the attached mockup */
.language-dropdown {
    position: relative;
    display: inline-block;
}

.language-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 32px;
    padding: 8px 12px;
    cursor: pointer;
    /* font-weight removed - using centralized typography system */
    color: #1f2d3d;
    box-shadow: 0 8px 20px rgba(18,28,45,0.06);
    border: 1px solid rgba(18,28,45,0.06);
    white-space: nowrap;
}

    .language-btn img {
        width: 28px;
        height: 20px;
        border-radius: 3px;
        object-fit: cover;
    }

.language-menu {
    display: none;
    position: absolute;
    top: 52px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(18,28,45,0.08);
    min-width: 220px;
    z-index: 2000;
    padding: 8px;
}

/* RTL/LTR positioning for language menu */
[dir="rtl"] .language-menu {
    right: 0;
}

[dir="ltr"] .language-menu {
    left: 0;
}

.language-menu.active {
    display: block;
}

.language-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    /* font-weight removed - using centralized typography system */
    color: #22303b;
    text-transform: uppercase;
    /* font-size removed - using centralized typography system */
    border-radius: 8px;
}

    .language-option img {
        width: 28px;
        height: 20px;
        border-radius: 3px;
    }

    .language-option:hover {
        background: #f6f8fb;
    }

    /* explicit check element on the right */
    .language-option .lang-check {
        display: none;
        color: #28a745;
        /* font-weight and font-size removed - using centralized typography system */
    }

[dir="rtl"] .language-option .lang-check {
    margin-right: auto;
}

[dir="ltr"] .language-option .lang-check {
    margin-left: auto;
}

.language-option.active .lang-check {
    display: inline-block;
}

/* Header RTL/LTR Support */
.Header {
    padding-left: 156px;
    padding-right: 156px;
    position: relative;
}

/* Mobile */
@@media (max-width: 768px) {
    .Header {
        padding-left: 20px;
        padding-right: 20px;
        flex-wrap: wrap;
    }
}

/* Small Mobile */
@@media (max-width: 480px) {
    .Header {
        padding-left: 16px;
        padding-right: 16px;
    }
}

[dir="rtl"] .Header {
    direction: rtl;
}

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

/* Reverse flex direction for RTL tabs */
[dir="rtl"] .Tabs {
    flex-direction: row-reverse;
}

/* For English LTR, also reverse to maintain right-to-left navigation order */
[dir="ltr"] .Tabs {
    flex-direction: row-reverse;
}

/* Reverse button order for RTL */
[dir="rtl"] .Buttons {
    flex-direction: row-reverse;
}

/* Text alignment based on direction */
[dir="rtl"] .header-text {
    text-align: right;
}

[dir="ltr"] .header-text {
    text-align: left;
}

/* Language button spacing */
.lang-arrow {
    margin-left: 5px;
    flex-shrink: 0;
}

[dir="rtl"] .lang-arrow {
    margin-left: 0;
    margin-right: 5px;
}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    background: var(--Primary-500, #6A5D8B);
    border: none;
    color: white;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
}

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

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

/* Side Menu Panel */
.mobile-side-menu {
    position: fixed;
    top: 0;
    width: 320px;
    max-width: 85%;
    height: 100%;
    background: white;
    z-index: 9999;
    box-shadow: -2px 0 12px rgba(0,0,0,0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 24px;
    display: none;
    flex-direction: column;
    gap: 24px;
}

[dir="rtl"] .mobile-side-menu {
    right: 0;
    transform: translateX(100%);
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}

[dir="ltr"] .mobile-side-menu {
    left: 0;
    transform: translateX(-100%);
}

.mobile-side-menu.active {
    display: flex;
    transform: translateX(0);
}

/* Close button in side menu */
.mobile-menu-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: #666;
    /* font-size removed - using centralized typography system */
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

/* Side menu sections */
.mobile-menu-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-menu-section-title {
    /* font-size and font-weight removed - using centralized typography system */
    color: #999;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.mobile-menu-item {
    padding: 12px 16px;
    color: #666;
    /* font-size and font-weight removed - using centralized typography system */
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

    .mobile-menu-item:hover,
    .mobile-menu-item:active {
        background: #F3F2F6;
    }

    .mobile-menu-item.active {
        color: #111;
        /* font-weight removed - using centralized typography system */
        background: #F3F2F6;
    }

.mobile-menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid #E6E6E6;
}

    .mobile-menu-buttons .ContactUs {
        width: 100%;
        height: 48px;
    }

/* Language items in mobile menu */
.mobile-menu-item img {
    display: inline-block;
    vertical-align: middle;
}

[dir="ltr"] .mobile-menu-item img {
    margin-right: 12px;
}

[dir="rtl"] .mobile-menu-item img {
    margin-left: 12px;
    margin-right: 0;
}

@@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    /* Hide desktop navigation on mobile */
    .Tabs {
        display: none !important;
    }
    /* Hide buttons except Profile on mobile */
    .Buttons > .ContactUs,
    .Buttons > form {
        display: none !important;
    }
    /* Keep profile visible */
    .Buttons .Profile {
        display: flex !important;
    }
    /* Adjust header layout */
    .Header {
        justify-content: space-between;
    }

    .Buttons {
        flex: 0 0 auto;
    }

    .hero-BlueSquare {
        right: 2%;
        top: -6%;
    }
}

/* Tablet adjustments */
@@media (max-width: 1024px) {


    .Tabs {
        gap: 16px;
    }

        .Tabs > a {
            /* font-size removed - using centralized typography system */
            padding: 8px 12px;
        }

    .Buttons {
        gap: 8px;
    }

    .ContactUs {
        padding-left: 12px;
        padding-right: 12px;
        /* font-size removed - using centralized typography system */
    }

    .hero-BlueSquare {
        right: 2%;
        top: -6%;
    }

    .Licenses {
        align-self: auto !important;
    }
}

/* Logo responsive */
@@media (max-width: 768px) {
    .Image1 {
        width: 55px !important;
        height: 38px !important;
    }

    .hero-BlueSquare {
        right: 2%;
        top: -6%;
    }

    .Licenses {
        align-self: auto !important;
    }
}

@@media (max-width: 480px) {
    .Image1 {
        width: 48px !important;
        height: 33px !important;
    }

    .mobile-menu-toggle {
        width: 40px !important;
}

/* Logo transparent background */
img[alt="Aqar360"],
img[data-uid="fkAvulGTIz8vmOfs"],
div[data-uid="nB2ABHQbGJfENqXi"] img {
    background: transparent !important;
    background-color: transparent !important;
}

div[data-uid="nB2ABHQbGJfENqXi"] {
    background: transparent !important;
    background-color: transparent !important;
}
        height: 40px !important;
    }

    .Profile {
        width: 40px !important;
        height: 40px !important;
    }

    .mobile-side-menu {
        padding: 20px 16px;
    }

    .hero-BlueSquare {
        right: 2%;
        top: -6%;
    }
    /* .Licenses {
			align-self: auto !important;
		} */
}

/* Additional responsive styles for navigation links to prevent word breaking */
@@media (max-width: 1200px) {
    .Tabs > a {
        white-space: nowrap;
        /* font-size removed - using centralized typography system */
    }

    .mobile-menu-toggle {
        display: flex;
    }
    /* Adjust header layout for mobile based on language direction */
    [dir="rtl"] .Header {
        flex-direction: row-reverse;
        justify-content: space-between !important;
    }

    [dir="ltr"] .Header {
        flex-direction: row;
        justify-content: space-between !important;
    }
    /* Ensure logo and menu button are at opposite ends */
    [dir="rtl"] .Image1 {
        order: 2;
    }

    [dir="rtl"] .mobile-menu-toggle {
        order: 1;
    }

    [dir="ltr"] .Image1 {
        order: 1;
    }

    [dir="ltr"] .mobile-menu-toggle {
        order: 3;
    }
    /* Hide desktop navigation on mobile */
    .Tabs {
        display: none !important;
    }
    /* Hide all buttons including Profile and Language on mobile */
    .Buttons {
        display: none !important;
    }
    /* Hide language dropdown form on mobile */
    #langForm {
        display: none !important;
    }
}

/* Desktop view - ensure header is always visible */
@media (min-width: 1024px) {
    /* Ensure header element is visible and rendered */
    #mainHeader {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 99997 !important;
        height: auto !important;
        min-height: auto !important;
    }
    
    /* Ensure all header children are visible */
    #mainHeader * {
        visibility: visible !important;
    }
    
    /* Ensure desktop navigation is visible (Tailwind's lg:flex should handle this, but ensure it) */
    .hidden.lg\:flex {
        display: flex !important;
    }
    
    /* Hide mobile menu button on desktop */
    .mobile-menu-btn,
    #mobileMenuButton {
        display: none !important;
    }
}

@@media (max-width: 900px) {
    .Tabs > a {
        /* font-size removed - using centralized typography system */
        padding: 6px 8px;
    }
}

@@media (max-width: 768px) {
    .Tabs > a {
        /* font-size removed - using centralized typography system */
        padding: 4px 6px;
    }
}

/* Mobile Header Layout: Hamburger on left, Logo on right using row-reverse */
@media (max-width: 1024px) {
    /* Apply row-reverse to fix mobile layout - hamburger on left, logo on right */
    .mobile-header-container,
    div.mobile-header-container,
    div.mobile-header-container.flex.items-center.justify-between,
    div[data-uid="ZvwdQ4hADUDCZZ7D"].mobile-header-container,
    div[data-uid="ZvwdQ4hADUDCZZ7D"].flex.items-center.justify-between.mobile-header-container {
        flex-direction: row-reverse !important;
    }
}

/* Client marketing header: remove harsh box around mobile brand (UA / focus / Tailwind can read as a black frame). */
@media (max-width: 1023px) {
    #mainHeader #mobileLogoContainer,
    #mainHeader #mobileLogoContainer img,
    #mainHeader #mobileLogoContainer #headerLogoMobile {
        border: none !important;
        outline: none !important;
        box-shadow: none !important;
    }

    #mainHeader #mobileLogoContainer img#headerLogoMobile {
        -webkit-tap-highlight-color: transparent;
        display: block;
        width: auto !important;
        height: 38px !important;
        max-height: 40px !important;
        max-width: min(200px, 58vw) !important;
        object-fit: contain !important;
    }

    #mainHeader #mobileLogoContainer div#headerLogoMobile {
        border: none !important;
        outline: none !important;
        -webkit-tap-highlight-color: transparent;
    }
}

/* Post Listing — choose profile (outside fixed <header>): full-viewport overlay + card layout survives page-specific CSS */
#postListingProfileModal.post-listing-profile-gate {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    max-height: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    z-index: 2147483646 !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
}

#postListingProfileModal.post-listing-profile-gate > div {
    width: 100% !important;
    max-width: 28rem !important;
    flex: 0 1 auto !important;
    margin: 0 auto !important;
}

/* Footer: physical button order (Cancel then Continue); dir on inner panel handles RTL text */
#postListingProfileModal.post-listing-profile-gate .post-listing-profile-footer {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.5rem !important;
}

#postListingProfileModal.post-listing-profile-gate [dir="rtl"] .post-listing-profile-footer {
    justify-content: flex-start !important;
}

/* Header action cluster: under page dir=rtl, flex row places first DOM child on the right — reverse visual order.
   Force LTR on this strip so order is always: Notification → Profile → Post Listing → Join (left to right).
   Row layout is desktop-only: a global row + !important was overriding the mobile drawer column stack and caused overflow. */
.nav-actions--ltr-toolbar {
    direction: ltr !important;
}

@media (min-width: 1024px) {
    .nav-actions--ltr-toolbar {
        flex-direction: row !important;
    }
}

@media (max-width: 1023px) {
    .nav-actions--ltr-toolbar.active {
        direction: ltr !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .nav-actions--ltr-toolbar.active > .flex.justify-end {
        width: 100%;
        display: flex !important;
        justify-content: center;
    }

    .nav-actions--ltr-toolbar.active .action-button,
    .nav-actions--ltr-toolbar.active #joinPartnerButton {
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
        text-align: center;
    }

    /* Profile linked-accounts menu: #postListingButton is a flex sibling below the panel — it can paint over the first row (looks like a “transparent” menu). Hide while the drawer profile menu is open. */
    .nav-actions--ltr-toolbar.active.nav-actions--profile-panel-drawer-open #postListingButton,
    .nav-actions--ltr-toolbar.active.nav-actions--profile-panel-drawer-open #joinPartnerButton {
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }
}

/* Login: white hero chip is desktop toolbar only (lg+). On mobile, actions are in the drawer — keep purple like solid bar. */
@media (max-width: 1023px) {
    #loginButton.login-toolbar-surface-light {
        background-color: #6b5b95 !important;
        color: #ffffff !important;
        border-color: #6b5b95 !important;
    }

    #loginButton.login-toolbar-surface-light span {
        color: #ffffff !important;
    }

    #loginButton.login-toolbar-surface-light svg {
        color: #ffffff !important;
        stroke: #ffffff !important;
    }
}

/* Marketing footer blurb: follow logical start edge and wrap whole words where possible */
footer p.text-gray-400.leading-relaxed.text-lg {
    text-align: start;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: manual;
}

@supports (text-wrap: pretty) {
    footer p.text-gray-400.leading-relaxed.text-lg {
        text-wrap: pretty;
    }
}