@import "../mixins/mixins";
@import "../common/var";
@import "../common/transition";

.#{$namespace}-picker_popper {
  @include picker-popper($color-white, 1px solid $datepicker-border-color,$datepicker-shadow);
}


@include b(date-editor) {
  position: relative;
  display: inline-block;
  text-align: left;

  & .#{$namespace}-input_inner {
    color: $text-color-placeholder !important;
  }

  &.#{$namespace}-input,
  &.#{$namespace}-input_inner {
    width: 220px;
  }

  @include mf((monthrange)) {
    &.#{$namespace}-input,
    &.#{$namespace}-input_inner {
      width: 300px;
    }
  }

  @include mf((daterange, timerange)) {
    &.#{$namespace}-input,
    &.#{$namespace}-input_inner {
      width: 350px;
    }
  }

  @include mf(datetimerange) {
    &.#{$namespace}-input,
    &.#{$namespace}-input_inner {

      width: 400px;
    }
  }

  @include mf(dates) {
    .#{$namespace}-input_inner {
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .#{$namespace}-icon-error {
    cursor: pointer;
  }

  .#{$namespace}-range_icon {
    font-size: 14px;
    margin-left: -5px;
    color: $text-color-placeholder;
    float: left;
    line-height: 32px;
    width: 25px;
    text-align: center;
    cursor: default;
  }

  .#{$namespace}-range-input {
    appearance: none;
    border: none;
    outline: none;
    display: inline-block;
    height: 100%;
    margin: 0;
    padding: 0;
    width: 39%;
    text-align: center;
    font-size: $font-size-default;
    color: $text-color-placeholder;

    &::placeholder {
      color: $text-color-placeholder;
    }
  }

  .#{$namespace}-range-separator {
    display: inline-block;
    height: 100%;
    padding: 0 5px;
    margin: 0;
    text-align: center;
    line-height: 32px;
    font-size: 14px;
    width: 5%;
    color: $text-color-default;
  }

  .#{$namespace}-range_close-icon {
    font-size: 14px;
    color: $text-color-placeholder;
    display: inline-block;
    float: right;
    line-height: 32px;
    text-align: center;
    width: 25px;
  }
}

@include b(range-editor) {
  &.#{$namespace}-input_inner {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: $input-border;
    border-radius: $input-border-radius;
    transition: $border-color-transition;
    height: 32px;
    line-height: 32px;
    outline: none;

    &:hover {
      border-color: $datepicker-border-color-hover;
    }
  }

  .#{$namespace}-range-input {
    line-height: 1;
  }

  @include pf(active) {
    border-color: $datepicker-border-color-active;
    &:hover {
      border-color: $datepicker-border-color-active;
    }
  }

  @include mf(medium) {
    line-height: $input-medium-height;

    &.#{$namespace}-input_inner {
      height: $input-medium-height;
    }

    .#{$namespace}-range-separator {
      line-height: 28px;
      font-size: $input-medium-font-size;
    }

    .#{$namespace}-range-input {
      font-size: $input-medium-font-size;
    }

    .#{$namespace}-range_icon,
    .#{$namespace}-range_close-icon {
      line-height: 28px;
    }
  }

  @include mf(small) {
    line-height: $input-small-height;

    &.#{$namespace}-input_inner {
      height: $input-small-height;
    }

    .#{$namespace}-range-separator {
      line-height: 24px;
      font-size: $input-small-font-size;
    }

    .#{$namespace}-range-input {
      font-size: $input-small-font-size;
    }

    .#{$namespace}-range_icon,
    .#{$namespace}-range_close-icon {
      line-height: 24px;
    }
  }

  @include mf(mini) {
    line-height: $input-mini-height;

    &.#{$namespace}-input_inner {
      height: $input-mini-height;
    }

    .#{$namespace}-range-separator {
      line-height: 20px;
      font-size: $input-mini-font-size;
    }

    .#{$namespace}-range-input {
      font-size: $input-mini-font-size;
    }

    .#{$namespace}-range_icon,
    .#{$namespace}-range_close-icon {
      line-height: 20px;
    }
  }

  @include pf(disabled) {
    background-color: $input-disabled-bg-color;
    border-color: $input-disabled-border;
    color: $input-disabled-color;
    cursor: not-allowed;

    &:hover, &:focus {
      border-color: $input-disabled-border;
    }
    input {
      background-color: $input-disabled-bg-color;
      color: $input-disabled-color;
      cursor: not-allowed;

      &::placeholder {
        color: $input-disabled-placeholder-color;
      }
    }
    .#{$namespace}-range-separator {
      color: $input-disabled-color;
    }
  }
}


