/**
 * RTL + Arabic font stack when html[dir="rtl"] (set by /js/i18n.js).
 */

.nvz-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Modern language switch (replaces native select) */
.aurion-lang {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html[dir="rtl"] .aurion-lang {
  padding: 4px 5px 4px 10px;
}

.aurion-lang--floating {
  position: fixed;
  top: 16px;
  inset-inline-end: 16px;
  z-index: 200;
}

.aurion-lang-icon {
  display: flex;
  align-items: center;
  color: rgba(201, 169, 98, 0.7);
  line-height: 0;
}

.aurion-lang-track {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
}

.aurion-lang-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(242, 240, 235, 0.45);
  font-family: inherit;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms, background 160ms, box-shadow 160ms;
  line-height: 1;
}

.aurion-lang-btn:hover:not(.active) {
  color: rgba(242, 240, 235, 0.85);
}

.aurion-lang-btn.active {
  background: rgba(201, 169, 98, 0.14);
  color: #d4c49a;
  box-shadow: inset 0 0 0 1px rgba(201, 169, 98, 0.32);
}

.aurion-lang-btn:focus-visible {
  outline: 2px solid rgba(201, 169, 98, 0.55);
  outline-offset: 1px;
}

.aurion-lang-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 768px) {
  .aurion-lang-icon { display: none; }
  html[dir="ltr"] .aurion-lang { padding-inline-start: 5px; }
  html[dir="rtl"] .aurion-lang { padding-inline-end: 5px; }
}

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

/* ── Dashboard shell (RTL) ── */
html[dir="rtl"] .dash-page-head,
html[dir="rtl"] .dash-page-head-text,
html[dir="rtl"] .dash-page-lead,
html[dir="rtl"] .dash-panel-head-bar,
html[dir="rtl"] .dash-panel-head {
  text-align: start;
}

html[dir="rtl"] .dash-page-head--home .dash-page-title {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

html[dir="rtl"] #homeWelcomeName {
  unicode-bidi: isolate;
}

html[dir="rtl"] .dash-topbar .title {
  font-family: "Noto Sans Arabic", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--aurion-gold-light, #d4c49a);
  text-shadow: 0 0 20px rgba(201, 169, 98, 0.22);
  white-space: nowrap;
}

html[dir="rtl"] .dash-nav-dock {
  direction: rtl;
}

html[dir="rtl"] .dash-user-role {
  text-transform: none;
  letter-spacing: 0;
  font-size: 10px;
  font-weight: 600;
}

html[dir="rtl"] .dash-user-logout-label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

html[dir="rtl"] .dash-user-meta {
  align-items: flex-start;
}

html[dir="rtl"] .home-hero-meta {
  direction: rtl;
}

html[dir="rtl"] .home-hero-value,
html[dir="rtl"] .dash-kpi-value,
html[dir="rtl"] .home-activity-pnl,
html[dir="rtl"] .home-activity-symbol {
  direction: ltr;
  unicode-bidi: isolate;
  text-align: start;
}

html[dir="rtl"] .dash-membership-row,
html[dir="rtl"] .dash-system-row,
html[dir="rtl"] .home-activity-row,
html[dir="rtl"] .home-alert {
  flex-direction: row-reverse;
}

html[dir="rtl"] .home-module {
  align-items: flex-start;
  text-align: start;
}

html[dir="rtl"] .topbar-session {
  margin-inline: 2px 0;
}

html[dir="rtl"] .toast-container {
  inset-inline-end: auto;
  inset-inline-start: 16px;
}

html[dir="rtl"] .toast.success,
html[dir="rtl"] .toast.error {
  border-inline-start: none;
  border-inline-end: 3px solid var(--green, #16a34a);
}

html[dir="rtl"] .toast.error {
  border-inline-end-color: var(--red, #dc2626);
}

html[dir="rtl"] .tbl th,
html[dir="rtl"] .tbl td {
  text-align: start;
}

html[dir="rtl"] .chart-toolbar-row,
html[dir="rtl"] .strat-toolbar,
html[dir="rtl"] .evt-log-card-header {
  flex-direction: row-reverse;
}

html[dir="rtl"] .chart-toolbar-cluster.chart-toolbar-actions {
  flex-direction: row-reverse;
}

html[dir="rtl"] .signal-log-body .signal-entry {
  direction: ltr;
}

html[dir="rtl"] .chart-candle-countdown {
  flex-direction: row-reverse;
}

html[dir="rtl"] .sm-header,
html[dir="rtl"] .sm-footer-actions {
  flex-direction: row-reverse;
}

/* Public marketing pages (landing) */
html[dir="rtl"] .nav,
html[dir="rtl"] .footer {
  flex-direction: row-reverse;
}

html[dir="rtl"] .disabled-lang {
  inset-inline-end: auto;
  inset-inline-start: 16px;
}
