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

.execution-stages-pane {
  .rt-td {
    cursor: default;
  }

  .graph-cell {
    position: relative;

    & > svg {
      position: absolute;
      width: 100%;
      height: 100%;

      line {
        stroke: $light-gray5;
      }

      circle {
        fill: $light-gray5;
      }
    }
  }

  .stage {
    color: #8dd3c7;
  }

  .datasource {
    color: #ffffb3;
  }

  .external {
    color: #80b1d3;
  }

  .broadcast-tag {
    margin-left: 3px;
    margin-right: 1px;
    opacity: 0.6;
  }

  .detail-line {
    font-style: italic;
    opacity: 0.6;
  }

  .error-warning {
    position: absolute;
    top: 7px;
    right: 3px;
  }

  .counter-spacer {
    position: relative;
    height: 5px;

    &:after {
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
      content: '';
      border-top: 1px solid white;
      opacity: 0.2;
    }

    &.extend-right:after {
      right: -5px;
    }

    &.extend-left:after {
      left: -5px;
    }
  }

  .data-transfer {
    .counter-type-label {
      display: inline-block;
      width: 125px;
      text-align: right;
      padding-right: 15px;
    }
  }

  .execution-stage-detail-pane {
    padding: 0 10px 10px 0;
    background: $dark-gray2;
    min-height: 100px;
    position: relative;

    &:empty:after {
      position: absolute;
      top: 45%;
      left: 50%;
      transform: translate(-50%, -50%);
      content: 'Detailed counters are not available';
    }

    .detail-counters-for-partitions,
    .detail-counters-for-workers,
    .detail-counters-for-sort {
      display: inline-block;
      margin-left: 10px;
      margin-top: 10px;
      vertical-align: top;
      background: $dark-gray3;
    }

    .detail-counters-for-sort {
      .count {
        font-style: italic;
        opacity: 0.8;
      }
    }
  }

  .cpu-label {
    display: inline-block;
    width: 140px;
  }

  .cpu-counter {
    display: inline-block;
    width: 80px;
  }

  .timing-value {
    position: relative;
    height: 100%;
    padding: 10px 5px;
    margin-right: 1px; // This is to allow to show a 1px wide .timing-bar bar right at "left: 99.9%"

    .timing-bar {
      position: absolute;
      top: 1px;
      height: 3px;
      border-radius: 2px;
      background: $druid-brand;
      opacity: 0.8;
    }
  }
}
