@import '../variables';

@mixin mat-step-active-icon-color($step-position, $color) {
  .mat-horizontal-stepper-header:nth-child(#{$step-position}) {

    .mat-step-icon-selected,
    .mat-step-icon-state-done,
    .mat-step-icon-state-edit {
      background-color: $color;
    }
  }
}

@mixin mat-step-icon-color($color) {
  .mat-step-header .mat-step-icon {
    background-color: $color;

    .mat-icon {
      display: none;
    }

    .mat-step-icon-content {
      display: none;
    }
  }
}

@mixin mat-step-icon-size($size) {
  .mat-step-icon {
    width: $size !important;
    height: $size !important;
  }
}

@mixin mat-step-active-icon-size($size) {
  .mat-horizontal-stepper-header[aria-selected="true"] {

    .mat-step-icon-selected,
    .mat-step-icon-state-done,
    .mat-step-icon-state-edit {
      width: $size !important;
      height: $size !important;
    }
  }
}

@mixin mat-form-field {
  .mat-form-field {
    width: 100%;
    margin-top: 6px;

    input,
    textarea {
      padding-left: 16px;
      border: 1px solid #545454;
      border-radius: 12px;
      height: 57px;
      font-size: 16px;
      resize: none;
    }

    label {
      // padding-bottom: 1.25em;
      font-weight: bold;
    }
  }

  .mat-form-field-underline {
    display: none;
  }

  .mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label {
    font-weight: bold !important;
    font-size: 16px !important;
    color: #545454 !important;
  }

  .mat-input-element {
    caret-color: #545454;
    opacity: 1;
  }

  .mat-form-field.mat-focused .mat-input-element,
  .mat-form-field-label,
  .mat-form-field:not(.mat-focused) .mat-form-field-label,
  .mat-form-field.mat-form-field-invalid:not(.mat-focused) .mat-form-field-label {
    color: #545454 !important;
  }

  .mat-form-field-invalid .mat-input-element,
  .mat-warn .mat-input-element,
  .mat-form-field.mat-form-field-invalid:not(.mat-focused) .mat-input-element,
  .mat-warn .mat-input-element,
  .mat-form-field-invalid .mat-select,
  .mat-warn .mat-select,
  .mat-form-field.mat-form-field-invalid:not(.mat-focused) .mat-select,
  .mat-warn .mat-select {
    border: 2px solid #ff696d !important;
  }

  .mat-form-field.mat-focused:not(.mat-form-field-invalid) .mat-input-element {
    border: 2px solid #8732e8 !important;
    color: #000;
  }

  .mat-input-element:disabled {
    border: 1px solid #c6c6c6 !important;
    background-color: #f3f3f3;
  }

  .mat-form-field.mat-form-field-disabled .mat-form-field-label {
    color: #c8c8c8 !important;
    padding-left: 12px;
    padding-top: 11px;
  }

  .mat-form-field:not(.mat-form-field-empty):not(.mat-focused):not(.mat-form-field-invalid) .mat-input-element {
    border: 1px solid #545454;
  }

  .mat-form-field:not(.mat-focused):not(.mat-form-field-invalid) .mat-input-element:placeholder-shown {
    border: 1px solid #c6c6c6;
  }

  .mat-form-field:not(.mat-focused):not(.mat-form-field-invalid) .mat-select-empty {
    border: 1px solid #c6c6c6 !important;
  }

  .mat-form-field-subscript-wrapper {
    margin-top: 2px !important;
    font-size: 12px !important;
  }

  .mat-form-field-suffix {
    position: absolute;
    top: 36px;
    right: 25px;
  }

  .mat-form-field-invalid .mat-icon {
    color: $danger;
  }

  input:not(:placeholder-shown) {
    .mat-icon {
      display: none;
    }
  }

  .mat-select-placeholder {
    font-weight: 500;
  }

  .mat-select-value-text {
    font-weight: 500;
  }

  .mat-form-field-label {
    opacity: 1 !important;
  }

  .mat-select {
    padding-left: 16px;
    border: 1px solid #545454;
    border-radius: 12px;
    height: 57px;
    font-size: 16px;

    &-arrow {
      opacity: 0;
    }

    &-value {
      line-height: 57px;
    }
  }
}

@mixin mat-check-box-color($color) {

  .mat-checkbox-ripple .mat-ripple-element,
  .mat-checkbox-checked.mat-accent .mat-checkbox-background,
  .mat-checkbox-checked.mat-primary .mat-checkbox-background,
  .mat-checkbox-indeterminate.mat-primary .mat-checkbox-background {
    background-color: $color !important;
  }
}

@mixin mat-error($color) {
  .mat-error {
    text-align: end;
    color: $color;
  }
}

mat-horizontal-stepper.stepper-bg  {
  background: #fff !important;
}
