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

@tab-prefix-cls: ~'@{wd-prefix}-tabs';
@menu-prefix-cls: ~'@{wd-prefix}-menu';
@scrollbar-prefix-cls: ~'@{wd-prefix}-scrollbar';

.@{tab-prefix-cls}-dropdown {
  .reset-component();

  position: absolute;
  top: -9999px;
  left: -9999px;
  z-index: @zindex-dropdown;
  display: block;
  box-shadow: @box-shadow-200-drop !important;
  border-radius: @tabs-dropdown-border-radius;

  .@{scrollbar-prefix-cls} {
    border-radius: @tabs-dropdown-border-radius;
  }

  &-hidden {
    display: none;
  }

  .@{menu-prefix-cls} {
    margin: 0;
    padding: @tabs-dropdown-menu-padding;
    text-align: left;
    list-style-type: none;
    background-color: @dropdown-menu-bg;
    background-clip: padding-box;
    border-radius: @tabs-dropdown-border-radius;
    border: none;
    outline: none;

    .@{menu-prefix-cls}-item {
      display: flex;
      align-items: center;
      min-width: @tabs-dropdown-menu-item-min-width;
      max-width: @tabs-dropdown-menu-item-max-width;
      margin: 0;
      padding: @tabs-dropdown-menu-item-padding;
      overflow: hidden;
      color: @text-primary;
      font-weight: normal;
      font-size: @dropdown-font-size;
      line-height: @tabs-dropdown-menu-item-line-height;
      white-space: nowrap;
      text-overflow: ellipsis;
      cursor: pointer;
      // transition: all 0.3s;
      border-radius: @tabs-dropdown-menu-item-border-radius;
      margin-bottom: @tabs-dropdown-menu-item-margin-bottom;
      height: @tabs-dropdown-menu-item-height;

      &:last-child {
        margin-bottom: 0;
      }

      > span {
        flex: 1;
        white-space: nowrap;
      }

      .@{tab-prefix-cls}-dropdown-menu-item-remove {
        display: none;
      }

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

      &-disabled {
        &,
        &:hover {
          color: @disabled-color;
          background: transparent;
          cursor: not-allowed;
        }
      }
    }

    .@{menu-prefix-cls}-item:not(:last-child) {
      margin-bottom: 4px;
    }
  }
}

.@{tab-prefix-cls}-dropdown.ellipsis {
  .@{menu-prefix-cls} {
    .@{menu-prefix-cls}-item {
      .@{menu-prefix-cls}-title-content {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
}
