// Copyright Contributors to the Amundsen project.
// SPDX-License-Identifier: Apache-2.0

@import 'variables';

#search-bar {
  position: relative;

  .search-bar-form {
    .search-button {
      height: 24px;
      position: absolute;
      width: 24px;

      &.small {
        left: $spacer-1;
        top: 6px;
      }

      &.large {
        left: 24px;
        top: 28px;
      }
    }

    .clear-button {
      height: 24px;
      position: absolute;
      right: $spacer-1;
      top: 2px;
      width: 24px;
    }

    .search-bar-input {
      border: 1px solid $stroke;
      border-radius: 4px;
      box-shadow: 0 3px 12px 0 rgba(17, 17, 31, 0.04);
      width: 100%;

      &.large {
        height: 80px;
        padding: $spacer-2 24px $spacer-2 64px;
      }

      &.small {
        height: 36px;
        padding: 6px 6px 6px 36px;
      }

      &:focus {
        border-color: $stroke-focus;
      }

      &:focus + .search-button .icon-search:not(:hover) {
        background-color: $stroke-focus;
      }
    }

    @media (max-width: $screen-md-max) {
      .search-button.large {
        left: 16px;
        top: 18px;
      }

      .text-headline-w2.search-bar-input {
        font-size: 24px;
        height: 60px;
        padding: 16px 16px 16px 48px;
      }
    }
  }

  .subtext {
    margin-top: 16px;
  }

  .error {
    color: red;
  }
}
