/* ======================================================================== *
 * Copyright 2025 HCL America Inc.                                          *
 * Licensed under the Apache License, Version 2.0 (the "License");          *
 * you may not use this file except in compliance with the License.         *
 * You may obtain a copy of the License at                                  *
 *                                                                          *
 * http://www.apache.org/licenses/LICENSE-2.0                               *
 *                                                                          *
 * Unless required by applicable law or agreed to in writing, software      *
 * distributed under the License is distributed on an "AS IS" BASIS,        *
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
 * See the License for the specific language governing permissions and      *
 * limitations under the License.                                           *
 * ======================================================================== */

@use "sass:map";
@use "../../common";
@use "../../common/themeMap.module";

@mixin enchanted-switch-base-styles {
  &::part(switch-label),
  &::part(switch-label-disabled) {
    @include common.switch-label-common;
  }

  &::part(switch-label-disabled) {
    pointer-events: none;
    outline: none;
  }

  &::part(switch-input) {
    opacity: 0;
    width: 0;
    height: 0;
  }

  &::part(switch-label) {
    &:focus-visible {
      outline: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06) solid 1px;
    }

    &:hover {
      background-color: map.get(themeMap.$enchantedPalette, BLACK12P);
    }
  }

  &::part(switch-slider),
  &::part(switch-slider-disabled),
  &::part(switch-slider-checked-disabled),
  &::part(switch-slider-checked) {
    @include common.switch-slider-common;
  }

  &::part(switch-slider),
  &::part(switch-slider-disabled) {

    &::after {
      @include common.switch-slider-thumb;
      transform: translateX(0px);
    }
  }

  &::part(switch-slider) {
      background-color: map.get(themeMap.$enchantedPalette, BLACK60P);
  }

  &::part(switch-slider-disabled),
  &::part(switch-slider-checked-disabled) {
    background-color: map.get(themeMap.$enchantedPalette, NG150);
  }

  &::part(switch-slider-checked),
  &::part(switch-slider-checked-disabled) {

    &::before {
      @include common.switch-slider-thumb;
      transform: translateX(16px);
    }
  }

  &::part(switch-slider-checked) {
    background-color: map.get(themeMap.$enchantedPalette, HCLSOFTWAREBLUE06);
  }
}
