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

.main {
  padding: 12px;

  .inner {
    background-color: $bg-color;
  }

  .header {
    display: flex;
    height: 56px;
    padding: 12px;
    border-bottom: 0 none;

    .search {
      width: 100%;
    }

    .actions {
      flex: 1 0 auto;

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

  .body {
    min-height: 80px;
    padding: 12px;
  }

  .footer {
    margin: 0 -12px;
    padding: 10px 24px;
  }
}

.item {
  margin-bottom: 8px;

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

.itemMain {
  display: flex;
  align-items: center;
  padding: 12px;
  background-color: $white;
  border: 1px solid $border-color;
  border-radius: 4px;
  cursor: pointer;

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

    .status {
      position: absolute;
      right: 2px;
      bottom: 7px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid $white;
    }
  }

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

    dl {
      display: table-cell;
      line-height: 20px;
      vertical-align: middle;

      &.more {
        display: table-cell;
        width: 20px;
      }

      dt {
        font-weight: bold;
        color: $text-color;
      }

      dd {
        color: $second-text-color;
      }
    }
  }
}

.itemExtra {
  display: none;
  position: absolute;
  top: 66px;
  left: 0;
  z-index: 2;
  width: 100%;
  margin-bottom: 20px;
  padding: 12px;
  background-color: $white;
  border: 1px solid $border-hover-color;
  border-top: 0 none;
  box-shadow: 0 4px 8px 0 rgba(36, 46, 66, 0.2);
  border-radius: 0 0 4px 4px;
  transition: all $trans-speed;

  .actions {
    position: absolute;
    display: inline-block;
    top: 12px;
    right: 12px;
    z-index: 3;
    line-height: 32px;
  }
}

.expanded {
  position: relative;

  .more {
    :global(.icon) {
      transform: rotate(180deg);

      svg {
        color: $white;
      }
    }
  }

  .itemMain {
    margin: 0 -4px;
    background-color: $dark;
    border-color: $dark;

    .icon {
      .status {
        border-color: $dark;
      }
    }
    dl {
      dd,
      dt {
        color: $white;
      }
    }
  }

  .itemExtra {
    display: block;
  }
}

.instances {
  box-shadow: none;
  padding: 0;
  margin-bottom: -24px;
}

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

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