/* ── Floating reaction animation (like / talk / listen) ── */

.floating-reaction {
  position: fixed;
  transform: translate(-50%, 0);
  font-size: 1.4rem;
  pointer-events: none;
  z-index: 9999;
  animation: floatReaction 1s ease-out forwards;
}

@keyframes floatReaction {
  0% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -60px) scale(1.6);
  }
}

.chat {
  width: 100%;
  margin-bottom: 20px;
  flex-direction: column;
}

.balloon-container {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 20px;
}

.balloon {
  position: relative;
  padding: 15px;
  background: #f5f5fa;
  border-radius: 10px;
  flex: 1;
  min-width: 0;
}

.balloon::after {
  content: "";
  position: absolute;
  top: 15px;
  left: -20px;
  border: 10px solid transparent;
  border-right-color: #f5f5fa;
}

.avatar-img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.comment-content {
  flex: 1;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: var(--card-body-font-size);
}

.comment-time {
  font-size: var(--card-time-font-size);
}

/* ── Like button (circle, matches comment-toggle-btn) ── */

.likes form,
.talks form,
.listens form {
  display: contents;
}

.like-circle-btn {
  width: auto;
  height: 1.7em;
  padding: 0 0.7em;
  border: 1.5px solid #b0b6c1;
  border-radius: 9999px;
  background-color: #fff;
  color: #8b919c;
  cursor: pointer;
  font-size: 0.8em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  gap: 5px;
}

.like-circle-btn .bi-heart-fill {
  font-size: 0.85em;
  line-height: 1;
}

.like-circle-btn:hover {
  border-color: hsl(220, 85%, 50%);
  color: hsl(220, 85%, 50%);
  background-color: #fff;
}

.like-circle-btn--active {
  border-color: hsl(220, 85%, 50%);
  background-color: hsl(220, 85%, 50%);
  color: #fff;
}

.like-circle-btn--active:hover {
  border-color: hsl(220, 85%, 42%);
  background-color: hsl(220, 85%, 42%);
  color: #fff;
}

.like-circle-btn--readonly {
  cursor: default;
}

/* ── Talk button (same design, sits left of like button) ── */

.talk-circle-btn {
  width: auto;
  height: 1.7em;
  padding: 0 0.7em;
  border: 1.5px solid #b0b6c1;
  border-radius: 9999px;
  background-color: #fff;
  color: #8b919c;
  cursor: pointer;
  font-size: 0.8em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  gap: 5px;
}

.talk-circle-btn .bi-chat-dots-fill {
  font-size: 0.85em;
  line-height: 1;
}

.talk-circle-btn:hover {
  border-color: hsl(220, 85%, 50%);
  color: hsl(220, 85%, 50%);
  background-color: #fff;
}

.talk-circle-btn--active {
  border-color: hsl(220, 85%, 50%);
  background-color: hsl(220, 85%, 50%);
  color: #fff;
}

.talk-circle-btn--active:hover {
  border-color: hsl(220, 85%, 42%);
  background-color: hsl(220, 85%, 42%);
  color: #fff;
}

.talk-circle-btn--readonly {
  cursor: default;
}

.talk-users {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 100%;
}

/* ── Listen button (same design, sits left of talk button) ── */

.listen-circle-btn {
  width: auto;
  height: 1.7em;
  padding: 0 0.7em;
  border: 1.5px solid #b0b6c1;
  border-radius: 9999px;
  background-color: #fff;
  color: #8b919c;
  cursor: pointer;
  font-size: 0.8em;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  gap: 5px;
}

.listen-circle-btn .bi-ear-fill {
  font-size: 0.85em;
  line-height: 1;
}

.listen-circle-btn:hover {
  border-color: hsl(220, 85%, 50%);
  color: hsl(220, 85%, 50%);
  background-color: #fff;
}

.listen-circle-btn--active {
  border-color: hsl(220, 85%, 50%);
  background-color: hsl(220, 85%, 50%);
  color: #fff;
}

.listen-circle-btn--active:hover {
  border-color: hsl(220, 85%, 42%);
  background-color: hsl(220, 85%, 42%);
  color: #fff;
}

.listen-circle-btn--readonly {
  cursor: default;
}

.listen-users {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 100%;
}

.cd-timeline__content {
  padding-bottom: var(--space-sm);
}

.reaction-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.comment-toggle-btn {
  position: static;
  width: auto;
  height: 1.7em;
  padding: 0 0.7em;
  border-radius: 9999px;
  font-size: 0.8em;
}

.reaction-users-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 100%;
  margin-top: 6px;
}

.reaction-users-stack:empty {
  margin-top: 0;
}

.like-circle-count {
  font-size: 0.6em;
  font-weight: 700;
  line-height: 1;
}

.like-users {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  max-width: 100%;
}

.like-avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #e5e7eb;
}

.avatar-tooltip {
  position: relative;
  display: inline-flex;
  cursor: default;
}

.avatar-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 0.7rem;
  line-height: 1.4;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.avatar-tooltip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1f2937;
  margin-bottom: -4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.avatar-tooltip:hover::after,
.avatar-tooltip:hover::before {
  opacity: 1;
}

.like-users-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-right: 2px;
}

.like-avatar-fallback {
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
}

/* ── Comment form ── */

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.comment-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d0d0e0;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  background: #ffffff;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}

.comment-input:focus {
  outline: none;
  border-color: #5a67d8;
  box-shadow: 0 0 0 3px rgba(90, 103, 216, 0.15);
}

.comment-input::placeholder {
  color: #aaa;
}

.comment-submit-btn {
  align-self: flex-start;
  padding: 8px 20px;
  background: #5a67d8;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.comment-submit-btn:hover {
  background: #434fba;
}

.comment-submit-btn:active {
  transform: scale(0.97);
}
