@use '~@angular/material' as mat;

/**
* Reset user agent button styles
* button {
*   @include rds-c.button-reset();
* }
*/
@mixin button-reset($fontSize: 14px) {
  display: inline-block;
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  font-size: $fontSize;
  cursor: pointer;
  text-align: center;
  -webkit-appearance: none;
  -moz-appearance: none;
}

@mixin button-gradient($palette) {
  /** Old browsers */
  background: mat.get-color-from-palette($palette, default);
  color: mat.get-contrast-color-from-palette($palette, 300);
  /* FF3.6-15 */
  background: -moz-linear-gradient(-45deg, mat.get-color-from-palette($palette, default), mat.get-color-from-palette($palette, 200, 0.87));
  /* Chrome10-25, Safari5.1.6 */
  background: -webkit-linear-gradient(
    -45deg,
    mat.get-color-from-palette($palette, default),
    mat.get-color-from-palette($palette, 200, 0.87) 100%
  );
  /* W3C, IE10, FF16, Chrome26, Opera12, Safari7 */
  background-image: linear-gradient(
    135deg,
    mat.get-color-from-palette($palette, default),
    mat.get-color-from-palette($palette, 200, 0.87) 100%
  );
}

@mixin large-chips($remMultiplier: 1.5) {
  .mat-chip-list {
    .mat-chip,
    .mat-basic-chip,
    .mat-chip.mat-basic-chip {
      font-size: $remMultiplier * 1rem;
      line-height: $remMultiplier * 1.33rem;
      min-width: $remMultiplier * 3.5rem;

      &:focus-visible {
        outline: thin solid;
      }
    }

    .mat-chip.rds-c-chip .mat-chip-remove,
    .rds-c-chip .mat-chip-remove {
      line-height: $remMultiplier * 1rem;
      height: $remMultiplier * 1rem;
      width: $remMultiplier * 1rem;
      font-size: $remMultiplier * 1rem;
      margin-left: $remMultiplier * 0.66rem;
      .mat-icon {
        font-size: inherit;
        height: inherit;
        line-height: inherit;
        width: inherit;
      }
    }
  }
  .rds-c-chips-vertical .mat-chip-list .mat-chip.rds-c-chip {
    margin-bottom: $remMultiplier * 0.66rem;
  }
}

@mixin chips() {
  box-sizing: border-box;
  border-radius: 4px;
  font-size: 14px;
  height: 18px;
  line-height: 20px;
  margin: 0px 0px 4px 0px;
  padding: 6px 8px;
  border-width: 1px;
  border-style: solid;
  box-sizing: content-box;
  &:focus {
    outline: none;
  }
  &:focus-visible {
    outline: thin solid;
  }
  &.cdk-drag-preview {
    @include mat.elevation(8);
    width: auto !important;
    min-width: unset !important;
    height: auto !important;
    flex: 0 1 auto !important;
  }
  /* Animate an item that has been dropped. */
  &.cdk-drag-animating {
    transition: transform 300ms cubic-bezier(0, 0, 0.2, 1);
  }
  &.dense {
    padding: 0px 8px;
    font-size: 12px;
    line-height: 16px;
    .mat-chip-remove {
      margin-right: -4px;
    }
  }
  .mat-chip-remove {
    @include button-reset();
    font-size: 18px;
    height: 18px;
    width: 18px;
    margin-left: 4px;
    .mat-icon {
      font-size: inherit;
      height: inherit;
      width: inherit;
    }
  }
  .mat-ripple-element {
    display: none;
  }
}
