/**
 * Language Selector Styles
 * Multilingual website navigation component
 * Format: ISO | Native Name (e.g., EN | English, DE | Deutsch)
 * Pure CSS dropdown using checkbox (works without JavaScript)
 */

/* Language Selector Container */
.language-selector {
  display: inline-block;
  margin-right: 12px;
  margin-top: 10px;
  position: relative;
  vertical-align: middle;
}

/* Hide the checkbox toggle */
.language-menu-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Current Language Button */
.language-current {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background-color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 14px;
  font-family: Lato, Helvetica, sans-serif;
  color: #333;
  user-select: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

/* Globe icon */
.language-icon {
  font-size: 16px;
  font-variant-emoji: text;
  color: #11888c;
  font-weight: bold;
}

/* Dropdown arrow */
.language-arrow {
  font-size: 10px;
  transition: transform 0.2s ease;
}

/* Hover State */
.language-current:hover {
  border-color: #11888c; /* Brand color 2 (teal) */
  background-color: rgba(255, 255, 255, 1);
}

/* Focus State (Accessibility) */
.language-menu-toggle:focus + .language-current {
  outline: none;
  border-color: #11888c;
  box-shadow: 0 0 0 2px rgba(17, 136, 140, 0.2);
  background-color: rgba(255, 255, 255, 1);
}

/* Rotate arrow when menu is open */
.language-menu-toggle:checked + .language-current .language-arrow {
  transform: rotate(180deg);
}

/* Language Menu Dropdown */
.language-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 1000;
}

/* Show menu when checkbox is checked */
.language-menu-toggle:checked ~ .language-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Menu Items */
.language-menu li {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f0f0f0;
}

.language-menu li:last-child {
  border-bottom: none;
}

/* Menu Links */
.language-menu a {
  display: block;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  font-size: 14px;
  font-family: Lato, Helvetica, sans-serif;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Link Hover State */
.language-menu a:hover {
  background-color: rgba(17, 136, 140, 0.08);
  color: #11888c;
}

/* Active/Current Language */
.language-menu li.active a {
  background-color: rgba(17, 136, 140, 0.12);
  color: #11888c;
  font-weight: 600;
}

/* Active language hover */
.language-menu li.active a:hover {
  background-color: rgba(17, 136, 140, 0.16);
}

/*
 * Responsive Design
 * Hide language selector dropdown on mobile (< 800px)
 * Language links are available in hamburger menu and footer instead
 */

/* Hide dropdown language selector on mobile */
@media screen and (max-width: 800px) {
  .language-selector {
    display: none;
  }
}

/*
 * High Contrast Mode Support (Accessibility)
 * Ensures selector is visible in high contrast mode
 */
@media (prefers-contrast: high) {
  #language-select {
    border-width: 2px;
  }
}

/*
 * Reduced Motion Support (Accessibility)
 * Removes animations for users who prefer reduced motion
 */
@media (prefers-reduced-motion: reduce) {
  #language-select {
    transition: none;
  }
}

/*
 * Hamburger Menu Language Links
 * Shown on mobile (< 800px) as alternative to dropdown
 */
.hamburger-language-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 6px 12px 12px 12px;
}

.hamburger-language-link {
  font-size: 13px;
  padding: 4px 8px !important;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.hamburger-language-link:hover {
  border-color: #11888c;
  text-decoration: none !important;
}

.hamburger-language-link.active {
  background-color: rgba(17, 136, 140, 0.12);
  border-color: #11888c;
  color: #11888c;
  font-weight: 600;
}

/* Hide hamburger language section on desktop */
@media screen and (min-width: 801px) {
  .hamburger-language-delimiter,
  .hamburger-language-links {
    display: none;
  }
}

/*
 * Footer Language Links
 * Always visible in footer on separate line
 */
.footer-language-links {
  display: block;
  margin-top: 12px;
  margin-bottom: 12px;
}

.footer-language-link {
  font-size: inherit;
  color: #777;
  text-decoration: none;
  padding: 2px 6px;
  margin-right: 4px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

/* First language link - use negative margin to align text with content edge */
.footer-language-link:first-child {
  margin-left: -7px;
}

.footer-language-link.active:first-child {
  margin-left: 0;
}

.footer-language-link:hover {
  color: #11888c;
  border-color: #ddd;
  text-decoration: none;
}

.footer-language-link.active {
  font-weight: 600;
  color: #11888c;
  border-color: #11888c;
}

/*
 * Print Styles
 * Hide language selector when printing
 */
@media print {
  .language-selector {
    display: none;
  }
}
