/* ============================================================
   Star Rating Widget — clickable 5-star radio input
   Pure CSS, no JS. Uses the row-reverse + ~ sibling trick.
   ============================================================ */

.star-rating {
    display: inline-flex;
    flex-direction: row-reverse;
    border: none;
    padding: 0;
    margin: 0;
}

.star-rating input[type="radio"] {
    /* Hide the radio but keep it focusable for accessibility */
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-rating label {
    cursor: pointer;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dee2e6;            /* unfilled: light gray */
    font-size: 1.5rem;
    transition: color 0.15s ease-in-out, transform 0.1s ease-in-out;
    user-select: none;
}

.star-rating label:hover {
    transform: scale(1.15);
}

/* On hover: the hovered star and all stars to its left fill up.
   With row-reverse, "to the left visually" = "after in DOM", so
   the ~ sibling combinator reaches them naturally. */
.star-rating label:hover,
.star-rating label:hover ~ label,
/* When a star is checked, fill it and all stars to its left */
.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;            /* filled: Bootstrap warning yellow */
}

/* Keyboard focus ring on the label so screen-reader users can see it */
.star-rating input[type="radio"]:focus-visible + label,
.star-rating input[type="radio"]:focus + label {
    outline: 2px solid #ffc107;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Disabled state (banned students) */
.star-rating--disabled label {
    cursor: not-allowed;
    opacity: 0.5;
    transform: none;
}
