/*!
 * MOLAA Healing Center - Language Switcher Styles
 * Dropdown-based language switcher with globe icon
 */

/* ========================================
   HEADER LANGUAGE SWITCHER - DESKTOP
   ======================================== */

.header-language-switcher {
  position: relative;
  margin-right: 15px;
  display: flex;
  align-items: center;
}

/* Globe Icon Button */
.language-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  background: rgba(212, 176, 140, 0.1);
  border: 2px solid rgba(212, 176, 140, 0.3);
  border-radius: 50%;
  color: #66462f;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.language-toggle-btn:hover {
  background: rgba(212, 176, 140, 0.2);
  border-color: rgba(212, 176, 140, 0.5);
  transform: scale(1.05);
}

.language-toggle-btn.active {
  background: #66462f;
  border-color: #66462f;
  color: white;
  box-shadow: 0 2px 8px rgba(102, 70, 47, 0.3);
}

.language-toggle-btn i {
  font-size: 20px;
}

/* Dropdown Menu */
.language-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid rgba(212, 176, 140, 0.2);
}

.header-language-switcher.open .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 15px;
  width: 12px;
  height: 12px;
  background: white;
  border-left: 1px solid rgba(212, 176, 140, 0.2);
  border-top: 1px solid rgba(212, 176, 140, 0.2);
  transform: rotate(45deg);
}

/* Language Options */
.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #333;
  text-decoration: none;
  font-family: "Nunito", sans-serif;
  font-size: 14px;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.lang-option:hover {
  background: rgba(212, 176, 140, 0.1);
}

.lang-option.active {
  background: rgba(212, 176, 140, 0.15);
  color: #66462f;
  font-weight: 600;
}

.lang-option img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.lang-option span {
  flex: 1;
  letter-spacing: 0.3px;
}

/* Desktop menu wrapper adjustment */
.menu-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  width: 100%;
}

.menu-wrap .main-navigation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-wrap-actions {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* ========================================
   MOBILE MENU LANGUAGE SWITCHER (Slide-out menu)
   ======================================== */

/* Hide on desktop, show on mobile */
.mobile-menu-language-switcher {
  display: none;
}

@media (max-width: 1024px) {
  /* Desktop menu language switcher - hide on mobile */
  .menu .header-language-switcher {
    display: none !important;
  }

  /* Mobile slide-out menu language switcher */
  .mobile-menu-language-switcher {
    display: block;
    padding: 20px 15px;
    border-top: 1px solid rgba(212, 176, 140, 0.2);
    margin-top: 15px;
  }

  .mobile-lang-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #66462f;
    margin-bottom: 15px;
    font-family: "Nunito", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .mobile-lang-label i {
    font-size: 18px;
    color: #66462f;
  }

  .mobile-lang-buttons {
    display: flex;
    gap: 12px;
  }

  .mobile-lang-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 12px;
    background: rgba(212, 176, 140, 0.08);
    border: 2px solid rgba(212, 176, 140, 0.25);
    border-radius: 12px;
    color: #66462f;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: "Nunito", sans-serif;
  }

  .mobile-lang-btn:active {
    transform: scale(0.97);
  }

  .mobile-lang-btn.active {
    background: #66462f;
    border-color: #66462f;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 70, 47, 0.25);
    font-weight: 600;
  }

  .mobile-lang-btn img {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
  }

  .mobile-lang-btn span {
    font-size: 14px;
    letter-spacing: 0.3px;
  }
}

/* Mobile - Adjust spacing for smaller screens */
@media (max-width: 768px) {
  .mobile-menu-language-switcher {
    padding: 18px 12px;
  }

  .mobile-lang-label {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .mobile-lang-buttons {
    gap: 10px;
  }

  .mobile-lang-btn {
    padding: 12px 10px;
    font-size: 13px;
  }

  .mobile-lang-btn img {
    width: 24px;
    height: 24px;
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .mobile-menu-language-switcher {
    padding: 15px 10px;
  }

  .mobile-lang-label {
    font-size: 13px;
    gap: 8px;
    margin-bottom: 10px;
  }

  .mobile-lang-label i {
    font-size: 16px;
  }

  .mobile-lang-buttons {
    gap: 8px;
  }

  .mobile-lang-btn {
    padding: 10px 8px;
    font-size: 12px;
    gap: 8px;
  }

  .mobile-lang-btn img {
    width: 22px;
    height: 22px;
  }

  .mobile-lang-btn span {
    font-size: 12px;
  }
}

/* ========================================
   ANIMATION & TRANSITIONS
   ======================================== */

.lang-btn {
  position: relative;
  overflow: hidden;
}

.lang-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease;
}

.lang-btn:active::before {
  width: 200px;
  height: 200px;
}

/* Smooth language transition for text content */
[data-vi][data-en] {
  transition: opacity 0.2s ease;
}

/* Loading state (optional) */
.lang-btn.loading {
  pointer-events: none;
  opacity: 0.6;
}

/* Accessibility improvements */
.lang-btn:focus-visible {
  outline: 3px solid #66462f;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .lang-btn {
    border-width: 2px;
  }

  .lang-btn.active {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .lang-btn,
  .lang-btn::before,
  [data-vi][data-en] {
    transition: none;
  }

  .lang-btn:hover {
    transform: none;
  }
}
