@import '../../style/themes/index';
@import '../../style/mixins/index';
@import '../../input/style/mixin';

@yee-mention-prefix-cls: ~'@{yee-prefix}-mentions';

.@{yee-mention-prefix-cls} {
  .yee-reset-component;
  .yee-input;

  position: relative;
  display: inline-block;
  height: auto;
  padding: 0;
  overflow: hidden;
  line-height: @yee-line-height-base;
  white-space: pre-wrap;
  vertical-align: bottom;

  // =================== Status ===================
  &-disabled {
    > textarea {
      .yee-disabled();
    }
  }

  &-focused {
    .yee-active();
  }

  // ================= Input Area =================
  > textarea,
  &-measure {
    min-height: @yee-input-height-base - 2px;
    margin: 0;
    padding: @yee-input-padding-vertical-base @yee-input-padding-horizontal-base;
    overflow: inherit;
    overflow-x: hidden;
    overflow-y: auto;
    font-weight: inherit;
    font-size: inherit;
    font-family: inherit;
    font-style: inherit;
    font-variant: inherit;
    font-size-adjust: inherit;
    font-stretch: inherit;
    line-height: inherit;
    direction: inherit;
    letter-spacing: inherit;
    white-space: inherit;
    text-align: inherit;
    vertical-align: top;
    word-wrap: break-word;
    word-break: inherit;
    tab-size: inherit;
  }

  > textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    .yee-placeholder();

    &:read-only {
      cursor: default;
    }
  }

  &-measure {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    color: transparent;
    pointer-events: none;

    > span {
      display: inline-block;
      min-height: 1em;
    }
  }

  // ================== Dropdown ==================
  &-dropdown {
    // Ref select dropdown style
    .yee-reset-component;

    position: absolute;
    top: -9999px;
    left: -9999px;
    z-index: @yee-zindex-dropdown;
    box-sizing: border-box;
    font-size: @yee-font-size-base;
    font-variant: initial;
    background-color: @yee-component-background;
    border-radius: @yee-border-radius-base;
    outline: none;
    box-shadow: @yee-box-shadow-base;

    &-hidden {
      display: none;
    }

    &-menu {
      max-height: 250px;
      margin-bottom: 0;
      padding-left: 0; // Override default ul/ol
      overflow: auto;
      list-style: none;
      outline: none;

      &-item {
        position: relative;
        display: block;
        min-width: 100px;
        padding: 5px @yee-control-padding-horizontal;
        overflow: hidden;
        color: @yee-text-color;
        font-weight: normal;
        line-height: 22px;
        white-space: nowrap;
        text-overflow: ellipsis;
        cursor: pointer;
        transition: background 0.3s ease;

        &:hover {
          background-color: @yee-item-hover-bg;
        }

        &:first-child {
          border-radius: @yee-border-radius-base @yee-border-radius-base 0 0;
        }

        &:last-child {
          border-radius: 0 0 @yee-border-radius-base @yee-border-radius-base;
        }

        &-disabled {
          color: @yee-disabled-color;
          cursor: not-allowed;

          &:hover {
            color: @yee-disabled-color;
            background-color: @yee-component-background;
            cursor: not-allowed;
          }
        }

        &-selected {
          color: @yee-text-color;
          font-weight: @yee-select-item-selected-font-weight;
          background-color: @yee-background-color-light;
        }

        &-active {
          background-color: @yee-item-active-bg;
        }
      }
    }
  }
}
