/* DESIGN DECISIONS:
 * Typography: inherited NextGO UI font, 700 weight, 0.70rem environment glyph.
 * Palette: quiet cool glass; cyan STAGE dot and green LIVE dot.
 * Motion: 160ms lift only, completely removed for reduced motion.
 * Layout: third floating control, 14px left of the existing theme button.
 * Glass mode: restrained frosted glass with a single specular rim.
 */

.nextgo-environment-switch {
  --nextgo-env-edge-right: max(clamp(0.85rem, 2vw, 1.25rem), env(safe-area-inset-right));
  --nextgo-env-edge-bottom: max(clamp(0.85rem, 2vh, 1.25rem), env(safe-area-inset-bottom));
  position: fixed;
  right: calc(var(--nextgo-env-edge-right) + 120px);
  bottom: var(--nextgo-env-edge-bottom);
  z-index: 9000;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid oklch(72% 0.08 225 / 0.28);
  border-radius: 50%;
  background: oklch(16% 0.025 245 / 0.68);
  color: oklch(88% 0.025 225);
  box-shadow:
    inset 0 1px 0 oklch(100% 0 0 / 0.16),
    0 7px 20px oklch(0% 0 0 / 0.28);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  text-decoration: none;
  opacity: 0.58;
  transition:
    opacity 160ms ease,
    transform 160ms cubic-bezier(0.16, 1, 0.3, 1),
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.nextgo-environment-switch::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    oklch(100% 0 0 / 0.1),
    transparent 46%,
    oklch(60% 0.08 230 / 0.04)
  );
}

.nextgo-environment-switch:hover {
  opacity: 0.96;
  transform: translateY(-2px);
  border-color: oklch(78% 0.13 215 / 0.56);
  box-shadow:
    inset 0 1px 0 oklch(100% 0 0 / 0.24),
    0 10px 25px oklch(0% 0 0 / 0.38);
}

.nextgo-environment-switch:focus-visible {
  opacity: 1;
  outline: 3px solid oklch(79% 0.16 205 / 0.92);
  outline-offset: 3px;
}

.nextgo-environment-switch__glyph {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}

.nextgo-environment-switch__dot {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(78% 0.16 205);
  box-shadow: 0 0 0 2px oklch(12% 0.02 245 / 0.86);
}

.nextgo-environment-switch[data-environment-target="live"]
  .nextgo-environment-switch__dot {
  background: oklch(76% 0.18 150);
}

html.login-light .nextgo-environment-switch {
  background: oklch(97% 0.01 230 / 0.72);
  color: oklch(25% 0.025 240);
  border-color: oklch(45% 0.08 225 / 0.28);
  box-shadow:
    inset 0 1px 0 oklch(100% 0 0 / 0.8),
    0 7px 20px oklch(20% 0.02 240 / 0.18);
}

html.login-light .nextgo-environment-switch__dot {
  box-shadow: 0 0 0 2px oklch(97% 0.01 230 / 0.9);
}

@media (max-width: 360px) {
  .nextgo-environment-switch {
    right: calc(var(--nextgo-env-edge-right) + 116px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .nextgo-environment-switch {
    transition: none;
  }

  .nextgo-environment-switch:hover {
    transform: none;
  }
}

