.query-history {
  overflow: auto;

  .list-item {
    border-bottom: $panel-border;
    background-color: $color-bg-theme;
  }

  .entry {
    font-family: $font-family-editor;
    border: $panel-border-width solid transparent;
    margin-left: 1px;
    padding: 0 5px;

    .other-info {
      @extend .text-12;
      color: $text-muted;
      font-family: $font-family-editor;
      display: flex;
      flex-direction: row;
      justify-content: space-between;

      .timestamp {
        align-self: flex-start;
      }
    }

    .query {
      text-overflow: ellipsis;
      overflow: hidden;
      white-space: nowrap;
      user-select: initial;

      .query-history-icon {
        width: 18px;
        text-align: center;
      }
    }
  }

  .date-label {
    font-family: $font-family-editor;
    background: $color-gray-lighter;
    padding: 2px 9px;
    font-size: 11px;
    font-weight: bold;
    color:  $color-gray;
    border-bottom: $panel-border;
  }

  .entry.error {
    background: $sql-history-error-bg;
  }

  .selected {
    & .entry.error {
      background-color: $sql-history-error-bg;
    }

    & .entry {
      color: $sql-history-success-fg;
      border: $table-hover-border;
      background: $sql-history-success-bg;
      font-weight: bold;

      .other-info {
        color: $sql-history-success-fg;
        font-weight: bold;
      }
    }
  }
}

#history-detail-query .CodeMirror {
  border: $panel-border;
  background-color: $sql-history-detail-bg;
  width: 100%;
  padding-left: 5px;
  position: absolute;
}

.header-label {
  @extend .text-12;
  @extend .text-gray;
  display: block;
}


.sql-editor-history-container {
  height: 100%;
  overflow: auto;
  background-color: $negative-bg;
}


.query-detail {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background-color: $color-bg-theme;
  .error-message-block {
    background: $sql-history-error-bg;
    flex: 0.3;
    padding-left: 20px;

    .history-error-text {
      @extend .text-12;
      padding: 7px 0;

      span {
        color:$sql-history-error-fg;
        font-weight: 500;
        margin-right: 8px;
      }
    }
  }

  .info-message-block {
    background: $sql-history-detail-bg;
    flex: 0.3;
    padding-left: 20px;

    .history-info-text {
      @extend .text-12;
      padding: 7px 0;
    }
  }

  .metadata-block {
    flex: 0.4;
    padding: 10px 20px;

    .metadata {
      display: flex;
      flex-wrap: wrap;

      .item {
        flex: 1;
        min-width: 130px;

        .value {
          @extend .text-14;
          display: block;
        }

        .description {
          @extend .header-label;
        }
      }

    }
  }

  .query-statement-block {
    flex: 5;
    margin-left: 10px;
    margin-right: 10px;
    height: 0;
    position: relative;

    .copy-all, .was-copied, .copy-to-editor {
      float: left;
      position: relative;
      z-index: 10;
      border: 1px solid $color-gray-light;
      color: $color-primary;
      font-size: 12px;
      box-shadow: 1px 2px 4px 0px $color-gray-light;
      padding: 3px 12px 3px 10px;
      font-weight: 500;
      min-width: 75px;
    }

    .copy-all {
      background-color: $color-bg;
    }

    .was-copied {
      background-color: $color-primary-light;
      border-color: $color-primary-light;
    }

    .CodeMirror-scroll {
      padding-top: 25px;
    }
  }

  .block-divider {
    margin-top: 11px;
    margin-bottom: 8px;
  }

  .message-block {
    flex: 2;
    display: flex;
    padding: 0 20px;

    .message {
      flex: 2 2 0%;
      flex-direction: column;
      display: flex;

      .message-header {
        @extend .header-label;
        @extend .not-selectable;
        flex: 0 0 auto;
      }

      .content {
        flex: 0 1 auto;
        overflow: auto;
        position: relative;
        height: 100%;

        .content-value {
          @extend .bg-white;
          @extend .text-13;
          font-family: $font-family-editor;
          border: 0;
          padding-left: 0;
          position: absolute;
        }
      }
    }
  }
}

#history_grid {
  .gutter.gutter-horizontal {
    width: $panel-border-width;
    background: $panel-border-color;

    &:hover {
      cursor: ew-resize;
    }
  }

  .toggle-and-history-container {
    display: flex;
    flex-direction: column;
    height: 100%;

    .query-history-toggle {
      padding-top: 4px;
      padding-bottom: 4px;
    }
  }
}
