/* ==========================================================================
   Hybrid Arabic layout
   - Keep full page/content LTR.
   - Apply RTL only to sidebar + topbar shell.
   ========================================================================== */

/* Keep inner page/content strictly LTR even in Arabic mode. */
body[data-language="ar"] #main-body,
body[data-language="ar"] #main-body * {
  direction: ltr;
}

/* Sidebar shell RTL only */
body[data-language="ar"] .sidebar {
  direction: rtl;
  text-align: right;
  right: 0;
  left: auto;
  border-right: 0;
  border-left: 1px solid var(--cloud-border);
}

/* Desktop collapse/open should move from the right in Arabic mode */
body[data-language="ar"].sidebar-collapsed .sidebar {
  transform: translateX(100%);
}

body[data-language="ar"] .qwe {
  padding-right: var(--cloud-sidebar-width);
  padding-left: 0;
}

body[data-language="ar"].sidebar-collapsed .qwe {
  padding-right: 0;
}

body[data-language="ar"] .cloud-sidebar-fab {
  right: 10px;
  left: auto;
}

body[data-language="ar"] .cloud-brand-close i,
body[data-language="ar"] .cloud-sidebar-fab i {
  transform: rotate(180deg);
}

body[data-language="ar"] .cloud-nav-link,
body[data-language="ar"] .cloud-submenu-link,
body[data-language="ar"] .cloud-user-name,
body[data-language="ar"] .cloud-user-email {
  text-align: right;
}

body[data-language="ar"] .cloud-nav-link {
  justify-content: flex-end;
}

body[data-language="ar"] .cloud-nav-link:not(.cloud-nav-toggle) {
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
}

body[data-language="ar"] .cloud-nav-toggle {
  direction: rtl;
  flex-direction: row;
}

body[data-language="ar"] .cloud-nav-label {
  display: inline-flex;
  direction: rtl;
  flex-direction: row;
  justify-content: flex-start;
  width: 100%;
  text-align: right;
}

body[data-language="ar"] .cloud-submenu {
  padding: 0 22px 0 0;
}

/* Topbar shell RTL only */
body[data-language="ar"] .cloud-topbar {
  direction: rtl;
}

body[data-language="ar"] .cloud-topbar-right {
  margin-right: 20px;
  margin-left: 0;
}

/* Keep controls/search input itself LTR for stable behavior */
body[data-language="ar"] .cloud-language-switcher,
body[data-language="ar"] .cloud-theme-switcher,
body[data-language="ar"] .cloud-search-wrap {
  direction: ltr;
}

body[data-language="ar"] .cloud-search-input {
  direction: ltr;
  text-align: left;
}

body[data-language="ar"] .cloud-notification-menu {
  direction: rtl;
  text-align: right;
  right: 0;
  left: auto;
}

body[data-language="ar"] .cloud-notification-dropdown {
  position: relative;
}

body[data-language="ar"] .cloud-notification-dropdown .dropdown-menu.show {
  right: auto !important;
  left: 0 !important;
  top: calc(100% + 10px) !important;
  transform: none !important;
}

body[data-language="ar"] .cloud-notification-header {
  direction: rtl;
  text-align: right;
}

body[data-language="ar"] .cloud-notification-item {
  flex-direction: row;
  text-align: right;
}

body[data-language="ar"] .cloud-notification-content {
  text-align: right;
}

/* Breadcrumb RTL in Arabic mode */
body[data-language="ar"] .cloud-breadcrumb-card {
  direction: rtl;
}

body[data-language="ar"] .cloud-breadcrumb-title-wrap {
  text-align: right;
}

body[data-language="ar"] .cloud-breadcrumb-nav-wrap {
  margin-right: auto;
  margin-left: 0;
}

body[data-language="ar"] .cloud-breadcrumb-wrap .breadcrumb {
  direction: rtl;
  flex-direction: row-reverse;
  justify-content: flex-start;
}

body[data-language="ar"] .cloud-breadcrumb-wrap .breadcrumb-item + .breadcrumb-item::before {
  transform: rotate(180deg);
}

@media (max-width: 991.98px) {
  body[data-language="ar"] .sidebar {
    transform: translateX(100%);
  }

  body[data-language="ar"].sidebar-collapsed .sidebar {
    transform: translateX(100%);
  }
}

@media (max-width: 767.98px) {
  body[data-language="ar"] .cloud-topbar-right {
    margin-right: 0;
    justify-content: space-between;
  }
}
