/*
 * 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';
@import '../../../blueprint-overrides/common/colors';

.result-table-pane {
  position: relative;

  &.more-results .-totalPages {
    // Hide the total page counter as it can be confusing due to the auto limit
    display: none;
  }

  .dead-end {
    position: absolute;
    left: 50%;
    top: 45%;
    transform: translate(-50%, -50%);
    width: 350px;

    p {
      text-align: center;
    }

    > * {
      margin-bottom: 10px;
    }
  }

  .ReactTable {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 100%;
    font-feature-settings: tnum;
    font-variant-numeric: tabular-nums;

    .rt-thead.-header {
      box-shadow: 0 1px 0 0 rgba(black, 0.2); // This is a hack! this line is sometimes too weak in tables.

      .rt-th {
        &.aggregate-header {
          background: rgba($druid-brand, 0.06);
        }

        .asc {
          box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, 0.6);
        }

        .desc {
          box-shadow: inset 0 -3px 0 0 rgba(255, 255, 255, 0.6);
        }

        .#{$bp-ns}-icon {
          margin-left: 3px;
        }

        .output-name {
          overflow: hidden;
          text-overflow: ellipsis;

          > * {
            display: inline-block;
            vertical-align: top;
          }

          .type-icon {
            margin-top: 3px;
            margin-right: 5px;
          }

          .filter-icon {
            margin-top: 2px;
          }
        }

        .formula {
          font-family: monospace;
          font-size: 11px;
          margin-top: 4px;
          overflow: hidden;
          text-overflow: ellipsis;
        }
      }
    }

    .rt-td {
      cursor: pointer;
    }
  }

  .clickable-cell {
    padding: $table-cell-v-padding $table-cell-h-padding;
    cursor: pointer;
    width: 100%;
  }

  .#{$bp-ns}-popover-target {
    width: 100%;
  }

  .aggregate-column {
    background-color: rgba($druid-brand, 0.06);
  }
}
