/* ─────────────────────────────────────────────────────────────────────────────
   i18n.css — Language switcher UI + RTL overrides.

   The web app's existing CSS uses physical properties (left/right/border-left,
   margin-left, etc.). Rather than refactor everything to logical properties,
   this file adds targeted [dir="rtl"] overrides for the spots where RTL would
   otherwise look wrong (sidebar border, active-nav marker, action bar, modal
   close button position, auth nav alignment).
   ───────────────────────────────────────────────────────────────────────────── */

/* ── Language switcher (shared) ───────────────────────────────────────────── */

.lang-switcher {
  display: flex;
  gap: 4px;
}
.lang-switcher .lang-btn {
  flex: 1;
  padding: 6px 10px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  transition: background 0.15s, color 0.15s;
}
.lang-switcher .lang-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
}
.lang-switcher .lang-btn.active {
  background: rgba(191, 31, 58, 0.25);
  color: #f87171;
}

/* Sidebar variant: tucked above the sign-out button. */
.lang-switcher-sidebar {
  margin-bottom: 10px;
  padding: 4px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 10px;
}

/* Auth-nav variant: small pill at top-right of unauth pages. */
.lang-switcher-auth .lang-btn {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  padding: 5px 10px;
  font-size: 0.74rem;
}
.lang-switcher-auth .lang-btn.active {
  background: white;
  color: var(--navy-deep);
}

/* ── Header variant: globe icon + dropdown ────────────────────────────────── */

.lang-switcher-header {
  position: relative;
  flex-shrink: 0;
}

.lang-globe-btn {
  display: flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px; cursor: pointer;
  color: rgba(255,255,255,0.65);
  padding: 5px 8px;
  font-family: inherit; transition: all 0.15s;
}
.lang-globe-btn:hover, .lang-globe-btn.open {
  background: rgba(255,255,255,0.14);
  color: white;
  border-color: rgba(255,255,255,0.2);
}
.lang-globe-code {
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  line-height: 1;
}

.lang-globe-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  min-width: 130px;
  z-index: 60;
  animation: fadeIn 0.15s ease;
}
.lang-globe-dropdown.open { display: block; }

[dir="rtl"] .lang-globe-dropdown { right: auto; left: 0; }

.lang-globe-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px;
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text); transition: background 0.1s; gap: 10px;
}
.lang-globe-option:hover { background: var(--bg); }
.lang-globe-option.active { color: var(--navy); font-weight: 700; }
.lang-globe-option.active svg { color: var(--navy); }

/* ── RTL overrides ────────────────────────────────────────────────────────── */

/* Sidebar border flips to the left edge in RTL. */
[dir="rtl"] aside {
  border-right: none;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
}

/* Active-nav red marker: pinned to the right edge in RTL with mirrored radius. */
[dir="rtl"] .nav-item.active::before {
  left: auto;
  right: 0;
  border-radius: 3px 0 0 3px;
}

/* Auth-nav: when RTL we want the "back" arrow to face right and the lang
   switcher to sit visually mirrored. Flex already mirrors via dir, but the
   back-arrow glyph (←) is baked into the text — the translations themselves
   use the appropriate arrow (→), so we don't need to flip the glyph here. */

/* Week-nav chevrons: flex auto-swaps button positions in RTL, but the
   chevron SVGs still point the original direction. Mirror them so "previous"
   points right and "next" points left, matching RTL reading flow. */
[dir="rtl"] .week-nav .week-btn svg,
[dir="rtl"] .prof-month-nav .prof-month-btn svg {
  transform: scaleX(-1);
}
