/* ============================================================================
   BLUE OASIS — Language Switcher + RTL styling
   ==========================================================================*/

/* --- Language switcher --------------------------------------------------- */
.bo-lang-switcher {
  position: relative;
  display: inline-flex;
  z-index: 1200;
  font-family: 'Poppins', 'Montserrat', sans-serif;
}

.bo-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.bo-lang-btn:hover {
  border-color: #2E86DE;
  background: rgba(46, 134, 222, 0.12);
}

.bo-lang-globe { font-size: 0.95rem; }
.bo-lang-caret { font-size: 0.6rem; opacity: 0.7; transition: transform 0.3s ease; }
.bo-lang-switcher.open .bo-lang-caret { transform: rotate(180deg); }

.bo-lang-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 190px;
  background: rgba(10, 12, 18, 0.97);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0.4rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  max-height: 60vh;
  overflow-y: auto;
}

.bo-lang-switcher.open .bo-lang-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* RTL: open the menu to the left edge instead */
html[dir="rtl"] .bo-lang-menu { right: auto; left: 0; }

.bo-lang-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: none;
  border-radius: 9px;
  color: #cdd3dc;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

html[dir="rtl"] .bo-lang-item { text-align: right; }

.bo-lang-item:hover { background: rgba(46, 134, 222, 0.15); color: #fff; }
.bo-lang-item .bo-lang-flag { font-size: 1.05rem; }
.bo-lang-item .bo-lang-name { flex: 1; }
.bo-lang-item .bo-lang-check { opacity: 0; color: #2E86DE; font-weight: 700; }
.bo-lang-item.active { color: #fff; background: rgba(46, 134, 222, 0.1); }
.bo-lang-item.active .bo-lang-check { opacity: 1; }

/* Floating fallback (pages without a header placeholder, e.g. LMS) */
.bo-lang-switcher.bo-lang-floating {
  position: fixed;
  top: 16px;
  right: 16px;
}
html[dir="rtl"] .bo-lang-switcher.bo-lang-floating { right: auto; left: 16px; }
.bo-lang-switcher.bo-lang-floating .bo-lang-btn {
  background: rgba(10, 12, 18, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* --- Mobile / tablet: keep the switcher ALWAYS visible beside the hamburger */
@media (max-width: 1024px) {
  /* Never let it hide inside a collapsed menu */
  #bo-lang-switcher,
  .bo-lang-switcher:not(.bo-lang-floating) {
    display: inline-flex !important;
    align-items: center;
    z-index: 1001;
  }
  /* Landing header: switcher is a direct child of the nav row — push it to the
     right so it groups next to the hamburger instead of floating mid-row. */
  .nav-container > #bo-lang-switcher { margin-left: auto; margin-right: 0.6rem; }
  html[dir="rtl"] .nav-container > #bo-lang-switcher { margin-left: 0.6rem; margin-right: auto; }
  /* Interior header keeps its switcher inside .nav-cta beside the hamburger. */
  .nav-cta #bo-lang-switcher { margin-right: 0.25rem; }
  /* Compact the pill a touch so it fits small screens cleanly. */
  .bo-lang-btn { padding: 0.45rem 0.7rem; font-size: 0.68rem; }
}

@media (max-width: 480px) {
  .bo-lang-btn { padding: 0.4rem 0.6rem; gap: 0.35rem; }
  .bo-lang-menu { min-width: 168px; }
}

/* --- Global RTL adjustments (Arabic) ------------------------------------ */
html[dir="rtl"] body { direction: rtl; }

/* Mirror common flex nav rows so the logo/menu order feels natural */
html[dir="rtl"] .nav-container,
html[dir="rtl"] .main-nav { direction: rtl; }

/* Text alignment for content blocks */
html[dir="rtl"] .hero-content,
html[dir="rtl"] .about-content,
html[dir="rtl"] .about-text,
html[dir="rtl"] .section-subtitle,
html[dir="rtl"] .footer-tagline,
html[dir="rtl"] p { text-align: right; }

/* Keep centered elements centered */
html[dir="rtl"] .text-center,
html[dir="rtl"] .pricing-header,
html[dir="rtl"] .faq-header,
html[dir="rtl"] .blog-header,
html[dir="rtl"] [style*="text-align: center"],
html[dir="rtl"] [style*="text-align:center"] { text-align: center; }

/* Arabic-friendly typography — improves rendered Arabic legibility */
html[dir="rtl"],
html[dir="rtl"] body {
  font-family: 'Segoe UI', 'Tahoma', 'Noto Naskh Arabic', 'Cormorant Garamond', sans-serif;
}

/* Flip directional spacing helpers used around icons */
html[dir="rtl"] .footer-contact li,
html[dir="rtl"] .contact-item { flex-direction: row-reverse; }

/* Smooth fade when language changes (premium feel) */
body { transition: opacity 0.25s ease; }
html.bo-switching body { opacity: 0.35; }
