//
// Tabs
.tabs{
  $tabs:#{&};
  //tabs-list
  &-list{
    box-shadow: 0 1px 0 0 $gray-lightest-18;
    .clear-btn {
      float: right;
      line-height: 32px;
      cursor: pointer;
      i {
        color: #ccc;

        &:hover {
          color: #666;
        }
      }
    }
    //more tabs
    &__more{
      float: right;
      text-align: center;
      .#{$dropdown-prefix-cls}__toggle{
        height: $nav-tabs-height;
        line-height: $nav-tabs-height;
        #{$tabs}--sm & {
          height: $nav-tabs-sm-height;
          line-height: $nav-tabs-sm-height;
        }
      }

      .#{$dropdown-prefix-cls}__menu{
        margin-top:5px;
        min-width: 100px;
        right: 0;
        left: auto;
      }

      &.#{$dropdown-prefix-cls}--open{
        .#{$dropdown-prefix-cls}__toggle{
          &::after{
            content:"\F295";
          }
        }
      }

      .dropdown__item {
        position: relative;
        padding-right: 32px;

        .aid-close {
          position: absolute;
          right: 8px;
        }
      }
    }
  }

  // Hide tabbable panes to start, show them when `.active`
  .tab-content {
    > .tab-pane {
      display: none;
    }
    > .active {
      display: block;
    }
  }

  //sizing sm
  &--sm {
    .nav-tabs .nav-link {
      height:$nav-tabs-sm-height;
      line-height: $nav-tabs-sm-height;
    }
  }

}


//
// tabs--Pills

.tabs--pills{
  $tabs-pills:#{&};
  .tabs-list{
    background: $nav-pills-bg;
    box-shadow: none;
    border-bottom: 1px solid $gray-lightest;

    // .aid-close {
    //   position: absolute;

    //   & + .nav-label {

    //   }
    // }

    &__more{
      position: relative;
      //nav-pills separate line
      /*&::before {
        position: absolute;
        top: 50%;
        left: 0;
        display: block;
        width: 1px;
        height: 16px;
        background: $nav-pills-separate-line-color;
        transform: translateY(-50%);
        content: "";
      }*/
      .#{$dropdown-prefix-cls}__toggle {
        padding:0 0.5rem;
        cursor: pointer;
        &:after{
          display: inline;
          padding: 4px;
          color: $gray;
        }
        #{$tabs-pills}.tabs--sm{
          height: $nav-pills-sm-height;
          line-height: $nav-pills-sm-height;
        }
      }

      &.#{$dropdown-prefix-cls}--open{
        &::after{
          display: none;
        }
      }
    }

    //.nav-link {
      //@include text-truncate;
     // max-width: 146px;
      //&.active {
        //max-width: none;
      //}
    //}
  }

  //sizing sm
  // &.tabs--sm{
  //   .nav-pills .nav-link{
  //     height:$nav-pills-sm-height;
  //     line-height: $nav-pills-sm-height;
  //   }
  // }
}


//
// tabs--center
//

.tabs--center {
  .tabs-list .nav{
    justify-content: center;
  }
}


//
// tabs--vertical
//

.tabs--vertical {
  display: flex;

  .tabs-list {
    position: relative;
    width: 160px;
    height: 100%;
    overflow: hidden;
    box-shadow: inset -1px 0 0 0 $gray-lightest-18;


    // 遮罩
    // &::after {
    //   position: absolute;
    //   right: 2px;
    //   bottom: 0;
    //   z-index: 2;
    //   display: block;
    //   width: 100%;
    //   height: $tabs-vertical-nav-tabs-height;
    //   pointer-events: none;
    //   content: "";
    //   background: linear-gradient(to bottom,rgba(248,249,250,0),rgba(255,255,255,1));
    // }
  }

  .nav-tabs {
    flex-flow: column;
    width: 100%;
    height: 100%;
    overflow: auto;
    @extend %transparent-scroll;

    .nav-link {
      height: $tabs-vertical-nav-tabs-height;
      padding: 0 16px;
      line-height: $tabs-vertical-nav-tabs-height;
      border-right-width: $nav-tabs-link-border-width;
      border-bottom: 0;
      @include text-truncate;
      margin: 0;
    }
  }

  .tab-content {
    flex: 1;
  }

  &.tabs--sm {
    .nav-tabs {
      .nav-item {
        margin-bottom: 8px;
      }
      .nav-link {
        height: $tabs-vertical-sm-nav-tabs-height;
        line-height: $tabs-vertical-sm-nav-tabs-height;
        margin: 0;
      }
    }
  }
  &.tabs--right {
    flex-direction: row-reverse;
    .tabs-list {
      box-shadow: inset 1px 0 0 0 $gray-lightest-18;
    }
    .nav-tabs {
      .nav-link {
        text-align: left;
        border-right-width: 0;
        border-left-width: $nav-tabs-link-border-width;
      }
    }
  }
}

//
// text align way
//

// text right
.tabs--text-right {
  .nav-tabs {
    .nav-link {
      text-align: right;
    }
  }
}

.tabs--pills.page-tabs {
  position: relative;

  &::after {
    content: '';
    width: 100%;
    height: 1px;
    background-color: #E5E5E5;
    display: block;
    position: absolute;
    bottom: 0;
  }
  
  .tabs-list {
    padding: 0 30px;
    border: none;
  }

  .tabs-container {
    position: relative;
    width: calc(100% - 80px);
    overflow: hidden;

    .get-width-dom {
      position: absolute;
      z-index: -1;
      opacity: 0;
    }
  }

  .more-action {
    width: 80px;
    float: right;
  }
}