/* ==========================================================================
   Vikky 3D Animation - Help & Guides Internationalization (i18n) & RTL
   ========================================================================== */

/* --------------------------------------------------------------------------
   Language Switcher Component (Tactile Pill + Dropdown)
   -------------------------------------------------------------------------- */
.lang-switch-wrap {
  position: relative;
  display: inline-block;
  user-select: none;
  z-index: 10005;
}

.lang-switch-wrap.open {
  z-index: 10010;
}

.lang-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1.5px solid rgba(78, 205, 196, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-family: var(--font-primary, 'Fredoka', 'Tajawal', sans-serif);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.lang-switch-btn:hover {
  background: rgba(78, 205, 196, 0.16);
  border-color: var(--color-primary-2, #4ECDC4);
  transform: translateY(-1px);
}

.lang-switch-btn i.fa-globe {
  color: var(--color-primary-2, #4ECDC4);
  font-size: 0.95rem;
}

.lang-switch-chevron {
  font-size: 0.72rem;
  opacity: 0.75;
  transition: transform 0.2s ease;
}

.lang-switch-wrap.open .lang-switch-chevron {
  transform: rotate(180deg);
}

/* Light theme overrides for Guides pages */
.guide-main .lang-switch-btn {
  background: #F8FAFC;
  color: var(--color-dark, #011627);
  border-color: rgba(78, 205, 196, 0.4);
}

.guide-main .lang-switch-btn:hover {
  background: rgba(78, 205, 196, 0.15);
}

/* Dropdown Menu */
.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 148px;
  background: #151A24;
  border: 1.5px solid rgba(78, 205, 196, 0.3);
  border-radius: 14px;
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 99999;
  animation: langDropdownIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.guide-main .lang-dropdown-menu {
  background: #FFFFFF;
  border-color: rgba(78, 205, 196, 0.35);
  box-shadow: 0 12px 30px rgba(1, 22, 39, 0.12);
}

.lang-switch-wrap.open .lang-dropdown-menu {
  display: flex;
}

@keyframes langDropdownIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.lang-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 11px;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: #CBD5E1;
  font-family: var(--font-primary, 'Fredoka', 'Tajawal', sans-serif);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.guide-main .lang-menu-item {
  color: #334155;
}

.lang-menu-item:hover {
  background: rgba(78, 205, 196, 0.15);
  color: var(--color-primary-2, #4ECDC4);
}

.lang-menu-item.active {
  background: var(--color-primary-2, #4ECDC4);
  color: var(--color-dark, #011627);
  font-weight: 700;
}

.lang-item-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  letter-spacing: 0.5px;
}

.lang-menu-item.active .lang-item-badge {
  background: rgba(1, 22, 39, 0.15);
  color: var(--color-dark, #011627);
}

/* --------------------------------------------------------------------------
   RTL Typography & Layout Rules
   -------------------------------------------------------------------------- */
[dir="rtl"],
body.is-rtl {
  direction: rtl;
  text-align: right;
  font-family: 'Tajawal', var(--font-primary, 'Fredoka'), sans-serif;
}

[dir="rtl"] .hub-hero-title,
[dir="rtl"] .guide-nav-title h1,
[dir="rtl"] .step-title,
[dir="rtl"] .main-section-title,
[dir="rtl"] .hub-nav-brand-logo,
[dir="rtl"] .guide-row-title,
[dir="rtl"] .hub-cta-text h3 {
  font-family: 'Tajawal', var(--font-primary, 'Fredoka'), sans-serif !important;
  font-weight: 700;
  letter-spacing: normal;
}

[dir="rtl"] .hub-hero-subtitle,
[dir="rtl"] .step-instruction,
[dir="rtl"] .step-tip-box,
[dir="rtl"] .hub-cta-text p {
  font-family: 'Tajawal', var(--font-text, 'Comic Neue'), sans-serif !important;
  line-height: 1.7;
}

/* Navigation arrow flipping in RTL */
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .guide-arrow-indicator i {
  transform: scaleX(-1);
}

/* Search input in RTL */
[dir="rtl"] .hub-search-box i {
  left: auto;
  right: 18px;
}

[dir="rtl"] .hub-search-input {
  padding-left: 20px;
  padding-right: 48px;
  text-align: right;
}

/* Guide items list row layout in RTL */
[dir="rtl"] .guide-list-row {
  text-align: right;
}

[dir="rtl"] .guide-row-left {
  flex-direction: row;
}

[dir="rtl"] .guide-type-pill,
[dir="rtl"] .guide-platform-tag {
  margin-right: 0;
  margin-left: 6px;
}

/* Simulator controls in RTL */
[dir="rtl"] .step-choice-label {
  text-align: right;
}

[dir="rtl"] .step-tip-box {
  border-left: none;
  border-right: 4px solid var(--color-primary-2, #4ECDC4);
  text-align: right;
}

[dir="rtl"] .step-choice-btn {
  text-align: right;
}

/* Nav Actions Container */
.guide-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Hindi Language Specific Typography (LTR, Devanagari Script)
   -------------------------------------------------------------------------- */
[lang="hi"] {
  --font-text: 'Mukta', 'Segoe UI', system-ui, sans-serif;
}

[lang="hi"] h1,
[lang="hi"] h2,
[lang="hi"] h3,
[lang="hi"] h4,
[lang="hi"] .guide-row-title,
[lang="hi"] .step-title,
[lang="hi"] .btn-step,
[lang="hi"] .lang-switch-btn,
[lang="hi"] .lang-menu-item,
[lang="hi"] .guide-nav-title h1,
[lang="hi"] .guide-nav-back,
[lang="hi"] .hero-title,
[lang="hi"] .filter-btn {
  font-family: 'Mukta', 'Fredoka', 'Segoe UI', sans-serif;
  letter-spacing: 0;
}

@media (max-width: 640px) {
  .lang-switch-btn {
    padding: 3px 8px;
    font-size: 0.78rem;
    gap: 4px;
  }

  .lang-switch-chevron {
    display: none;
  }

  .lang-dropdown-menu {
    min-width: 125px;
  }
}