/* Heavily inspired by https://www.w3schools.com/howto/howto_css_switch.asp */

.theme-switcher {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

/* Hide default HTML checkbox */
.theme-switcher input {
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switcher .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--cv-bg-color);
  transition: .4s;
}

.theme-switcher .slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 26px;
  background-color: white;
  transition: .4s;
}


.theme-switcher input:focus + .slider {
  box-shadow: 0 0 1px var(--cv-bg-color);
}

.theme-switcher input:checked + .slider:before {
  transform: translateX(24px);
}

.theme-switcher .slider.round {
  border-radius: 34px;
}

.theme-switcher .slider.round::before {
  border-radius: 50%;
  background-color: var(--cv-action-color);
}

.theme-switcher .slider.round::after {
  content: "🌙";
  display: inline-block;
  margin-top: 2px;
  margin-left: 26px;
  color: #ffc83d
}

.theme-switcher input:checked + .slider.round::after {
  content: "☀";
  margin-top: 0;
  margin-left: 6px;
  font-size: 18px;
}
