/* =====================================================
   Language Switcher — LogicRacks Academy
   ===================================================== */

/* Hide Google Translate default UI (we use custom buttons) */
#google_translate_element { display: none !important; }
.goog-te-banner-frame,
.goog-te-gadget,
.skiptranslate,
iframe.skiptranslate,
.goog-te-balloon-frame,
#goog-gt-tt,
.goog-tooltip { display: none !important; }
body { top: 0 !important; position: static !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
font { color: inherit !important; background: transparent !important; }

/* Custom switcher pills — in utility bar */
.lr-lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 100px;
  padding: 3px;
  margin-left: 12px;
}
.lr-lang-switch button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.65);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 100px;
  cursor: pointer;
  transition: all .18s;
  line-height: 1.2;
}
.lr-lang-switch button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.lr-lang-switch button.active {
  background: var(--accent);
  color: #fff;
}
.lr-lang-switch button[data-lr-lang="ur"] {
  font-family: 'Noto Nastaliq Urdu', 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
  padding: 3px 12px;
}

/* Mobile floating switcher (utility bar hidden on mobile) */
.lr-lang-switch-mobile {
  display: none;
}
@media (max-width: 991px) {
  .lr-lang-switch-mobile {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(255,255,255,.08);
    border: 1px solid var(--line);
    border-radius: 100px;
    padding: 3px;
    margin-right: 10px;
  }
  .lr-lang-switch-mobile button {
    border: 0;
    background: transparent;
    color: var(--ink-500);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 100px;
    cursor: pointer;
    line-height: 1.2;
  }
  .lr-lang-switch-mobile button.active {
    background: var(--accent);
    color: #fff;
  }
  .lr-lang-switch-mobile button[data-lr-lang="ur"] {
    font-family: 'Noto Nastaliq Urdu', 'Plus Jakarta Sans', sans-serif;
    font-size: 0.86rem;
    text-transform: none;
    padding: 2px 10px;
  }
}

/* Urdu mode — apply Nastaliq font + RTL adjustments */
body.lang-urdu {
  font-family: 'Noto Nastaliq Urdu', 'Inter', sans-serif;
  line-height: 2 !important;
}
body.lang-urdu h1,
body.lang-urdu h2,
body.lang-urdu h3,
body.lang-urdu h4,
body.lang-urdu h5,
body.lang-urdu h6 {
  font-family: 'Noto Nastaliq Urdu', 'Plus Jakarta Sans', sans-serif;
  line-height: 1.7 !important;
  letter-spacing: 0 !important;
}
body.lang-urdu .btn,
body.lang-urdu button,
body.lang-urdu .tb-cta,
body.lang-urdu .pg-cta,
body.lang-urdu .cat-row,
body.lang-urdu .nav-link {
  font-family: 'Noto Nastaliq Urdu', 'Plus Jakarta Sans', sans-serif;
}

/* RTL layout adjustments */
html[dir="rtl"] .lr-lang-switch,
html[dir="rtl"] .lr-lang-switch-mobile { margin-right: 12px; margin-left: 0; }
html[dir="rtl"] .navbar-brand { flex-direction: row-reverse; }
html[dir="rtl"] .bi-arrow-right::before { content: "\f12f"; }  /* arrow-left */
html[dir="rtl"] .bi-arrow-up-right::before { content: "\f132"; }  /* arrow-up-left */
html[dir="rtl"] .tb-cta i,
html[dir="rtl"] .pg-cta i { transform: scaleX(-1); }

/* Google Translate leaves ugly attribute on body — reset */
body[style*="top"] { top: 0 !important; }

/* ---------- Loading toast ---------- */
.lr-lang-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1A0F4A;
  color: #fff;
  padding: 14px 22px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,.15);
  border-left: 4px solid #F26A21;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 0.92rem;
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .3s cubic-bezier(.2,.7,.3,1);
  white-space: nowrap;
  max-width: 90vw;
}
.lr-lang-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lr-lang-toast::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,196,0,.3);
  border-top-color: #FFC400;
  border-radius: 50%;
  margin-right: 10px;
  vertical-align: middle;
  animation: lr-spin 0.6s linear infinite;
}
.lr-lang-toast-error {
  border-left-color: #EF4444;
  background: #7f1d1d;
}
.lr-lang-toast-error::before {
  display: none;
}
@keyframes lr-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 575px) {
  .lr-lang-toast { bottom: 80px; font-size: 0.82rem; padding: 10px 16px; }
}
