/*!
 * Wooptima Language Switcher Styles
 * Version: 1.2.1
 */

/* CSS Custom Properties pre easy theming */
:root {
  --wa-ls-primary-color: #1f1f2e;
  --wa-ls-bg-color: #ffffff;
  --wa-ls-border-color: rgba(0, 0, 0, 0.08);
  --wa-ls-hover-bg: #f4f5f7;
  --wa-ls-border-radius: 0.5rem;
  --wa-ls-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  --wa-ls-transition: 0.15s ease;
  --wa-ls-font-weight: 600;
  --wa-ls-font-size: 0.95rem;
  --wa-ls-z-index: 9999;
  --wa-ls-gap: 0.35rem;
  --wa-ls-padding: 0.35rem 0.55rem;
  --wa-ls-focus-outline: 2px solid var(--wa-ls-primary-color);
}

/* Main container */
.wa-lang-switcher {
  position: relative;
  display: inline-block;
  font-family: inherit;
  margin-right: var(--space-l);
}

/* Current language button */
.wa-lang-switcher .wa-current {
    display: flex;
    align-items: center;
    gap: var(--wa-ls-gap);
    padding: var(--wa-ls-padding);
    cursor: pointer;
    transition: var(--wa-ls-transition);
    user-select: none;
    color: var(--base);
    font-size: calc(var(--text-m) * 0.9);
}

.wa-lang-switcher .wa-current:hover {
  border-color: rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.wa-lang-switcher .wa-current:focus {
  outline: var(--wa-ls-focus-outline);
  outline-offset: 2px;
}

/* Caret dropdown indicator */
.wa-lang-switcher .wa-caret {
  display: inline-block;
  margin-left: 0.1rem;
  border: 0.3rem solid transparent;
  border-top-color: var(--wa-ls-primary-color);
  transform: translateY(15%);
  transition: var(--wa-ls-transition);
}

/* Dropdown menu */
.wa-lang-switcher .wa-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--shade-light);
  box-shadow: var(--wa-ls-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--wa-ls-transition);
  z-index: 9999999;
}

/* Show dropdown on hover/focus */
.wa-lang-switcher:hover .wa-menu,
.wa-lang-switcher:focus-within .wa-menu,
.wa-lang-switcher .wa-current[aria-expanded="true"] + .wa-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Caret rotation animation */
.wa-lang-switcher:hover .wa-caret,
.wa-lang-switcher:focus-within .wa-caret {
  transform: translateY(15%) rotate(180deg);
}

/* Menu items */
.wa-lang-switcher .wa-menu li {
  margin: 0;
}

.wa-lang-switcher .wa-menu a {
  display: block;
  padding: var(--space-xs) var(--space-s);
  color: var(--base);
  text-decoration: none;
  white-space: nowrap;
  font-size: calc(var(--text-m) * 0.9);
  transition: var(--wa-ls-transition);
  border-radius: 0;
}

.wa-lang-switcher .wa-menu a:hover,
.wa-lang-switcher .wa-menu a:focus {
  background: var(--primary-ultra-light);
  color: var(--primary);
  outline: none;
}

.wa-lang-switcher .wa-menu a:focus {
  box-shadow: inset var(--wa-ls-focus-outline);
}

/* Accessibility improvements */
.wa-lang-switcher .wa-menu a:focus-visible {
  outline: var(--wa-ls-focus-outline);
  outline-offset: -2px;
}

/* Responsive design */

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --wa-ls-border-color: rgba(0, 0, 0, 0.3);
    --wa-ls-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .wa-lang-switcher .wa-current,
  .wa-lang-switcher .wa-caret,
  .wa-lang-switcher .wa-menu,
  .wa-lang-switcher .wa-menu a {
    transition: none;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --wa-ls-primary-color: #ffffff;
    --wa-ls-bg-color: #2a2a2a;
    --wa-ls-border-color: rgba(255, 255, 255, 0.1);
    --wa-ls-hover-bg: rgba(255, 255, 255, 0.1);
    --wa-ls-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    --wa-ls-focus-outline: 2px solid #ffffff;
  }
}

/* Print styles */
@media print {
  .wa-lang-switcher {
    display: none;
  }
}

/* RTL support */
[dir="rtl"] .wa-lang-switcher .wa-menu {
  left: auto;
  right: 0;
}

[dir="rtl"] .wa-lang-switcher .wa-caret {
  margin-left: 0;
  margin-right: 0.1rem;
}

/* Error state styling */
.wa-lang-switcher-error {
  color: #d63384;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  background: rgba(214, 51, 132, 0.1);
  border-radius: 0.25rem;
  border: 1px solid rgba(214, 51, 132, 0.2);
}