/**
 * styles for React Toggle
 * copied over because we want to allow user to swizzle it and modify the css
 * and also to make sure its compatible with our dark mode
 * https://github.com/aaronshaf/react-toggle/blob/master/style.css
 */
.toggle {
  position: relative;
}

:global(.react-toggle) {
  touch-action: pan-x;

  display: inline-block;
  position: relative;
  cursor: pointer;
  background-color: transparent;
  border: 0;
  margin-top: -1px;
  padding: 0;

  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;

  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-tap-highlight-color: transparent;
}

:global(.react-toggle-screenreader-only) {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

:global(.react-toggle--disabled) {
  cursor: not-allowed;
}

:global(.react-toggle-track) {
  width: 15px;
  height: 10px;
  padding: 0;
  border-radius: 30px;
  background-color: var(--gray-4);
  -webkit-transition: all 0.2s ease;
  -moz-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

:global(.react-toggle-track-check) {
  position: absolute;
  width: 14px;
  height: 10px;
  top: 0px;
  bottom: 0px;
  margin-top: auto;
  margin-bottom: auto;
  line-height: 0;
  left: 8px;
  opacity: 0;
  -webkit-transition: opacity 0.25s ease;
  -moz-transition: opacity 0.25s ease;
  transition: opacity 0.25s ease;
}

:global([data-theme='dark'] .react-toggle .react-toggle-track-check),
:global(.react-toggle--checked .react-toggle-track-check) {
  opacity: 1;
  -webkit-transition: opacity 0.25s ease;
  -moz-transition: opacity 0.25s ease;
  transition: opacity 0.25s ease;
}

:global(.react-toggle-track-x) {
  position: absolute;
  width: 10px;
  height: 10px;
  top: 0px;
  bottom: 0px;
  margin-top: auto;
  margin-bottom: auto;
  line-height: 0;
  right: 10px;
  opacity: 1;
  -webkit-transition: opacity 0.25s ease;
  -moz-transition: opacity 0.25s ease;
  transition: opacity 0.25s ease;
}

:global([data-theme='dark'] .react-toggle .react-toggle-track-x),
:global(.react-toggle--checked .react-toggle-track-x) {
  opacity: 0;
}

:global(.react-toggle-thumb) {
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0ms;
  position: absolute;
  transform: translateY(-50%);
  top: 50%;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--toggle-indicator-background);

  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;

  -webkit-transition: all 0.25s ease;
  -moz-transition: all 0.25s ease;
  transition: all 0.25s ease;
}

:global([data-theme='dark'] .react-toggle .react-toggle-thumb),
:global(.react-toggle--checked .react-toggle-thumb) {
  left: 5.5px;
  border-color: #19ab27;
}

html[data-theme='dark'] {
  --toggle-background: var(--gray-1);
  --toggle-indicator-background: var(--default-background-color);
}

:root {
  --toggle-background: #4d4d4d;
  --toggle-indicator-background: #fafafa;
}
