$autocomplete-option-height: 48px;
$input-container-padding: 2px !default;
$input-error-height: 24px !default;

@keyframes md-autocomplete-list-out {
  0% {
    animation-timing-function: linear;
  }
  50% {
    opacity: 0;
    height: 40px;
    animation-timing-function: ease-in;
  }
  100% {
    height: 0;
    opacity: 0;
  }
}
@keyframes md-autocomplete-list-in {
  0% {
    opacity: 0;
    height: 0;
    animation-timing-function: ease-out;
  }
  50% {
    opacity: 0;
    height: 40px;
  }
  100% {
    opacity: 1;
    height: 40px;
  }
}
md-autocomplete {
  border-radius: 2px;
  display: block;
  height: 40px;
  position: relative;
  overflow: visible;
  min-width: 190px;
  &[disabled] {
    input {
      cursor: not-allowed;
    }
  }
  &[md-floating-label] {
    padding-bottom: $input-container-padding + $input-error-height;
    border-radius: 0;
    background: transparent;
    height: auto;
    md-input-container {
      padding-bottom: 0;
    }
    md-autocomplete-wrap {
      height: auto;
    }
    button {
      position: absolute;
      top: auto;
      bottom: 0;
      right: 0;
      width: 30px;
      height: 30px;
    }
  }
  md-autocomplete-wrap {
    display: block;
    position: relative;
    overflow: visible;
    height: 40px;
    &.md-menu-showing {
      z-index: $z-index-backdrop + 1;
    }
    md-progress-linear[md-mode=indeterminate] {
      position: absolute;
      bottom: 0; left: 0; width: 100%;
      height: 3px;
      transition: none;

      .md-container {
        transition: none;
        top: auto;
        height: 3px;
      }
      &.ng-enter {
        transition: opacity 0.15s linear;
        &.ng-enter-active {
          opacity: 1;
        }
      }
      &.ng-leave {
        transition: opacity 0.15s linear;
        &.ng-leave-active {
          opacity: 0;
        }
      }
    }
  }
  input:not(.md-input) {
    width: 100%;
    box-sizing: border-box;
    border: none;
    box-shadow: none;
    padding: 0 15px;
    font-size: 14px;
    line-height: 40px;
    height: 40px;
    outline: none;
    background: transparent;
    &::-ms-clear {
      display: none;
    }
  }
  button {
    position: relative;
    line-height: 20px;
    text-align: center;
    width: 30px;
    height: 30px;
    cursor: pointer;
    border: none;
    border-radius: 50%;
    padding: 0;
    font-size: 12px;
    background: transparent;
    margin: auto 5px;
    &:after {
      content: '';
      position: absolute;
      top: -6px;
      right: -6px;
      bottom: -6px;
      left: -6px;
      border-radius: 50%;
      transform: scale(0);
      opacity: 0;
      transition: $swift-ease-out;
    }
    &:focus {
      outline: none;

      &:after {
        transform: scale(1);
        opacity: 1;
      }
    }
    md-icon {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate3d(-50%, -50%, 0) scale(0.9);
      path {
        stroke-width: 0;
      }
    }
    &.ng-enter {
      transform: scale(0);
      transition: transform 0.15s ease-out;
      &.ng-enter-active {
        transform: scale(1);
      }
    }
    &.ng-leave {
      transition: transform 0.15s ease-out;
      &.ng-leave-active {
        transform: scale(0);
      }
    }
  }
  @media screen and (-ms-high-contrast: active) {
    $border-color: #fff;

    input {
      border: 1px solid $border-color;
    }
    li:focus {
      color: #fff;
    }
  }
}
.md-autocomplete-suggestions {
  position: absolute;
  margin: 0;
  list-style: none;
  padding: 0;
  overflow: auto;
  max-height: 41px * 5.5;
  z-index: $z-index-tooltip;
  li {
    cursor: pointer;
    font-size: 14px;
    overflow: hidden;
    padding: 0 15px;
    line-height: $autocomplete-option-height;
    height: $autocomplete-option-height;
    transition: background 0.15s linear;
    margin: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    &.ng-enter,
    &.ng-hide-remove {
      transition: none;
      animation: md-autocomplete-list-in 0.2s;
    }
    &.ng-leave,
    &.ng-hide-add {
      transition: none;
      animation: md-autocomplete-list-out 0.2s;
    }

    &:focus {
        outline: none;
      }

  }
}
@media screen and (-ms-high-contrast: active) {
  md-autocomplete,
  .md-autocomplete-suggestions {
    border: 1px solid #fff;
  }
}
