/* ---------------------------
   Article Feedback (like/dislike)
---------------------------- */

/* Shared */
.articleFeedback {
  display: flex;
  align-items: center;
  gap: 4px;
}

.articleFeedback__buttons {
  display: flex;
  gap: 4px;
}

.articleFeedback__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  transition: color 200ms ease, transform 200ms ease;
}

.articleFeedback__btn:hover {
  color: var(--text);
}

.articleFeedback__btn:disabled {
  pointer-events: none;
}

.articleFeedback__iconWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.articleFeedback__canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  width: 60px;
  height: 60px;
}

/* Active states — filled icon */
.articleFeedback__btn--like.is-active {
  color: var(--accent);
}

.articleFeedback__btn--like.is-active svg {
  fill: var(--accent);
}

.articleFeedback__btn--dislike.is-active {
  color: #ef4444;
}

.articleFeedback__btn--dislike.is-active svg {
  fill: #ef4444;
}

/* Pop animation on click — squeeze down, then burst up filled */
@keyframes feedbackShrink {
  0%   { transform: scale(1); }
  100% { transform: scale(0); }
}

@keyframes feedbackBurst {
  0%   { transform: scale(0); }
  50%  { transform: scale(1.3); }
  75%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.articleFeedback__btn.is-shrinking svg {
  animation: feedbackShrink 200ms ease forwards;
}

.articleFeedback__btn.is-bursting svg {
  animation: feedbackBurst 400ms cubic-bezier(0.17, 0.89, 0.32, 1.49) forwards;
}

/* Fill immediately when bursting (icon reappears filled) */
.articleFeedback__btn--like.is-bursting svg {
  fill: var(--accent);
  color: var(--accent);
}

.articleFeedback__btn--dislike.is-bursting svg {
  fill: #ef4444;
  color: #ef4444;
}

/* Header variant — right-aligned in meta row */
.articleMeta {
  justify-content: space-between;
}

.articleMeta__left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.articleFeedback--header .articleFeedback__iconWrap {
  width: 26px;
  height: 26px;
}

/* Bottom variant — centered, bigger */
.articleFeedback--bottom {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.articleFeedback__label {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.articleFeedback--bottom .articleFeedback__btn {
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: color 200ms ease, border-color 200ms ease, background 200ms ease, transform 200ms ease;
}

.articleFeedback--bottom .articleFeedback__btn:hover {
  border-color: var(--text);
  background: var(--surface);
}

.articleFeedback--bottom .articleFeedback__btn--like.is-active {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
}

.articleFeedback--bottom .articleFeedback__btn--dislike.is-active {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.articleFeedback--bottom .articleFeedback__iconWrap {
  width: 36px;
  height: 36px;
}

/* Voted state — fade out the other button, keep active clickable for undo */
.articleFeedback.has-voted .articleFeedback__btn:not(.is-active) {
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.articleFeedback.has-voted .articleFeedback__btn.is-active {
  cursor: pointer;
  pointer-events: auto;
}

/* Thank-you text */
.articleFeedback__thanks {
  font-size: 13px;
  color: var(--muted);
  opacity: 0;
  animation: feedbackFadeIn 400ms ease 200ms forwards;
}

@keyframes feedbackFadeIn {
  to { opacity: 1; }
}
