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

:host(.chat-message) {
  max-height: none;
  margin-top: 15px;
}

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

  margin-top: 1em;
  margin-bottom: 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;
}

.meta {
  margin-bottom: -6px;
}

.left {
  display: flex;
  flex-direction: column;
}

.right {
  display: flex;
  flex-direction: column;
  max-width: 100%;
}

.header {
  width: fit-content;
}

.name {
  font-size: 1em;
  width: fit-content;
}

.center {
  width: calc(100% - 15px); /* Without this, words start on a new line */
  min-height: 60px;
  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.1em;
  min-height: 50px;
  margin-left: 10px; /* Space for avatar */
  background-color: var(--panel-surface-color, #f1f1f1);
  min-width: 0;
  max-width: calc(100% - 20px);
  padding: 5px;
  width: fit-content;
  display: flex;
  align-items: center;
  justify-content: left;
  overflow-wrap: anywhere;
  word-break: break-word;
}

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

.timestamp {
  opacity: 0.5;
  transition: opacity 0.1s ease-in-out;
  margin-block: 2px;
}

.timestamp:hover {
  opacity: 1;
}

.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);
}

.icons {
  opacity: 0.5;
  margin-left: 8px;
  margin-top: -2px;
  transition: opacity 0.1s ease-in-out;
}

.icons:hover {
  opacity: 1;
}

@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;
  /* since 1.25em, adjust line-height */
  font-size: 1.25em;
  line-height: 0.9em;
}

.edit-icon {
  margin-top: 4px;
  margin-inline: 3px;
}

.placeholder {
  margin: 0;
  width: calc(100% - 15px);
}

.edit-area {
  /* for that smooth transition on a one line message */
  height: 51.5px;
}

pre {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

code {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
