/**
 *
 * This file may have been modified by Bytedance Inc. (“Bytedance Inc.'s Modifications”). 
 * All Bytedance Inc.'s Modifications are Copyright (year) Bytedance Inc..  
 * 
 * This source code is licensed under the Apache license.
 * See LICENSE file in the project root for license information.
 *
 */
// ant tabs
@tab-prefix-cls: ~'@{ant-prefix}-tabs';

.@{tab-prefix-cls} {
  // 去除badge的颜色样式影响
  .@{ant-prefix}-badge {
    color: inherit;
  }

  &.@{tab-prefix-cls}-title {
    .@{tab-prefix-cls}-tab-active .@{tab-prefix-cls}-tab-btn {
      color: @color-text-icon-0;
    }
  }

  // ========================== Top & Bottom ==========================
  &-top,
  &-bottom {
    > .@{tab-prefix-cls}-nav,
    > div > .@{tab-prefix-cls}-nav {
      margin: 0;
      .@{tab-prefix-cls}-ink-bar {
        height: 3px;
        border-radius: 1.5px;
      }

      .@{tab-prefix-cls}-tab {
        margin: 0 @spacing-xl;
      }
    }
  }

  &-tab {
    line-height: 20px;
    .sp-tabs-dropdown-arrow {
      margin-left: 4px;
      color: @color-text-icon-2;
    }
  }
  &-nav-list {
    .@{tab-prefix-cls}-tab:first-child {
      margin-left: 0;
    }
  }
  &-large {
    > .@{tab-prefix-cls}-nav {
      .@{tab-prefix-cls}-tab {
        padding: @tabs-horizontal-padding-lg;
        font-size: @tabs-title-font-size-lg;
        line-height: 22px;
      }
    }
  }

  &-small {
    color: @tabs-small-font-color;
  }

  &-small:not(&-left):not(&-right),
  &.sp-tabs-button {
    &.@{tab-prefix-cls}-top,
    &.@{tab-prefix-cls}-bottom {
      > .@{tab-prefix-cls}-nav,
      > div > .@{tab-prefix-cls}-nav {
        &::before {
          border-bottom: none;
        }
        .@{tab-prefix-cls}-ink-bar {
          display: none;
        }
      }
    }

    > .@{tab-prefix-cls}-nav {
      .@{tab-prefix-cls}-tab {
        margin: 0 @spacing-s;
        padding: @spacing-s @spacing-l;
        border-radius: @border-radius-base;
        line-height: @Font-Lineheight-1;
        font-size: @font-body-regular-Size;
        background: @background-color-light;

        &.sp-tabs-more-tab {
          padding: 0;

          .sp-tabs-more-tab-dropdown {
            padding: @spacing-s @spacing-l;
          }
        }

        &-active {
          background: @color-primary-bright;
        }

        &:first-child {
          margin-left: 0;
        }
      }
    }
  }

  // ========================== Left & Right ==========================
  &-left,
  &-right {
    > .@{tab-prefix-cls}-nav,
    > div > .@{tab-prefix-cls}-nav {
      .@{tab-prefix-cls}-tab {
        margin-bottom: @spacing-xs;
      }
    }

    .@{tab-prefix-cls}-ink-bar {
      display: none;
    }

    .@{tab-prefix-cls}-content-holder {
      border-left: 0;
    }

    .@{tab-prefix-cls}-nav {
      .@{tab-prefix-cls}-tab {
        border-radius: @border-radius-base;

        &.@{tab-prefix-cls}-tab-active {
          background: @color-primary-bright;
        }

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

    &.@{tab-prefix-cls}-large {
      .@{tab-prefix-cls}-tab {
        padding: @Spacing-5 @padding-lg;
        margin-bottom: @margin-xs;

        &:first-child {
          margin-left: 0;
        }
      }
    }

    &.@{tab-prefix-cls}-large {
      & > .@{tab-prefix-cls}-nav,
      > div > .@{tab-prefix-cls}-nav {
        .@{tab-prefix-cls}-tab {
          margin-bottom: @spacing-m;
        }
      }
    }

    &.@{tab-prefix-cls}-small {
      & > .@{tab-prefix-cls}-nav,
      > div > .@{tab-prefix-cls}-nav {
        .@{tab-prefix-cls}-tab {
          padding: @Spacing-5 @padding-md;
        }
      }
    }
  }
}

// tabs 中dropdown位置调整
.@{ant-prefix}-dropdown {
  .sp-tabs-more-tab-dropdown {
    .@{ant-prefix}-dropdown-menu {
      left: -12px;
      top: 12px;
    }
  }
  .sp-tabs-more-tab-button-dropdown {
    .@{ant-prefix}-dropdown-menu {
      left: -12px;
      top: 6px;
    }
  }
}
