.ssr-rating-wrapper {
    --star-size: 34px;
    --star-color: #ddd;
    --star-active-color: #ffc107;
    --text-color: #555;
    --bg-color: #fff;
    display: inline-block;
    padding: 10px;
    border-radius: 8px;
    background: var(--bg-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    width: 100%;
    box-sizing: border-box;
}

.post-thumbnail .ssr-rating-wrapper {
    position: absolute; 
    z-index: 2; 
     top:12px; 
     left:20px;
     width: unset;
     display: block;
     background-color: rgba(255, 255, 255, .8);
}

.page-template-default .post-thumbnail {
  display: flex;
  justify-content: center;
}

.page-template-default .post-thumbnail .ssr-rating-wrapper  {
  position: relative;
  left: auto;
  top: auto;
  margin-bottom: 9px;
}

.page-template-default .post-thumbnail .thumbnail-container {
    flex-direction: column-reverse;
    display: flex;
}

.page-template-default .post-thumbnail .thumbnail-container 
img.attachment-paddle-featured-image {
  overflow: hidden;
    position: relative;
    background-color: white;
    background-clip: border-box;
    border: 1px solid gainsboro;
    border-radius: 0.4em;
    padding: 0.3em;
    margin-bottom: 0.5em;
    transition: all 0.25s !important;

}
.post-thumbnail .rated .ssr-rating-feedback {
    display: none;
}
.post-thumbnail .ssr-rating-feedback, .post-thumbnail  .ssr-rating-stats {
    margin-top: 0;
}
.post-thumbnail .ssr-rating-feedback {
    color: #ffffff;
    font-weight: 500;
    background-color: rgba(2, 2, 2, 0.3);
    padding: 2px 12px;
    border-radius: 9px;
    margin-top: 0;
}

.ssr-star-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ssr-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
}

.ssr-stars input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ssr-stars label {
  display: block;
  width: var(--star-size);
  height: var(--star-size);
  cursor: pointer;
   border-radius: 5px;
  background: var(--text-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ddd'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
  background-size: contain;
  transition: transform 0.2s, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}

/* Touch device optimizations */
@media (hover: none) {
  .ssr-stars label {
    padding: 10px; /* Larger touch target */
  }
}

/* RTL hover/selection logic */
.ssr-stars input:checked + label,
.ssr-stars input:checked ~ input + label,
.ssr-stars:not(:hover) input:checked + label,
.ssr-stars:not(:hover) input:checked ~ input + label {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffc107'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.ssr-stars:hover input + label {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ddd'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.ssr-stars input:hover + label,
.ssr-stars input:hover ~ input + label {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffc107'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.ssr-stars label:hover {
  transform: scale(1.1);
  filter: brightness(1.1);
}

.ssr-rating-output {
  flex-basis: 100%;
  text-align: center;
  font-size: 13px;
  color: var(--text-color);
  font-weight: 500;
  min-height: 18px;
  margin-top: 10px;
  display:none;
}

.ssr-rating-output::before {
  content: "0 stars"; /* Default */
}

#ssr-rating-1:checked ~ .ssr-rating-output::before { content: "1 star"; }
#ssr-rating-2:checked ~ .ssr-rating-output::before { content: "2 stars"; }
#ssr-rating-3:checked ~ .ssr-rating-output::before { content: "3 stars"; }
#ssr-rating-4:checked ~ .ssr-rating-output::before { content: "4 stars"; }
#ssr-rating-5:checked ~ .ssr-rating-output::before { content: "5 stars"; }

.ssr-rating-feedback,
.ssr-rating-stats {
  text-align: center;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-color);
}

.ssr-rating-feedback {
  color: #4caf50;
  font-weight: 500;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .ssr-rating-wrapper {
    padding: 8px;
  }
  
  .ssr-stars {
    gap: 2px;
  }
  
  .ssr-stars label {
    width: 28px;
    height: 28px;
  }
}

/* Disabled state for already rated */
.ssr-rating-wrapper.rated .ssr-stars label {
    cursor: default;
    
}

.ssr-rating-wrapper.rated .ssr-stars input:checked + label,
.ssr-rating-wrapper.rated .ssr-stars input:checked ~ input + label {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffc107'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

.ssr-rating-wrapper.rated .ssr-stars input:not(:checked) + label {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ddd'%3E%3Cpath d='M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z'/%3E%3C/svg%3E");
}

/* Loading state */
.ssr-rating-wrapper.loading .ssr-stars {
  opacity: 0.7;
  pointer-events: none;
}