* {
  box-sizing: border-box;
}

:host {
  display: block;
  width: 100%;
  animation: fadeIn 0.3s ease-out;
}

:host(.USER) {
  display: flex;
  justify-content: flex-end;
}

:host(.BOT) {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: max-content;
}

:host(.SYSTEM) {
  width: max-content;
  max-width: 60%;
  color: var(--primary-blue);
  border: 0.01rem solid var(--primary-blue);
  border-radius: 999px;
  padding: 0.2rem var(--space-12);
  font-size: 10px;
  margin: 0 auto;
}

p {
  margin: 0;
  font-size: 0.875rem;
}

.bubble {
  width: fit-content;
  max-width: 95%;
  padding: 0.75rem;
  border-radius: 0.875rem;
  position: relative;
  transform-origin: bottom;
  animation: popIn 0.2s ease-out;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pending-tick,
.single-tick {
  position: absolute;
  right: 0.625rem;
  bottom: 4px;
  color: var(--text-secondary-color);
}

.double-tick {
  position: absolute;
  right: 0.625rem;
  bottom: 4px;
  color: var(--text-secondary-color);
}

.double-tick.read {
  color: white;
}

:host(.USER) .message a {
  color: white;
}

:host(.USER) .bubble {
  background: #001e57;
  color: white;
  border-bottom-right-radius: 0px;
}

:host(.USER) .bubble.with-status {
  padding-bottom: 1.25rem;
}

:host(.BOT) .bubble {
  background: #f5f5f5;
  color: #333;
  border-bottom-left-radius: 0px;
  /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); */
}

.message {
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.4;
  word-wrap: break-word;
}

.timestamp {
  font-size: 0.5rem;
  opacity: 0.7;
  display: block;
  margin-top: 4px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes popIn {
  from {
    transform: scale(0.95);
  }
  to {
    transform: scale(1);
  }
}

/* .bubble:hover {
  transition: all 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
} */

.markdown-content {
  line-height: 1.5;
}

.markdown-content pre {
  background-color: #f6f8fa;
  padding: 16px;
  border-radius: 6px;
  overflow-x: auto;
}

.markdown-content code {
  font-family: monospace;
  background-color: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

.markdown-content blockquote {
  border-left: 4px solid #dfe2e5;
  padding-left: 1em;
  color: #6a737d;
  margin: 1em 0;
}

.markdown-content ul,
.markdown-content ol {
  padding-left: 2em;
}

.markdown-content p {
  /* margin: 1em 0; */
}

.message-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  /* margin-right: 12px;
  align-self: flex-end; */
}

.action-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: #6b7280;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: #f3f4f6;
  color: #374151;
}

.action-btn:active {
  transform: scale(0.95);
}

.action-btn[title='Like'].selected,
.action-btn[title='Like']:hover {
  color: #16a34a;
  background-color: rgba(22, 163, 74, 0.1);
  border-radius: 6px;
}

.action-btn[title='Dislike'].selected,
.action-btn[title='Dislike']:hover {
  color: #dc2626;
  background-color: rgba(220, 38, 38, 0.1);
  border-radius: 6px;
}

/* .reaction-buttons {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.reaction-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
}

.reaction-btn:hover {
  opacity: 1;
  background-color: rgba(0, 0, 0, 0.05);
} */
