@use 'sass:map';
@use 'mixins/mixins' as *;
@use 'common/var' as *;

@include b(timeline-item) {
  display: flex;
  padding-bottom: 16px;
  width: 100%;

  @include e(wrapper) {
    position: relative;
    padding-left: 16px;
    flex: 1;
  }
  @include e(sidebar) {
    width: 14px;
    height: inherit;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    flex-direction:column;
    margin-top: 6px;
  }
  @include e(tail) {
    // position: absolute;
    // left: 4px;
    // height: 100%;
    // border-left: 2px solid getCssVar('timeline-line-color');
    margin-top: 4px;
    flex: 1;
    width: 2px;
    background-color: #eeeeee;
  }

  & .#{$namespace}-timeline-item__icon {
    color: getCssVar('color-white');
    font-size: getCssVar('font-size-small');
  }

  @include e(node) {
    // position: absolute;
    // background-color: getCssVar('timeline-node-color');
    // border-color: getCssVar('timeline-node-color');
    // border-radius: 50%;
    // box-sizing: border-box;
    // display: flex;
    // justify-content: center;
    // align-items: center;
    width: 100%;
    background-color: getCssVar('timeline-node-color');
    border-color: getCssVar('timeline-node-color');
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    @include m(normal) {
      left: 1px;
      width: getCssVar('timeline-node-size-normal');
      height: getCssVar('timeline-node-size-normal');
    }
    @include m(large) {
      left: -2px;
      width: getCssVar('timeline-node-size-large');
      height: getCssVar('timeline-node-size-large');
    }
    @include when(hollow) {
      background: getCssVar('color-white');
      border-style: solid;
      border-width: 2px;
    }

    @each $type in (primary, success, warning, danger, info) {
      @include m($type) {
        background-color: getCssVar('color', $type);
        border-color: getCssVar('color', $type);
      }
    }
  }

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

  @include e(content) {
    line-height: 1.5;
    color: getCssVar('text-color', 'primary');
  }

  @include e(timestamp) {
    color: getCssVar('text-color', 'secondary');
    line-height: 1.5;
    font-size: getCssVar('font-size-small');

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