/* [vodoou] chat message replies + reactions */

:root {
  --vx-surface: #ffffff;
  --vx-border: rgba(15, 23, 42, 0.12);
  --vx-text: #1f2937;
  --vx-muted: #6b7280;
  --vx-hover: #f1f5f9;
  --vx-accent: #00209f;
  --vx-accent-soft: rgba(0, 32, 159, 0.10);
  --vx-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

body.night-mode {
  --vx-surface: #1f2329;
  --vx-border: rgba(255, 255, 255, 0.12);
  --vx-text: #f3f4f6;
  --vx-muted: #9ca3af;
  --vx-hover: #2b3038;
  --vx-accent: #f5c518;
  --vx-accent-soft: rgba(245, 197, 24, 0.16);
  --vx-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}

/* the hidden pill must never cause a sideways scrollbar */
.chat-conversations {
  overflow-x: hidden !important;
}

/* keep room beside each bubble for the action pill (36px) */
.chat-conversations .conversation-body {
  max-width: calc(100% - 78px);
}

.chat-conversations .conversation.right .conversation-body {
  max-width: calc(100% - 38px);
}

/* ---------- message action pill (react / reply), beside the bubble ---------- */
.conversation-body .vx-msg-actions {
  position: absolute;
  top: 0;
  left: calc(100% + 4px);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  background: var(--vx-surface);
  border: 1px solid var(--vx-border);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
}

.conversation.right .conversation-body .vx-msg-actions {
  left: auto;
  right: calc(100% + 4px);
}

.conversation:hover .vx-msg-actions,
.conversation.vx-active .vx-msg-actions,
.conversation-body .vx-msg-actions:focus-within {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.vx-act {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vx-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.vx-act:hover,
.vx-act:focus-visible {
  background: var(--vx-hover);
  color: var(--vx-accent);
  outline: none;
}

/* ---------- replied-message quote inside a bubble ---------- */
.conversation-body .vx-reply-quote {
  clear: both;
  float: left;
  max-width: 100%;
  min-width: 120px;
  margin-bottom: 2px;
  padding: 5px 10px;
  border-left: 3px solid var(--vx-accent);
  border-radius: 10px;
  background: var(--vx-hover);
  color: var(--vx-text);
  font-size: 12px;
  line-height: 1.35;
  cursor: pointer;
  opacity: .92;
}

.conversation.right .conversation-body .vx-reply-quote {
  float: right;
}

.conversation-body .vx-reply-quote:hover {
  opacity: 1;
}

.vx-reply-name {
  font-weight: 600;
  color: var(--vx-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vx-reply-text {
  color: var(--vx-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.conversation-body .vx-reply-quote + .clearfix,
.conversation-body .vx-reply-quote + div {
  clear: both;
}

/* highlight a message after jumping to it */
.conversation.vx-flash .conversation-body .text {
  animation: vx-flash 1.4s ease;
}

@keyframes vx-flash {
  0%, 60% { box-shadow: 0 0 0 3px var(--vx-accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- reaction chips under a bubble ---------- */
.conversation-body .vx-reactions {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: -6px;
  padding: 0 4px;
  position: relative;
  z-index: 2;
}

.conversation-body .vx-reactions.x-hidden {
  display: none;
}

.conversation.right .conversation-body .vx-reactions {
  justify-content: flex-end;
}

.vx-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--vx-border);
  border-radius: 999px;
  background: var(--vx-surface);
  color: var(--vx-text);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  transition: transform .12s ease, background .12s ease;
}

.vx-chip:hover {
  transform: translateY(-1px);
}

.vx-chip.mine {
  border-color: var(--vx-accent);
  background: var(--vx-accent-soft);
}

.vx-chip-emoji {
  font-size: 14px;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

.vx-chip-count {
  font-weight: 600;
}

.vx-chip.vx-pop {
  animation: vx-pop .3s ease;
}

@keyframes vx-pop {
  0% { transform: scale(.6); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ---------- reaction picker ---------- */
.vx-picker {
  position: fixed;
  z-index: 2000;
  width: 296px;
  max-width: calc(100vw - 16px);
  padding: 6px;
  background: var(--vx-surface);
  border: 1px solid var(--vx-border);
  border-radius: 18px;
  box-shadow: var(--vx-shadow);
  animation: vx-picker-in .14s ease;
}

@keyframes vx-picker-in {
  from { opacity: 0; transform: translateY(6px) scale(.97); }
  to { opacity: 1; transform: none; }
}

.vx-picker-quick {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.vx-picker-grid {
  display: none;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--vx-border);
  max-height: 210px;
  overflow-y: auto;
}

.vx-picker.expanded .vx-picker-grid {
  display: grid;
}

.vx-emoji-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  transition: transform .12s ease, background .12s ease;
}

.vx-emoji-btn:hover,
.vx-emoji-btn:focus-visible {
  background: var(--vx-hover);
  transform: scale(1.2);
  outline: none;
}

.vx-emoji-btn.mine {
  background: var(--vx-accent-soft);
  box-shadow: inset 0 0 0 2px var(--vx-accent);
}

.vx-picker-more {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--vx-hover);
  color: var(--vx-muted);
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

.vx-picker-more:hover {
  color: var(--vx-accent);
}

.vx-picker.expanded .vx-picker-more i {
  transform: rotate(45deg);
}

.vx-picker-label {
  height: 18px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--vx-muted);
  text-align: center;
}

/* ---------- "replying to" bar above the message box ---------- */
.vx-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  padding: 6px 8px 6px 10px;
  border-left: 3px solid var(--vx-accent);
  border-radius: 10px;
  background: var(--vx-hover);
  color: var(--vx-text);
  font-size: 12px;
}

.vx-reply-bar-body {
  flex: 1 1 auto;
  min-width: 0;
}

.vx-reply-bar .vx-reply-text {
  -webkit-line-clamp: 1;
}

.vx-reply-bar-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--vx-muted);
  cursor: pointer;
}

.vx-reply-bar-close:hover {
  background: var(--vx-surface);
  color: var(--vx-text);
}

/* touch screens: no hover, show actions after a tap */
@media (hover: none) {
  .conversation:hover .vx-msg-actions {
    opacity: 0;
    pointer-events: none;
  }

  .conversation.vx-active .vx-msg-actions {
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .vx-act {
    width: 30px;
    height: 30px;
  }

  .chat-conversations .conversation-body {
    max-width: calc(100% - 82px);
  }

  .chat-conversations .conversation.right .conversation-body {
    max-width: calc(100% - 42px);
  }
}

/* ---------- numbers blocked notice ---------- */
.conversation-body .vx-numbers-notice {
  clear: both;
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 4px 0 2px;
  padding: 4px 9px;
  border: 1px solid rgba(210, 16, 52, 0.35);
  border-radius: 8px;
  background: rgba(210, 16, 52, 0.08);
  color: #d21034;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
}

.conversation.right .conversation-body .vx-numbers-notice {
  margin-left: auto;
}

body.night-mode .conversation-body .vx-numbers-notice {
  border-color: rgba(255, 92, 112, 0.45);
  background: rgba(210, 16, 52, 0.18);
  color: #ff7083;
}
