/* Vote System Styles - CSP Compliant */
/* Global focus outline removal for all voting elements */
button[class*="upvote"],
button[class*="downvote"],
.voting button,
.voting-container button,
.vote-element:focus,
.vote-element:focus-visible,
.vote-element:active {
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.voting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  max-width: 200px;
  padding: 8px 0;
  margin: 8px auto;
}

.voting button {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  width: 55px;
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  outline: none;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.voting .thumb-icon {
  width: 28px;
  height: 28px;
  transition: all 0.2s ease;
}

.voting button:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
}

.voting button:focus {
  outline: none;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.voting button:focus-visible {
  outline: none;
  box-shadow: none;
}

.voting button:active {
  outline: none;
  box-shadow: none;
}

.voting button:focus-within {
  outline: none;
  box-shadow: none;
}

/* Remove all possible focus styles */
.upvote:focus,
.downvote:focus,
.upvote:focus-visible,
.downvote:focus-visible,
.upvote:active,
.downvote:active {
  outline: none;
  box-shadow: none;
  border-color: inherit;
}

/* Thumbs Up Icon */
.upvote {
  color: #27ae60;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upvote .thumb-icon {
  stroke: #27ae60;
  fill: none;
  transition: all 0.2s ease;
}

.upvote:hover .thumb-icon {
  stroke: #2ecc71;
}

.upvote.active {
  background: rgba(46, 204, 113, 0.2);
  border-color: #2ecc71;
}

.upvote.active .thumb-icon {
  stroke: #2ecc71;
  fill: #2ecc71;
}

/* Thumbs Down Icon */
.downvote {
  color: #e74c3c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.downvote .thumb-icon {
  stroke: #e74c3c;
  fill: none;
  transition: all 0.2s ease;
}

.downvote:hover .thumb-icon {
  stroke: #c0392b;
}

.downvote.active {
  background: rgba(231, 76, 60, 0.2);
  border-color: #e74c3c;
}

.downvote.active .thumb-icon {
  stroke: #c0392b;
  fill: #c0392b;
}

.vote-count {
  font-family: 'Courier New', monospace;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 14px;
  min-width: 32px;
  max-width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.vote-count.negative {
  color: #fff;
  background-color: rgba(231, 76, 60, 0.8);
  border-color: #e74c3c;
}

/* Vote count animation */
.vote-updated {
  animation: pulse-vote 0.5s ease;
}

@keyframes pulse-vote {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Rating update animation */
.rating-updated .star-rating {
  animation: pulse-gold 1s ease;
}

@keyframes pulse-gold {
  0% { color: #d4af37; transform: scale(1); }
  50% { color: #ffeb3b; transform: scale(1.05); text-shadow: 0 0 10px gold; }
  100% { color: #d4af37; transform: scale(1); }
}

/* Fix for dark mode & mobile */
@media (max-width: 768px) {
  .voting {
    gap: 6px;
    padding: 8px 0;
  }
  
  .vote-count {
    font-size: 14px;
    min-width: 30px;
    padding: 3px 6px;
  }
}

/* Position voting container properly inside casino card */
.voting-container {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 15px 0 5px;
  border: none;
  background-color: transparent;
}

/* Comprehensive focus outline removal - clean and CSP compliant */
.voting button,
.voting button:focus,
.voting button:active,
.voting button:focus-visible,
.voting .upvote,
.voting .downvote,
.voting .upvote:focus,
.voting .downvote:focus,
.voting .upvote:active,
.voting .downvote:active,
.voting .upvote:focus-visible,
.voting .downvote:focus-visible,
button.upvote,
button.downvote,
button.upvote:focus,
button.downvote:focus,
button.upvote:active,
button.downvote:active {
  outline: 0;
  outline: none;
  outline-width: 0;
  outline-style: none;
  outline-color: transparent;
  box-shadow: none;
  border-style: solid;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  -webkit-tap-highlight-color: transparent;
  -webkit-focus-ring-color: transparent;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Clean focus removal for all vote-related elements */
.vote-element,
.vote-element:focus,
.vote-element:active,
.vote-element:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: inherit;
}

/* Voting system disabled states and progress indicators */
.voting button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.voting.in-progress {
  position: relative;
}

.voting.in-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

/* Toast notification styles */
.toast {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.toast.fade-out {
  opacity: 0;
}

/* Geo-restricted voting elements */
.voting[data-voting-disabled="geo-restricted"] {
  display: none;
}

/* Override accessibility-enhancements.css focus outlines for voting buttons */
.voting button:focus-visible,
.voting .upvote:focus-visible,
.voting .downvote:focus-visible,
.voting .thumbs-up:focus-visible,
.voting .thumbs-down:focus-visible,
button.upvote:focus-visible,
button.downvote:focus-visible {
  outline: none !important;
  outline-width: 0 !important;
  outline-style: none !important;
  outline-color: transparent !important;
  outline-offset: 0 !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
  transform: scale(1.1) !important;
  -webkit-tap-highlight-color: transparent !important;
}
