/* chat/05_message_actions.css
 * ------------------------------------------------------------
 * Split 5 of 10 from web/account/css/chat.css (CLAUDE.md §8.16 — see
 * 01_tokens_reset.css's header for the split's background; loaded fifth
 * in chat.html, right after the thread/bubble file it continues — the
 * original file's own "===== Message actions =====" banner marked this
 * as a distinct sub-section of the bubble rules, so the split follows the
 * same seam).
 *
 * Covers: the "⋯" actions disc and its dropdown menu (its quick-reaction
 * row and destructive delete item), the reaction chips shown under a
 * bubble, the "redigeret" (edited) marker, the composer's edit-in-
 * progress strip, the presence dot on the thread header's avatar, and the
 * reply-quote block shown inside a message that replies to another one,
 * the link-preview card, and the failed-message retry/discard row.
 * ------------------------------------------------------------ */

/* ===== Message actions: the second disc, its menu, reactions ===== */

/* The "⋯" disc sits beside the reply arrow in the same corner. One button
   width plus a gap to its left, so the two read as a pair rather than as one
   control that moved. */
/* The wrapper is NOT the positioning anchor — the bubble (or the picture) is,
   exactly as for the reply arrow, so the two share one coordinate system. */
.chat-bubble__menu-wrap { position: static; }

/* One disc-width plus a gap to the left of the reply arrow, in each context.
   The two numbers differ because the arrow's own inset does: 4px over a
   picture, 6px inside a bubble. Stated relative to that rather than picked, so
   moving the arrow moves both. */
.chat-bubble__menu.is-overlay { right: 34px; }        /* 4 + 26 + 4 */
.chat-bubble__body .chat-bubble__menu.is-overlay { right: 36px; }  /* 6 + 26 + 4 */

/* Opens UPWARD and toward the middle of the column: the disc is in a bubble's
   bottom-right, and a menu dropping down or further right would leave the
   viewport on the last message in a thread — which is exactly the message
   people act on most. */
.chat-msgmenu__panel {
  position: absolute;
  bottom: 34px;
  right: 0;
  z-index: 30;
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: var(--chat-composer-bg);
  box-shadow: 0 6px 24px rgb(0 0 0 / .45);
}
.chat-msgmenu__panel.is-hidden { display: none; }

/* The quick row: eight reactions, one press each. */
.chat-msgmenu__quick {
  display: flex;
  flex-wrap: wrap;
  padding-bottom: 4px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--chat-wash-soft);
}
.chat-msgmenu__emoji {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-msgmenu__emoji:hover { background: var(--chat-wash-soft); }

.chat-msgmenu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}
.chat-msgmenu__item:hover { background: var(--chat-wash-soft); }
/* Deleting is for everyone and cannot be undone, so it does not look like the
   row above it. --error is the palette's own "this is destructive" colour. */
.chat-msgmenu__item.is-destructive { color: var(--error); }

/* The reaction chips under a bubble. */
.chat-bubble__reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px 2px 0;
}
.chat-reaction {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 2px;
  border-radius: 999px;
  background: var(--chat-composer-field);
  font-size: 12px;
  line-height: 1.4;
}
.chat-reaction:hover { background: var(--chat-wash-soft); }
.chat-reaction__emoji { font-size: 13px; }
.chat-reaction__count { color: var(--chat-bubble-muted); }

/* "redigeret" beside the timestamp — quieter than the time itself, because it
   qualifies the message rather than telling you anything new about it. */
.chat-bubble__edited {
  font-size: 11px;
  font-style: italic;
  color: var(--chat-bubble-muted);
  opacity: .8;
}

/* The strip above the field while a message is being rewritten. */
.chat-composer__editing {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--chat-wash-soft);
  font-size: 12px;
}
.chat-composer__editing.is-hidden { display: none; }
.chat-composer__editing-cancel { color: var(--chat-read-tick); font-size: 12px; }

/* The presence dot on the thread header's avatar. Drawn on the avatar itself
   rather than as a sibling so it travels with it and cannot drift out of
   alignment when the header's layout changes. */
.chat-top-bar__avatar .chat-avatar { position: relative; }
.chat-top-bar__avatar .chat-avatar.has-presence::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  /* A ring in the bar's own colour, so the dot reads as separate from the
     photo underneath instead of merging with whatever is at that corner. */
  box-shadow: 0 0 0 2px var(--primary);
}

.chat-bubble__reply.is-overlay > span {
  display: block;
  transform: translateY(3px);
}
@media not all and (hover: hover) {
  .chat-bubble__reply { opacity: .55; }
}

.chat-bubble__quote {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--chat-wash-soft);
  border-left: 3px solid var(--chat-read-tick);
  border-radius: 6px;
  padding: 5px 8px;
}
.chat-bubble__quote-sender {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--chat-sender-name);
}
.chat-bubble__quote-text {
  display: block;
  font-size: 12.5px;
  color: var(--chat-bubble-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A sent message's link-preview card (ui/link_preview_block.js, issue #354).
   Same translucent-wash treatment as .chat-bubble__quote above — it reads as
   a distinct panel on either bubble colour without a bespoke token (see that
   file's header). Margin-bottom, not the column gap, so it sits directly
   above the text it belongs to. */
.chat-link-preview {
  display: block;
  width: 100%;
  overflow: hidden;
  background: var(--chat-wash-soft);
  border: 1px solid var(--chat-wash-medium);
  border-radius: 10px;
  margin-bottom: 6px;
}
.chat-link-preview__image {
  display: block;
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.chat-link-preview__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
}
.chat-link-preview__site {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--chat-bubble-muted);
}
.chat-link-preview__title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--chat-bubble-text);
  /* Two-line clamp, matching the app's `maxLines: 2` (chat_link_preview_
     block.dart) — a long scraped title must not blow out the bubble. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-link-preview__description {
  font-size: 12px;
  line-height: 1.4;
  color: var(--chat-bubble-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chat-bubble__failed {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  /* Wraps because the reason sentence (below) can be longer than the row is
     wide. Without this the buttons would be squeezed off the bubble's edge on
     a narrow screen, and "discard" is the one control that must always stay
     reachable — it is the only way out of a message that can never be sent. */
  flex-wrap: wrap;
}
.chat-bubble__failed-label { font-size: 11.5px; color: var(--error); }
/* The classified reason ("the server refused it", "no space left"), shown
   beside the compact "not sent" label. Muted rather than red: the label
   already carries the alarm, and repeating it in the same colour would make
   the whole row read as one long warning instead of a status plus an
   explanation. Allowed to wrap onto its own line — it is a sentence, not a
   chip, and truncating the reason would defeat the point of showing it — so no
   ellipsis here; the row wraps instead. */
.chat-bubble__failed-reason {
  font-size: 11.5px;
  color: var(--chat-bubble-muted);
}
.chat-bubble__retry { font-size: 11.5px; font-weight: 700; color: var(--chat-read-tick); }
.chat-bubble__discard { font-size: 11.5px; font-weight: 700; color: var(--error); }

