#translate-container {
  position: fixed;
  top: 108px;
  right: 20px;
  z-index: 60;
  touch-action: none;
  transition: all 0.2s ease;
}

#translate-btn {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02)),
    rgba(6, 10, 18, 0.92);
  box-shadow:
    0 16px 32px rgba(0, 0, 0, 0.32),
    0 0 22px rgba(67, 243, 255, 0.16);
  cursor: pointer;
}

.translate-lottie-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  overflow: visible;
}

.translate-lottie-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 10px rgba(67, 243, 255, 0.28));
  animation: translate-orbit 14s linear infinite;
}

#language-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(9, 13, 22, 0.92);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

#translate-container[data-side="left"] #language-dropdown {
  left: 0;
  right: auto;
}

#translate-container[data-up="true"] #language-dropdown {
  top: auto;
  bottom: calc(100% + 12px);
  transform: translateY(8px) scale(0.96);
}

#language-dropdown.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#language-dropdown.fade-out {
  opacity: 0;
  pointer-events: none;
}

#language-dropdown button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    opacity 0.16s ease;
}

#language-dropdown button:hover,
#language-dropdown button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
}

#language-dropdown img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.active-flag {
  opacity: 1;
  transform: scale(1.06);
  border-color: rgba(67, 243, 255, 0.5) !important;
  box-shadow: 0 0 18px rgba(67, 243, 255, 0.22);
}

.inactive-flag {
  opacity: 0.7;
}

@keyframes translate-orbit {
  from {
    transform: rotate(0deg) scale(1.28);
  }

  to {
    transform: rotate(360deg) scale(1.28);
  }
}

@media (max-width: 640px) {
  #translate-container {
    top: 86px;
    right: 12px;
  }

  #translate-btn {
    width: 66px;
    height: 66px;
  }

  #language-dropdown {
    padding: 10px;
  }

  .translate-lottie-icon {
    width: 44px;
    height: 44px;
  }

  #language-dropdown button {
    width: 44px;
    height: 44px;
  }

  #language-dropdown img {
    width: 30px;
    height: 30px;
  }
}
