/* RTL layout for Arabic (portal shell).
 *
 * Bootstrap RTL CSS is loaded when LANGUAGE_BIDI (see base.html). This file
 * only covers portal chrome that still uses physical left/right (sidebar,
 * topbar) plus the Arabic font stack.
 */

[dir="rtl"] body {
  font-family: "Noto Sans Arabic", Inter, system-ui, -apple-system, sans-serif;
}

/* Sidebar is custom (not Bootstrap) — mirror manually */
[dir="rtl"] .portal-sidebar {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid var(--sidebar-border);
}

[dir="rtl"] .portal-main {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

[dir="rtl"][data-sidebar-collapsed="true"] .portal-main {
  margin-right: var(--sidebar-collapsed-width);
}

/* Top-nav hides the sidebar — do not keep the RTL sidebar gutter */
[dir="rtl"][data-portal-nav="top"] .portal-main {
  margin-right: 0 !important;
}

[dir="rtl"] .portal-topbar {
  left: auto;
  right: var(--sidebar-width);
}

[dir="rtl"][data-sidebar-collapsed="true"] .portal-topbar {
  right: var(--sidebar-collapsed-width);
}

[dir="rtl"][data-portal-nav="top"] .portal-topbar {
  left: 0 !important;
  right: 0 !important;
}

[dir="rtl"] .sidebar-link {
  border-left: none;
  border-right: 2px solid transparent;
}

[dir="rtl"] .sidebar-link.active,
[dir="rtl"] .sidebar-link:hover {
  border-right-color: var(--sidebar-item-active-border);
}

[dir="rtl"] .sidebar-submenu {
  padding-left: 0;
  padding-right: 18px;
}

[dir="rtl"] .sidebar-sub-submenu {
  padding-left: 0;
  padding-right: 14px;
}

[dir="rtl"] .topbar-user-name {
  margin-left: 0;
  margin-right: 0.5rem;
}

[dir="rtl"] .portal-lang-menu {
  text-align: right;
}

[dir="rtl"] .portal-lang-option-text {
  align-items: flex-end;
}

[dir="rtl"] .welcome-date {
  text-align: start;
}

@media (max-width: 991px) {
  [dir="rtl"] .portal-sidebar.mobile-open {
    right: 0;
    left: auto !important;
  }
  [dir="rtl"] .portal-main {
    margin-right: 0 !important;
  }
}

/* Marketing site RTL (public pages that share this stylesheet) */
[dir="rtl"] .mk-body {
  font-family: "Noto Sans Arabic", Inter, system-ui, sans-serif;
}

[dir="rtl"] .mk-nav-inner {
  flex-direction: row-reverse;
}

[dir="rtl"] .mk-nav-actions {
  flex-direction: row-reverse;
}

[dir="rtl"] .mk-signup-grid {
  direction: rtl;
}

[dir="rtl"] .mk-lang-select {
  direction: rtl;
}
