.panel-problems {
  height: 100%;

  .fa-icon-container {
    padding-right: 0.4rem;
    color: $gray-2;
    i {
      width: 1rem;
    }

    &.fired {
      color: $problem-statusbar-fired;
      text-shadow: 0px 0px 10px rgba($problem-statusbar-fired, 0.5);
    }
  }

  // <ReactTable /> styles
  .ReactTable {
    height: 100%;
    display: flex;
    flex-direction: column;

    .rt-table {
      height: 100%;
    }

    .rt-thead {
      &.-header {
        height: 2.4em;
      }

      .rt-th {
        &.-sort-desc {
          box-shadow: inset 0 -3px 0 0 $blue;
        }
        &.-sort-asc {
          box-shadow: inset 0 3px 0 0 $blue;
        }
      }
    }

    .rt-tr-group {
      flex: 0 0 auto;
      border-bottom: solid 1px $problems-border-color;
      // border-left: solid 2px transparent;

      &:last-child {
        border-bottom: solid 1px $problems-border-color;
      }

      &:hover {

        .rt-tr {
          background: $problems-table-row-hovered;
          z-index: 1;
        }

        .rt-tr.-even {
          background: $problems-table-row-hovered;
        }
      }

      .rt-tr {
        .rt-td {
          border: 0;
          transition: 0s;
        }

        &.-even {
          background: $problems-table-stripe;
        }
      }
    }

    .rt-noData {
      z-index: 2;
      background: unset;
      color: $text-muted;
    }

    .pagination-bottom {
      margin-top: auto;
      flex: 1 0 auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      $footer-height: 30px;
      padding-top: 4px;
      margin-left: -10px;
      margin-right: -10px;
      box-shadow: 0px -2px 5px $problems-footer-shadow;
      z-index: 1;

      .-pagination {
        margin-top: auto;
        align-items: center;
        padding: 0px;

        .-previous {
          flex: 1;
          height: $footer-height;
        }

        .-center {
          flex: 3;
          width: 32rem;

          .-pageJump {
            margin: 0px 0.4rem;
            input {
              height: $footer-height;
            }
          }

          .select-wrap.-pageSizeOptions select {
            width: 8rem;
            height: $footer-height;
          }
        }

        .-next {
          flex: 1;
          height: $footer-height;
        }
      }
    }

    .problem-severity {

      &.rt-td {
        padding: 0px;
      }

      .severity-cell {
        width: 100%;
        height: 100%;
        padding: 0.45em 0 0.45em 1.1em;
        color: $white;
        font-weight: 500;
      }
    }

    .problem-status--new {
      animation: blink-opacity 2s ease-in-out infinite;
    }

    .rt-tr .rt-td {
      &.custom-expander {
        text-align: center;
        padding: 0.6em 0 0 0;
        i {
          color: #676767;
          font-size: 1.2rem;
        }
        & .expanded {
          i {
            color: $problem-expander-expanded-color;
          }
        }
      }

      &.custom-expander:hover {
        background-color: $problem-expander-highlighted-background;
        i {
          color: $problem-expander-highlighted-color;
        }
      }

      &.last-change {
        text-align: left;
      }

      &.problem-status-icon {
        padding: 0;
        margin-top: 0;
        font-size: 1.5em;

        i {
          width: 100%;
          padding-left: 0.6em;
          text-align: center;

          &.zbx-problem {
            color: $problem-icon-problem-color;
          }
          &.zbx-ok {
            color: $problem-icon-ok-color;
          }
        }
      }
    }

    .comments-icon {
      float: right;
      padding-right: 0.6rem;
      i {
        color: $gray-2;
      }
    }

    .problem-tags {
      &.rt-td {
        padding-left: 0.6rem;
      }
      .label-tag, .zbx-tag {
        cursor: pointer;
        margin-right: 0.6rem;

        &.highlighted {
          box-shadow: 0 0 10px $orange;
        }
      }
    }

    .problem-details-container {
      display: flex;
      padding-top: 4px;
      background-color: $problem-details-background;
      border-bottom-width: 0px;

      max-height: 0px;
      opacity: 0;
      overflow: hidden;
      transition-duration: 0.3s;
      transition-timing-function: ease-out;
      transition-property: opacity, max-height;

      &.show {
        max-height: 20rem;
        opacity: 1;
        box-shadow: inset -3px 3px 10px $problem-container-shadow;
      }

      .problem-details-row {
        display: flex;
        margin-bottom: 0.6rem;
        min-height: 3rem;

        .problem-value-container {
          display: flex;
          flex-direction: column;
          flex: 1 1 auto;
        }
      }

      .problem-details {
        position: relative;
        flex: 10 1 auto;
        padding: 0.5rem 1rem 0.5rem 1.2rem;
        display: flex;
        flex-direction: column;
      }

      .description-label {
        font-weight: 500;
        font-style: italic;
        color: $text-muted;
      }

      .problem-age {
        font-weight: 500;
      }

      .problem-tags {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
        margin-top: auto;
      }

      .problem-item {
        .problem-item-name {
          color: $text-muted;
        }

        .problem-item-value {
          font-weight: 500;
        }
      }


      .problem-statusbar {
        margin-bottom: 0.6rem;
        display: flex;
        flex-direction: row;

        &.compact .problem-statusbar-item {
          width: 2.5rem;
          padding: 0.4rem 0.4rem 0.4rem 0.8rem;
        }

        .problem-statusbar-item {
          width: 3rem;
          height: 2rem;
          padding: 0.4rem 0.4rem 0.4rem 1rem;
          background: $problem-statusbar-background;
          margin-right: 2px;
          border-radius: 2px;

          &:hover {
            background: darken($problem-statusbar-background, 2%);
          }

          &.muted {
            .fa-icon-container {
              color: $problem-statusbar-muted;
            }
          }
          &.fired {
            box-shadow: $problem-statusbar-glow;
            .fa-icon-container {
              color: $problem-statusbar-fired;
              text-shadow: 0px 0px 10px rgba($problem-statusbar-fired, 0.5);
            }
          }
        }
      }

      .problem-actions {
        margin-left: 1.6rem;
      }

      .problem-action-button {
        &.btn {
          width: 3rem;
          height: 2rem;

          background-image: none;
          background-color: $action-button-color;
          border: 1px solid darken($action-button-color, 6%);
          border-radius: 1px;

          span {
            color: $action-button-text-color;
          }

          &:hover {
            background-color: darken($action-button-color, 4%);
          }
        }
      }

      .problem-explore-button {
        &.btn {
          width: 6rem;
          height: 2rem;

          background-image: none;
          background-color: $action-button-color;
          border: 1px solid darken($action-button-color, 6%);
          border-radius: 1px;

          margin-right: 1.6rem;

          span {
            color: $action-button-text-color;
          }

          i {
            vertical-align: middle;
          }

          &:hover {
            background-color: darken($action-button-color, 4%);
          }
        }
      }

      .problem-details-middle {
        flex: 1 0 auto;
        overflow: auto;

        .problem-ack-container {
          margin: 0.5rem 0.4rem;
          padding: 0.6rem 0.6rem;
        }
      }

      .problem-ack-container {
        margin-top: 0.6rem;
        margin-left: -0.6rem;
        padding: 1.2rem 0.6rem;
        overflow: auto;
        box-shadow: $porblem-ack-shadow;
      }

      .problem-ack-list {
        display: flex;
        overflow: auto;

        .problem-ack-col {
          display: flex;
          flex-direction: column;
          padding-right: 0.8rem;
        }

        .problem-ack-time,
        .problem-ack-user {
          color: $text-muted;
        }
      }


      .problem-details-right {
        flex: 0 0 auto;
        padding: 0.5rem 2rem;
        color: $text-muted;

        &.compact {
          padding: 0.5rem 1rem;
        }

        .problem-details-right-item {
          margin-bottom: 0.2rem;

          &:hover {
            color: $text-color-emphasis;

            .fa-icon-container {
              color: $text-color-emphasis;
            }
          }
        }
      }

      .problem-maintenance {
        .fa-icon-container {
          color: $orange;
        }
      }

      .problem-multi-event-type {
        i {
          color: $orange;
          text-shadow: 0px 0px 10px $orange;
          animation: blink-shadow 2s ease-out infinite;
        }
      }

      .event-timeline {
        position: relative;
        margin: 0.2rem 0;
        padding-top: 2.6rem;

        .timeline-info-container {
          position: absolute;
          top: 0;
          left: 0;
          transition: all 0.2s ease-out;

          .event-timestamp {
            font-weight: 500;

            .event-timestamp-label {
              color: $text-muted;
            }

            .event-timestamp-value {
              float: right;
            }
          }
        }

        .problem-event-region {

          &.problem-event {
            &--ok {
              fill: $problem-event-ok-color;
            }
            &--problem {
              fill: $problem-event-problem-color;
            }
          }

          &:hover,
          &.highlighted {
            stroke: $problem-event-highlighted;
            filter: url(#glowShadow);
          }
        }

        .problem-event-item {
          circle {
            transition: all 0.2s ease-out;
          }

          &.problem-event {
            &--ok .point-border {
              fill: $problem-event-ok-color;
            }
            &--problem .point-border {
              fill: $problem-event-problem-color;
            }
          }

          .point-core {
            fill: $problem-event-core;
          }

          &:hover,
          &.highlighted {
            circle.point-border {
              stroke: $problem-event-highlighted;
              stroke-width: 1;
              filter: url(#glowShadow);
            }
            .point-core {
              fill: $problem-event-core-highlighted;
            }
          }
        }

        .problem-event-ack {
          circle {
            transition: all 0.2s ease-out;
          }

          .point-border {
            fill: $blue;
          }

          .point-core {
            fill: $problem-event-core;
          }

          &:hover,
          &.highlighted {
            circle.point-border {
              stroke: $problem-event-highlighted;
              stroke-width: 1;
              filter: url(#glowShadow);
            }
            .point-core {
              fill: $problem-event-core-highlighted;
            }
          }
        }
      }
    }
  }

  @for $i from 8 through 9 {
    .item-#{$i} { width: 2em * $i; }
    &.font-size--#{$i * 10} .rt-table {
      font-size: 1% * $i * 10;

      & .rt-tr .rt-td.custom-expander i {
        font-size: 1.2rem * $i / 10;
      }

      .problem-details-container.show {
        font-size: 13px;
      }
    }
  }

  @for $i from 11 through 25 {
    .item-#{$i} { width: 2em * $i; }
    &.font-size--#{$i * 10} {
      .rt-table {
        font-size: 1% * $i * 10;

        & .rt-tr .rt-td.custom-expander i {
          font-size: 1.2rem * $i / 10;
        }

        .problem-details-container.show {
          font-size: 13px;
        }
      }

      .rt-noData {
        top: 4.5em;
        font-size: 1% * $i * 10;
      }
    }
  }
}

.zbx-ack-modal {
  .gf-form-input.zbx-ack-error {
    border-color: $btn-danger-bg;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 5px $btn-danger-bg;
  }

  .gf-form .gf-form-hint {
    .gf-form-hint-text {
      display: inherit;
      float: right;

      &.ack-error-message {
        float: left;
        color: $error-text-color;
      }
    }
  }
}

.panel-options-button {
  text-align: left;
}

@keyframes blink-opacity {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes fade-in {
  0% {
    color: $dark-3;
    text-shadow: unset;
  }
  100% {
    color: $orange;
    text-shadow: 0px 0px 10px rgba($orange, 0.5);
  }
}

@keyframes blink-shadow {
  0% {
    opacity: 1;
    text-shadow: 0px 0px 3px $orange;
  }
  50% {
    opacity: 0.3;
    text-shadow: 0px 0px 10px $orange;
  }
  100% {
    opacity: 1;
    text-shadow: 0px 0px 2px $orange;
  }
}
