@import '../../styles/mixins/index';
.nut-theme-dark {
  .nut-tabs {
    &__titles {
      background: $dark-background3;
      &-item {
        color: $dark-color-gray;
        &.active {
          color: $dark-color;
        }
      }
    }
    &.vertical {
      .nut-tabs__titles {
        &-item {
          &.active {
            background-color: $dark-background2;
          }
        }
      }
    }
  }
}

.nut-tabs {
  display: flex;

  &.horizontal {
    flex-direction: column;
  }

  &.vertical {
    flex-direction: row;
    width: 100%;

    .nut-tabs__titles {
      box-sizing: border-box;
      flex-direction: column;
      height: 100%;
      padding: 10px 0 !important;
      width: $tabs-vertical-titles-width;
      flex-shrink: 0;

      &.scrollable {
        overflow-x: hidden;
        overflow-y: auto;
      }

      &-item {
        height: $tabs-vertical-titles-item-height;
        flex: none;

        &__smile {
          transition: width 0.3s ease;
        }

        &__line {
          bottom: none;
          transform: translate(0, -50%);
          transition: height 0.3s ease;
          width: 0;
          height: 0;
        }

        &.active {
          background-color: #fff;

          .nut-tabs__titles-item__line {
            left: 10px;
            width: 3px;
            background: $tabs-vertical-tab-line-color;
            height: $tabs-vertical-titles-item-active-line-height;
          }

          .nut-tabs__titles-item__smile {
            right: -2px;
            bottom: 2px;
            left: auto;
            width: 3px;
            transform: rotate(320deg);
            height: $tabs-vertical-titles-item-active-line-height;
          }
        }
      }
    }

    .nut-tabs__content {
      flex-direction: column;
      &__wrap {
        flex: 1;
      }
      height: 100%;

      .nut-tabpane {
        height: 100%;
      }
    }
  }

  &__titles {
    height: $tabs-horizontal-titles-height;
    padding: 0 10px;
    display: flex;
    user-select: none;
    background: $tabs-titles-background-color;
    border-radius: $tabs-titles-border-radius;
    flex-shrink: 0;
    overflow: hidden;

    &.large {
      .nut-tabs__titles-item {
        font-size: $tabs-titles-item-large-font-size;
      }
    }

    &.normal {
      .nut-tabs__titles-item {
        font-size: $tabs-titles-item-font-size;
      }
    }

    &.small {
      .nut-tabs__titles-item {
        font-size: $tabs-titles-item-small-font-size;
      }
    }

    &::-webkit-scrollbar {
      display: none;
      width: 0;
      background: transparent;
    }

    &.smile {
      .nut-tabs__titles-item {
        &.active {
          .nut-tabs__titles-item__smile {
            width: 20px;
            height: 8px;
          }
        }
      }
    }

    &.scrollable {
      overflow-x: auto;
      overflow-y: hidden;

      .nut-tabs__titles-item {
        width: auto;
      }
    }

    &-item {
      position: relative;
      font-size: $tabs-titles-item-font-size;
      flex: 1 0 auto;
      min-width: $tabs-horizontal-titles-item-min-width;
      width: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      color: $tabs-titles-item-color;

      &__text {
        &.ellipsis {
          @include oneline-ellipsis();
        }

        text-align: center;
      }

      &__smile,
      &__line {
        position: absolute;
        transition: width 0.3s ease;
        width: 0;
        height: 0;
        content: ' ';
        bottom: 15%;
        left: 50%;
        transform: translate(-50%, 0);
        overflow: hidden;
      }

      &__smile {
        .nut-icon {
          position: absolute;
          font-size: 12px;
          width: 100%;
          height: 100%;
          color: $tabs-tab-smile-color;
        }
      }

      &.disabled {
        color: $disable-color;
      }

      &.active {
        font-weight: 600;

        .nut-tabs__titles-item__line {
          content: ' ';
          width: $tabs-horizontal-titles-item-active-line-width;
          height: 3px;
          background: $tabs-horizontal-tab-line-color;
        }
      }
    }
  }

  &__content {
    &__wrap {
      overflow: hidden;
    }
    display: flex;
    box-sizing: border-box;
  }
}
