/* ═══════════════════════════════════════════════════════════════════════════
   👍 VOTE WIDGET - KOLO UI v1.0 Dark Theme
   Лайки/Дизлайки • Cyber Glow Edition • Темна тема
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* ────────────── Vote-специфічні змінні ────────────── */
  --vote-bg: rgba(255, 255, 255, 0.04);
  --vote-bg-hover: rgba(255, 255, 255, 0.06);
  --vote-border: rgba(255, 255, 255, 0.10);
  --vote-border-hover: rgba(255, 107, 53, 0.26);
  
  /* Градієнти для активних станів */
  --vote-gradient-like: linear-gradient(135deg, #10b981, #059669);
  --vote-gradient-dislike: linear-gradient(135deg, #ef4444, #dc2626);
  
  /* Тіні */
  --vote-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --vote-shadow-hover: 0 0 20px rgba(255, 107, 53, 0.15);
  --vote-shadow-active-like: 0 4px 16px rgba(16, 185, 129, 0.3);
  --vote-shadow-active-dislike: 0 4px 16px rgba(239, 68, 68, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎴 CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */
.vote-widget {
  display: inline-flex;
  align-items: center;
  gap: var(--k-space-2);
  padding: 4px;
  background: var(--vote-bg);
  backdrop-filter: blur(var(--k-glass-blur));
  -webkit-backdrop-filter: blur(var(--k-glass-blur));
  border-radius: 999px;
  border: 1px solid var(--vote-border);
  box-shadow: var(--vote-shadow);
  transition: all var(--k-duration-normal) var(--k-ease-default);
  position: relative;
  user-select: none;
}

.vote-widget:hover {
  background: var(--vote-bg-hover);
  border-color: var(--vote-border-hover);
  box-shadow: var(--vote-shadow), var(--vote-shadow-hover);
}

/* Busy state */
.vote-widget[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔘 BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */
.vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--k-space-2);
  padding: var(--k-space-2) var(--k-space-4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--k-radius-lg);
  background: rgba(255, 255, 255, 0.04);
  color: var(--k-text-secondary);
  font-size: var(--k-text-sm);
  font-weight: var(--k-weight-semibold);
  cursor: pointer;
  transition: all var(--k-duration-normal) var(--k-ease-default);
  position: relative;
  overflow: hidden;
  min-height: 36px;
  outline: none;
}

/* Ripple effect з ::before */
.vote-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  pointer-events: none;
  z-index: 0;
}

.vote-btn:active::before {
  width: 100px;
  height: 100px;
}

/* Content з z-index */
.vote-btn i,
.vote-btn .like-count,
.vote-btn .dislike-count {
  position: relative;
  z-index: 1;
}

/* Icons */
.vote-btn i {
  font-size: 16px;
  transition: transform var(--k-duration-normal) var(--k-ease-bounce);
}

/* Count */
.vote-btn .like-count,
.vote-btn .dislike-count {
  font-variant-numeric: tabular-nums;
  font-weight: var(--k-weight-semibold);
  transition: all var(--k-duration-normal) ease;
}

/* ═══════════════════════════════════════════════════════════════════════════
   👍 LIKE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.like-btn {
  color: var(--k-text-muted);
}

.like-btn:hover:not(:disabled) {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.26);
  color: var(--k-green);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.like-btn:hover:not(:disabled) i {
  transform: scale(1.1) rotate(-5deg);
}

/* Active state з градієнтом */
.like-btn.active {
  background: var(--vote-gradient-like);
  border-color: var(--k-green);
  color: white;
  box-shadow: var(--vote-shadow-active-like),
              0 0 20px var(--k-green-glow);
  animation: likeAnimation 0.3s var(--k-ease-bounce);
}

.like-btn.active:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--vote-shadow-active-like),
              0 0 30px var(--k-green-glow);
}

.like-btn.active i {
  animation: thumbsUpBounce 0.5s var(--k-ease-bounce);
}

/* Animations */
@keyframes likeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes thumbsUpBounce {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-15deg) scale(1.2); }
  75% { transform: rotate(15deg) scale(1.2); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   👎 DISLIKE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */
.dislike-btn {
  color: var(--k-text-muted);
}

.dislike-btn:hover:not(:disabled) {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.26);
  color: var(--k-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.dislike-btn:hover:not(:disabled) i {
  transform: scale(1.1) rotate(5deg);
}

/* Active state з градієнтом */
.dislike-btn.active {
  background: var(--vote-gradient-dislike);
  border-color: var(--k-red);
  color: white;
  box-shadow: var(--vote-shadow-active-dislike),
              0 0 20px var(--k-red-glow);
  animation: dislikeAnimation 0.3s var(--k-ease-bounce);
}

.dislike-btn.active:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--vote-shadow-active-dislike),
              0 0 30px var(--k-red-glow);
}

.dislike-btn.active i {
  animation: thumbsDownBounce 0.5s var(--k-ease-bounce);
}

/* Animations */
@keyframes dislikeAnimation {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes thumbsDownBounce {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(15deg) scale(1.2); }
  75% { transform: rotate(-15deg) scale(1.2); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⛔ DISABLED STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.vote-btn:disabled,
.vote-btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.vote-btn:disabled::before,
.vote-btn.is-disabled::before {
  display: none;
}

.vote-btn:disabled i,
.vote-btn.is-disabled i {
  animation: none !important;
  transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ⏳ LOADING STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.vote-btn .loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: voteSpinner 0.6s linear infinite;
  z-index: 2;
}

.vote-btn .loader.small {
  width: 14px;
  height: 14px;
}

@keyframes voteSpinner {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎯 FOCUS STATES
   ═══════════════════════════════════════════════════════════════════════════ */
.vote-btn:focus-visible {
  outline: 2px solid var(--k-primary);
  outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🎨 STYLE VARIANTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Colored background variant (default - використовується) */
.vote-widget[data-active-style="bg-colored"] .like-btn.active {
  background: var(--vote-gradient-like);
  color: white;
  border-color: var(--k-green);
}

.vote-widget[data-active-style="bg-colored"] .dislike-btn.active {
  background: var(--vote-gradient-dislike);
  color: white;
  border-color: var(--k-red);
}

/* Outlined variant */
.vote-widget[data-active-style="outlined"] .like-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: var(--k-green);
  border: 2px solid var(--k-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.vote-widget[data-active-style="outlined"] .dislike-btn.active {
  background: rgba(239, 68, 68, 0.12);
  color: var(--k-red);
  border: 2px solid var(--k-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Minimal variant */
.vote-widget[data-active-style="minimal"] {
  background: transparent;
  border: none;
  padding: 0;
  gap: var(--k-space-1);
}

.vote-widget[data-active-style="minimal"] .vote-btn {
  background: transparent;
  border: none;
  padding: var(--k-space-2) var(--k-space-3);
}

.vote-widget[data-active-style="minimal"] .vote-btn:hover:not(:disabled) {
  background: rgba(255, 107, 53, 0.1);
}

.vote-widget[data-active-style="minimal"] .like-btn.active {
  color: var(--k-green);
  background: rgba(16, 185, 129, 0.15);
}

.vote-widget[data-active-style="minimal"] .dislike-btn.active {
  color: var(--k-red);
  background: rgba(239, 68, 68, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   ✨ SPECIAL EFFECTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Pulse effect */
@keyframes votePulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70% {
    box-shadow: 0 0 0 10px rgba(0, 0, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
}

.vote-btn.pulse-effect {
  animation: votePulse 0.5s ease-out;
}

/* Confetti effect for like (тільки візуальний ефект) */
@keyframes confetti {
  0% {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(720deg);
    opacity: 0;
  }
}

/* Shake effect for dislike */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   📐 LAYOUT VARIANTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Compact mode */
.vote-widget.compact {
  gap: var(--k-space-1);
  padding: 2px;
  border-radius: var(--k-radius-lg);
}

.vote-widget.compact .vote-btn {
  padding: var(--k-space-2) var(--k-space-3);
  font-size: var(--k-text-xs);
  min-height: 32px;
}

.vote-widget.compact .vote-btn i {
  font-size: 14px;
}

/* Vertical layout */
.vote-widget.vertical {
  flex-direction: column;
  padding: var(--k-space-2);
  border-radius: var(--k-radius-2xl);
  gap: var(--k-space-1);
}

.vote-widget.vertical .vote-btn {
  width: 100%;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════════════
   📱 RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .vote-widget {
    gap: var(--k-space-2);
    padding: 3px;
    border-radius: var(--k-radius-xl);
  }
  
  .vote-btn {
    padding: var(--k-space-2) var(--k-space-3);
    font-size: var(--k-text-xs);
    min-height: 34px;
  }
  
  .vote-btn i {
    font-size: 14px;
  }
  
  .vote-btn .like-count,
  .vote-btn .dislike-count {
    font-size: var(--k-text-xs);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ♿ ACCESSIBILITY
   ═══════════════════════════════════════════════════════════════════════════ */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vote-btn,
  .vote-btn i,
  .vote-widget {
    animation: none !important;
    transition: opacity var(--k-duration-fast) ease,
                color var(--k-duration-fast) ease,
                background-color var(--k-duration-fast) ease !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔗 INTEGRATION
   ═══════════════════════════════════════════════════════════════════════════ */

/* Integration з post widget */
.post-widget .vote-widget {
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.post-actions .vote-widget {
  margin: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   🖨️ PRINT STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
  .vote-widget {
    border: 1px solid #333;
    background: transparent;
    box-shadow: none;
  }
  
  .vote-btn {
    background: transparent;
    color: #000;
    border-color: #666;
  }
  
  .vote-btn.active {
    font-weight: bold;
    text-decoration: underline;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   🔥 END OF VOTE WIDGET - KOLO UI v1.0
   ═══════════════════════════════════════════════════════════════════════════ */
