@import "../../style/themes/default";
@import "../../style/mixins/index";

@timeline-prefix-cls: ~"@{dt-prefix}-timeline";
@timeline-color: @border-color-split;

.@{timeline-prefix-cls} {
  .reset-component;
  margin: 0;
  padding: 0;
  font-size: @font-size-base;
  table {
    width: 100%;
  }
  td {
    max-width: 450px;
    vertical-align: top;
    padding-bottom: @timeline-base-padding;
    &:nth-child(2) {
      padding-left: @timeline-base-padding;
    }
    &:not(.@{timeline-prefix-cls}-line) {
      padding-right: @timeline-right-padding;
    }
  }
  &-line {
    position: relative;
  }
  &-item {
    position: absolute;
    top: 0;
    bottom: 0;
    padding: 0 18px 0 0;

    &-tail {
      position: absolute;
      left: 4px;
      top: 0.75em;
      height: 100%;
      border-left: 2px solid @timeline-color;
    }

    &-head {
      position: absolute;
      top: (@font-size-base * @line-height-base - @font-size-base) - 3px;
      width: 10px;
      height: 10px;
      background-color: @component-background;
      border-radius: 100px;
      border: 2px solid transparent;

      &-blue {
        border-color: @primary-color;
        color: @primary-color;
      }
      &-red {
        border-color: @error-color;
        color: @error-color;
      }
      &-green {
        border-color: @success-color;
        color: @success-color;
      }
    }

    &-head-custom {
      position: absolute;
      text-align: center;
      line-height: 1;
      margin-top: 0;
      border: 0;
      height: auto;
      border-radius: 0;
      padding: 3px 0;
      transform: translate(-50%, -50%);
      top: 8px;
      left: 5px;
      width: auto;
    }

    &-process {
      .@{timeline-prefix-cls}-item-head {
        &-blue {
          background-color: @primary-color;
        }
        &-red {
          background-color: @error-color;
        }
        &-green {
          background-color: @success-color;
        }
      }
    }

    &-next-wait, &-wait {
      .@{timeline-prefix-cls}-item-tail {
        border-left-style: dotted;
        border-left-color: @timeline-wait-color;
      }
      &:not(.@{timeline-prefix-cls}-item-process) {
        .@{timeline-prefix-cls}-item-head {
          border-color: @timeline-wait-color;
        }
      }
    }

    &-next-more {
      .@{timeline-prefix-cls}-item-tail {
        border-left-style: dotted;
        border-left-color: @timeline-wait-color;
      }
    }

    &-last {
      .@{timeline-prefix-cls}-item-tail {
        display: none;
      }
    }
  }

  &-more-btn {
    cursor: pointer;
  }
}
