// 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-data-explorer-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  height: 100%;
  padding: 0.5rem;
  color: var(--pf-color-text-muted);
  overflow-y: auto;

  // Center content when small, scroll when large
  &::before {
    content: "";
    flex-grow: 1;
  }

  &::after {
    content: "";
    flex-grow: 1;
  }

  &__icon {
    font-size: 32px;
  }

  &__message {
    text-align: center;
    max-width: 600px;
    font-size: 0.875rem;
  }

  // Style children (spinner, buttons) to be prominent
  .pf-spinner {
    font-size: 32px;
  }

  &.pf-warning {
    color: var(--pf-color-text);

    .pf-data-explorer-empty-state__icon {
      color: var(--pf-color-warning);
    }
  }
}

.pf-query-stats {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--pf-color-text-muted);
}

.pf-query-stats-separator {
  margin: 0 0.25rem;
  color: var(--pf-color-text-disabled);
}

.pf-failing-sql {
  width: 100%;
  max-width: 800px;
  text-align: left;
  margin-top: 0.5rem;

  &__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
  }

  &__label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--pf-color-text-muted);
  }

  &__code {
    background-color: var(--pf-color-surface-1);
    border: 1px solid var(--pf-color-border);
    border-radius: 4px;
    padding: 0.75rem;
    margin: 0;
    font-family: var(--pf-font-family-mono);
    font-size: 0.75rem;
    line-height: 1.4;
    overflow-x: auto;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }
}
