.language-switcher {
  position: relative;
  display: inline-block;
}

.language-switcher-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #334155;
  transition: all 0.2s ease;
  min-width: 120px;
}

.language-switcher-toggle:hover {
  border-color: #7d53de;
  background: #f8f9ff;
}

.language-switcher-toggle:focus {
  outline: 2px solid #7d53de;
  outline-offset: 2px;
}

.language-switcher-toggle .chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.language-switcher-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.language-switcher-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 8px;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.language-switcher-toggle[aria-expanded="true"] + .language-switcher-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-item {
  margin: 0;
}

.language-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: #334155;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.language-link:hover {
  background: #f8f9ff;
  color: #7d53de;
}

.language-item.active .language-link {
  background: #f0ebff;
  color: #7d53de;
}

.flag-icon {
  font-size: 20px;
  line-height: 1;
  width: 24px;
  text-align: center;
}

.language-link .language-name {
  flex: 1;
}

.check-icon {
  color: #7d53de;
}

/* RTL Support */
.dir-rtl .language-switcher-dropdown {
  right: auto;
  left: 0;
}

.dir-rtl .language-switcher-toggle .chevron {
  margin-left: 0;
  margin-right: auto;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .language-switcher-toggle {
    min-width: 100px;
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .language-switcher-dropdown {
    min-width: 180px;
  }
  
  .language-link {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* JavaScript Toggle (Alternative to hover) */
.language-switcher.active .language-switcher-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


