/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you 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.
 */

@import '../../../variables';

$vertical-gap: 6px;
$visible-splitter-size: 3px;

.query-tab {
  position: relative;

  .#{$bp-ns}-dark & {
    background: $dark-gray2;
  }

  .splitter-layout.splitter-layout-vertical {
    height: 100%;

    & > .layout-splitter {
      height: 3px + $vertical-gap * 2;
      position: relative;

      &::after {
        content: '';
        background-color: $gray1;
        position: absolute;
        top: $vertical-gap;
        width: 100%;
        height: $visible-splitter-size;
        border-radius: 2px;
      }

      &:hover::after {
        background-color: $gray2;
      }
    }
  }

  .top-section {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;

    .query-section {
      position: absolute;
      width: 100%;
      top: 0;
      bottom: 30px + $vertical-gap;
      @include card-like;
      overflow: hidden;

      .flexible-query-input {
        height: 100%;
      }

      .corner {
        position: absolute;
        top: 0;
        right: 0;
        @include card-background;
        z-index: 1;
        padding: 3px;
      }
    }

    .run-bar {
      position: absolute;
      width: 100%;
      bottom: 0;
      display: flex;
      gap: 10px;
      align-items: center;

      .execution-timer-panel,
      .execution-summary-panel {
        margin-left: auto;
      }
    }
  }

  .output-section {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    @include card-like;

    > * {
      position: absolute;
      width: 100%;
      height: 100%;
    }

    .init-placeholder {
      text-align: center;

      p {
        position: relative;
        top: 38%;
        font-size: 15px;
      }
    }

    .error-container {
      position: relative;

      .execution-error-pane {
        position: absolute;
        top: 5px;
        left: 5px;
        right: 5px;
        height: 150px;
        width: auto;
      }

      .execution-stages-pane {
        position: absolute;
        top: 160px;
        bottom: 0;
        left: 0;
        right: 0;
      }
    }

    .generic-status-container {
      position: relative;

      .generic-status-container-info {
        position: absolute;
        top: 5px;
        left: 5px;
        right: 5px;
        height: 30px;
      }

      .execution-stages-pane {
        position: absolute;
        top: 40px;
        bottom: 0;
        left: 0;
        right: 0;
      }
    }
  }
}
