/* ============================================================================== */
/*  S t a r k   S l i d e r  -  T h e m e                                         */
/* ============================================================================== */
/* stark-ui: src/modules/slider/components/slider/_slider-theme.scss */
@use "sass:map";
@use "@angular/material" as mat;
@use "../../../../styles/old-variables" as old-vars;
@import "~nouislider/dist/nouislider.css";

@mixin stark-slider-theme($material-theme-config, $stark-theme-config) {
  .stark-slider {
    font-size: 12px;

    .noUi-horizontal,
    .noUi-vertical {
      background-color: #d8e0f3;
      border: 0;
      box-shadow: none;
      border-radius: 0;
    }

    .noUi-horizontal {
      height: 5px;

      .noUi-origin {
        top: -15px;
      }

      .noUi-tooltip {
        padding: 2px 5px;
        bottom: 40px;
        border: solid 1px old-vars.$divider-color;
      }

      .noUi-pips-horizontal {
        padding: 0;
      }

      .noUi-value {
        padding-top: 4px;
      }
    }

    .noUi-connect {
      background-color: mat.get-color-from-palette(map.get($material-theme-config, primary));
    }

    .noUi-handle {
      top: 0;
      border: 0;
      width: 36px;
      height: 36px;
      background-color: mat.get-color-from-palette(map.get($material-theme-config, primary));
      border-radius: 50%;
      box-shadow: old-vars.$elevation-2;

      &:active,
      &:focus,
      &:hover {
        background-color: mat.get-color-from-palette(map.get($material-theme-config, primary), 700);
        outline: none;
      }

      &::before {
        display: none;
      }

      &::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        height: 8px;
        width: 8px;
        background-color: #fff;
        border-radius: 50%;
      }
    }

    .horizontal {
      padding: 42px 32px 30px 16px;
      margin-bottom: 16px;

      .noUi-pips-horizontal {
        height: 30px;
      }
    }

    .vertical {
      padding: 18px 60px 20px 80px;
    }

    .noUi-vertical {
      /* setting default height: without a height, the vertical slider will not work */
      height: 300px;
      width: 5px;

      .noUi-origin {
        top: 0;
      }

      .noUi-handle {
        transform: translate(-10px, -50%);
      }

      .noUi-tooltip {
        right: 40px;
      }

      .noUi-value {
        transform: translate(0, -50%);
      }
    }

    .noUi-pips-vertical {
      padding: 0;
    }

    /* disabled state */
    [disabled] {
      &.noUi-target {
        cursor: default;
      }

      .noUi-handle {
        background-color: #ccc;
        box-shadow: none;
        cursor: default;
      }
    }
  }
}

/* END stark-ui: src/modules/slider/components/slider/_slider-theme.scss */
