/**
 * Rating Input Component Styles
 *
 * Supports progressive (fill 1→N) and single (show selected only) modes.
 *
 * @package YayReviews
 */

/* CSS Custom Properties for theme customization */
.yayrev-rating-input {
    --yayrev-rating-gap: 0.25rem;
    --yayrev-rating-icon-size: 1.5rem;
    --yayrev-rating-dimmed-opacity: 0.35;
    --yayrev-rating-hover-scale: 1.15;
    --yayrev-rating-transition: 0.15s ease;
}

.yayrev-rating-input {
    display: flex;
    align-items: center;
    gap: var(--yayrev-rating-gap);
    flex-wrap: wrap;
}

.yayrev-rating-input__option {
    background: none;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    padding: 0.25rem;
    cursor: pointer;
    transition: transform var(--yayrev-rating-transition), opacity var(--yayrev-rating-transition), border-color var(--yayrev-rating-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.yayrev-rating-input__option:focus {
    outline: 2px solid var(--yayrev-primary, #2563eb);
    outline-offset: 2px;
}

.yayrev-rating-input__option:focus:not(:focus-visible) {
    outline: none;
}

.yayrev-rating-input__icon {
    font-size: var(--yayrev-rating-icon-size);
    line-height: 1;
    display: block;
}

/* Progressive mode - dimmed by default */
.yayrev-rating-input--progressive .yayrev-rating-input__option {
    opacity: var(--yayrev-rating-dimmed-opacity);
}

.yayrev-rating-input--progressive .yayrev-rating-input__option--filled,
.yayrev-rating-input--progressive .yayrev-rating-input__option:hover {
    opacity: 1;
    transform: scale(var(--yayrev-rating-hover-scale));
}

/* Single mode - border highlight on hover/select */
.yayrev-rating-input--single .yayrev-rating-input__option:hover {
    border-color: var(--yayrev-primary, #2563eb);
}

.yayrev-rating-input--single .yayrev-rating-input__option[aria-checked="true"] {
    border-color: var(--yayrev-primary, #2563eb);
    background: rgba(37, 99, 235, 0.1);
}

/* Hide non-selected in single mode after selection */
.yayrev-rating-input--single.yayrev-rating-input--has-selection
    .yayrev-rating-input__option:not([aria-checked="true"]) {
    display: none;
}

/* Change button */
.yayrev-rating-input__change {
    background: none;
    border: none;
    color: var(--yayrev-primary, #2563eb);
    cursor: pointer;
    font-size: 0.75rem;
    text-decoration: underline;
    padding: 0.25rem 0.5rem;
    margin-left: 0.5rem;
}

.yayrev-rating-input__change:hover {
    text-decoration: none;
}

/* Selected label display */
.yayrev-rating-input__selected-label {
    display: block;
    font-size: 0.875rem;
    color: var(--yayrev-text-muted, #6b7280);
    margin-top: 0.25rem;
    min-height: 1.25em;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .yayrev-rating-input__option {
        transition: none;
    }
}
