@import '../../../../../app/assets/stylesheets/page_bundles/pipelines';

.linked-pipeline-mini-list {
  &.is-downstream {
    margin-left: -4px;
    margin-right: 4px;
  }

  .arrow-icon {
    display: inline-block;
    vertical-align: middle;
    fill: $border-color;
  }

  &:hover {
    .linked-pipeline-mini-item {
      margin-left: 0;
    }
  }

  .linked-pipeline-mini-item {
    @include mini-pipeline-item();
    display: inline-block;
    transition: margin 0.2s linear;
    margin: 2px 7px 3px -14px;

    svg {
      height: $ci-action-icon-size;
      width: $ci-action-icon-size;
      position: absolute;
      top: -1px;
      left: -1px;
      z-index: 2;
      overflow: visible;
    }

    &:first-of-type:last-of-type {
      margin-right: 1px;
    }

    &:nth-of-type(1) {
      margin-left: 0;
      z-index: 100;
    }

    &:nth-of-type(2):not(.linked-pipelines-counter) {
      z-index: 99;
    }

    &:nth-of-type(3) {
      z-index: 98;
    }

    &:nth-of-type(4) {
      z-index: 97;
    }
  }

  .linked-pipelines-counter {
    position: relative;
    font-size: 12px;
    vertical-align: middle;
    line-height: 20px;
    height: 22px;
    width: 22px;
    padding-left: 1px;
    margin-left: -15px;
    border-radius: 2em;
    background: $gray-darkest;
    color: $white;
    z-index: 96;
    text-decoration: none;

    &:hover {
      width: 22px;
      background: darken($gray-darkest, 10%);
    }
  }
}
