/* ============================================================
   PREMIUM LANGUAGE SWITCHER — Hurghada Tours & Transfers
   Glassmorphism design with smooth animations
   ============================================================ */

/* --- Container --- */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 9999;
}

/* --- Trigger Button --- */
.lang-switcher-btn {
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.35);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  user-select: none;
  backdrop-filter: blur(6px);
}
.lang-switcher-btn:hover,
.lang-switcher-btn[aria-expanded="true"] {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.6);
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
}

/* When navbar is scrolled / on light background */
.scrolled .lang-switcher-btn,
.navbar-light .lang-switcher-btn {
  background: rgba(13,27,62,0.08);
  border-color: rgba(13,27,62,0.22);
  color: #0d1b3e;
}
.scrolled .lang-switcher-btn:hover,
.navbar-light .lang-switcher-btn:hover {
  background: rgba(13,27,62,0.14);
  border-color: rgba(13,27,62,0.4);
}

/* Globe icon + code */
.lang-btn-icon {
  font-size: 15px;
  line-height: 1;
}
.lang-btn-code {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.lang-btn-chevron {
  font-size: 9px;
  transition: transform 0.25s ease;
  opacity: 0.8;
}
.lang-switcher-btn[aria-expanded="true"] .lang-btn-chevron {
  transform: rotate(180deg);
}

/* --- Dropdown Panel --- */
.lang-switcher-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 50px rgba(0,0,0,0.18), 0 2px 10px rgba(0,0,0,0.08);
  min-width: 200px;
  overflow: hidden;
  z-index: 99999;
  animation: langDropIn 0.22s cubic-bezier(0.34,1.56,0.64,1);
  border: 1px solid rgba(0,0,0,0.06);
}
.lang-switcher-dropdown.open {
  display: block;
}

@keyframes langDropIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Dropdown header */
.lang-dropdown-header {
  padding: 12px 16px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #999;
  border-bottom: 1px solid #f0f0f0;
}

/* Each language option */
.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #2d2d2d;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.lang-option:hover {
  background: #f5f7ff;
  color: #1a2d6d;
}
.lang-option.active {
  background: linear-gradient(90deg, #eef1ff, #f5f7ff);
  color: #1a2d6d;
  font-weight: 700;
}
.lang-option.active::after {
  content: "✓";
  margin-left: auto;
  color: #1a2d6d;
  font-size: 13px;
  font-weight: 800;
}

/* Flag emoji span */
.lang-flag-emoji {
  font-size: 18px;
  line-height: 1;
  width: 22px;
  text-align: center;
}

/* Language name */
.lang-name {
  flex: 1;
}

/* Native name (secondary) */
.lang-native {
  font-size: 11px;
  color: #aaa;
  font-weight: 400;
}

/* Divider between groups */
.lang-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 4px 0;
}

/* --- RTL support for Arabic --- */
html[lang="ar"] .lang-switcher-dropdown {
  right: auto;
  left: 0;
  text-align: right;
}
html[lang="ar"] .lang-option {
  flex-direction: row-reverse;
  text-align: right;
}
html[lang="ar"] .lang-option.active::after {
  margin-left: 0;
  margin-right: auto;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .lang-switcher-dropdown {
    right: -10px;
    min-width: 180px;
  }
}

/* --- Dark mode compatible --- */
@media (prefers-color-scheme: dark) {
  .lang-switcher-dropdown {
    background: #1e2235;
    border-color: rgba(255,255,255,0.1);
  }
  .lang-dropdown-header {
    color: #666;
    border-bottom-color: rgba(255,255,255,0.08);
  }
  .lang-option {
    color: #e0e0e0;
  }
  .lang-option:hover,
  .lang-option.active {
    background: rgba(255,255,255,0.07);
    color: #fff;
  }
  .lang-divider {
    background: rgba(255,255,255,0.08);
  }
}
