/**
 * I18N Language Switcher Component Styles
 * WCAG 2.1 Level AA compliant
 */

.lang-switcher {
  position: relative;
  display: inline-block;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(5, 10, 30, 0.8);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.9);
  transition: all 0.2s ease;
  min-width: 80px;
}

.lang-switcher-btn:hover {
  background: rgba(5, 10, 30, 0.95);
  border-color: rgba(0, 212, 255, 0.4);
}

.lang-switcher-btn:focus {
  outline: 2px solid #00d4ff;
  outline-offset: 2px;
}

.lang-switcher-btn[aria-expanded="true"] {
  border-color: rgba(0, 212, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.lang-current {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lang-chevron {
  transition: transform 0.2s ease;
  opacity: 0.6;
}

.lang-switcher-btn[aria-expanded="true"] .lang-chevron {
  transform: rotate(180deg);
}

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  background: rgba(5, 10, 30, 0.95);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  z-index: 1000;
  max-height: 60vh;
  overflow-y: auto;
}

.lang-switcher-menu[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background 0.15s ease;
  color: rgba(255, 255, 255, 0.8);
}

.lang-option:hover {
  background: rgba(0, 212, 255, 0.1);
  color: rgba(255, 255, 255, 0.95);
}

.lang-option:focus {
  background: rgba(0, 212, 255, 0.15);
  outline: 2px solid #00d4ff;
  outline-offset: -2px;
}

.lang-option.selected {
  background: rgba(0, 212, 255, 0.2);
  color: #00d4ff;
}

.lang-option .lang-code {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  color: #3b82f6;
  min-width: 2rem;
  letter-spacing: 0.05em;
}

.lang-option .lang-label {
  font-size: 0.9375rem;
  color: #475569;
}

.lang-option.selected .lang-label {
  font-weight: 600;
  color: #1e293b;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .lang-switcher-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    min-width: 70px;
  }
  
  .lang-switcher-menu {
    position: fixed;
    top: calc(var(--header-height, 70px) + 8px);
    right: 12px;
    left: auto;
    min-width: 160px;
    max-width: calc(100vw - 24px);
  }
  
  .lang-option {
    padding: 0.625rem 0.875rem;
  }
}

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

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .lang-switcher-btn,
  .lang-chevron,
  .lang-option {
    transition: none;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .lang-switcher-btn {
    background: #1e293b;
    border-color: #334155;
    color: #f1f5f9;
  }
  
  .lang-switcher-btn:hover {
    background: #334155;
  }
  
  .lang-switcher-menu {
    background: #1e293b;
    border-color: #334155;
  }
  
  .lang-option:hover {
    background: #334155;
  }
  
  .lang-option:focus {
    background: #1e40af;
  }
  
  .lang-option.selected {
    background: #1e40af;
  }
  
  .lang-option .lang-label {
    color: #cbd5e1;
  }
  
  .lang-option.selected .lang-label {
    color: #f1f5f9;
  }
}
