@import '../../style/themes/index';
@import './token.less';

@datePicker-prefix-cls: ~'@{kd-prefix}-date-picker';

.input-wrapper() {
  display: inline-flex;
  border: 1px solid @date-input-color-border;
  border-radius: @date-input-border-radius;
  box-sizing: border-box;
  background-color: @date-input-color-background;
  &-borderless {
    border: 0;
  }
  &-underline {
    border: none;
    border-bottom: 1px solid @date-input-underline-color;
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }
  &-disabled {
    background-color: @date-input-color-background-disabled !important;
    border-color: @date-input-color-border !important;
    color: @date-input-color-disabled !important;
    cursor: not-allowed !important;
    input {
      cursor: not-allowed !important;
    }
  }
  &-underline&-disabled,
  &-borderless&-disabled {
    background-color: @date-input-color-background;
    border-color: @date-input-color-border;
  }

  &-focused {
    box-shadow: none;
    outline: none;
    border-color: @date-color-background-checked;
  }

  &:hover {
    border-color: @date-color-background-checked;
  }

  &:not(&-disabled) input:focus {
    color: @date-input-color-focus;
  }
}

.input() {
  width: 100%;
  min-width: 0;
  color: @date-input-color;
  &::-webkit-input-placeholder {
    color: @date-input-color-placeholder;
  }
  &::-moz-input-placeholder {
    color: @date-input-color-placeholder;
  }
  &::-ms-input-placeholder {
    color: @date-input-color-placeholder;
  }
  &:focus {
    box-shadow: none;
    outline: none;
    border-color: @date-color-background-checked;
  }
}

.input-size(@height, @fonSize, @padding-vertical, @padding-horizontal) {
  height: @height;
  line-height: calc(@height - (@padding-vertical * 2) - 2);
  font-size: @fonSize;
  padding: @padding-vertical @padding-horizontal;

  &.@{datePicker-prefix-cls}-underline {
    padding: @padding-vertical 0;
  }
}

.today-after(@background) {
  position: relative;
  &::after {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 6px;
    background: @background;
    content: '';
    bottom: 0;
    left: calc(50% - 3px);
  }
}
