.fa { &:not(.fa-spin) { animation: none; } }

.reporter {
  min-height: 0; // needed for firefox or else scrolling gets funky

  .container {
    box-shadow: 0 1px 2px #aaa;
    flex-grow: 2;
    overflow-y: auto;
  }

  .wrap {
    box-shadow: 0 1px 2px #aaa;
    margin-bottom: 40px;
    padding-left: 0;
    width: 100%;
  }

  .runnables {
    padding-left: 0;
  }

  .no-tests {
    background-color: #f5f5f5;
    min-height: 20px;
    padding: 24px;

    h2 {
      color: #e94f5f;
      font-size: 1.3em;
      font-weight: 500;
      line-height: 1.4;
      margin-bottom: 0.6em;
    }

    h3 {
      color: #3386d4;
      font-size: 1.2em;
      font-weight: 500;
      line-height: 1.4;
      margin-top: 1.2em;
      margin-bottom: 0.3em;
    }

    p {
      font-size: 1.1em;

      &.text-muted {
        color: #b4b5bc;
      }
    }

    a {
      color: #3386d4;
      cursor: pointer;
    }

    i {
      margin-right: 5px;
    }

    hr {
      margin-top: 1.6em;
      margin-bottom: 1.6em;
      border: none;
      height: 1px;
      color: #dadade;
      background-color: #dadade;
    }

    .open-studio,
    .open-studio-desc {
      display: none;
    }
  }

  &.experimental-studio-enabled .no-tests .open-studio,
  &.experimental-studio-enabled .no-tests .open-studio-desc {
    display: inline;
  }

  .runnable {
    width: 100%;
    color: #6c6c6c;
    background-color: #fff;
    overflow: auto;
    line-height: 18px;
    padding-left: 0;

    .runnable-wrapper {
      border-left: 5px solid transparent;
      padding: 0;

      .collapsible-header {
        &:focus {
          .collapsible-header-inner {
            background-color: #f7f8f9;
            cursor: pointer;
          }
        }

        .collapsible-header-inner {
          &:hover {
            background-color: #f7f8f9;
            cursor: pointer;
          }

          &:focus {
            outline: 0;
          }

          height: 100%;
          padding: 5px 15px 5px 5px;
          width: 100%;
        }
      }

      &:hover {
        .runnable-controls-studio {
          opacity: 0.5;

          &:hover {
            opacity: 1;
          }
        }
      }
    }

    .attempt-item:hover {
      > .runnable-wrapper .runnable-controls i.fa-redo {
        visibility: visible !important;
      }

      .hooks-container, .runnable-err-wrapper {
        border-color: #828282;
      }
    }

    &.runnable-active {
      .runnable-state {
        @include runnable-state-active;
      }
    }

    .runnable-state,.attempt-state {
      display: inline-block;
      line-height: 18px;
      margin-right: 5px;
      min-width: 12px;
      height: 18px;
      text-align: center;
      font-size: 11px;
    }

    &.suite .collapsible-indicator  {
      padding-left: 2px;
      font-size: 14px;
      color: #bbbcbd;
    }


    &.test.runnable-processing  {
      .runnable-state {
        @include runnable-state-processing;
      }
    }

    &.runnable-failed > div > .runnable-wrapper,
    &.runnable-failed > div > .runnable-instruments {
      border-left: 5px solid $fail;

      .fa-exclamation-triangle.has-command-failures {
        visibility: visible;
      }
    }

    &.runnable-pending > div > .runnable-wrapper,
    &.runnable-pending > div > .runnable-instruments {
      border-left: 5px solid lighten($pending, 25%);
      padding-bottom: 0;
    }

    &.runnable-passed > div > .runnable-wrapper,
    &.runnable-passed > div > .runnable-instruments {
      border-left: 5px solid $pass;
    }

    .runnable-retried > div > .runnable-wrapper,
    .runnable-retried > div > .runnable-instruments {
      border-left: 5px solid $retried;
    }

    &.runnable-studio.runnable-passed > div > .runnable-wrapper,
    &.runnable-studio.runnable-passed > div > .runnable-instruments {
      border-left: 5px solid #3386d4;
    }

    &.runnable-skipped > .runnable-wrapper {
      .runnable-state {
        @include runnable-state-skipped;
      }

      .runnable-title {
        color: #aaa;
      }
    }

    &.runnable-skipped > div > .runnable-wrapper,
    &.runnable-skipped > div > .runnable-instruments {
      border-left: 5px solid #9a9aaa;
    }

    &.test.runnable-failed {
      .runnable-state {
        @include runnable-state-failed;
      }
    }

    &.suite > div > .runnable-wrapper {
      .runnable-title {
        color: #111;
        font-weight: 800;
        font-size: 13px;
      }
    }

    &.test.runnable-passed {
      .runnable-state {
        @include runnable-state-passed;
      }
    }

    &.test.runnable-passed.runnable-studio {
      .runnable-state {
        @include studio-state-passed;
      }

      .studio-controls {
        display: flex;

        .studio-save {
          display: block;
        }
      }
    }

    &.test.runnable-pending {
      .runnable-state {
        @include runnable-state-pending;
      }
      .runnable-title {
        color: lighten($pending, 25%);
      }

      .runnable-commands-region {
        display: none;
      }

      .studio-controls {
        display: flex;
      }
    }

    &.test.runnable-failed {
      .studio-controls {
        display: flex;
      }
    }
  }

  .runnable-instruments {
    border-left: 5px solid transparent;
    padding-bottom: 5px;
  }

  .runnable-title {
    font-size: 12.5px;
    min-width: $reporter-contents-min-width;
    white-space: pre-line;

    &:focus {
      outline: 1px dotted #6c6c6c;
    }
  }

  .runnable-wrapper > .collapsible-header {
    overflow: auto;
    position: relative;
    display: inline-flex;
    width: 100%;

    &:focus {
      outline: 1px dotted #6c6c6c;
      outline-offset: 3px;
    }
  }

  .suite > div .runnable-wrapper,
  .test .runnable-wrapper > .collapsible-header {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
  }

  .runnable-controls {
    float: right;

    label {
      padding: 2px 4px;
    }

    .runnable-controls-status {
      margin: 0 2px;
      color: #999;
      visibility: hidden;
      font-size: 15px;
    }

    .runnable-controls-studio {
      color: #3386d4;
      opacity: 0;
      display: none;
    }
  }

  .test.runnable-failed .runnable-controls .runnable-controls-status {
    visibility: visible;
  }

  &.experimental-studio-enabled .runnable-controls .runnable-controls-studio {
    display: inline;
  }

  &.studio-active .runnable-controls .runnable-controls-studio {
    display: none;
  }

  .test .collapsible {
    display: flex;
    flex-direction: column;

    .runnable-wrapper .collapsible-header-inner {
      width: 100%;

      .collapsible-header-text {
        display: flex;

        .runnable-title {
          flex-grow: 1;
          padding-right: 10px;
        }
      }
    }
  }

  .collapsible-header {
    display: flex;
  }

  .test > .collapsible > .runnable-wrapper > .collapsible-header > .collapsible-header-inner > .collapsible-indicator {
    display: none;
  }

  .runnable-header {
    background: #f2f2f2;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.25);
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 24px;
    overflow-wrap: break-word;
    padding: 5px 10px;
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1;

    span > span > a:before,
    span > span > span:before {
      @extend .#{$fa-css-prefix};
      @extend .#{$fa-css-prefix}-file;
      color: #bdbdbd;
      display: inline;
      margin-right: 5px;
    }
  }

  .studio-controls {
    display: none;
    margin: 10px 20px 10px 0;

    button {
      border-radius: 5px;
      font-family: $muli;
      font-size: 12px;
      padding: 6px 20px;

      &:focus {
        outline: none;
      }

      &:active {
        box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
      }
    }

    .studio-cancel {
      background-color: #e8e8ec;
      color: #777;

      &:hover {
        background-color: darken(#e8e8ec, 5%);
      }
    }

    .studio-save {
      background-color: #3386d4;
      color: #fff;
      display: none;
      margin-left: auto;

      &:hover {
        background-color: darken(#3386d4, 10%);
      }

      &[disabled],
      &[disabled]:hover,
      &[disabled]:active {
        background-color: #3386d4;
        opacity: 0.5;
      }
    }
  }

  .runnable-loading {
    .runnable-loading-animation {
      display: flex;
      margin: 3.5rem auto 1.5rem;
      padding: 0 5px;
      width: 160px;

      div {
        animation: scaling 1.65s ease-in-out infinite;
        border-radius: 50%;
        height: 40px;
        margin: 0 -5px;
        transform: scale(0.5);
        width: 40px;
      }

      div:nth-child(1) {
        animation-delay:0.1s;
        background: #56b790;
      }

      div:nth-child(2) {
        animation-delay:0.2s;
        background: #4a88cc;
      }

      div:nth-child(3) {
        animation-delay:0.3s;
        background: #b96162;
      }

      div:nth-child(4) {
        animation-delay:0.4s;
        background: #e3b065;
      }

      div:nth-child(5) {
        animation-delay:0.5s;
        background: #a9abad;
      }

      @keyframes scaling {
        0%, 20%, 80%, 100% {
          opacity: 100%;
          transform: scale(0.5);
        }

        50% {
          opacity: 50%;
          transform: scale(1);
        }
      }
    }

    .runnable-loading-title {
      font-family: $muli;
      font-size: 20px;
      text-align: center;
    }
  }
}

.reporter.multiSpecs {
  overflow-y: auto;

  .container {
    flex-grow: 0;
    overflow-y: unset;

    .wrap {
      margin-bottom: 0;
    }
  }
}
