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

@timeline-prefix-cls: ~'@{c7n-prefix}-timeline';
@timeline-color: @border-color-split;

.@{timeline-prefix-cls} {
  .reset-component;
  margin: 0;
  padding: 0;
  list-style: none;

  &-item {
    position: relative;
    margin: 0;
    padding: 0 0 0.2rem;
    font-size: @font-size-base;
    list-style: none;

    &-tail {
      position: absolute;
      top: 0.75em;
      left: 0.04rem;
      height: 100%;
      border-left: 0.02rem solid @timeline-color;
    }

    &-pending &-head {
      font-size: @font-size-sm;
    }

    &-pending &-tail {
      display: none;
    }

    &-head {
      position: absolute;
      width: 0.1rem;
      height: 0.1rem;
      background-color: @component-background;
      border: 0.02rem solid transparent;
      border-radius: 1rem;

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

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

    &-content {
      position: relative;
      top: -(@font-size-base * @line-height-base - @font-size-base) + 0.01rem;
      padding: 0 0 0 0.18rem;
    }

    &-last {
      .@{timeline-prefix-cls}-item-tail {
        display: none;
        border-left: 0.02rem dotted @timeline-color;
      }
      .@{timeline-prefix-cls}-item-content {
        min-height: 0.48rem;
      }
    }
  }

  &&-pending &-item-last &-item-tail {
    display: block;
  }
}
