/**
 *
 * @ai-apps/angular v2.152.0 | _time-picker-spinner.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}--time-picker__wrapper {
  position: relative;

  &.#{$iot-prefix}--time-picker__wrapper--with-spinner {
    .bx--time-picker__input-field {
      width: 5.875rem;
      padding-right: $spacing-07;
    }
  }

  &.#{$iot-prefix}--time-picker__wrapper--updown {
    .bx--time-picker__input-field {
      caret-color: transparent;
    }
  }

  &.#{$iot-prefix}--time-picker__wrapper--show-underline {
    .bx--time-picker--invalid .bx--time-picker__input:before {
      bottom: 1.6rem;
    }
    .bx--time-picker__input:before {
      content: '__';
      position: absolute;
      bottom: 0.365rem;
      left: 1rem;
    }

    &.#{$iot-prefix}--time-picker__wrapper--show-underline-minutes {
      .bx--time-picker__input:before {
        left: 2.7rem;
      }
    }
  }

  .bx--time-picker--invalid {
    .#{$iot-prefix}--time-picker__controls {
      bottom: calc(#{$spacing-06} - #{$spacing-01});
    }
  }

  .#{$iot-prefix}--time-picker__controls {
    position: absolute;
    left: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    bottom: 2px;

    .#{$iot-prefix}--time-picker__controls--btn {
      border: none;
      display: inline-flex;
      justify-content: center;
      align-items: center;
      padding: 0;
      width: 1.7rem;
      height: rem(18px);

      svg {
        fill: currentColor;
        position: relative;
      }

      &.up-icon svg {
        top: rem(4px);
      }

      &.down-icon svg {
        top: rem(-4px);
      }

      &:focus {
        @include focus-outline;
        outline-width: 2px;
        outline-offset: -2px;
      }

      &:hover {
        cursor: pointer;
        color: $icon-01;
      }

      &:disabled {
        cursor: not-allowed;
        color: $disabled;
      }
    }
  }
}

html[dir='rtl'] {
  .#{$iot-prefix}--time-picker__wrapper {
    &.#{$iot-prefix}--time-picker__wrapper--show-underline {
      .bx--time-picker__input:before {
        left: unset;
        right: 3.7rem;
      }
      &.#{$iot-prefix}--time-picker__wrapper--show-underline-minutes {
        .bx--time-picker__input:before {
          left: unset;
          right: 2rem;
        }
      }
    }

    .#{$iot-prefix}--time-picker__controls {
      left: unset;
      right: 2px;
    }
  }
}
