/* Ghost Comment Voting Styles */
/* Add this to your Ghost theme's CSS file or create a separate voting.css */

.comment-votes {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  font-size: 14px;
  user-select: none;
}

.vote-btn {
  background: transparent;
  border: 1px solid #e1e8ed;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  color: #657786;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  min-width: 36px;
  height: 32px;
}

.vote-btn:hover:not(:disabled) {
  background: #f5f8fa;
  border-color: #aab8c2;
  transform: translateY(-1px);
}

.vote-btn:active:not(:disabled) {
  transform: translateY(0);
}

.vote-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.vote-btn svg {
  display: block;
  pointer-events: none;
}

/* Upvote button states */
.vote-btn.upvote-btn:hover:not(.active):not(:disabled) {
  color: #1da1f2;
  border-color: #1da1f2;
}

.vote-btn.upvote-btn.active {
  color: #1da1f2;
  border-color: #1da1f2;
  background: #e8f5fe;
  font-weight: 600;
}

/* Downvote button states */
.vote-btn.downvote-btn:hover:not(.active):not(:disabled) {
  color: #e0245e;
  border-color: #e0245e;
}

.vote-btn.downvote-btn.active {
  color: #e0245e;
  border-color: #e0245e;
  background: #fce8ef;
  font-weight: 600;
}

/* Vote score */
.vote-score {
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  color: #14171a;
  font-size: 15px;
  line-height: 1;
}

.vote-score.positive {
  color: #1da1f2;
}

.vote-score.negative {
  color: #e0245e;
}

.vote-score.neutral {
  color: #657786;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .vote-btn {
    border-color: #38444d;
    color: #8899a6;
  }

  .vote-btn:hover:not(:disabled) {
    background: #192734;
    border-color: #8899a6;
  }

  .vote-btn.upvote-btn.active {
    background: rgba(29, 161, 242, 0.1);
  }

  .vote-btn.downvote-btn.active {
    background: rgba(224, 36, 94, 0.1);
  }

  .vote-score {
    color: #e1e8ed;
  }

  .vote-score.neutral {
    color: #8899a6;
  }
}

/* Mobile responsive */
@media (max-width: 768px) {
  .comment-votes {
    gap: 8px;
    margin: 10px 0;
  }

  .vote-btn {
    min-width: 32px;
    height: 28px;
    padding: 4px 8px;
  }

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

  .vote-score {
    min-width: 28px;
    font-size: 14px;
  }
}

/* Animation for vote changes */
@keyframes vote-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.vote-score.changed {
  animation: vote-pulse 0.3s ease;
}

/* Focus states for accessibility */
.vote-btn:focus {
  outline: 2px solid #1da1f2;
  outline-offset: 2px;
}

.vote-btn:focus:not(:focus-visible) {
  outline: none;
}

/* Loading state */
.vote-btn.loading {
  opacity: 0.6;
  cursor: wait;
}

.vote-btn.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Integration with Ghost comment styles */
.gh-comment .comment-votes {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5eff5;
}

.gh-comment-footer .comment-votes {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* Ensure votes display properly in nested comments */
.gh-comment .gh-comment .comment-votes {
  margin-left: 0;
}
