@use "@tencentcloud/uikit-base-component-react/dist/styles/theme/util" as *;
@use "../../styles/mixins/scrollbar" as scrollbar;

.contactList {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;

  @include theme() {
    background-color: get(bg-color-operate);
  }

  &__container {
    display: flex;
    height: 100%;
  }

  &__main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
  }

  &__search {
    @include light() {
      border-bottom: 1px solid #f0f2f7;
    }
    @include dark() {
      border-bottom: 1px solid #2b2c30;
    }
  }

  &__content {
    flex: 1;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;

    @include scrollbar.scrollbar-hidden;
  }

  &__groupHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
  }

  &__groupTitle {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 400;

    @include theme() {
      color: get(text-color-primary);
    }
  }

  &__groupIcon {
    display: inline-flex;
    transition: transform 0.2s ease;

    @include theme() {
      color: get(text-color-secondary);
    }

    &--expanded {
      transform: rotate(90deg);
    }
  }

  &__groupName {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 16px;
    font-weight: 400;
  }

  &__groupCount {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 20px;

    @include theme() {
      color: get(text-color-tertiary);
    }
  }

  &__unreadBadge {
    box-sizing: border-box;
    min-width: 16px;
    height: 16px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 4px;
    font-size: 12px;
    font-weight: 500;
    flex-shrink: 0;

    @include theme() {
      background-color: get(text-color-error);
      color: get(bg-color-topbar);
    }
  }

  &__groupContent {
    @include theme() {
      background-color: get(bg-color-operate);
    }
  }

  &__section {
    display: flex;
    flex-direction: column;
  }

  &__sectionHeader {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 12px 12px 0;
    margin-left: 32px;
    border-bottom: 1px solid;

    @include theme() {
      color: get(text-color-tertiary);
      border-color: get(stroke-color-secondary);
    }
  }

  &__sectionTitle,
  &__sectionCount {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
  }

  &__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;

    @include theme() {
      color: get(text-color-tertiary);
    }
  }

  &__emptyText {
    font-size: 14px;
    margin-top: 16px;
  }
}
