/* Hide default language switcher in sidebar footer */
#R-select-language-container,
.footerLangSwitch {
  display: none !important;
}

/* Language Switcher Styles */
.language-switcher {
  position: relative;
}

.language-switcher .topbar-control {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.language-switcher .topbar-content {
  min-width: 180px;
  padding: 0.5rem 0;
}

.language-switcher-menu {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 0 0.5rem;
}

.language-option:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateX(4px);
}

[data-theme="dark"] .language-option:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.language-option.active {
  background-color: rgba(0, 0, 0, 0.08);
  font-weight: 600;
  position: relative;
}

[data-theme="dark"] .language-option.active {
  background-color: rgba(255, 255, 255, 0.15);
}

.language-option.active::before {
  content: "✓";
  position: absolute;
  left: 0.5rem;
  font-weight: bold;
}

.language-code {
  font-weight: 600;
  font-size: 0.875rem;
  min-width: 2.5rem;
  text-align: center;
  padding: 0.25rem 0.5rem;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .language-code {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.language-option.active .language-code {
  background-color: rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .language-option.active .language-code {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
}

.language-name {
  flex: 1;
  font-size: 0.9375rem;
}

/* Mobile responsive adjustments */
@media screen and (max-width: 768px) {
  .language-switcher .topbar-content {
    min-width: 160px;
  }
  
  .language-option {
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
  }
  
  .language-code {
    min-width: 2rem;
    font-size: 0.8125rem;
  }
  
  .language-name {
    font-size: 0.875rem;
  }
}

/* Smooth animations */
.language-switcher .topbar-content {
  animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
