@import '../style/theme/color';
@import '../style/core/_font';
@import '../style/core/animation';
@import '../style/theme/corner';

.devui-dropdown-menu {
  padding-bottom: 0;
}

.devui-dropdown-item {
  height: 32px;
  padding: 8px 12px;
}

.devui-dropdown-open {
  input {
    border: 1px solid $devui-brand;

    &::-webkit-input-placeholder {
      color: $devui-text;
    }
  }

  .devui-drop-icon {
    svg {
      transform: rotate(180deg);
    }
  }

  .devui-tags-input-wrapper {
    border-color: $devui-brand;
    border-radius: $devui-border-radius;
  }
}

.devui-input {
  padding-right: 36px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}

:host ::ng-deep .devui-tag-item.tag-disabled {
  cursor: not-allowed;
  background-color: $devui-disabled-bg;
  color: $devui-disabled-text;
}

.devui-search-cascader {
  cursor: text;
}

.devui-cascader-list {
  border-left: 1px solid $devui-dividing-line;
  height: 180px;
  overflow-y: auto;
  overflow-y: overlay;
  display: inline-block;
  font-size: $devui-font-size;

  &:first-of-type {
    border-left: none;
  }

  &-item {
    height: 32px;
    padding: 8px 12px;
    cursor: pointer;
    display: block;

    &:hover {
      background-color: $devui-list-item-hover-bg;
      color: $devui-link;
    }
  }

  .active-li {
    background-color: $devui-list-item-hover-bg;
    color: $devui-link;
  }
}

::ng-deep {
  .devui-dropdown-top .devui-cascader-list {
    border-top-color: $devui-brand !important;
    border-bottom-color: $devui-dividing-line !important;
    box-shadow: unset;
  }
}

.devui-drop-no-data {
  height: auto;
  display: block;
}

.devui-drop-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  line-height: 16px;
  vertical-align: middle;

  svg path {
    fill: $devui-text;
  }

  &-animation svg {
    transition: transform $devui-animation-duration-slow $devui-animation-ease-in-out-smooth;
  }
}

.devui-cascader-close-icon {
  display: none;
  font-size: $devui-font-size-icon;
  cursor: pointer;
  width: 12px;
  height: 12px;
  line-height: 12px;
  background-color: $devui-line;
  border-radius: 50%;
  text-align: center;

  svg path {
    fill: $devui-light-text;
  }
}

.dropdown-show-clear {
  &:hover {
    .devui-drop-icon {
      display: none;
    }

    .devui-cascader-close-icon {
      display: block;
    }
  }
}

.devui-single-drop-icon-wrapper {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 12px;
  width: 16px;
  display: flex;

  .devui-cascader-close-icon {
    position: relative;
    left: 2px;
  }
}

:host:not(.devui-glow-style) .devui-tags-input-wrapper:hover {
  border-color: $devui-aide-text;
}

.devui-tags-input-wrapper {
  border: 1px solid $devui-line;
  display: inline-flex;
  width: 100%;
  border-radius: $devui-border-radius;

  .devui-tags-input {
    flex: 1;
    min-height: 26px;
    max-height: 56px;
    overflow: auto;
    padding: 1px 0 1px 4px;

    d-tag {
      margin-right: 4px;
      margin-bottom: 2px;
      margin-top: 2px;
    }
  }

  .devui-drop-icon-wrapper {
    flex: 0 0 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .inner-input {
    max-width: 150px;
    height: 21px;
    border: none;
    outline: 0;
    background: $devui-base-bg;
    color: $devui-text;
    padding: 0 8px;
  }
}

.devui-dropdown-placeholder {
  line-height: 22px;
  margin-left: 8px;
  color: $devui-placeholder;
}

.devui-drop-menu-wrapper {
  white-space: nowrap;
  font-size: 0;
}

:host ::ng-deep {
  .devui-max-width-tag {
    height: 16px;
  }
}
