@use '../mixins/mixins' as *;
@use '../common/var' as *;

@include b(time-spinner) {
  display: flex;

  &.has-seconds {
    .#{$namespace}-time-spinner__wrapper {
      width: 33.3%;
    }
  }

  @include e(wrapper) {
    max-height: 160px;
    overflow: auto;
    display: flex;
    justify-content: center;
    width: 50%;
    vertical-align: top;
    position: relative;

    &.#{$namespace}-scrollbar__wrap:not(.#{$namespace}-scrollbar__wrap--hidden-default) {
      padding-bottom: 12px;
    }

    @include when(arrow) {
      box-sizing: border-box;
      text-align: center;
      overflow: hidden;

      .#{$namespace}-time-spinner__list {
        transform: translateY(-32px);
      }

      .#{$namespace}-time-spinner__item:hover:not(.is-disabled):not(.is-active) {
        color: getCssVar('color-neutral-9');
        background-color: transparent;
        cursor: default;
      }
    }
  }

  @include e(arrow) {
    font-size: 12px;
    color: getCssVar('color-neutral-9');
    position: absolute;
    left: 0;
    width: 100%;
    z-index: getCssVar('index-normal');
    text-align: center;
    height: 24px;
    line-height: 24px;
    cursor: pointer;

    &:hover {
      color: getCssVar('color-primary-3');
    }

    &.action-up {
      top: 8px;
    }

    &.action-down {
      bottom: 8px;
    }
  }

  @include e(input) {
    &.#{$namespace}-input {
      width: 70%;

      .#{$namespace}-input__inner {
        padding: 0;
        text-align: center;
      }
    }
  }

  @include e(list) {
    padding: 0;
    margin: 0;
    list-style: none;
    text-align: center;

    &::after,
    &::before {
      content: '';
      display: block;
      width: 100%;
      height: 64px;
    }
  }

  @include e(item) {
    height: 32px;
    width: 32px;
    line-height: 32px;
    font-size: 12px;
    color: getCssVar('color-neutral-9');
    border-radius: getCssVar('border-radius-sm');

    &:hover:not(.is-disabled):not(.is-active) {
      color: getCssVar('color-primary-3');
      background: getCssVar('color-primary-1');
      cursor: pointer;
    }

    &.is-active:not(.is-disabled) {
      font-weight: 600;
    }

    &.is-disabled {
      color: getCssVar('color-neutral-5');
      cursor: not-allowed;
    }
  }
}
