$tooltip-background-color: #151515;

.co-resource-item.co-resource-item--monitoring-alert {
  margin: 0 5px;
}

.graph-empty-state {
  min-height: 310px;
}

.monitoring-dashboards__card {
  height: calc(100% - 20px);
  margin: 0 0 20px 0;

  .co-dashboard-card__body--dashboard-graph {
    padding: 10px;
  }

  &.co-dashboard-card--gradient {
    .pf-c-card__body {
      max-height: 350px;
      overflow: scroll;
    }
    &:after {
      width: calc(100% - 10px);
    }
  }

  .graph-wrapper--query-browser {
    min-height: 305px; // Allow for chart legend
  }

  // Move tooltip above cursor to work around bug where the legend is visible through the tooltip
  .query-browser__tooltip-arrow {
    border-bottom: none;
    border-top: 12px solid $tooltip-background-color;
  }
  .query-browser__tooltip-svg-wrap {
    transform: translate(0, -500px);
  }
  .query-browser__tooltip-wrap {
    flex-direction: column-reverse;
  }

  .query-browser__wrapper {
    border: 0;
    margin: 0;
    padding: 0;
  }
}

.monitoring-dashboards__card-header {
  flex: 0 0 auto;
}

.monitoring-dashboards__dropdown-button {
  max-width: 280px !important; // allow truncation
  min-width: 100px;
  @media (min-width: $screen-sm-min) {
    max-width: 100% !important;
  }
}

.monitoring-dashboards__dropdown-title {
  text-transform: capitalize;
}

.monitoring-dashboards__dropdown-wrap {
  display: flex;
  flex-direction: column;
  margin-right: 20px;
}

.monitoring-dashboards__label-column-header {
  // Set a min-width to avoid aggressive wrapping, which makes the table much taller.
  min-width: 175px;
  @media (min-width: $screen-lg-min) {
    min-width: 225px;
  }
}

.monitoring-dashboards__legend-wrap {
  height: 75px;
  overflow-x: auto;
  padding-top: 1px;
  svg {
    max-height: 50px; // Required for Chrome. legend-wrap - scrollbar height
  }
}

.monitoring-dashboards__header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

.monitoring-dashboards__options {
  display: flex;
  float: right;
  margin-right: -20px;
  margin-top: -20px;
}

.monitoring-dashboards__panel {
  padding: 0 10px;
}

.monitoring-dashboards__panel--max-1 {
  width: 100%;
}

$screen-phone-landscape-min-width: 567px;

@media (max-width: $screen-phone-landscape-min-width) {
  .monitoring-dashboards__panel--max-2,
  .monitoring-dashboards__panel--max-3,
  .monitoring-dashboards__panel--max-4 {
    min-width: 100%;
  }
}

@media (min-width: $screen-phone-landscape-min-width) and (max-width: $screen-md-max) {
  .monitoring-dashboards__panel--max-2 {
    width: 100%;
  }
  .monitoring-dashboards__panel--max-3,
  .monitoring-dashboards__panel--max-4 {
    flex: 1 0 50%;
    min-width: 50%;
  }
}

@media (min-width: $screen-lg-min) {
  .monitoring-dashboards__panel--max-2 {
    flex: 1 0 50%;
    min-width: 50%;
  }
  .monitoring-dashboards__panel--max-3 {
    flex: 1 0 33%;
    min-width: 33%;
  }
  .monitoring-dashboards__panel--max-4 {
    flex: 0 0 25%;
    min-width: 25%;
  }
}

.monitoring-dashboards__row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.monitoring-dashboards__single-stat {
  font-size: var(--pf-global--FontSize--3xl);
  padding-bottom: 0;
}

.monitoring-dashboards__table {
  table-layout: auto;
  width: auto;
}

.monitoring-dashboards__table-container {
  overflow-x: auto;
}

.monitoring-dashboards__variables {
  display: flex;
  flex-wrap: wrap;
}

.monitoring-icon-wrap {
  margin-right: 10px;
}

.query-browser__toggle-graph {
  margin-bottom: 5px;
  float: right;
}

.graph-wrapper__horizontal-bar {
  padding-right: 10px;
}

.graph-wrapper--query-browser {
  padding-left: 50px;
  padding-right: 10px;
}

.query-browser__clear-icon {
  font-size: 18px !important;
  padding: 4px !important;
  position: absolute !important;
  right: 0;
  top: 0;
  width: 30px;
}

.query-browser__dropdown--subtitle {
  padding: 1px 10px;
}

.query-browser__expand-button {
  border: none;
  height: 30px;
  padding: 0 14px !important; // align with series buttons
}

.query-browser__expand-icon {
  font-size: 30px;
  vertical-align: middle;
}

.query-browser__controls {
  display: flex;
  flex-wrap: wrap-reverse;
  justify-content: space-between;
  margin-bottom: 15px;
  width: 100%;
}

.query-browser__controls--left {
  display: flex;
}

.query-browser__controls--right {
  display: flex;
  margin-left: auto;
}

.query-browser__inline-control {
  margin-left: 10px;
  margin-right: 10px;
}

.query-browser__loading {
  margin: auto 0;
  min-width: 20px;
}

.query-browser__metrics-dropdown-menu {
  max-height: 25vh;
  overflow: auto;
  width: 100%;

  &--insert {
    @media (min-width: $screen-sm-min) {
      max-width: 55vw;
    }
    max-width: 85vw;
    width: 550px;
  }
}

.query-browser__pagination {
  margin-top: 15px;
  ul {
    list-style: none;
  }
}

.query-browser__query {
  line-height: 1;
  margin: 0 15px 0 0;
  width: 100%;
}

.query-browser__query-controls {
  align-items: center;
  border: solid $color-grey-background-border;
  border-width: 1px 0;
  display: flex;
  padding: 10px 0;
}

.query-browser__query-input {
  padding-right: 28px !important;
  resize: vertical;
}

.query-browser__series-btn-wrap {
  border: 1px solid transparent;
  border-radius: var(--pf-global--BorderRadius--sm);
  display: flex;
  height: 26px;
  padding: 2px;
  width: 26px;
  &:hover {
    background-color: var(--pf-global--active-color--200);
    border-color: var(--pf-global--active-color--100);
  }
}

.query-browser__series-btn {
  border: 1px solid transparent;
  border-radius: var(--pf-global--BorderRadius--sm);
  height: 20px;
  padding: 0 !important;
  width: 20px;
  &--disabled {
    border: 1px solid #888 !important;
  }
}

.query-browser__span-dropdown-menu {
  right: 0;
  width: 130px;
}

.query-browser__span-text {
  max-width: 87px;
}

.query-browser__table {
  border-left: 3px solid transparent;
  margin-bottom: 25px;

  &--expanded {
    border-left-color: var(--pf-global--active-color--100);
  }

  tr > :first-child {
    width: 40px;
  }
}

.query-browser__table-cell {
  @include co-break-word;
  padding-right: 0 !important;
}

.query-browser__table-message {
  border-bottom: solid 1px $color-grey-background-border;
  padding: 10px 20px;
}

.query-browser__tech-preview {
  margin: 0 10px;
}

.query-browser__tooltip-wrap {
  align-items: center;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.query-browser__tooltip {
  background-color: $tooltip-background-color;
  color: #eee;
  font-size: 12px;
  overflow-y: auto;
  padding: 15px;
  width: 100%;
}

.query-browser__tooltip-arrow {
  border-bottom: 12px solid $tooltip-background-color;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  height: 0;
  width: 0;
}

.query-browser__tooltip-group {
  align-items: stretch;
  display: flex;
  margin-bottom: 15px;
}

.query-browser__tooltip-label-key {
  font-weight: var(--pf-global--FontWeight--bold);
  text-transform: uppercase;
}

.query-browser__tooltip-time,
.query-browser__tooltip-value {
  margin-left: auto;
  padding-left: 15px;
}

.query-browser__tooltip-value {
  font-weight: var(--pf-global--FontWeight--bold);
}

.query-browser__wrapper {
  border: 1px solid $color-grey-background-border;
  margin: 0 0 20px 0;
  overflow: visible;
  padding: 10px;
  width: 100%;

  &--hidden {
    border-bottom: none;
    border-top: none;
    height: 0;
    margin: 0;
    padding-bottom: 0;
    padding-top: 0;
  }
}

.query-browser__zoom {
  cursor: ew-resize;
  position: relative;
}

.query-browser__zoom-overlay {
  background-color: rgba(0, 0, 0, 0.2);
  bottom: 0;
  position: absolute;
  top: 0;
  z-index: $zindex-modal;
}

.query-browser__graph-container {
  z-index: 1;
}

.co-alert-manager-config__edit-alert-routing-btn {
  margin-bottom: 10px;
}

.co-alert-manager-config__save-as-default-label {
  padding-left: 4px;
  padding-right: 4px;
}

.co-routing-label-editor__error-message {
  margin-top: -15px;
}
