@import './theme/default.pcss';
$c-border: $theme-stroke-5;
$c-blue: $theme-primary-1;
$c-light-blue: $theme-primary-4;
$c-blue-hover: $theme-primary-6;

.zent-cascader {
  display: inline-block;

  &.open {
    .zent-cascader__select-text {
      border-color: $c-blue;
      box-shadow: 0 1px 1px $c-light-blue;

      .zenticon {
        transform: rotate(180deg) scale(0.5);
      }
    }
  }

  &__select {
    cursor: pointer;
    display: inline-block;
    font-size: 0;
    position: relative;
    text-align: left;
    user-select: none;
    width: 260px;
    vertical-align: middle;

    &-text {
      box-sizing: border-box;
      border: 1px solid $c-border;
      border-radius: 2px;
      display: inline-block;
      min-height: 30px;
      line-height: 1.5;
      max-height: 76px;
      padding: 5px 30px 5px 10px;
      transition: border-color 0.25s;
      width: 100%;
      background-color: $theme-stroke-10;
      position: relative;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 12px;

      &-content {
        line-height: inherit;
      }

      &.is-placeholder {
        color: $theme-stroke-4;
      }

      .zenticon {
        margin-top: -6px;
        position: absolute;
        right: 10px;
        top: 50%;
        transition: transform 0.25s;
        font-size: 12px;
        transform: scale(0.5);
      }
    }
  }

  &__list {
    font-size: 0;
    padding: 10px 4px;
    min-height: 80px;

    &-item {
      display: inline-block;
      line-height: 30px;
      height: 30px;
      width: 108px;
      box-sizing: border-box;
    }

    &-link {
      cursor: pointer;
      display: inline-block;
      font-size: 12px;
      padding: 0 5px;
      line-height: 18px;
      vertical-align: middle;
      max-width: 98px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;

      &:hover {
        background: $c-blue-hover;
      }

      &.active {
        background: $c-blue;
        border-radius: 2px;
        color: $theme-stroke-10;
      }
    }
  }

  &__tabs {
    .zent-tabs {
      &-nav {
        margin-bottom: 0;
      }

      &-nav-content {
        height: auto;
      }

      &-tab {
        border-radius: 0;
        border-top: none;
        width: 80px;

        &:first-child {
          border-left: none;
          border-top: none;
        }
      }

      &-tab-inner {
        min-width: 80px;
      }
    }
  }

  &__popup {
    z-index: 2000;

    &-inner {
      background: $theme-stroke-10;
      width: 440px;
      box-shadow: 0 1px 4px $theme-mask-2;
      box-sizing: border-box;
      margin-top: 5px;
    }
  }

  &__loading {
    display: inline-block;
    position: relative;
    vertical-align: middle;
    background-color: white;

    &-label {
      line-height: 16px;
      display: inline-block;
      vertical-align: middle;
    }

    &-icon {
      display: inline-block;
      position: relative;
      vertical-align: middle;
      height: 12px;
      width: 12px;
      border-radius: 50%;
      border: 1px solid $c-blue;
      margin-left: 5px;

      &:after {
        content: '';
        display: inline-block;
        position: absolute;
        height: 10px;
        width: 4px;
        background: white;
        animation: 1s linear rotate infinite;
        transform-origin: 8px 3px;
        left: -1px;
        top: 4px;
      }
    }
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
