/* Upvote Button Styles */
/* Article upvoting for "most wanted" placeholder posts */

/* ========================================
   UPVOTE CONTAINER
   ======================================== */

.upvote-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  position: relative;
}

/* ========================================
   UPVOTE BUTTON
   ======================================== */

.upvote-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  background: white;
  border: 2px solid var(--primary-color, #2c5aa0);
  border-radius: 24px;
  color: var(--primary-color, #2c5aa0);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.upvote-button:hover:not(:disabled) {
  background: var(--primary-color, #2c5aa0);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(44, 90, 160, 0.2);
}

.upvote-button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(44, 90, 160, 0.2);
}

.upvote-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Voted state */
.upvote-button.voted {
  background: var(--primary-color, #2c5aa0);
  color: white;
  border-color: var(--primary-color, #2c5aa0);
}

.upvote-button.voted:hover {
  transform: none;
  box-shadow: none;
}

/* ========================================
   BUTTON ANIMATIONS
   ======================================== */

/* Voting animation */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.upvote-button.pulse {
  animation: pulse 0.6s ease-in-out;
}

/* Ripple effect */
.upvote-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.upvote-button.voting::before {
  width: 300px;
  height: 300px;
}

/* ========================================
   ICON & TEXT
   ======================================== */

.upvote-icon {
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.2s;
}

.upvote-button:hover .upvote-icon {
  transform: scale(1.2);
}

.upvote-text {
  line-height: 1;
}

/* ========================================
   VOTE COUNT
   ======================================== */

.upvote-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: var(--bg-color-secondary, #f6f8fa);
  border: 1px solid var(--border-color, #e1e4e8);
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color-secondary, #586069);
}

/* ========================================
   UPVOTE MESSAGE
   ======================================== */

.upvote-message {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text-color, #333);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10;
}

.upvote-message::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--text-color, #333);
}

.upvote-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========================================
   MOST WANTED SECTION (Homepage)
   ======================================== */

.most-wanted-section {
  margin: 3rem 0;
}

.most-wanted-section h2 {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.section-intro {
  text-align: center;
  color: var(--text-color-secondary, #586069);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.most-wanted-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* ========================================
   WANTED POST CARD
   ======================================== */

.wanted-post-card {
  background: white;
  border: 2px solid var(--border-color, #e1e4e8);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.wanted-post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color, #2c5aa0);
}

.wanted-post-title {
  font-size: 1.25rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-color, #333);
  line-height: 1.4;
}

.wanted-post-excerpt {
  font-size: 0.9375rem;
  color: var(--text-color-secondary, #586069);
  margin-bottom: 1rem;
  flex-grow: 1;
  line-height: 1.6;
}

.series-indicator {
  margin-bottom: 0.75rem;
}

/* Upvote container inside wanted post card */
.wanted-post-card .upvote-container {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color, #e1e4e8);
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .most-wanted-grid {
    grid-template-columns: 1fr;
  }

  .upvote-button {
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
  }

  .upvote-icon {
    font-size: 1.125rem;
  }

  .wanted-post-title {
    font-size: 1.125rem;
  }
}

@media (max-width: 480px) {
  .upvote-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .upvote-message {
    top: auto;
    bottom: -50px;
    left: 0;
    transform: translateX(0) translateY(-10px);
  }

  .upvote-message.show {
    transform: translateX(0) translateY(0);
  }

  .upvote-message::after {
    bottom: auto;
    top: -6px;
    border-top: none;
    border-bottom: 6px solid var(--text-color, #333);
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.upvote-button:focus-visible {
  outline: 2px solid var(--primary-color, #2c5aa0);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .upvote-button,
  .upvote-icon,
  .upvote-message,
  .wanted-post-card {
    transition: none;
    animation: none;
  }

  .upvote-button:hover {
    transform: none;
  }

  .wanted-post-card:hover {
    transform: none;
  }
}
