@use "../globals/" as *;

.toggle-theme {
  position: fixed;
  bottom: 0;
  left: 0;
  margin: 0.3em 0.5em;
  z-index: 1;
  display: none;

  @include mq(lg) {
    display: block;
  }
  // @media (max-height: 668px) {
  //   display: none !important;
  // }
}

.btn-toggle {
  cursor: pointer;
  font-size: 80px;
  width: 1em;
  height: 0.5em;
  border-radius: 0.5em;

  --blur: 5px;
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.2), inset 0 0 10px rgba(0, 0, 0, 0.2);

  &::after {
    position: absolute;
    content: "";

    top: 50%;
    left: 50%;
    transform: translate(calc(-50% - 0.5em / 2), -50%);
    width: calc(0.5em - 10px);
    height: calc(0.5em - 10px);
    border-radius: 50%;

    transition: transform var(--toggle-theme-duration) var(--toggle-theme-ease),
      background-color var(--toggle-theme-duration) var(--toggle-theme-ease),
      opacity 0.3s;

    box-shadow: 0 0 80px rgba(0, 0, 0, 0.2);
    opacity: 0.4;

    background-color: #fff3c7;
  }

  &:hover::after {
    opacity: 0.7;
  }

  &:has(:checked)::after {
    background: #99e5ff;
    transform: translate(calc(-50% + 0.5em / 2), -50%);
  }

  input {
    display: none;
  }
}
