@use 'sass:map';

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

@include b(picker) {
  @include e(popper) {
    @include picker-popper(
      getCssVar('color-white'),
      1px solid getCssVar('color-neutral-2'),
      getCssVar('box-shadow', 'lv2')
    );
  }
}

@include b(date-editor) {
  .#{$namespace}-input__wrapper {
    .#{$namespace}-input__inner {
      padding-right: 0;
    }
  }

  @include m((daterange, timerange, monthrange, datetimerange)) {
    padding: 8px;
  }

  @include m(timerange) {
    min-width: 280px;
  }

  .#{$namespace}-range__icon {
    height: inherit;
    font-size: 16px;
    color: getCssVar('color-neutral-9');

    svg {
      vertical-align: middle;
    }
  }

  .#{$namespace}-range-input {
    appearance: none;
    border: none;
    outline: none;
    height: 20px;
    width: 100%;
    margin: 0;
    padding: 0;
    text-align: center;
    font-size: 16px;
    line-height: 20px;
    color: getCssVar('color-neutral-9');
    background-color: transparent;

    &::placeholder {
      color: getCssVar('color-neutral-7');
    }
  }

  .#{$namespace}-range-separator {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    padding: 0 8px;
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    word-break: keep-all;
    color: getCssVar('color-neutral-7');
  }

  .#{$namespace}-range__close-icon {
    font-size: 16px;
    color: getCssVar('color-neutral-9');
    height: inherit;
    width: unset;
    cursor: pointer;

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

    svg {
      vertical-align: middle;
    }

    &--hidden {
      opacity: 0;
      visibility: hidden;
    }
  }
}

@include b(range-editor) {
  &:hover {
    .#{$namespace}-range__close-icon,
    .#{$namespace}-range__icon {
      color: getCssVar('color-primary-3');
    }
  }

  @include when(active) {
    border-color: getCssVar('color-primary-3');
    background-color: getCssVar('color-white');
    box-shadow: getCssVar('box-shadow-lv1');
    cursor: pointer;
  }
}
