/**
 * i18n Language Switcher Position Fix v2
 * - Prevents language switcher from overlapping the "主理人" nav link
 * - Moves nav items slightly left to avoid overlap with icon buttons
 * - Makes dropdown text black for readability
 */

/* ── Language Switcher Container ── */
#mujoo-lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  margin-right: 8px;
  z-index: 50;
  flex-shrink: 0;
}

/* ── Trigger Button ── */
#mujoo-lang-switcher .lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #333 !important;
  transition: background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
  line-height: 1.4;
}

#mujoo-lang-switcher .lang-trigger:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ── Dropdown ── */
#mujoo-lang-switcher .lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 4px;
  display: none;
  min-width: 120px;
  z-index: 10000;
}

#mujoo-lang-switcher .lang-dropdown.open {
  display: block;
}

/* ── Dropdown Items - BLACK TEXT for readability ── */
#mujoo-lang-switcher .lang-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  color: #111 !important;
  border-radius: 8px;
  transition: background 0.15s;
  text-align: left;
}

#mujoo-lang-switcher .lang-item:hover {
  background: rgba(0, 200, 180, 0.1);
  color: #000 !important;
}

#mujoo-lang-switcher .lang-item.active {
  background: rgba(0, 200, 180, 0.15);
  font-weight: 600;
  color: #000 !important;
}

/* ── Flag & Label - ensure black text ── */
#mujoo-lang-switcher .lang-flag {
  font-size: 16px;
  color: #111 !important;
}

#mujoo-lang-switcher .lang-label {
  font-size: 13px;
  color: #111 !important;
}

#mujoo-lang-switcher .lang-arrow {
  font-size: 10px;
  opacity: 0.6;
  margin-left: 2px;
  color: #333 !important;
}

/* ── Nav bar adjustment: shift nav items left to avoid overlap ── */
nav {
  padding-right: 10px !important;
}

nav > div {
  gap: 2px !important;
}

/* Ensure nav links don't overlap with right-side buttons */
nav a[href*="designer"],
#mujoo-designer-nav-link {
  margin-right: 4px !important;
}

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  #mujoo-lang-switcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    top: auto;
    left: auto;
    margin: 0;
    z-index: 9999;
  }

  #mujoo-lang-switcher .lang-trigger {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    color: #333 !important;
  }

  #mujoo-lang-switcher .lang-dropdown {
    bottom: 100%;
    top: auto;
    margin-bottom: 4px;
    margin-top: 0;
  }
}
