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

.message-list {
  flex: 1;
  min-height: 0;
  position: relative;
  height: 100%;
  width: 100%;
  padding: 0 10px;
  overflow: hidden;
  flex-direction: column-reverse;

  @include responsive((
    "desktop": (
      padding: 0 20px,
    ),
  ));

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

  &__container {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
    padding-bottom: 12px;

    @include scrollbar.scrollbar-hidden;

    &--initializing {
      visibility: hidden;
    }

    &--chunk {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }
  }

  &__load-more {
    align-items: center;
    justify-content: center;
    padding: 8px;
    font-size: 14px;
    border: none;
    animation: fade-in 0.3s ease-out forwards;

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

      &:disabled {
        cursor: not-allowed;
        color: get(text-color-disabled);
      }
    }

    @keyframes fade-in {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    @keyframes breathing {
      0%, 100% {
        opacity: 1;
      }

      50% {
        opacity: 0.5;
      }
    }
  }

  &__typing-indicator {
    position: absolute;
    left: 12px;
    bottom: 0;
    z-index: 10;
    font-size: 12px;
    animation: fade-in 0.2s ease-out forwards, breathing 2s ease-in-out 0.2s infinite;
    color: var(--uikit-text-color-secondary);
  }
}

.unread-notification {
  position: absolute;
  bottom: 100px;
  right: 0;
  transform: translateX(-50%);
  z-index: 10;
}
