/*!
 * From Uiverse.io by artginzburg - https://uiverse.io/artginzburg/odd-rat-8
 * MIT License, Copyright (c) Praashoo7 (Prashant), artginzburg (Arthur Ginzburg)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/* Keep DaisyUI's native input as the track so the label and form state still work. */
input[type="checkbox"].toggle {
  --switch-width: 2.625em;
  --switch-thumb-width: 0.3em;
  --switch-offset: 0.225em;
  --switch-transition: 0.4s;

  position: relative;
  display: inline-block;
  width: var(--switch-width);
  height: 1.2em;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 5px;
  background: color-mix(in srgb, var(--workspace-hero-content) 80%, var(--color-base-300));
  box-shadow: inset 2px 5px 10px color-mix(in srgb, var(--frontend-color-24sea-dark-blue) 30%, transparent);
  font-size: 17px;
  transition: background-color var(--switch-transition), box-shadow var(--switch-transition);
}

input[type="checkbox"].toggle::before {
  position: absolute;
  content: "";
  inset: auto auto calc(0.18em - 1px) calc(var(--switch-offset) - 1px);
  height: 0.84em;
  width: var(--switch-thumb-width);
  box-sizing: border-box;
  border: 1px solid var(--color-border);
  border-radius: 0.1em;
  background: var(--frontend-color-24sea-dark-blue);
  box-shadow: none;
  transform: none;
  transition: transform var(--switch-transition);
}

input[type="checkbox"].toggle:checked {
  background-color: var(--frontend-color-24sea-light-blue);
}

input[type="checkbox"].toggle:checked::before {
  transform: translateX(calc(var(--switch-width) - var(--switch-offset) * 2 - var(--switch-thumb-width))) rotate(1turn);
}
