@import "../../../../styles/variables";

.nodes-list-status-filters {
  display: flex;
  margin: 35px 35px 16px;
  align-items: center;

  ::ng-deep .filter {
    font-size: 14px;
    height: auto;

    &::before {
      display: none;
    }

    &:last-child {
      margin-right: 0;
    }

    .option-content {
      display: flex;
      padding: 0;
      flex-direction: column;
    }

    .filter-total {
      display: flex;
      align-items: center;

      .filter-icon {
        margin: -2px 0.5em 0 0;
      }
    }

    &.selected {
      background: blue;

      .filter-label,
      .filter-total,
      .filter-total chef-icon {
        color: $chef-white;
      }

      &.all  {
        background: $chef-primary-bright;
      }

      &.critical  {
        background: $chef-critical;
      }

      &.skipped  {
        background: $chef-dark-grey;
      }

      &.passed  {
        background: $chef-success;
      }

      &.waived  {
        background: $chef-dark-grey;
      }
    }

    &:not(.selected) {
      &.all .filter-total  {
        color: $chef-primary-bright;
      }

      &.critical .filter-total  {
        color: $chef-critical;
      }

      &.skipped .filter-total  {
        color: $chef-dark-grey;
      }

      &.passed .filter-total  {
        color: $chef-success;
      }

      &.waived .filter-total  {
        color: $chef-dark-grey;
      }
    }
  }
}

.reporting-nodes-table {
  padding: 0 35px;

  chef-th,
  chef-td {

    chef-button {
      white-space: nowrap;
    }

    &:first-child {
      flex-basis: 200%;

      .status-icon {
        margin-right: 1em;
      }
    }

    &:last-child {
      justify-content: flex-end;
    }
  }

  .status-icon,
  .controls-status {
    &.failed {
      color: $chef-critical;
    }

    &.passed {
      color: $chef-success;
    }

    &.skipped {
      color: $chef-dark-grey;
    }
  }
}

.reporting-nodes-paging {
  margin: 0 35px 35px;
}

.reporting-nodes-side-panel {
  display: none;

  &.is-visible {
    display: block;
  }

  chef-button {
    margin: 0;
  }

  chef-icon.failed {
    color: $chef-critical;
  }

  chef-icon.passed {
    color: $chef-success;
  }

  chef-icon.skipped {
    color: $chef-dark-grey;
  }

  .critical {
    color: $chef-critical;
  }

  .major {
    color: $chef-major;
  }

  .minor {
    color: $chef-minor;
  }

  .side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1em;
    background: $chef-white;
    border-bottom: 1px solid $chef-grey;

    .header-icon {
      font-size: 2em;
      color: $chef-dark-grey;
    }

    .header-text {
      margin: 0 1em;
      flex-grow: 1;

      p {
        margin: 0;
        color: $chef-dark-grey;
      }
    }
  }

  .side-panel-body {
    .side-panel-body-header {
      display: flex;
      padding: 1em;
      border-bottom: 1px solid $chef-grey;
      align-items: center;

      chef-button {
        margin: 0 1em 0 0;
      }

      p {
        margin: 0;
      }
    }
  }

  .results-nodes-list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .results-nodes-list-item {
    border-bottom: 1px solid $chef-grey;
    background: $chef-white;
  }

  .list-item-summary {
    display: flex;
    align-items: center;
    padding: 1em;

    .list-item-text {
      margin: 0 1em;
      flex-grow: 1;

      chef-button,
      p {
        margin: 0;
      }

      p {
        line-height: 1.5;
      }
    }
  }

  .list-item-detail {
    border-top: 1px solid $chef-grey;
    border-left: 4px solid $chef-success;
    padding: 1em;

    &.failed {
      border-left-color: $chef-critical;
    }

    &.passed {
      border-left-color: $chef-success;
    }

    &.skipped {
      border-left-color: $chef-dark-grey;
    }

    chef-toggle {
      margin-bottom: 1em;
      font-size: 14px;
    }

    chef-snippet.source {
      border: 1px solid $chef-grey;
      border-radius: $global-radius;
      background: $chef-lightest-grey;

      ::ng-deep pre {
        background: transparent;
      }
    }
  }

  .result-item {
    margin-bottom: 1em;
    border: 1px solid $chef-grey;
    border-radius: $global-radius;

    &:last-child {
      margin-bottom: 0;
    }

    p {
      margin: 0;
    }

    .result-item-header {
      display: flex;
      padding: 1em;
      align-items: center;
      border-radius: $global-radius;

      chef-icon {
        margin-right: 1em;
      }
    }

    .result-item-body {
      background: $chef-lightest-grey;
      border-top: 1px solid $chef-grey;

      p {
        margin: 0;
        padding: 1em;
      }

      chef-snippet {
        background: $chef-lightest-grey;

        ::ng-deep pre {
          background: transparent;
        }
      }
    }
  }
}
