@import '../../styles/variables';
@import '../../styles/mixins';

.Autocomplete {
  position: relative;

  &_danger {
    .Autocomplete__input {
      border-color: $error-color;
      color: $error-color;
    }
  }

  &_disabled {
    .Autocomplete__input {
      pointer-events: none;
      background-color: $gray95;
    }
  }

  &__input {
    @include input;

    &_open {
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }

    &_focused {
      border-color: $action-color;
    }
  }

  &__suggestions-container {
    position: absolute;
    background: white;
    width: 100%;
    max-height: 300px;
    border: 1px solid rgba(0, 0, 0, .2);
    border-top-width: 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, .2);
    overflow-y: auto;
    cursor: pointer;
    z-index: layer('modal');
    opacity: 0;
    border-radius: 0 0 $border-radius $border-radius;

    &_open {
      opacity: 1;
    }
  }

  &__suggestions-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  &__suggestion {
    padding: 8px 10px;
    font-size: 14px;

    &_highlighted {
      background-color: $action-color;
      color: $white;
    }
  }

  &__helpers {
    position: absolute;
    display: flex;
    flex-direction: row;
    right: 1px;
    top: 0;
    height: $line-height;
    align-items: center;
  }
}
