/* ══ Система голосования ══════════════════════════════════════════ */

/* ══ Система голосования "Жидкая капля" ══════════════════════════ */

.gooey-vote-container {
  filter: url('#gooey-puddle');
  position: absolute;
  /* Увеличиваем область, чтобы фильтр не обрезал капли */
  inset: -40px;
  pointer-events: none;
  z-index: 5;
}

.msg-votes {
  position: absolute;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  /* Скрыты внутри правого края сообщения */
  right: 10px;
  transform: translateY(-50%) scale(0.4);
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 5;
}

/* Анимация "Выливания" из правого бока */
[data-msg-id]:hover .msg-votes:not(.msg-votes-hidden),
.msg-votes.has-active:not(.msg-votes-hidden) {
  opacity: 1 !important;
  right: -42px; /* Выплывают вправо */
  transform: translateY(-50%) scale(1) !important;
  pointer-events: auto !important;
}

/* Анимация "Возвращения" */
.msg-votes-hidden {
  opacity: 0 !important;
  right: 10px !important;
  transform: translateY(-50%) scale(0.1) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  pointer-events: none !important;
}

/* Кнопки для входящих всегда в стиле message-received */
.msg-votes .vote-btn {
  background: var(--message-received-bg) !important;
  color: var(--message-received-text);
}

.vote-btn {
  width: 30px; height: 30px;
  border-radius: 50% !important;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  box-shadow: -2px 0 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease;
}

.vote-btn:hover {
  transform: scale(1.15) translateX(-2px);
}

/* Позиционирование счетчика для вертикального вида */
.vote-count {
  position: absolute;
  left: -6px; top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  background: #ff3b30;
  color: white;
  border-radius: 8px !important;
  padding: 1px 4px;
  border: 1px solid white;
}
.vote-btn .vote-icon {
  display: block;
  transform: skewX(0) !important; /* сбрасываем глобальный skew на кнопках */
  line-height: 1;
  font-style: normal;
}
.vote-count {
  position: absolute;
  top: -6px; right: -6px;
  font-size: 9px; font-weight: 700;
  background: var(--bg-sidebar);
  color: var(--text-muted);
  border-radius: 8px !important;
  padding: 0 3px;
  line-height: 14px;
  min-width: 14px;
  text-align: center;
  pointer-events: none;
  border: 1px solid var(--border-color);
}

/* Пульсирующее кольцо (как у new-chat-btn) */
.vote-ring {
  position: absolute;
  inset: 0;
  border-radius: 50% !important;
  pointer-events: none;
}

/* Лайк — зелёный */
.vote-like:hover {
  color: #22c55e;
  background: rgba(34,197,94,0.12);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}
.vote-active-like {
  color: #16a34a !important;
  background: rgba(34,197,94,0.15) !important;
  box-shadow: 0 0 0 2px rgba(34,197,94,0.3) !important;
}
.vote-active-like .vote-count { color: #16a34a; border-color: rgba(34,197,94,0.4); }

/* Дизлайк — красный */
.vote-dislike:hover {
  color: #ef4444;
  background: rgba(239,68,68,0.1);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.15);
}
.vote-active-dislike {
  color: #dc2626 !important;
  background: rgba(239,68,68,0.12) !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.28) !important;
}
.vote-active-dislike .vote-count { color: #dc2626; border-color: rgba(239,68,68,0.4); }

/* Анимация вспышки лайка — как newChatFlash но зелёная */
@keyframes voteLikeFlash {
  0%   { box-shadow: 0 0 0 0   rgba(34,197,94,0.7);  transform: scale(0.88); color: #22c55e; }
  30%  { box-shadow: 0 0 0 8px rgba(34,197,94,0.3);  transform: scale(1.18); }
  60%  { box-shadow: 0 0 0 16px rgba(34,197,94,0.1); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 22px rgba(34,197,94,0);   transform: scale(1); }
}
.vote-flash-like {
  animation: voteLikeFlash 0.52s cubic-bezier(0.22,1,0.36,1) forwards;
  color: #16a34a !important;
  background: rgba(34,197,94,0.15) !important;
}

/* Анимация вспышки дизлайка — красная */
@keyframes voteDislikeFlash {
  0%   { box-shadow: 0 0 0 0   rgba(239,68,68,0.7);  transform: scale(0.88); color: #ef4444; }
  30%  { box-shadow: 0 0 0 8px rgba(239,68,68,0.28); transform: scale(1.18); }
  60%  { box-shadow: 0 0 0 16px rgba(239,68,68,0.1); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 22px rgba(239,68,68,0);   transform: scale(1); }
}
.vote-flash-dislike {
  animation: voteDislikeFlash 0.52s cubic-bezier(0.22,1,0.36,1) forwards;
  color: #dc2626 !important;
  background: rgba(239,68,68,0.12) !important;
}

/* Свечение пузыря — лайк зелёный */
@keyframes bubbleGlowLike {
  0%   { box-shadow: 0 0 0   0  rgba(34,197,94,0);   }
  25%  { box-shadow: 0 0 18px 4px rgba(34,197,94,0.45); }
  60%  { box-shadow: 0 0 28px 8px rgba(34,197,94,0.25); }
  100% { box-shadow: 0 0 0   0  rgba(34,197,94,0);   }
}
.bubble-glow-like {
  animation: bubbleGlowLike 0.9s ease-out forwards !important;
}

/* Свечение пузыря — дизлайк красный */
@keyframes bubbleGlowDislike {
  0%   { box-shadow: 0 0 0   0  rgba(239,68,68,0);   }
  25%  { box-shadow: 0 0 18px 4px rgba(239,68,68,0.4); }
  60%  { box-shadow: 0 0 28px 8px rgba(239,68,68,0.22); }
  100% { box-shadow: 0 0 0   0  rgba(239,68,68,0);   }
}
.bubble-glow-dislike {
  animation: bubbleGlowDislike 0.9s ease-out forwards !important;
}


@keyframes chatUnreadPulse {
  0%   { background-color: transparent; }
  30%  { background-color: color-mix(in srgb, var(--accent-color) 18%, transparent); }
  60%  { background-color: transparent; }
  80%  { background-color: color-mix(in srgb, var(--accent-color) 10%, transparent); }
  100% { background-color: color-mix(in srgb, var(--accent-color) 10%, transparent); }
}
.chat-unread-flash {
  animation: chatUnreadPulse 1.2s ease-out forwards;
  background-color: color-mix(in srgb, var(--accent-color) 10%, transparent);
}
.chat-unread-flash:hover {
  background-color: var(--bg-item-hover) !important;
}
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.message-bubble { display: inline-block; width: fit-content; max-width: 100%; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }