@import '~scss/variables';
@import '~scss/mixins';

@mixin cluster-base {
  padding: 8px;
  margin-right: 12px;
  color: #fff;
  border-radius: 4px;
}

.wrapper {
  display: flex;
  width: 100%;
}

.cluster,
.clusterLoading {
  width: 326px;
  min-height: 108px;
  @include cluster-base();
  background-image: url('/assets/cluster-card-bg.svg');
}

.scheduleCluster {
  max-width: 298px;
  min-height: 160px;
  padding: 12px;
  flex: 1;
  @include cluster-base();
  background-size: auto 100%;
  background-image: url('/assets/federate-cluster-card-bg.svg');
}

.clusterLoading {
  background-image: url('/assets/cluster-card-loading.svg');
}

.textWrapper {
  position: relative;
  display: flex;
}

.text {
  flex: 1;
  overflow: hidden;

  & > div {
    @include TypographyTitleH6(#fff);
    @include ellipsis;
  }

  & > p {
    @include TypographyParagraph(#fff);
    @include ellipsis;
  }
}

.icon {
  margin-right: 12px;
}

.bottom {
  position: relative;
  display: flex;
  margin-top: 8px;
  padding: 0 4px 4px;
}

.replicas {
  margin-right: 8px;
  @include TypographySymbolText(#fff);

  .readyNum {
    @include TypographyTitleH2(#fff);
    line-height: 40px;
  }
}

.pods {
  display: flex;
  align-items: flex-end;
}

.more {
  transform: rotate(90deg);
}

.control,
.edit {
  position: absolute;
  bottom: 4px;
  right: 6px;

  :global {
    .icon {
      padding: 4px;
      border-radius: $border-radius;
      background-color: $dark-color06;
    }

    .icon.icon-clickable:hover,
    .icon.icon-clickable:active {
      background-color: $dark-color07;
    }

    .icon + .icon {
      margin-left: 4px;
    }
  }
}

.edit {
  bottom: 32px;
}

.indicator {
  position: absolute;
  top: 28px;
  left: 30px;
}

.group {
  position: absolute;
  top: 0;
  right: 0;
}

.titleBox {
  margin-bottom: 12px;
  display: flex;

  .IconBox {
    display: flex;
    align-items: center;
  }

  .right {
    margin-left: 17px;

    span {
      display: block;
      font-family: 'PingFang SC', sans-serif;
      font-style: normal;
      font-weight: normal;
      font-size: 12px;
      line-height: 20px;

      &:nth-of-type(1) {
        font-weight: 600;
        color: $dark-color07;
      }

      &:nth-of-type(2) {
        color: $dark-color01;
      }
    }
  }
}

.totalBox {
  width: 72px;
  height: 160px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 10px 12px;
  background: $dark-color07;
  margin-right: 12px;

  .total {
    font-family: 'PingFang SC', sans-serif;
    font-style: normal;
    font-weight: normal;
    font-size: 12px;
    line-height: 20px;
    color: #fff;
    margin: 4px 0;
    text-align: center;
  }

  .replicasInput {
    input {
      outline: none;
      width: 48px;
      height: 32px;
      padding: 6px 12px;
      background: $dark-color07;
      border: 1px solid $dark-color04;
      box-sizing: border-box;
      border-radius: 4px;
      color: #fff;
    }
  }
}

.weight {
  display: flex;
  flex: 1 0 274px;
  height: 32px;
  margin: 0 auto;
  margin-top: 12px;
  padding: 6px;
  background: $dark-color06;
  border-radius: 16px;

  .value {
    flex: 1;
    text-align: center;
    @include TypographySymbolText($dark-color06);

    .spanText {
      color: $white;
    }

    .subText {
      color: $dark-color01;
    }
  }
}
