/*
* Autocomplete theme
*
*/

@use '../../../../style/core/utilities.scss' as utilities;

.dnb-autocomplete {
  &--open .dnb-input .dnb-input__shell,
  &:not(#{&}__status--error)
    .dnb-form-label:hover
    ~ &__inner
    .dnb-input:not([data-input-state='disabled']) {
    .dnb-input__shell {
      @include utilities.fakeBorder(
        var(--token-color-stroke-action-hover),
        0.125rem
      );
    }

    .dnb-input__submit-button__button {
      border-radius: 0;
      color: var(--token-color-text-neutral-inverse);
      background-color: var(--token-color-background-action-pressed);
      box-shadow: none;
    }
  }

  &--show-indicator &__input .dnb-input__icon {
    color: transparent;
  }

  &__shell,
  &__input {
    border-radius: var(--autocomplete-border-radius);
  }

  &__status--error:not(#{&}--open)
    .dnb-form-label:hover
    ~ &__inner
    .dnb-input:not([data-input-state='disabled']) {
    .dnb-input__shell {
      @include utilities.fakeBorder(
        var(--token-color-stroke-error),
        0.125rem
      );
    }
  }
}

.dnb-autocomplete__root .dnb-drawer-list__option {
  &__item:nth-of-type(1) {
    font-weight: var(--font-weight-basis);
  }

  &:not([disabled]) .dnb-drawer-list__option__item:nth-of-type(n + 2) {
    color: var(--token-color-text-neutral-alternative);
  }

  &__item--highlight {
    font-weight: var(--font-weight-bold);
  }
}

.dnb-autocomplete__root
  .dnb-drawer-list__option--selected:not([disabled])
  .dnb-drawer-list__option__item:nth-of-type(n + 2) {
  color: var(--token-color-text-neutral-inverse);
}

.dnb-autocomplete__root .dnb-drawer-list__option--selected .dnb-anchor {
  color: var(--token-color-text-neutral-inverse);
}
