/* Container for multiple widgets */
.vote-widgets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
}

.widget-container {
  background: linear-gradient(135deg, #080421 0%, #260a50 100%);
  color: white;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(8, 4, 33, 0.3);
  padding: 25px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
  border: 1px solid rgba(111, 49, 168, 0.2);
  transition: all 0.3s ease;
  min-width: 300px;
  box-sizing: border-box;
}

.widget-top-text {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  padding-bottom: 15px;
  text-align: center;
  font-weight: 500;
}

.widget-container:hover {
  box-shadow: 0 10px 30px rgba(111, 49, 168, 0.3);
  border-color: rgba(111, 49, 168, 0.3);
}

.voting-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.widget-image {
  flex: 0 0 auto;
  max-width: 200px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(111, 49, 168, 0.2);
}

.widget-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.widget-image:hover img {
  transform: scale(1.02);
}

.voting-content {
  flex: 1;
}

.question {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  color: white;
  text-align: left;
  position: relative;
  z-index: 1;
}

.slider-container {
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.range-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.custom-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(to right, #260a50, #6f31a8);
  outline: none;
  transition: all 0.3s;
}

.custom-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff7905;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px rgba(255, 121, 5, 0.6);
  transition: all 0.2s ease-in-out;
}

.custom-range::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(255, 121, 5, 0.8);
}

.custom-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff7905;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 15px rgba(255, 121, 5, 0.6);
  transition: all 0.2s ease-in-out;
}

.custom-range::-moz-range-thumb:hover {
  transform: scale(1.1);
}

.results-container {
  background: linear-gradient(
    135deg,
    rgba(20, 15, 35, 0.85) 0%,
    rgba(38, 10, 80, 0.9) 100%
  );
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(111, 49, 168, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  display: none;
}

.results-container.show {
  opacity: 1;
  transform: translateY(0);
  display: block;
}

.results-message {
  text-align: center;
  color: #ff7905;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(255, 121, 5, 0.4);
}

.results-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
}

.result-image img.thumbnail {
  width: 125px;
  height: 125px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid rgba(111, 49, 168, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.result-image img.thumbnail:hover {
  transform: scale(1.05);
}

.result-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-box {
  background: rgba(38, 10, 80, 0.4);
  border-radius: 12px;
  padding: 12px 16px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(111, 49, 168, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(111, 49, 168, 0.25);
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stat-label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 15px;
}

.value-display {
  font-weight: 700;
  font-size: 22px;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.user-value {
  color: #ff7905;
}

.avg-value {
  color: #9671ff;
}

.result-slider {
  height: 10px;
  background: rgba(38, 10, 80, 0.5);
  border-radius: 10px;
  position: relative;
  overflow: visible;
  margin: 35px 0 25px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.result-slider::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(
    to right,
    rgba(111, 49, 168, 0.7),
    rgba(255, 121, 5, 0.7)
  );
  border-radius: 10px;
  transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1);
}

.result-slider.animate::after {
  width: var(--progress-width, 100%);
}

.avg-marker,
.user-marker {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 2;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s,
    left 1s ease-in-out;
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.avg-marker {
  width: 26px;
  height: 26px;
  background: #9671ff;
  box-shadow: 0 0 15px rgba(150, 113, 255, 0.8);
  top: 50%;
}

.user-marker {
  width: 26px;
  height: 26px;
  background: #ff7905;
  box-shadow: 0 0 15px rgba(255, 121, 5, 0.8);
  top: 50%;
}

.avg-marker.show,
.user-marker.show {
  transform: translate(-50%, -50%) scale(1);
}

.avg-marker::before,
.user-marker::before {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 3;
  pointer-events: none;
}

.avg-marker::before {
  content: "Average Rating";
  top: -40px;
}

.user-marker::before {
  content: "Your Rating";
  bottom: -40px;
}

.avg-marker::after,
.user-marker::after {
  content: attr(data-value);
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: bold;
  white-space: nowrap;
}

.avg-marker::after {
  color: #fff;
} 

.user-marker::after {
  color: #fff;
}

.votes-count {
  position: absolute;
  right: 20px;
  top: -20px;
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  padding: 4px 8px;
  background-color: rgba(38, 10, 80, 0.6);
  border-radius: 15px;
  z-index: 10;
}

.votes-number {
  font-weight: 600;
  color: #9671ff;
}

.results-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 10px;
}

.results-message {
  margin-bottom: 15px;
}

.reset-btn {
  display: inline-block;
  padding: 10px 20px;
  background: rgba(255, 121, 5, 0.1);
  color: #ff7905;
  border: 1px solid #ff7905;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-top: 16px;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.reset-btn:hover {
  background: rgba(255, 121, 5, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 121, 5, 0.3);
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.pulse {
  animation: pulse 1.5s infinite;
}

.ripple {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .voting-container,
  .results-content {
    flex-direction: column;
    align-items: center;
  }

  .widget-image,
  .result-image {
    margin-bottom: 15px;
    max-width: 100%;
  }

  .result-stats {
    width: 100%;
  }

  .widget-container {
    padding: 15px;
  }

  .value-display {
    font-size: 18px;
  }
}

.stat-box {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.stat-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(to right, rgba(38, 10, 80, 0.7), rgba(111, 49, 168, 0.7));
  z-index: -1;
  transition: width 1.2s cubic-bezier(0.19, 1, 0.22, 1);
  border-radius: 8px;
}

.your-rating-box::before {
  background: linear-gradient(to right, rgba(150, 50, 0, 0.4), rgba(255, 121, 5, 0.4));
}

.stat-box.animate::before {
  width: var(--fill-width, 0%);
}
.value-display.user-value {
  color: #f57406;
  font-size: 1.5em;
  font-weight: 600;
}
.value-display.avg-value {
  color: #9951c9;
  font-size: 1.5em;
  font-weight: 600;
}
/* This rule is already defined above, removing duplicate */
/* Hide widget-top-text initially */
.widget-top-text {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  margin-bottom: 15px;
  font-weight: 500;
}

/* Show widget-top-text when results are displayed */
.results-container.show .widget-top-text {
  opacity: 1;
  transform: translateY(0);
}

/* Add a slight delay to the appearance */
.results-container .widget-top-text {
  transition-delay: 0.3s;
}