/* shimmer  */
@keyframes shimmer-animation {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* chat list shimmer*/
.chat-list-shimmer {
  width: 100%;
  overflow: hidden;
}

.chat-list-shimmer .shimmer-message {
  display: flex;
  align-items: center;
  padding: 16px;
}

.chat-list-shimmer .shimmer-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--shimmer-skeleton);
  margin-right: 12px;
  flex-shrink: 0;
}

.chat-list-shimmer .shimmer-content {
  flex: 1;
}

.chat-list-shimmer .shimmer-line {
  height: 12px;
  background: var(--shimmer-skeleton);
  border-radius: 4px;
  margin-bottom: 8px;
}

.chat-list-shimmer .shimmer-line.short {
  width: 60%;
}

.chat-list-shimmer .shimmer-line.medium {
  width: 80%;
}

.chat-list-shimmer .shimmer-line.long {
  width: 100%;
}

.chat-list-shimmer .shimmer-avatar,
.chat-list-shimmer .shimmer-line {
  position: relative;
  overflow: hidden;
}

.chat-list-shimmer .shimmer-avatar::before,
.chat-list-shimmer .shimmer-line::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shimmer-highlight),
    transparent
  );
  animation: shimmer-animation 1.5s infinite;
}

/* chat shimmer */
.chat-top-profile .chat-shimmer-profile-img {
  position: relative;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--shimmer-skeleton);
  margin: auto 0;
}

.chat-top-profile-shimmer-container {
  display: flex;
  flex-direction: column;
  justify-content: start;
}

.chat-top-profile-shimmer-container .name {
  margin: auto 0 0 6px;
  position: relative;
  overflow: hidden;
  width: 100px;
  height: 1.1rem;
  background: var(--shimmer-skeleton);
  border-radius: 4px;
}

.chat-top-profile-shimmer-container .last-seen {
  margin: 6px 0 auto 6px;
  position: relative;
  overflow: hidden;
  width: 150px;
  height: 0.8rem;
  background: var(--shimmer-skeleton);
  border-radius: 4px;
}

.chat-top-profile .chat-shimmer-profile-img::before,
.chat-top-profile-shimmer-container .name::before,
.chat-top-profile-shimmer-container .last-seen::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shimmer-highlight),
    transparent
  );
  animation: shimmer-animation 1.5s infinite;
}

/* date shimmer  */
.chat-shimmer-content-wrapper {
  height: 100%;
}

.chat-shimmer-content-wrapper .date-container {
  position: relative;
  padding: 10px 0;
  display: flex;
  justify-content: center;
}

.chat-shimmer-content-wrapper .date-container::before,
.chat-shimmer-content-wrapper .date-container::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 50px;
  height: 1px;
}

.chat-shimmer-content-wrapper .date-container::before {
  left: calc(50% + 3.5rem + 4px);
  background: linear-gradient(90deg, var(--onSecondBackground), transparent);
}

.chat-shimmer-content-wrapper .date-container::after {
  right: calc(50% + 3.5rem + 4px);
  background: linear-gradient(270deg, var(--onSecondBackground), transparent);
}

.chat-shimmer-content-wrapper .date-container .date {
  background: var(--shimmer-skeleton);
  border-radius: 6px;
  width: 7rem;
  height: 1.5rem;
  z-index: 2;
  position: relative;
  padding: 0 4px;
  overflow: hidden;
}

.chat-shimmer-content-wrapper .date-container .date::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shimmer-highlight),
    transparent
  );
  animation: shimmer-animation 1.5s infinite;
}

/* chat bubble section */
.chat-shimmer-content-wrapper .sent-card,
.chat-shimmer-content-wrapper .receive-card {
  position: relative;
  border-radius: 8px;
  max-width: 65%;
  height: 50px;
  background-color: var(--shimmer-skeleton);
}

.chat-shimmer-content-wrapper .sent-card div,
.chat-shimmer-content-wrapper .receive-card div {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: transparent;
  overflow: hidden;
}

.chat-shimmer-content-wrapper .sent-card {
  border-top-right-radius: 0;
  margin: 24px 0 0 auto;
}

.chat-shimmer-content-wrapper .receive-card {
  border-top-left-radius: 0;
  margin: 24px auto 0 0;
}

.chat-shimmer-content-wrapper .receive-card:before,
.chat-shimmer-content-wrapper .sent-card:before {
  content: "";
  position: absolute;
  top: 0;
  width: 0;
  height: 0;
  border-top: 10px solid var(--shimmer-skeleton);
}

.chat-shimmer-content-wrapper .receive-card:before {
  left: -10px;
  border-left: 10px solid transparent;
}

.chat-shimmer-content-wrapper .sent-card:before {
  right: -10px;
  border-right: 10px solid transparent;
}

.chat-shimmer-content-wrapper .sent-card div::after,
.chat-shimmer-content-wrapper .receive-card div::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--shimmer-highlight),
    transparent
  );
  animation: shimmer-animation 1.5s infinite;
}
