@import '~@angular/material/theming';



@mixin jd-select-theme($theme) {
  $primary: map-get($theme, primary);
  $accent: map-get($theme, accent);
  $warn: map-get($theme, warn);
  $foreground: map-get($theme, foreground);
  $is-dark-theme: map-get($theme, is-dark);
  $background: map-get($theme, background);
  .ant-select-dropdown-menu-item {
    color: mat-color($foreground, text, 0.65);
    &:hover {
      background-color: mat-color($primary, 0.08);
    }
  }
  .ant-select-selection__clear {
    background-color: mat-color($background, card);
    border-color: mat-color($primary, 0.25);
    &:hover {
      color:mat-color($primary, 0.45);
    }
  }
  .ant-select-focused  {
    .ant-select-selection {
      border-color: mat-color($primary, 0.8);
      box-shadow: 0 0 0 2px rgba(lighten(mat-color($primary), 8%), 0.5);
    }
  }
  .ant-select-disabled {
    color: mat-color($foreground, disabled);
    .ant-select-selection {
      background-color: mat-color($background, disabled-button);
      &:hover, &:focus, &:active {
        border-color: mat-color($foreground, divider, 0.65);
      }
    }
    .ant-select-selection--multiple .ant-select-selection__choice {
      background-color: mat-color($background, disabled-button);
      color: mat-color($foreground, divider, 0.65);
    }
    .ant-select-selection__choice__remove:hover {
      color: mat-color($foreground, text, 0.25);
    }
  }
  .ant-select-dropdown-menu-item-disabled {
    color: mat-color($foreground, text, 0.25);

    &:hover {
      color: mat-color($foreground, text, 0.25);
      background-color: mat-color($background, card);
    }
  }
  .ant-select-selection__placeholder,
  .ant-select-search__field__placeholder {

  }

  .ant-select-selection--multiple {
    .ant-select-selection__choice {
      background-color: mat-color($background, card);
      color: mat-color($foreground, text, 0.65);
      border: 1px solid mat-color($foreground, divider, 0.65);
    }
    .ant-select-selection__choice__remove {
      color: mat-color($foreground, text, 0.45);
    }
  }
  .ant-select-dropdown {
    color: mat-color($foreground, text, 0.65);
    background-color: mat-color($background, card);
    box-shadow: 0 2px 8px rgba(mat-color($foreground, text), 0.15);
  }

  .ant-select-dropdown-menu-item-group-title {
    color: mat-color($foreground, text, 0.45);
  }
  .ant-select-dropdown-menu-item-selected,
  .ant-select-dropdown-menu-item-selected:hover {
    color: mat-color($foreground, text, 0.65);
    background-color: mat-color($foreground, divider, 0.06);
  }
  .ant-select-open .ant-select-selection {
    border-color: mat-color($primary, 0.8);
    box-shadow: 0 0 0 2px rgba(lighten(mat-color($primary), 8%), 0.5);
  }
  .ant-select-dropdown-menu-item-divider, .ant-select-dropdown-menu-item-active {
    background-color: mat-color($foreground, divider);
  }
  .ant-select-selection {
    background-color: mat-color($background, card);
    border: 1px solid mat-color($foreground, divider);

    &:hover {
      border-color: mat-color($primary, 0.8);
    }

    &:focus, &:active {
      border-color:mat-color($primary, 0.8);
      box-shadow: 0 0 0 2px rgba(lighten(mat-color($primary), 8%), 0.5);
    }
  }


  .ant-select-arrow {
    color: mat-color($foreground, text, 0.25);
  }
  .ant-select {
    color: mat-color($foreground, text, 0.65);

    > ul > li > a {
      background-color: mat-color($background, card);
    }
  }
}
