@import '../style/var';
@import './var';

:root {
  --tm-tabs-font-size: @tabs-font-size;
  --tm-tabs-active-font-size: @tabs-active-font-size;
  --tm-tabs-color: @tabs-color;
  --tm-tabs-active-color: @tabs-active-color;
  --tm-tabs-button-active-color: @tabs-button-active-color;
  --tm-tabs-button-border-radius: @tabs-button-border-radius;
  --tm-tabs-font-weight-normal: @tabs-font-weight-normal;
  --tm-tabs-font-weight-bold: @tabs-font-weight-bold;
  --tm-tabs-button-active-padding: @tabs-button-active-padding;
}

.tm-tabs {
  width: 100%;
  overflow: hidden;

  .tm-tabs__wrapper {
    display: flex;
    flex: 1 1 auto;
    overflow: hidden;
    position: relative;
  }

  .tm-tabs__content {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    flex: 1 0 auto;
    white-space: nowrap;
    transition: .3s cubic-bezier(.25,.8,.5,1);

    &.tm-is-left {
      justify-content: flex-start;
    }
    &.tm-is-center {
      justify-content: center;
    }
    &.tm-is-right {
      justify-content: flex-end;
    }
  }

  .icon-prev,
  .icon-next {
    line-height: 26px;
    font-size: 12px;
    color: #000;
    border-radius: 3px;
    cursor: pointer;

    &.tm-is-disabled {
      color: #d7d7d7;
      cursor: not-allowed;
    }
  }

  .icon-prev {
    padding-right: 8px;
  }
  .icon-next {
    padding-left: 8px;
  }

  .tm-tabs__pane {
    padding: 0;
    margin-right: 24px;
    font-size: var(--tm-tabs-font-size);
    font-weight: var(--tm-tabs-font-weight-normal);
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    color: var(--tm-tabs-color);
    white-space: nowrap;

    &:last-child {
      margin-right: 0;
    }
  }

  &.tm-tabs--text {
    .tm-tabs__pane {
      line-height: 54px;
    }
    .tm-tabs__pane.tm-is-active {
      position: relative;
      font-size: var(--tm-tabs-active-font-size);
      color: var(--tm-tabs-active-color);
      font-weight: var(--tm-tabs-font-weight-bold);
    }
  }

  &.tm-tabs--underline {
    .tm-tabs__pane {
      line-height: 40px;
    }
    .tm-tabs__pane.tm-is-active {
      position: relative;
      font-size: var(--tm-tabs-active-font-size);
      color: var(--tm-tabs-active-color);
      font-weight: var(--tm-tabs-font-weight-bold);

      &:after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        margin: 0 auto;
        width: 30px;
        height: 3px;
        border-radius: 5px;
        background-color: var(--tm-tabs-active-color);
      }
    }
  }

  &.tm-tabs--button {
    .tm-tabs__pane.tm-is-active {
      min-width: 116px;
      padding: 0 var(--tm-tabs-button-active-padding);
      font-weight: var(--tm-tabs-font-weight-bold);
      color: var(--tm-tabs-button-active-color);
      border-radius: var(--tm-tabs-button-border-radius);
      background: var(--tm-tabs-active-color);
    }

    .tm-tabs__pane.tm-is-active.tm-is-round {
      border-radius: 20px;
    }
  }

  &.tm-tabs--small {
    .tm-tabs__pane {
      line-height: 26px;
    }
    .tm-tabs__pane.tm-is-active {
      font-size: var(--tm-tabs-font-size);
    }
  }
}
