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

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

  @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: $--color-white;
    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: -1px;
      width: $--timeline-node-size-normal;
      height: $--timeline-node-size-normal;
    }

    @include m(large) {
      left: -2px;
      width: $--timeline-node-size-large;
      height: $--timeline-node-size-large;
    }

    @include m(primary) {
      background-color: $--color-primary;
    }

    @include m(success) {
      background-color: $--color-success;
    }

    @include m(warning) {
      background-color: $--color-warning;
    }

    @include m(danger) {
      background-color: $--color-danger;
    }

    @include m(info) {
      background-color: $--color-info;
    }
  }

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

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

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

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

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

@include b(timeline-log-item) {
  .el-timeline-item__node {
    left: -5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0px 3px 5px 0px rgba(83, 114, 236, 0.44);
    border: 4px solid #5372ec;
  }
  .el-timeline-item__wrapper {
    .el-card {
      border-radius: 6px;
      box-shadow: 0px 3px 10px 0px rgba(223, 223, 223, 0.5);
      &__body {
        padding: 12px;
      }
      p {
        margin: 0;
      }
      .el-timeline-card-div {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-bottom: 12px;
        font-weight: 500;
        color: #3F4249;

        .el-text-tooltip {
          margin-right: 12px;
        }

        .el-timeline-card-p {
          font-size: 14px;
          color: $--color-gray;
          white-space: nowrap;
        }

        &+.el-timeline-card-p {
          color: $--color-info;
        }
      }
      .el-timeline-card-date {
        margin-bottom: 12px;
        color: #3F4249;
        font-weight: 500;
        font-size: 14px;
      }
      .el-timeline-card-state {
        span {
          font-size: 12px;
          font-weight: 400;
          padding: 4px;
          padding-left: 6px;
          padding-right: 6px;
          border-radius: 6px;
          margin-right: 8px;
          &.normal {
            color: #18be6a;
            background: #e7f8f0;
          }
          &.error {
            color: #ff4d4f;
            background: #fdebe7;
          }
        }
      }
    }
  }
}