/*
 * File: language-switcher.css
 * Version: 3.10.0
 * Munich Musicians DB - Language Switcher (Dropdown)
 * Styles for the language switcher dropdown in navigation menus
 */

/* Preferences gear icon container */
.imm-preferences-icon {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}

/* Preferences link */
.imm-preferences-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.imm-preferences-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.imm-preferences-link:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Gear icon */
.imm-gear-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

/* Language switcher container */
.imm-language-switcher {
  position: relative;
  display: inline-block;
}

/* Current language button (dropdown trigger) */
.imm-lang-current {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  color: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.imm-lang-current:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.imm-lang-current:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Flag emoji in button */
.imm-lang-current .imm-lang-flag {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

/* Language code in button */
.imm-lang-current .imm-lang-code {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Arrow indicator */
.imm-lang-arrow {
  font-size: 10px;
  opacity: 0.6;
  transition: transform 0.2s ease;
  margin-left: 2px;
}

/* Rotate arrow when open */
.imm-lang-open .imm-lang-arrow {
  transform: rotate(180deg);
}

/* Dropdown menu (hidden by default) */
.imm-lang-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 9999;
  overflow: hidden;
}

/* Show dropdown when open */
.imm-lang-open .imm-lang-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Language option in dropdown */
.imm-lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  transition: background-color 0.15s ease;
  cursor: pointer;
}

.imm-lang-option:hover {
  background: #f5f5f5;
  text-decoration: none;
}

.imm-lang-option:focus {
  background: #f0f0f0;
  outline: none;
}

/* Flag in dropdown option */
.imm-lang-option .imm-lang-flag {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

/* Language code in dropdown */
.imm-lang-option .imm-lang-code {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 24px;
}

/* Language name in dropdown */
.imm-lang-option .imm-lang-name {
  font-size: 14px;
  color: #666;
  flex: 1;
}

/* Menu item integration */
.imm-language-switcher-menu-item {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Classic theme menu integration */
.menu .imm-language-switcher {
  margin: 0 8px;
}

/* Block theme (Twenty Twenty-Five) integration */
.wp-block-navigation__container .imm-language-switcher {
  margin: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .imm-preferences-link {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .imm-preferences-link:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .imm-lang-current {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
  }

  .imm-lang-current:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
  }

  .imm-lang-dropdown {
    background: #2a2a2a;
    border-color: #444;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  }

  .imm-lang-option {
    color: #e0e0e0;
  }

  .imm-lang-option:hover {
    background: #333;
  }

  .imm-lang-option:focus {
    background: #383838;
  }

  .imm-lang-option .imm-lang-name {
    color: #aaa;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .imm-lang-current {
    padding: 5px 10px;
    gap: 5px;
  }

  .imm-lang-current .imm-lang-flag {
    font-size: 16px;
  }

  .imm-lang-current .imm-lang-code {
    font-size: 12px;
  }

  .imm-lang-dropdown {
    min-width: 140px;
  }

  .imm-lang-option {
    padding: 8px 12px;
  }

  .imm-lang-option .imm-lang-flag {
    font-size: 18px;
  }

  .imm-lang-option .imm-lang-code {
    font-size: 12px;
  }

  .imm-lang-option .imm-lang-name {
    font-size: 13px;
  }
}

/* Very small screens - make dropdown full width */
@media (max-width: 480px) {
  .imm-language-switcher {
    width: 100%;
  }

  .imm-lang-current {
    width: 100%;
    justify-content: center;
  }

  .imm-lang-dropdown {
    left: 0;
    right: 0;
    width: 100%;
  }
}

/* Print: Hide language switcher */
@media print {
  .imm-language-switcher,
  .imm-language-switcher-menu-item {
    display: none !important;
  }
}

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .imm-lang-current,
  .imm-lang-dropdown,
  .imm-lang-option,
  .imm-lang-arrow {
    transition: none;
  }
}
