.rbf-timeline {
  position: relative;
  width: 100%;
  padding: 1em 0;

  &::after, &::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2em;
    z-index: 2;
  }

  &::before {
    left: 0;
    background: linear-gradient(to right, var(--box-bg), var(--box-bg), transparent);
  }

  &::after {
    right: 0;
    background: linear-gradient(to left, var(--box-bg), var(--box-bg), transparent);
  }

  .timeline-wrapper {
    position: relative;
    width: calc(100% - 2em);
    margin: auto;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
  
    &::-webkit-scrollbar {
      display: none;
    }
  }

  .fade-out {
    position: relative;

    &::before {
      content: '';
      position: absolute;
      width: 100%;
      height: 70px;
      top: -70px;
      background: linear-gradient(to bottom, var(--fade-out-box-bg-start), var(--fade-out-box-bg-end));
      z-index: 1;
    }
  }

  .toggle-wrapper {
    width: 100%;
    text-align: center;
    margin: 1.25em 0 0;
  }

  .intervals, .nodes {
    min-width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: center;

    .node, .node-spacer, .connector {
      width: 6em;
      min-width: 6em;
      flex-grow: 1;
    }

    .interval, .interval-spacer {
      width: 8em;
      min-width: 5em;
      max-width: 8em;
      height: 32px;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: flex-end;
    }

    .interval {
      overflow: visible;
    }

    .interval-time {
      font-size: 12px;
      line-height: 16px;
      white-space: nowrap;
    }
  }

  .node, .interval-spacer {
    position: relative;
    .track {
      position: absolute;
      height: 10px;
      left: -5px;
      right: -5px;
      top: 0;
      transform: translateY(-50%);
      background: var(--primary);
      border-radius: 5px;

      &.left {
        right: 50%;
      }
      &.right {
        left: 50%;
      }

      &.fullrbf {
        background: var(--info);
      }
    }
    &.first-node {
      .track.left {
        display: none;
      }
    }
    &:last-child {
      .track.right {
        display: none;
      }
    }
  }

  .nodes {
    position: relative;
    margin-top: 1em;
    .node {
      .shape-border {
        display: block;
        margin: auto;
        height: calc(1em + 8px);
        width: calc(1em + 8px);
        margin-bottom: -8px;
        transform: translateY(-50%);
        border-radius: 10%;
        cursor: pointer;
        padding: 4px;
        background: transparent;
        transition: background-color 300ms, padding 300ms;

        .shape {
          width: 100%;
          height: 100%;
          border-radius: 10%;
          background: white;
          transition: background-color 300ms, border 300ms;
        }

        &.rbf, &.rbf .shape {
          border-radius: 50%;
        }
      }

      &.selected {
        .shape-border {
          background: var(--mainnet-alt);
        }
      }

      &.mined {
        .shape-border {
          background: var(--success);
        }
      }

      .shape-border:hover {
        padding: 0px;
        .shape {
          background: var(--info);
        }
      }

      &.selected.mined {
        .shape-border {
          background: var(--success);
          height: calc(1em + 16px);
          width: calc(1em + 16px);

          .shape {
            border: solid 4px var(--mainnet-alt);
          }

          &:hover {
            padding: 4px;
            .shape {
              border-width: 1px;
              border-color: var(--info)
            }
          }
        }
      }
    }

    .connector {
      position: relative;
      height: 10px;

      .corner, .pipe {
        position: absolute;
        left: -10px;
        width: 20px;
        height: 108px;
        bottom: 50%;
        border-right: solid 10px var(--primary);
        &.fullrbf {
          border-right: solid 10px var(--info);
        }
        &.last-pipe {
          height: 150px;
          bottom: -42px;
        }
      }

      .corner {
        border-bottom: solid 10px var(--primary);
        border-bottom-right-radius: 10px;
        &.fullrbf {
          border-bottom: solid 10px var(--info);
        }
      }
    }
  }
}