@import '@angular/material';

// Material select mixin
@mixin mat-select-override($theme) {
  $primary: map-get($theme, primary);
  $warn: map-get($theme, warn);
  $is-dark: map-get($theme, is-dark);

  .mat-mdc-option {
    min-height: 2.8em;
    .mdc-list-item__primary-text {
      line-height: initial !important;
    }
    .mat-pseudo-checkbox-checked.mat-pseudo-checkbox-minimal::after {
      @if $is-dark {
        color: $mic-brand-colors-blue !important;
      }
    }
  }
  .mat-select-empty-placeholder {
    @if $is-dark {
      color: $mic-brand-colors-white;
    }
  }

  .mat-mdc-autocomplete-panel,
  .mat-mdc-select-panel:not([class*='mat-elevation-z']) {
    overflow: hidden;
    .mat-mdc-form-field {
      * {
        @if $is-dark {
          color: $mic-brand-colors-white;
        }
      }
    }
  }

  .mat-select-options-wrapper {
    .mat-mdc-option {
      line-height: 2.8em;
      height: 2.8em;
    }
    .mat-mdc-option.mat-active {
      color: inherit;
      @if $is-dark {
        color: $mic-brand-colors-white;
      }
    }
  }

  .mat-mdc-option:hover:not(.mdc-list-item--disabled),
  .mat-mdc-option:focus:not(.mdc-list-item--disabled),
  .mat-mdc-option.mat-mdc-option-active.mdc-list-item,
  .mat-accent .mat-mdc-option.mdc-list-item--selected:not(.mdc-list-item--disabled),
  .mat-mdc-option.mdc-list-item--selected:not(.mat-mdc-option-multiple):not(.mdc-list-item--disabled) {
    background-color: map-get($primary, 50);
    .mdc-list-item__primary-text {
      color: $mic-brand-colors-blue !important;
    }
  }

  .mat-select-checked {
    small {
      color: map-get($primary, A400);
    }
  }

  .mat-pseudo-checkbox-full {
    border-color: var(--mdc-checkbox-unselected-icon-color);
  }
}
