@import "mixins/mixins";
@import "common/var";

@include b(timeline-item) {
  position: relative;
  padding-bottom: 30px;

  @include e(wrapper) {
    position: relative;
    padding-left: 28px;
    top: -3px;
  }

  @include e(tail) {
    position: absolute;
    left: 4px;
    height: 100%;
    border-left: 2px solid $--timeline-node-color;
  }

  @include e(icon) {
    color: $--timeline-icon-color;
    font-size: $--font-size-small;
  }

  @include e(node) {
    position: absolute;
    background-color: $--timeline-node-color;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;

    @include m(normal) {
      left: 0;
      width: $--timeline-node-size-normal;
      height: $--timeline-node-size-normal;
      &.el-timeline-item__node--default {
        width: $--timeline-node-size-normal - 2;
        height: $--timeline-node-size-normal - 2;
        left: 1px;
      }
    }
    @include m(middle) {
      left: -1px;
      width: $--timeline-node-size-middle;
      height: $--timeline-node-size-middle;
      &.el-timeline-item__node--default {
        width: $--timeline-node-size-middle - 2;
        height: $--timeline-node-size-middle - 2;
        left: 0;
      }
    }
    @include m(large) {
      left: -2px;
      width: $--timeline-node-size-large;
      height: $--timeline-node-size-large;
      &.el-timeline-item__node--default {
        width: $--timeline-node-size-large - 2;
        height: $--timeline-node-size-large - 2;
        left: -1px;
      }
    }
    @include m(default) {
      background: $--color-white;
      box-shadow: 0 0 0 2px rgba($--timeline-node-color, 1);
      width: $--timeline-node-size-normal;
      height: $--timeline-node-size-normal;
      left: 0;
    }
    @include m(primary) {
      background-color: $--timeline-primary-color;
      box-shadow: 0 0 0 3px rgba($--timeline-primary-color, 0.2);
    }
    @include m(success) {
      background-color: $--timeline-success-color;
      box-shadow: 0 0 0 3px rgba($--timeline-success-color, 0.2);
    }
    @include m(warning) {
      background-color: $--timeline-warning-color;
      box-shadow: 0 0 0 3px rgba($--timeline-warning-color, 0.2);
    }
    @include m(danger) {
      background-color: $--timeline-danger-color;
      box-shadow: 0 0 0 3px rgba($--timeline-danger-color, 0.2);
    }
    @include m(info) {
      background-color: $--timeline-info-color;
      box-shadow: 0 0 0 3px rgba($--timeline-info-color, 0.2);
    }
  }

  @include e(dot) {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  @include e(content) {
    color: $--timeline-content-color;
  }

  @include e(timestamp) {
    color: $--timeline-font-color;
    line-height: 1;
    font-size: $--font-size-small;

    @include when(top) {
      margin-bottom: 8px;
      padding-top: 4px;
    }
    @include when(bottom) {
      margin-top: 8px;
    }
  }
}
