.rpmlint-result {
  font-size: .95em;
  max-height: 35rem;
}

.rpm-lint-content .rpmlint-result {
  @extend .rpmlint-result;
  max-height: none;
}

#buildresult-box {
  .nav-link {
    .fa-sync-alt { @extend .invisible; }

    &.active {
      .fa-sync-alt { @extend .visible; }
    }
  }
}

.buildresult_repo_header {
  background-color: var(--bs-secondary-bg);
}

.custom-label {
  cursor: pointer;
  color: $link-color;
}

.build-results {
  a[data-bs-toggle="collapse"] { width: 1.875rem; }
}

.build-results .sticky-top, #log-space-wrapper #log-info.position-sticky {
  top: $top-navigation-height;
}

.rpm-lint-content .sticky-top {
  top: $top-navigation-height;
  z-index: 900;
}

.toggle-build-info { cursor: pointer; }
.toggle-build-info-parent { z-index: 2; }

.build-info {
  @extend .d-flex;
  @extend .flex-column;
  position: relative;
  background-color: var(--bs-secondary-bg);
  max-height: 100vh;
  width: 100%;
  font-size: 90%;
  transition: max-height .3s 0s ease-in-out, margin-bottom .1s .1s linear;

  .triangle {
    position: absolute;
    width: 0;
    height: 0;
    top: -.5rem;
    border-left: .5rem solid transparent;
    border-right: .5rem solid transparent;
    border-bottom: .5rem solid #eeeeee;
    transition: top .3s .1s ease-in-out, opacity 0.1s .2s ease-in-out;

    &.center { margin: 0 0 0 calc(38% + .5rem); }
    &.left { left: .5rem; }
  }

  .build-info-content {
    @extend .px-3;
    padding-top: 0.4rem !important;
    padding-bottom: 0.4rem !important;
    overflow-y: hidden;
  }

  &.collapsed {
    max-height: 0;
    @extend .mb-0;

    .triangle {
      top: 0;
      opacity: 0;
    }
  }

  &.hover {
    max-height: 100vh;
    @extend .mb-2;

    .triangle {
      top: -.5rem;
      opacity: 1;
    }
  }
}

// Build state

.build-state {
  @extend .ps-1;
  @extend .ps-sm-2;
  flex-basis: 62%;
}

.build-state-succeeded {
  @extend .text-success;
}

.build-state-building {
  @extend .text-bg-secondary;
  @extend .px-1;
}

.build-state-scheduled {
  @extend .text-bg-info;
  @extend .px-1;
}

.build-state-dispatching {
  @extend .text-bg-info;
  @extend .px-1;
}

.build-state-signing, .build-state-finished {
  @extend .text-bg-warning;
  @extend .px-1;
}

.build-state-unresolvable, .build-state-broken, .build-state-failed {
  @extend .text-danger;
}

.build-state-disabled {
  color: $gray-600;
}

.build-state-excluded {
  color: $gray-600;
}

.build-state-blocked {
  @extend .text-white;
  @extend .px-1;
  background-color: $gray-600;
}

.build-state-locked {
  @extend .text-bg-warning;
  @extend .px-1;
}

.build-state-scheduled-warning {
  @extend .text-white;
  @extend .px-1;
  background-color: $orange;
}

.build-state-unknown {
  color: $orange;
}

// Repository state

.repository-state {
  @extend .ps-1;
  @extend .ps-sm-3;
  @extend .text-nowrap;
  flex-basis: 38%;
}

.repository-state-default {
  @extend .text-black-50;
}

.repository-state-outdated {
  @extend .text-custom-gray-400;
}

.repository-state-broken {
  @extend .text-danger;
}

.repository-state-building, .repository-state-finished, .repository-state-publishing {
  color: $gray-600;
}

.repository-state-published {
  @extend .text-success;
}

#build-results-monitor {
  .accordion-button:not(.collapsed) {
    --bs-accordion-active-bg: var(--bs-secondary-bg);
  }

  .accordion-button:hover {
    box-shadow: 0px 0px 5px $custom-gray-400;
  }
}

@include media-breakpoint-up(md) {
  .build-info .triangle.left { left: .25rem; }
}

@include media-breakpoint-between(sm, lg) {
  .build-info .triangle {
    &.center { margin-left: calc(38% + .75rem); }
    &.left { left: .5rem; }
  }
}

.build-result-header {
  top: 50px;
  background-color: var(--bs-body-bg);
}

.build-result-table {
  .build-result-legend {
    display: none;
  }

  .build-result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.25rem 1rem;
    flex-wrap: wrap;
  }

  .build-result-architectures {
    display: flex;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: end;
  }

  .build-result-architectures .badge {
    margin-left: 0.25rem;
  }

  .build-result-row:not(:last-of-type) {
    border-bottom: var(--bs-border-width) solid var(--bs-border-color);
  }

  @include media-breakpoint-up(xl) {
    display: grid;
    grid-template-columns: 1fr repeat(20, auto);

    .build-result-architectures, .build-result-row, .build-result-legend {
      display: contents;
    }

    .build-result-name {
      grid-column-start: 1;
      padding: 0.25rem 1rem;
      top: 100px;
      background-color: var(--bs-body-bg);
    }

    .build-result-architecture {
      padding: 0.25rem;
      text-align: end;
      .architecture { display: none }
      &:last-of-type { padding-right: 1rem }
      top: 100px;
      background-color: var(--bs-body-bg);
    }

    .build-result-row:not(:last-of-type) {
      .build-result-name {
        border-bottom: var(--bs-border-width) solid var(--bs-border-color);
        top: 100px;
      }

      .build-result-architecture {
        border-bottom: var(--bs-border-width) solid var(--bs-border-color);
        top: 100px;
      }
    }
  }
}

.build-results-content {
  .dropdown-menu.limit-height {
    max-height: 50vh;
    overflow-y: auto;
  }
}
