@import "../mixins/mixins";
@import "../common/var";
@import "../common/transition";

@include b(date-editor) {
  position: relative;
  display: inline-block;
  text-align: left;

  @include m(dates) {
    .xb-input__inner {
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  }

  .xb-range__icon {
    font-size: $--font-size-base + 2px;
    margin-right: 4px;
    margin-left: 2px;
    color: $--color-black-25;
    float: left;
    line-height: 32px;
  }

  .xb-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-base;
    color: $--color-text-regular;

    &::placeholder {
      color: $--input-placeholder-color;
    }
  }

  .xb-range-separator {
    display: inline-block;
    height: 100%;
    padding: 0 5px;
    margin: 0;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
    width: 6%;
    color: $--color-text-primary;
  }

  .xb-range__close-icon {
    font-size: 16px;
    color: $--color-black-25;
    width: 25px;
    display: inline-block;
    line-height: 32px;
    margin-right: -5px;
  }
}

@include b(range-editor) {
  width: 260px;
  &.xb-input__inner {
    display: inline-flex;
    align-items: center;
    padding: 1px 0;
  }

  .xb-range-input {
    line-height: 1;
  }

  @include when(active) {
    @include theme-border-color;
  }

  @include m(big) {
    width: 288px;
    &.xb-input__inner {
      height: $--input-big-height;
    }

    .xb-range-separator {
      line-height: 36px;
    }

    .xb-range__icon,
    .xb-range__close-icon {
      line-height: 36px;
    }
  }

  @include m(medium) {
    width: 260px;
    &.xb-input__inner {
      height: $--input-medium-height;
    }

    .xb-range-separator {
      line-height: 32px;
    }

    .xb-range__icon,
    .xb-range__close-icon {
      line-height: 32px;
    }
  }

  @include m(small) {
    width: 230px;
    &.xb-input__inner {
      height: $--input-small-height;
    }

    .xb-range-separator {
      line-height: 28px;
    }

    .xb-range__icon,
    .xb-range__close-icon {
      line-height: 28px;
    }
  }

  @include when(disabled) {
    background-color: $--color-text-disabled;
    border-color: $--input-disabled-border;
    color: $--color-text-auxiliary;
    cursor: not-allowed;

    &:hover, &:focus {
      border-color: $--input-disabled-border;
    }

    input {
      background-color: $--color-text-disabled;
      color: $--color-text-auxiliary;
      cursor: not-allowed;
      &::placeholder {
        color: $--input-placeholder-color;
      }
    }

    .xb-range-separator {
      color: $--color-text-auxiliary;
    }
  }
}
