@keyframes icon-rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}

:host {
  max-height: none;
}

.chat-message {
  display: flex;
  flex-direction: row;
}

.avatar {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;

  margin-top: calc(1em + 5px);
  min-width: 50px;
  width: 50px;
  min-height: 50px;
  height: 50px;

  font-size: 25px;
  text-align: center;

  border-radius: 25px;
  background-color: var(--panel-surface-color, #f1f1f1);
  box-shadow:
    color-mix(in srgb, var(--panel-shadow-color) 30%, transparent) 0px 1px 2px
      0px,
    color-mix(in srgb, var(--panel-shadow-color) 15%, transparent) 0px 1px 3px
      1px;
}

.right {
  display: flex;
  flex-direction: column;
  margin-left: 5px;
  max-width: calc(100% - 80px);
}

.header {
  width: fit-content;
}

.name {
  font-size: 1em;
  margin-bottom: 0px;
  margin-top: 5px;
}

.center {
  width: calc(100% - 15px); /* Without this, words start on a new line */
  margin-right: 10px; /* Space for reaction icons */
  padding: 0px;
}

.message {
  border-radius: 5px;
  box-shadow:
    color-mix(in srgb, var(--panel-shadow-color) 30%, transparent) 0px 1px 2px
      0px,
    color-mix(in srgb, var(--panel-shadow-color) 15%, transparent) 0px 1px 3px
      1px;
  font-size: 1.25em;
  min-height: 50px;
  margin-top: 0px;
  margin-left: 10px; /* Space for avatar */
  margin-right: 5px; /* Space for reaction */
  background-color: var(--panel-surface-color, #f1f1f1);
  min-width: 0;
  max-width: calc(100% - 40px);
  padding: 5px;
  width: fit-content;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.timestamp {
  color: #a9a9a9;
  display: flex;
  margin-top: 0px;
}

.markdown {
  padding-block: 0px;
  padding-inline: 15px;
}

.avatar.rotating-placeholder {
  animation: icon-rotation 1.28s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.reaction-icons {
  display: flex;
  flex-direction: column;
  align-items: start;
  width: fit-content;
  margin-block: 0px;
  margin-inline: 2px;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.activity-dot {
  display: inline-block;
  animation: fadeOut 2s infinite cubic-bezier(0.68, -0.55, 0.27, 1.55);
  color: #32cd32;
  font-size: 1.25em;
  margin-block: 0px;
}
