.translatefy-language-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-start;
  padding: 6px 10px;
}

.translatefy-flag {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 1em;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

/* Flag-only mode: force equal dimensions so active state is a circle, not a pill */
[data-display-mode="flags"] .translatefy-flag {
  padding: 5px;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.translatefy-flag:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* Active / selected language button */
.translatefy-flag--active {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.translatefy-flag--active:hover {
  background: rgba(0, 0, 0, 0.12);
}

/* Flag style: active colored, others black & white */
.translatefy-style-colorize_active .translatefy-flag {
  filter: grayscale(100%) opacity(0.6);
}

.translatefy-style-colorize_active .translatefy-flag:hover {
  filter: grayscale(50%) opacity(0.8);
}

.translatefy-style-colorize_active .translatefy-flag--active {
  filter: none;
}

.translatefy-align-center {
  justify-content: center;
}

.translatefy-align-right {
  justify-content: flex-end;
}

.translatefy-above-site {
  position: relative;
  z-index: 9999;
}

.translatefy-floating {
  position: fixed;
  width: auto;
  max-width: calc(100vw - 24px);
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.translatefy-floating-top {
  top: 12px;
}

.translatefy-floating-bottom {
  bottom: 12px;
}

.translatefy-floating-left {
  left: 12px;
}

.translatefy-floating-right {
  right: 12px;
}

/* Loading overlay */
.translatefy-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.translatefy-loading-overlay.is-visible {
  display: flex;
}

.translatefy-loading-box {
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}

/* Error toast */
.translatefy-error-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #c0392b;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.translatefy-error-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
