@import "./vars";

@import "./components/Tag";
@import "./components/Group";
@import "./components/Option";
@import "./components/Options";
@import "./components/Notificator";

.react-select-tags {
  box-sizing: border-box;
  width: 100%;
  font-size: 1rem;
  background: $background;

  * {
    box-sizing: border-box;
  }

  &.focused {
    .inputWrapper {
      border-color: #86b7fe;
      border-radius: 4px;
      box-shadow: 0 0 0 4px rgb(13 110 253 / 25%);
    }
  }

  &.showOverflowedTags {
    .inputWrapper {
      height: auto !important;
    }
  }

  .mainWrapper {
    position: relative;

    .inputWrapper {
      display: flex;
      width: 100%;
      align-items: center;
      height: $rstHeight;
      padding: 5px 6px 5px 6px;
      border: 1px solid $rstBorderColor;
      border-radius: $rstTagBorderRadius;
      transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;

      &.invalid {
        border: 1px solid $rstInvalid !important;
      }

      &.has-selected-tags {
        align-items: baseline;
      }
    }

    .tags {
      display: flex;
      flex-wrap: wrap;
      flex-shrink: 1;
      align-items: center;
      justify-content: flex-start;
      overflow: hidden;
      height: 100%;
      gap: 6px;
    }

    .expander {
      border: 1px solid $rstTagBgColor;
      border-radius: $rstTagBorderRadius;
      padding: 4px 8px 4px 8px;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      margin: 0px 4px;
      user-select: none;
      background: white;
      color: $rstTagBgColor;

      &:hover {
        background: $rstTagBgColor;
        color: white;
      }
    }

    .input {
      width: auto;
      min-width: 200px;
      flex-grow: 1;
      padding: 0 0 0 4px;
      margin: 0 4px;

      font-size: $rstTagFontSize;
      line-height: 1;

      background: transparent;
      color: $rstMainInputColor;
      border: none;
      border-radius: $rstTagBorderRadius;
      outline: 0;
      box-shadow: none;
      -webkit-appearance: none;

      &::placeholder,
      &:-moz-placeholder,
      &:-ms-input-placeholder,
      &::-moz-placeholder,
      &::-webkit-input-placeholder {
        color: $rstMainInputColor;
      }
      &:focus {
        border: none;
      }
    }
  }
}
