@import '../../button/style/mixin';

.@{yee-calendar-prefix-cls}-picker-container {
  .yee-reset-component;

  position: absolute;
  z-index: @yee-zindex-picker;
  font-family: @yee-font-family;

  &.slide-up-enter.slide-up-enter-active&-placement-topLeft,
  &.slide-up-enter.slide-up-enter-active&-placement-topRight,
  &.slide-up-appear.slide-up-appear-active&-placement-topLeft,
  &.slide-up-appear.slide-up-appear-active&-placement-topRight {
    animation-name: antSlideDownIn;
  }

  &.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
  &.slide-up-enter.slide-up-enter-active&-placement-bottomRight,
  &.slide-up-appear.slide-up-appear-active&-placement-bottomLeft,
  &.slide-up-appear.slide-up-appear-active&-placement-bottomRight {
    animation-name: antSlideUpIn;
  }

  &.slide-up-leave.slide-up-leave-active&-placement-topLeft,
  &.slide-up-leave.slide-up-leave-active&-placement-topRight {
    animation-name: antSlideDownOut;
  }

  &.slide-up-leave.slide-up-leave-active&-placement-bottomLeft,
  &.slide-up-leave.slide-up-leave-active&-placement-bottomRight {
    animation-name: antSlideUpOut;
  }
}

.@{yee-calendar-prefix-cls}-picker {
  .yee-reset-component;

  position: relative;
  display: inline-block;
  outline: none;
  cursor: text;
  transition: opacity 0.3s;

  &-input {
    outline: none;

    &.@{yee-prefix}-input {
      line-height: @yee-line-height-base;
    }
  }

  &-input.@{yee-prefix}-input-sm {
    padding-top: 0;
    padding-bottom: 0;
  }

  &:hover &-input:not(.@{yee-prefix}-input-disabled) {
    border-color: @yee-input-hover-border-color;
  }

  &:focus &-input:not(.@{yee-prefix}-input-disabled) {
    .yee-active();
  }

  &-clear,
  &-icon {
    position: absolute;
    top: 50%;
    right: @yee-control-padding-horizontal;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    font-size: @yee-font-size-sm;
    line-height: 14px;
    transition: all 0.3s;
    user-select: none;
  }

  &-clear {
    z-index: 2;
    color: @yee-disabled-color;
    font-size: @yee-font-size-base;
    background: @yee-input-bg;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    &:hover {
      color: @yee-text-color-secondary;
    }
  }

  &:hover &-clear {
    opacity: 1;
    pointer-events: auto;
  }

  &-icon {
    display: inline-block;
    color: @yee-disabled-color;
    font-size: @yee-font-size-base;
    line-height: 1;
  }

  .@{yee-prefix}-input-disabled + &-icon {
    cursor: not-allowed;
  }

  &-small &-clear,
  &-small &-icon {
    right: @yee-control-padding-horizontal-sm;
  }
}
