/**
 *  Star component – ZACHOWANE + POPRAWIONA WALIDACJA
 */

.star-content {
  margin: 0 0 0 5px;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
}

.star-content div.star,
.star-content div.star-on,
.star-content div.star-hover {
  display: block;
  width: 20px;
  height: 20px;
  background: url(../img/stars.png) no-repeat 0 0 transparent;
  flex: auto;
  margin-left: 3px;
}

.star-content div.star-on,
.star-content div.star-hover {
  background-position: -24px 0;
}

.small-stars .star-content div.star,
.small-stars .star-content div.star-on,
.small-stars .star-content div.star-hover {
  background: url(../img/small_stars.png) no-repeat 0 0 transparent;
  width: 16px;
  height: 16px;
  margin-left: 2px;
}

.small-stars .star-content div.star-on,
.small-stars .star-content div.star-hover {
  background-position: -19px 0;
}

.star-content div.star-hover {
  cursor: pointer;
}

/* === GRADE-STARS – PODSTAWA === */
.grade-stars {
  position: relative;
  height: 20px;
  min-width: 120px;
  display: inline-block;
  padding: 8px 12px; /* Dodajemy padding, żeby był miejsce na border */
  border: 1px solid transparent; /* Domyślnie przezroczysty border */
  border-radius: 0.375rem;
  background-color: transparent;
  transition: all 0.2s ease-in-out;
}

.grade-stars.small-stars {
  min-width: 100px;
  height: 16px;
  padding: 6px 10px;
}

.grade-stars .star-content {
  position: absolute;
  top: 50%;
  left: 12px; /* wyrównaj do paddingu */
  transform: translateY(-50%);
  margin: 0;
}

.criterion-rating .grade-stars .star-content {
  top: 50%;
  transform: translateY(-50%);
}

/* === WALIDACJA – BŁĄD === */
#post-product-comment-modal .grade-stars.error {
  border-color: #dc3545 !important;
  background-color: rgba(220, 53, 69, 0.08) !important;
  box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.15) !important;
}

/* === WALIDACJA – SUKCES === */
#post-product-comment-modal .grade-stars.valid {
  border-color: #198754 !important;
  background-color: rgba(25, 135, 84, 0.08) !important;
  box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15) !important;
}

/* === KOMUNIKAT BŁĘDU === */
#ratingNotChosen {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #721c24;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  text-align: right;
  font-weight: 500;
}