@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

html[lang="en"] body,
html[lang="en"] input,
html[lang="en"] select,
html[lang="en"] textarea,
html[lang="en"] button {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[lang="ar"] body,
html[lang="ar"] input,
html[lang="ar"] select,
html[lang="ar"] textarea,
html[lang="ar"] button {
    font-family: 'Cairo', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select { text-align: right; }
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"] { direction: ltr; text-align: right; }

/* Keep the main navigation natural in Arabic without changing application logic. */
html[dir="rtl"] #sidebar {
    left: auto !important;
    right: 0 !important;
    border-right: 0 !important;
    border-left: 1px solid rgb(229 231 235) !important;
}
html[dir="rtl"] #sidebarMobileToggle {
    left: auto !important;
    right: 1rem !important;
}
html[dir="rtl"] #sidebar .sidebar-text.ml-3,
html[dir="rtl"] #sidebar .sidebar-text[class*="ml-3"] {
    margin-left: 0 !important;
    margin-right: .75rem !important;
}
html[dir="rtl"] #sidebar .ml-auto { margin-left: 0 !important; margin-right: auto !important; }
html[dir="rtl"] #globalChatWidget { right: auto !important; left: 1.5rem !important; }

@media (max-width: 1023px) {
    html[dir="rtl"] #sidebar[class~="-translate-x-full"] { transform: translateX(100%) !important; }
    html[dir="rtl"] #sidebar[class~="translate-x-0"] { transform: translateX(0) !important; }
}

/* Direction-sensitive controls and dropdowns. */
html[dir="rtl"] .text-left { text-align: right !important; }
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] [data-i18n-no-flip] { direction: ltr; }
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-chevron-left { transform: scaleX(-1); }

/* Language toggle shared by public/login pages. */
.estateos-language-switch {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .25rem;
    border-radius: .9rem;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(229,231,235,.95);
    box-shadow: 0 8px 24px rgba(15,23,42,.06);
    direction: ltr;
}
.estateos-language-switch a {
    padding: .45rem .75rem;
    border-radius: .65rem;
    font-size: .75rem;
    font-weight: 700;
    color: #64748b;
    text-decoration: none;
    white-space: nowrap;
}
.estateos-language-switch a.is-active {
    background: var(--brand-primary, var(--color-primary, #ea580c));
    color: #fff;
}
