/* From Uiverse.io by pharmacist-sabot */
.flip-switch-container {
  --card-width: 110px;
  --card-height: 120px;
  --switch-bg: rgba(255, 255, 255, 0.1);
  --switch-border-color: rgba(255, 255, 255, 0.2);
  --text-color: #ffffff;
  --inactive-text-color: rgba(255, 255, 255, 0.6);
  --icon-shadow-color: rgba(0, 0, 0, 0.3);
  --card-bg: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2),
    rgba(255, 255, 255, 0.1)
  );
  --highlight-color: #64ffda;

  display: grid;
  place-content: center;
  min-height: 100%;
  font-family: "Poppins", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.flip-switch {
  display: flex;
  position: relative;
  width: calc(var(--card-width) * 2);
  height: var(--card-height);
  background: var(--switch-bg);
  border-radius: 20px;
  border: 1px solid var(--switch-border-color);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37),
    inset 0 4px 8px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  perspective: 1000px;
}

.flip-switch input[type="radio"] {
  display: none;
}

.flip-switch .switch-button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 2;
  color: var(--inactive-text-color);
  transition: all 0.3s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.flip-switch .switch-button:hover {
  color: var(--text-color);
}

.flip-switch .switch-button:hover svg {
  transform: translateY(-3px);
  filter: drop-shadow(0 4px 6px var(--icon-shadow-color)) brightness(1.2);
}

.flip-switch .switch-button svg {
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  filter: drop-shadow(0 2px 3px var(--icon-shadow-color));
  width: 24px;
  height: 24px;
}

.flip-switch .switch-button span {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-1"],
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-2"] {
  color: var(--text-color);
  text-shadow: 0 0 8px rgba(100, 255, 218, 0.5);
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-2"],
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-1"] {
  color: var(--inactive-text-color);
}

.flip-switch .switch-card {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--card-width);
  height: var(--card-height);
  z-index: 1;
  transform-style: preserve-3d;
}

.flip-switch .card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
    inset 0 2px 4px rgba(255, 255, 255, 0.1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-switch .card-back {
  transform: rotateY(180deg);
}

.flip-switch #switch-opt-2:checked ~ .switch-card {
  animation: flipRight 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

.flip-switch #switch-opt-1:checked ~ .switch-card {
  animation: flipLeft 0.6s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes flipRight {
  0% {
    transform: translateX(0%) rotateY(0deg);
  }
  50% {
    transform: translateX(50%) rotateY(90deg) scale(1.05);
  }
  100% {
    transform: translateX(100%) rotateY(180deg) scale(1);
  }
}

@keyframes flipLeft {
  0% {
    transform: translateX(100%) rotateY(180deg);
  }
  50% {
    transform: translateX(50%) rotateY(90deg) scale(1.05);
  }
  100% {
    transform: translateX(0%) rotateY(0deg) scale(1);
  }
}

.flip-switch #switch-opt-1:checked ~ [for="switch-opt-1"]::after,
.flip-switch #switch-opt-2:checked ~ [for="switch-opt-2"]::after {
  content: "";
  position: absolute;
  bottom: -5px;
  width: 30px;
  height: 3px;
  background: var(--highlight-color);
  border-radius: 2px;
  animation: glow 1.5s infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px var(--highlight-color);
  }
  to {
    box-shadow: 0 0 15px var(--highlight-color), 0 0 25px var(--highlight-color);
  }
}
