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

.main {
  .header {
    display: flex;
    padding: 12px;
    background-color: $th-bg-color;

    .search {
      width: 100%;
    }

    .actions {
      flex: 1 0 auto;

      :global {
        button {
          margin-left: 12px;

          &:hover {
            background-color: $bg-color;
          }
        }
      }
    }
  }

  .body {
    min-height: 80px;
    padding: 12px;
    background-color: $th-bg-color;
  }

  .footer {
    padding: 10px 12px;
    background-color: $th-bg-color;

    :global .level-left {
      @include TypographyParagraph($dark-color01);
    }
  }
}

.item {
  position: relative;
  height: 64px;
  margin-bottom: 8px;

  &:last-child {
    margin-bottom: 0;
  }
}

.expanded {
  .arrow {
    :global(.icon) {
      transform-origin: center center;
      transform: rotate(180deg);
    }
  }

  .itemMain {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0 -4px;
    padding: 12px 16px;
    background-color: $dark-color07;
    border-color: $dark-color07;

    .content .text {
      div,
      a,
      p {
        color: $white;
      }

      a:hover {
        color: $primary;
      }
    }

    .content .monitors {
      color: $white;
    }
  }

  .itemExtra {
    display: block;
    transform: translate3d(0, 100%, 0);
  }
}

.itemMain {
  display: flex;
  padding: 12px;
  height: 64px;
  line-height: 20px;
  background-color: $white;
  border: 1px solid $border-color;
  border-radius: 4px;
  cursor: pointer;
  transition: all $trans-speed;

  .icon {
    position: relative;
    margin-right: 12px;

    .indicator {
      position: absolute;
      right: 2px;
      bottom: 2px;
      width: 8px;
      height: 8px;
    }

    .statusTip {
      strong {
        color: $white;
      }
    }
  }

  .content {
    display: table;
    table-layout: fixed;
    width: calc(100% - 52px);
    line-height: 20px;

    strong {
      font-size: $size-normal;
      font-weight: 600;
      color: $text-color;
      @include break-all;
    }

    :global(.spin-nested-loading) {
      position: relative;
    }

    p {
      color: $light-color08;
    }

    strong {
      font-family: $font-family-id;
    }

    .arrow {
      display: table-cell;
      vertical-align: middle;
      text-align: right;
      width: 5%;

      :global(.icon) {
        transition: all $trans-speed;
      }
    }

    .monitors {
      .charts {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 -10px;

        & > div {
          margin: 0 10px;
        }
      }
    }

    .podip {
      display: inline-block;
      width: 20px;
      height: 20px;
      border-radius: 4px;
      background: $green-color03;
      margin-left: 8px;
      line-height: 20px;
      text-align: center;
      font-weight: 600;
      color: white;
    }

    .text {
      display: table-cell;
      vertical-align: middle;
      width: 16%;
      padding-right: 20px;

      &:first-of-type {
        width: 28%;
      }

      & > div {
        @include ellipsis;
        @include TypographyTitleH6($dark-color07);
      }

      & > p {
        @include ellipsis;
        @include TypographyParagraph($dark-color01);
      }
    }
  }

  .ipTip {
    width: 176px;
    ul {
      margin-top: 8px;
    }
    li {
      display: flex;
      font-weight: normal;
      :global {
        .icon {
          margin-right: 4px;
        }
      }
    }
    li + li {
      margin-top: 4px;
    }
  }
}

.itemExtra {
  display: none;
  position: absolute;
  width: 100%;
  bottom: 0;
  padding: 12px;
  background-color: $white;
  border: 1px solid $dark-color01;
  border-top: 0;
  box-shadow: 0 4px 8px 0 rgba(36, 46, 66, 0.2);
  border-radius: 0 0 4px 4px;
  z-index: 1;

  .containers > div {
    background-color: $white;
    border: 1px solid $light-color03;
    margin-bottom: 12px;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

.loading {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.empty {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 56px;
}

.cluster {
  width: 260px;
  margin-right: 12px;
}
