/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

.toggle {
  touch-action: pan-x;
  position: relative;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.toggleScreenReader {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.toggleDisabled {
  cursor: not-allowed;
}

.toggleTrack {
  width: 50px;
  height: 24px;
  border-radius: 30px;
  background-color: #4d4d4d;
  transition: all 0.2s ease;
}

.toggleTrackCheck {
  position: absolute;
  width: 14px;
  height: 10px;
  top: 0px;
  bottom: 0px;
  margin: auto 0;
  left: 8px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

[data-theme='dark'] .toggle .toggleTrackCheck,
.toggleChecked .toggleTrackCheck {
  opacity: 1;
  transition: opacity 0.25s ease;
}

.toggleTrackX {
  position: absolute;
  width: 10px;
  height: 10px;
  top: 0px;
  bottom: 0px;
  margin: auto 0;
  right: 10px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

[data-theme='dark'] .toggle .toggleTrackX,
.toggleChecked .toggleTrackX {
  opacity: 0;
}

.toggleTrackThumb {
  position: absolute;
  top: 1px;
  left: 1px;
  width: 22px;
  height: 22px;
  border: 1px solid #4d4d4d;
  border-radius: 50%;
  background-color: #fafafa;
  transition: all 0.25s ease;
}

[data-theme='dark'] .toggle .toggleTrackThumb,
.toggleChecked .toggleTrackThumb {
  left: 27px;
}

.toggleFocused .toggleTrackThumb,
.toggle:hover .toggleTrackThumb {
  box-shadow: 0px 0px 2px 3px var(--ifm-color-primary);
}

.toggle:active:not(.toggleDisabled) .toggleTrackThumb {
  box-shadow: 0px 0px 5px 5px var(--ifm-color-primary);
}

.toggleIcon {
  align-items: center;
  display: flex;
  height: 10px;
  justify-content: center;
  width: 10px;
}
.toggle::before {
  position: absolute;
}
