@import '../../../style/theme/default/index';
@import '../../../style/index';
@import '../../input/style/mixin';
@import '../../../style/mixins/iconfont';
@import '../../../style/mixins/index';

@cascader-prefix-cls: ~"@{idoll-prefix}-cascader";

.@{cascader-prefix-cls} {
  .reset-component;

  &-input.@{idoll-prefix}-input {
    background-color: transparent !important;
    cursor: pointer;
    width: 100%;
    position: relative;
  }

  &-input{
    &:hover {
      border-color: @input-hover-border-color !important;
    }
  }

  &-input-autoFocus {
    border-color: @input-hover-border-color !important;
  }

  &-picker-show-search &-input.@{idoll-prefix}-input {
    position: relative;
  }

  &-picker {
    .reset-component;
    position: relative;
    display: inline-block;
    cursor: pointer;
    background-color: @white;
    border-radius: @border-radius-base;
    outline: 0;
    transition: color .3s;
    width: 216px;
    height: 32px;

    &-with-value &-label {
      color: transparent;
    }

    &-disabled {
      cursor: not-allowed;
      background: @input-disabled-bg;
      // color: @disabled-color;
      .@{cascader-prefix-cls}-input {
        cursor: not-allowed;
      }
    }

    &:focus .@{cascader-prefix-cls}-input {
      .active;
    }

    &-show-search&-focused {
      color: @disabled-color;
    }

    &-label {
      position: absolute;
      left: 0;
      height: 20px;
      line-height: 20px;
      top: 50%;
      margin-top: -10px;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      width: 100%;
      padding: 0 @padding-sm;
    }

    &-clear {
      opacity: 0;
      position: absolute;
      right: @padding-sm;
      z-index: 2;
      background: @white;
      top: 50%;
      font-size: @font-size-base;
      color: @disabled-color;
      width: 14px;
      height: 14px;
      margin-top: -6px;
      line-height: 14px;
      cursor: pointer;
      transition: color 0.3s ease, opacity 0.15s ease;
      &:hover {
        color: @text-color-secondary;
      }
    }

    &:hover &-clear {
      opacity: 1;
    }

    // arrow
    &-arrow {
      position: absolute;
      z-index: 1;
      top: 50%;
      right: @padding-sm;
      width: 14px;
      height: 14px;
      font-size: 14px;
      margin-top: -6px;
      line-height: 14px;
      color: @disabled-color;
      transition: transform .2s;
      &&-expand {
        transform: rotate(180deg);
      }
    }
  }

  &-picker-small {
    height: 24px;
  }

  &-picker-large {
    height: 40px;
  }

  &-picker-clear {
    height: 14px;
  }


  &-menus {
    font-size: @font-size-base;
    background: @white;
    position: absolute;
    z-index: 1050;
    border-radius: @border-radius-base;
    box-shadow: @box-shadow-base;
    white-space: nowrap;

    ul,
    ol {
      list-style: none;
      margin: 0;
      padding: 0;
    }

    &-empty,
    &-hidden {
      display: none;
    }
    &.slide-up-enter.slide-up-enter-active&-placement-bottomLeft,
    &.slide-up-appear.slide-up-appear-active&-placement-bottomLeft {
      animation-name: idollSlideUpIn;
    }

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

    &.slide-up-leave.slide-up-leave-active&-placement-bottomLeft {
      animation-name: idollSlideUpOut;
    }

    &.slide-up-leave.slide-up-leave-active&-placement-topLeft {
      animation-name: idollSlideDownOut;
    }
  }
  &-menu {
    display: inline-block;
    vertical-align: top;
    min-width: 128px;
    height: 180px;
    list-style: none;
    margin: 0;
    padding: 0;
    border-right: @border-width-base @border-style-base @background;
    overflow: auto;
    -ms-overflow-style: -ms-autohiding-scrollbar;
    &:first-child {
      border-radius: @border-radius-base 0 0 @border-radius-base;
    }
    &:last-child {
      border-right-color: transparent;
      margin-right: -1px;
      border-radius: 0 @border-radius-base @border-radius-base 0;
    }
    &:only-child {
      border-radius: @border-radius-base;
    }
  }
  &-menu-item {
    padding: 5px @padding-sm;
    line-height: 22px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s;
    &:not(&-disabled):hover {
      background-color: @primary-lightBg;
      color: @select-hover-color;
    }
    &-disabled {
      cursor: not-allowed;
      color: @text-color-disable;
      // &:hover {
      //   color: @disabled-color;
      // }

      .@{idoll-prefix}-icon-right {
        color: @disabled-color;
      }
    }
    &-active:not(&-disabled) {
      &,
      &:hover {
        background-color: @white;
        color: @primary-color ;

      }
    }
    &-expand {
      position: relative;
      padding-right: 24px;
    }

    &-expand &-expand-icon,
    &-expand &-loading-icon {
      .iconfont-size-under-12px(10px);
      font-size: 14px !important;
      color: @text-color-secondary;
      position: absolute;
      right: @padding-sm;
    }

    &-loading-icon {
      .idoll-icon:before {
        animation: loadingCircle 1s infinite linear;
      }
    }

    & &-keyword {
      color: @primary-hover;
    }
  }
}
