@mixin button() {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 38px;
  gap: 4px;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  padding: 0 24px;
  border-radius: 2px;
  box-sizing: border-box;
  white-space: nowrap;
  border: none;
  transition: 0.1s;
  cursor: pointer;

  .mat-icon {
    font-size: 20px;
  }

  &.button-small {
    height: 26px;
    padding: 0 16px;
  }

  &.button-icon {
    padding: 0 10px;

    &.button-small {
      padding: 0 6px;
    }
  }

  &.full-width {
    width: 100%;
    justify-content: center;
  }
}

.button-basic {
  @include button();
  color: #333333;
  background: $color-white-primary;

  &:hover {
    background: $color-primary-hover;
  }

  &:focus {
    outline: none;
    color: $color-primary;
    background: $color-blue-tint-1;
  }

  &:disabled {
    color: #d6d6d6;
    background: $color-white-primary;
    cursor: not-allowed;
  }

  // this is for toolbox button active state
  &.active {
    color: $color-primary;
    background: $color-blue-tint-1;
  }
}

.button-stroked {
  @include button();
  color: $color-grey-shade-2;
  background: $color-white-primary;
  border: 1px solid $color-white-tint-1;
  box-sizing: border-box;

  &:hover {
    background: $color-white-sidemenu;
    border-color: $color-white-tint-4;
  }

  &:focus {
    outline: none;
    color: $color-blue-primary;
    border-color: $color-blue-primary;
    background: $color-blue-tint-1;
    box-shadow: 0 0 2px 2px rgba(33, 136, 217, 0.3);
  }

  &:disabled {
    color: #d6d6d6;
    border-color: #f2f2f3;
    background: $color-white-primary;
    cursor: not-allowed;
  }
}

.button-flat {
  @include button();
  color: $color-white-primary;
  background: $color-primary;

  &:hover {
    background: $color-blue-shade-1;
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 2px 2px rgba(33, 136, 217, 0.3);
  }

  &:disabled {
    background: $color-blue-tint-4;
    cursor: not-allowed;
  }
}

.button-alert {
    @include button();
    color: $color-white-primary;
    background: $color-error-primary;
  
    &:hover {
      background: $color-error-shade;
    }
  
    &:focus {
      outline: none;
      box-shadow: 0px 4px 10px 0px #FFE0DE;
    }
  
    &:disabled {
      background: $color-error-tint;
      cursor: not-allowed;
    }
  }

//  this button was completely restyled by designer
.button-basic-new {
  display: flex;
  flex-direction: row;
  align-items: center;
  height: 25px;
  gap: 4px;
  font-weight: 400;
  font-size: 16px;
  line-height: 130%;
  padding: 0 2px;
  border-radius: 2px;
  box-sizing: border-box;
  white-space: nowrap;
  border: none;
  transition: 0.1s;
  cursor: pointer;
  color: $color-grey-shade-2;
  background: $color-white-primary;

  .mat-icon {
    font-size: 20px;
  }

  &.button-small {
    height: 22px;
  }

  &.full-width {
    width: 100%;
    justify-content: center;
  }

  &:hover {
    color: $color-grey-shade-4;
  }

  &:focus {
    outline: none;
    color: $color-primary;
  }

  &:disabled {
    color: $color-white-tint-3;
    cursor: not-allowed;
  }

  // this is for toolbox button active state
  &.active {
    color: $color-primary;
  }
}
