/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

/**
 * 1. Leave room for caret.
 * 2. Ensure the descenders don't get cut off
 */

.ouiSelect {
  @include ouiFormControlStyle;
  @include ouiFormControlWithIcon($side: 'right'); /* 1 */
  @include ouiFormControlIsLoading($isNextToIcon: true);

  appearance: none;
  line-height: $ouiFormControlHeight; /* 2 */
  padding-top: 0; /* 2 */
  padding-bottom: 0; /* 2 */

  &--compressed {
    @include ouiFormControlWithIcon($side: 'right', $compressed: true); /* 1 */
    line-height: $ouiFormControlCompressedHeight; /* 2 */
    padding-top: 0; /* 2 */
    padding-bottom: 0; /* 2 */
  }

  &--inGroup {
    line-height: $ouiFormControlLayoutGroupInputHeight; /* 2 */
  }

  &--inGroup#{&}--compressed {
    line-height: $ouiFormControlLayoutGroupInputCompressedHeight; /* 2 */
  }

  // Turn off linter for some MS specific bits.
  // sass-lint:disable no-vendor-prefixes
  &::-ms-expand {
    display: none;
  }

  &:focus::-ms-value {
    color: $ouiTextColor;
    background: transparent;
  }

  &:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 $ouiTextColor;
  }
}
