/**
 *
 * @ai-apps/angular v2.152.0 | _gauge-card.scss
 *
 * Copyright 2014, 2023 IBM
 *
 * 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.
 */


@import '../../globals/vars';

.#{$iot-prefix}--gauge-container {
  display: flex;
  flex-wrap: wrap;
  font-size: carbon--type-scale(1);
  flex-direction: row;
  align-items: center;
  row-gap: var(--gauge-row-gap);
  column-gap: $spacing-05;
}

.#{$iot-prefix}--gauge {
  fill: none;
  font-size: inherit;
  height: var(--gauge-size);
  min-width: var(--gauge-size);
  stroke-width: 8px;
  width: var(--gauge-size);

  text {
    fill: $text-02;
  }
}

.#{$iot-prefix}--gauge-bg {
  stroke: var(--gauge-bg);
  stroke-width: 0.25rem;
}

.#{$iot-prefix}--gauge-fg {
  paint-order: stroke;
  stroke: var(--gauge-colors);
  stroke-dasharray: 0 var(--stroke-dash-array);
  transform: rotate(-90deg);
  transform-origin: center;
  transition: all $duration--moderate-01 ease-in;

  .#{$iot-prefix}--gauge__loaded & {
    stroke-dasharray: var(--stroke-dash) var(--stroke-dash-array);
  }
}

.#{$iot-prefix}--gauge-value-sm {
  tspan:first-of-type {
    font-size: 1rem;
  }
}

.#{$iot-prefix}--gauge-value-md {
  tspan:first-of-type {
    font-size: 1.25rem;
  }
}

.#{$iot-prefix}--gauge-value-lg {
  tspan:first-of-type {
    font-size: 1.5rem;
  }
}

.#{$iot-prefix}--meter__centered::after {
  display: none;
}

.#{$iot-prefix}--gauge-trend {
  padding-left: $spacing-05;
  display: flex;
  align-items: center;

  & p::before {
    border-left: 0.3rem solid transparent;
    border-right: 0.3rem solid transparent;
    content: '';
    left: -$spacing-04;
    height: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
  }

  &__up {
    color: $support-02;

    & p::before {
      border-bottom: 0.3rem solid;
    }
  }
  &__down {
    color: $support-01;

    & p::before {
      border-top: 0.3rem solid;
    }
  }

  p {
    // --gauge-trend-color: blue;
    color: var(--gauge-trend-color);
    font-size: 0.875rem;
    position: relative;
  }
}
