@import "../../../style/theme/default/index";
@dropdown-prefix-cls: ~"@{idoll-prefix}-dropdown";
@submenu-prefix-cls: ~"@{dropdown-prefix-cls}-menu-submenu";

.@{dropdown-prefix-cls} {
  position: absolute;
  left: 1050;
  top: 1050;
  z-index: 1050;
  display: block;
  font-size: @font-size-sm;
  font-weight: normal;
  line-height: 1.5;

  &-disabled,&-disabled:hover {
    color: @text-color-disable;
    background-color: @disabled;
    cursor: not-allowed;
    pointer-events: none;
    i {
      color: @text-color-disable;
    }
  }
  .idoll-icon,
  .idoll-icon:hover,
  .idoll-icon:focus,
  .idoll-icon:active {
    color: @text-color-secondary;
    text-decoration: none;
  }

  &-normal {
    text-decoration: none;
    color: @text-color;
    i:before {
      margin-left: 4px;
      color: @text-color-disable;
      transition: all 0.3s;
    }
    &-disabled,&-disabled:hover {
      color: @text-color-disable;
      cursor: not-allowed;
      pointer-events: none;
      i {
        color: @text-color-disable;
      }
    }
  }
  &-normal:hover {
    color: @primary-color;
    text-decoration: none;
    i:before {
      margin-left: 4px;
      color: @primary-color;
    }
  }


  &-wrap {
    position: relative;

    .@{idoll-prefix}-btn > .@{iconfont-css-prefix}-down {
      font-size: @font-size-sm - 2px;
    }
  }

  &-wrap-open {
    .@{iconfont-css-prefix}-down:before {
      transform: rotate(180deg);
    }
  }

  &-hidden,
  &-menu-submenu-hidden {
    opacity: 0;
    pointer-events: none;
  }

  &-menu {
    outline: none;
    position: relative;
    list-style-type: none;
    padding: 0;
    margin: 0;
    text-align: left;
    background-color: @dropdown-color;
    border-radius: @border-radius-base;
    box-shadow: @shadow-small;
    background-clip: padding-box;

    &-item-group-title {
      color: @text-color-secondary;
      padding: @dropdown-padding @padding-sm;
      transition: all .3s;
    }

    &-submenu-popup {
      position: absolute;
    }

    &-item,
    &-submenu-title {
      padding: @dropdown-padding @padding-sm + 4px;
      margin: 0;
      clear: both;
      font-size: @font-size-base;
      font-weight: normal;
      color: @text-color;
      white-space: nowrap;
      cursor: pointer;;
      line-height: @dropdown-base-line-height;

      > a {
        color: @text-color;
        display: block;
        padding: @dropdown-padding @padding-sm;
        margin: -@dropdown-padding -@padding-sm;
        &:focus {
          text-decoration: none;
        }
      }

      &-selected {
        color: @text-color;
        background-color: @primary-lightBg;
      }

      &:hover {
        background-color: @primary-lightBg;
        a {
          color: @text-color;
        }
      }

      &-disabled {
        color: @text-color-disable;
        cursor: not-allowed;
        &:hover {
          color: @text-color-disable;
          cursor: not-allowed;
          background-color: @white;
        }
        a,a:hover {
          color: @text-color-disable;
          background-color: @white;
          cursor: not-allowed;
        }
      }

      &:first-child,
      &:first-child > a {
        border-radius: @border-radius-base @border-radius-base 0 0;
      }

      &:last-child,
      &:last-child > a {
        border-radius: 0 0 @border-radius-base @border-radius-base;
      }

      &:only-child,
      &:only-child > a {
        border-radius: @border-radius-base;
      }

      &-divider {
        height: 1px;
        overflow: hidden;
        background-color: @border;
        line-height: 0;
      }

      .@{dropdown-prefix-cls}-menu-submenu-arrow {
        position: absolute;
        right: @padding-xs;
        &:after {
          font-family: "idollicon" !important;
          font-style: normal;
          content: "\E72A";
          color: @text-color-secondary;
          font-size: @font-size-base;
        }
      }
    }

    &-submenu-title {
      padding-right: @padding-lg + 2px;
      &:first-child,
      &:last-child {
        border-radius: 0;
      }
    }

    &-submenu-vertical {
      position: relative;
    }

    &-submenu-vertical > & {
      top: 0;
      left: 100%;
      position: absolute;;
      min-width: 100%;
      margin-left: 8px - 4px;
      transform-origin: 0 0;
    }

    &-submenu&-submenu-disabled .@{dropdown-prefix-cls}-menu-submenu-title {
      &,
      .@{dropdown-prefix-cls}-menu-submenu-arrow:after {
        color: @text-color-disable;
      }
    }

    &-submenu:first-child &-submenu-title {
      border-radius: @border-radius-base @border-radius-base 0 0;
    }

    &-submenu:last-child &-submenu-title {
      border-radius: 0 0 @border-radius-base @border-radius-base;
    }
  }
}

.@{dropdown-prefix-cls}-trigger,
.@{dropdown-prefix-cls}-link {
  .@{iconfont-css-prefix}-down {
    font-size: @font-size-sm - 2px;
  }
}

.@{dropdown-prefix-cls}-button {
  white-space: nowrap;
  &-disabled {
    i:before {
      color:@text-color-disable
    }
  }
  &-disabled:hover {
    i:before {
      color: @text-color-disable;
    }
  }

  &.@{idoll-prefix}-btn-group {
    .@{idoll-prefix}-btn {
      border-radius: @border-radius-base;
    }
  }

  &.@{idoll-prefix}-btn-group > .@{idoll-prefix}-btn:last-child:not(:first-child) {
    padding-left: @padding-xs;
    padding-right: @padding-xs;
  }
  .@{iconfont-css-prefix}-down {
    font-size: @font-size-base;
    color: @text-color-disable;
    transition: all 0.3s;
  }
}

.@{dropdown-prefix-cls}-menu-dark {
  &,
  .@{dropdown-prefix-cls}-menu {
    background: @menu-dark-bg;
  }

  .@{dropdown-prefix-cls}-menu-item,
  .@{dropdown-prefix-cls}-menu-submenu-title,
  .@{dropdown-prefix-cls}-menu-item > a {
    color: @text-color-secondary-dark;
    .@{dropdown-prefix-cls}-menu-submenu-arrow:after {
      color: @text-color-secondary-dark;
    }

    &:hover {
      color: @dropdown-color;
      background: transparent;
    }
  }

  .@{dropdown-prefix-cls}-menu-item-selected {
    &,
    &:hover,
    > a {
      background: @primary-color;
      color: @dropdown-color;
    }
  }
}

.@{idoll-prefix}-btn-group {
  >.@{idoll-prefix}-btn-group {
    float: none
  }
}

.@{idoll-prefix}-icon-a,
.@{idoll-prefix}-icon-a:active,
.@{idoll-prefix}-icon-a:focus {
  text-decoration: none;
  color: @text-color-secondary;
}

@keyframes idollSlideUpIn {
  0% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(.8);
  }
  100% {
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }
}

@keyframes idollSlideUpOut {
  0% {
    opacity: 1;
    transform-origin: 0% 0%;
    transform: scaleY(1);
  }
  100% {
    opacity: 0;
    transform-origin: 0% 0%;
    transform: scaleY(0);
  }
}

















