// Copyright (C) 2025 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

.pf-query-history {
  &__header {
    position: sticky;
    top: 0;
    display: flex;
    align-content: baseline;
    background-color: var(--pf-color-background-secondary);
    font-size: var(--pf-font-size-l);
    font-weight: 400;
    padding: 4px 10px;
    vertical-align: middle;
    border-bottom: 1px solid var(--pf-color-border);
    z-index: 1;
  }

  &__item {
    border-bottom: 1px solid var(--pf-color-border-secondary);
    padding: 0.25em 0.5em;
    max-height: 150px;
    overflow-y: auto;
    position: relative;

    pre {
      font-size: 10pt;
      margin: 0;
      overflow-x: auto;
      overflow-y: hidden;
      white-space: pre-wrap;
      position: relative;
      cursor: pointer;

      &:hover::after {
        content: "Doubleclick to re-run";
        font-size: var(--pf-font-size-m);
        color: var(--pf-color-text-hint);
        position: absolute;
        top: 0;
        margin: auto;
        right: 0;
      }
    }

    &:hover {
      background-color: color_hover(transparent);
      .pf-query-history__item-buttons {
        visibility: visible;
      }
    }
  }

  &__item-buttons {
    position: sticky;
    top: 0;
    float: right;
    visibility: hidden;
  }
}
