$option-font-size: 14px;

.#{$lib-name}-select {
  position: relative;
  display: inline-block;
  width: 280px;
  .inner-input {
    .no-border-shadow {
      display: none;
      opacity: 0;
    }
    &.active .input-element {
      border-color: $primary-color;
      outline: none;
      box-shadow: 0 0 0 2px lighten($primary-color, 40);
      &.no-border {
        border-top-color: transparent;
        border-left-color: transparent;
        border-right-color: transparent;
        box-shadow: none;
      }
    }
    .input-element {
      color: $title-color-light;
      cursor: pointer;
      text-overflow: ellipsis;
      &.disabled + .suffix-area {
        cursor: not-allowed;
      }
    }
    .suffix-area {
      cursor: pointer;
      .clear {
        color: lighten($primary-color, 40);
        &:hover {
          color: $primary-color;
        }
      }
      .arrow-down {
        font-size: 12px;
        transition: transform $transition-time;
      }
      .arrow-down.reverse {
        transform: rotateZ(180deg);
      }
    }
    &:hover {
      .input-element {
        border-color: $primary-color;
        &.no-border {
          border-top-color: transparent;
          border-left-color: transparent;
          border-right-color: transparent;
        }
        &.disabled {
          &.no-border {
            border-top-color: transparent;
            border-left-color: transparent;
            border-right-color: transparent;
          }
          border-color: $border-color-base;
        }
      }
    }
  }
  .tag-container {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    cursor: pointer;
    .tag-wrapper {
      display: inline-block;
      min-height: 22px;
      margin: 3px 0 3px 10px;
      padding: 0 10px;
      background: lighten($primary-color-hover, 45);
      border-radius: 2px;
      cursor: default;
      .tag-text {
        margin-right: 8px;
        font-size: 12px;
        line-height: 22px;
        color: $content-color-light;
        cursor: text;
      }
      .remove-tag {
        font-size: 12px;
        transform: scale(0.8);
        color: $content-color-light;
        cursor: pointer;
      }
      &:hover {
        background: $primary-color;
        .tag-text,
        .remove-tag {
          color: $title-color-dark;
        }
      }
    }
    &.tag-container-disabled {
      cursor: not-allowed;
      .tag-wrapper,
      .tag-text,
      .remove-tag {
        color: $disabled-text-color-light;
        cursor: not-allowed;
      }
      .tag-wrapper,
      .tag-wrapper:hover {
        background: darken($background-color-disabled, 2);
        .tag-text,
        .remove-tag {
          color: $disabled-text-color-light;
        }
      }
    }
  }
}

.#{$lib-name}-select-dropdown {
  border-radius: 2px;
  box-shadow: $box-shadow-base;
  z-index: 500;
  background: $background-color-base;
  .inner-wrapper {
    background: $background-color-base;
  }
  .search-area {
    padding: 10px 10px 6px 10px;
    .input-element {
      background: $background-color-disabled;
      border: none;
      box-shadow: none;
      border-radius: 16px;
      &:hover {
        background: lighten($border-color-base, 4);
      }
      &.active {
        caret-color: $primary-color;
        background: $background-color-disabled;
        box-shadow: none;
      }
    }
  }
  .dropdown-container {
    // fix scroller line-height
    line-height: 1;
    margin: 0;
    padding: 6px 0;
    list-style: none;
  }
  .empty-hint-erea {
    // fix scroller line-height
    line-height: 1;
  }
  .empty-text {
    // fix scroller line-height
    line-height: 1;
    display: flex;
    flex-direction: column;
    i {
      font-size: 60px;
    }
    span {
      margin: 10px 0 0 0;
    }
    padding: 0 0 20px 0;
    font-size: $option-font-size;
    color: $sub-text-color-light;
    text-align: center;
  }
}
.#{$lib-name}-option {
  position: relative;
  cursor: pointer;
  .default-option-class {
    display: block;
    height: 34px;
    margin: 0 1px;
    padding: 0 9px;
    font-size: $option-font-size;
    line-height: 34px;
    color: $content-color-light;
    background: $background-color-base;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background $transition-time;
    &.focused,
    &:hover {
      background: lighten($primary-color-hover, 45);
    }
    .highlight {
      color: $sub-color;
    }
  }
  &.selected .default-option-class {
    color: $primary-color;
  }
  &.disabled .default-option-class {
    color: $disabled-text-color-light;
    cursor: not-allowed;
    &:hover {
      background: $background-color-base;
    }
  }
  &.multiple .default-option-class {
    padding-right: 49px;
  }
  .selected-mark {
    position: absolute;
    z-index: 1;
    display: block;
    width: 5px;
    height: 10px;
    top: 10px;
    right: 20px;
    border: 2px solid $primary-color;
    border-top: 0;
    border-left: 0;
    transform: rotate(45deg);
  }
}
.#{$lib-name}-option-group {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 20px 0 0 0;
  &::before {
    content: " ";
    position: absolute;
    top: 10px;
    left: 10px;
    width: calc(100% - 20px);
    height: 1px;
    background: $border-color-base;
  }
  &:first-child {
    padding-top: 0;
    &::before {
      height: 0;
    }
  }
  .group-title {
    display: block;
    height: 40px;
    padding: 0 10px;
    font-size: $option-font-size;
    font-weight: 500;
    line-height: 40px;
    color: $title-color-light;
  }
  .group-container {
    .group-wrapper {
      list-style: none;
      padding: 0;
    }
  }
  .default-option-class {
    padding-left: 20px;
  }
}
