@use '../../../../../styles/_globals.scss' as *;

:host {
  display: block;
  width: 100%;
}

input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.4;
  background: transparent;
  color: inherit;
  outline: none;
  transition: border-color 0.2s ease;

  @include mq(xs, max) {
    padding: 6px 8px;
    font-size: 12px;
  }

  &:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 2px rgba(var(--c-accent-rgb), 0.2);
  }

  &::placeholder {
    color: var(--text-tertiary);
    opacity: 0.7;
  }
}

::ng-deep {
  .mat-mdc-autocomplete-panel {
    max-height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    box-shadow: var(--whiteframe-shadow-3dp);
    background: var(--bg-color);

    .mat-mdc-option {
      padding: 6px 10px;
      font-size: 14px;
      line-height: 1.3;
      min-height: auto;
      border-bottom: 1px solid var(--border-light);

      @include mq(xs, max) {
        padding: 4px 8px;
        font-size: 12px;
      }

      &:last-child {
        border-bottom: none;
      }

      &:hover {
        background: rgba(var(--c-accent-rgb), 0.1);
      }

      &.mat-mdc-option-active {
        background: rgba(var(--c-accent-rgb), 0.15);
      }

      .mat-mdc-option-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: inherit;
      }
    }
  }
}
