@import './../theme/vars.scss';
@import './../mixins/reset.scss';

$timeline-prefix-cls: #{$vender-prefix}-timeline;
$timeline-color: $border-color-split;

.#{$timeline-prefix-cls} {
  @include reset-component;

  color: unset;

  &-item {
    position: relative;
    padding: 0 0 1.8em;
    margin: 0;
    font-size: $font-size-base;
    list-style: none;

    &-tail {
      position: absolute;
      top: 0.75em;
      left: 4px;
      height: 100%;
      border-left: 2px solid $timeline-color;
    }

    &-pending &-tail {
      display: none;
    }

    &-head {
      position: absolute;
      width: 1em;
      height: 1em;
      background-color: $component-background;
      border: 2px solid transparent;
      border-radius: 0.5em;

      &-blue {
        color: var(--primary-color);
        border-color: var(--primary-color);
      }

      &-red {
        color: $error-color;
        border-color: $error-color;
      }

      &-green {
        color: $success-color;
        border-color: $success-color;
      }
    }

    &-head-custom {
      position: absolute;
      top: 5px;
      left: 5px;
      width: auto;
      height: auto;
      padding: 3px 0;
      margin-top: 0;
      line-height: 1;
      text-align: center;
      border: 0;
      border-radius: 0;
      transform: translate(-50%, -50%);
    }

    &-content {
      position: relative;
      top: 1px - ($font-size-base * $line-height-base - $font-size-base);
      padding: 0 0 0 18px;
    }

    &-last {
      .#{$timeline-prefix-cls}-item-tail {
        display: none;
        border-left: 2px dotted $timeline-color;
      }

      .#{$timeline-prefix-cls}-item-content {
        min-height: 48px;
      }
    }
  }

  &.#{$timeline-prefix-cls}-pending &-item-last &-item-tail {
    display: block;
  }
}

.#{$timeline-prefix-cls}.#{$timeline-prefix-cls}-horizontal {
  padding-left: 2em;

  .#{$timeline-prefix-cls}-item {
    display: inline-block;
    padding: 1.8em 0 0;

    &-tail {
      top: 26px;
      width: 100%;
      height: 5px;
      border-top: 3px solid #bdbcbc;
      border-left: none;
    }

    &-content {
      top: -17px;
      left: -20px;
      padding: 0 18px 0 0;
    }

    &-last {
      .#{$timeline-prefix-cls}-item-tail {
        display: none;
        border-left: none;
      }

      .#{$timeline-prefix-cls}-item-content {
        min-height: 48px;
      }
    }
  }
}
