/*
 * 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';

$filter-bar-height: 34px;
$control-bar-height: 34px;
$control-pane-width: 240px;
$small-border: 1px;

.module-pane {
  position: relative;
  @include card-like;
  overflow: hidden;

  .filter-pane {
    position: absolute;
    top: 0;
    left: 0;
    right: 90px;
    height: $filter-bar-height;
    border-bottom: $small-border solid $dark-gray2;
    padding: 2px 0;
  }

  .module-control-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: $control-bar-height;
    border-bottom: $small-border solid $dark-gray2;
    padding: 2px;
    display: flex;
  }

  .control-pane-container {
    position: absolute;
    top: $control-bar-height + 1;
    bottom: 0;
    width: $control-pane-width;
    right: 0;
    border-left: $small-border solid $dark-gray2;
    padding: 8px;
    overflow: auto;
  }

  &.show-controls .module-inner-container {
    right: $control-pane-width + $small-border;
  }

  &.show-filter {
    .module-control-bar {
      top: $filter-bar-height + $small-border;
    }

    .module-inner-container {
      top: $filter-bar-height + $small-border + $control-bar-height + $small-border;
    }
  }

  .corner-buttons {
    position: absolute;
    top: 2px;
    right: 2px;
  }

  .module-inner-container {
    position: absolute;
    top: $control-bar-height + $small-border;
    bottom: 0;
    left: 0;
    right: 0;

    & > .module {
      width: 100%;
      height: 100%;
      position: relative;

      & > .echart-container {
        position: absolute;
        width: 100%;
        height: 100%;
      }

      & > .issue {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
      }

      .loader {
        position: absolute;
        top: 0;
        left: 0;
      }
    }
  }
}
