@import '../../../styles/fills';
@import '../../../styles/mixins';
@import '../../../styles/definitions/typography';
@import '../../../styles/definitions/colors';
@import '../../../styles/definitions/forms';

// Local Variables
$rating-input-label-spacing: 25px;

.ratingInput {
    &_ratingsWrapper {
        @extend %reset-list;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }

    &_radioGroupLabel {
        @extend %sr-only;
    }

    &_control {
        &--hidden {
            display: none;
        }
    }

    &_score {
        position: relative;
        display: inline-flex;
        align-items: center;
    }

    &_ratingWrapper {
        position: relative;
        &:not(:last-of-type) {
            margin-right: 4px;
        }
    }

    &_ratingLabel {
        cursor: pointer;

        &--rating1 {
            --color: #{$rating-1-color};
        }
        &--rating2 {
            --color: #{$rating-2-color};
        }
        &--rating3 {
            --color: #{$rating-3-color};
        }
        &--rating4 {
            --color: #{$rating-4-color};
        }
        &--rating5 {
            --color: #{$rating-5-color};
        }
    }

    &_radioBtn:focus-visible + &_ratingLabel,
    &_ratingLabel:focus-visible {
        @include focus-outline-style(var(--color, #{$rating-selected-color}));
    }

    &_radioBtn {
        position: absolute;
        top: 0;
        left: 0;
        z-index: -1;
        opacity: 0;
    }

    &_starValue {
        @extend %sr-only;
    }

    &_currentValue {
        @include text-4;
        position: absolute;
        left: calc(100% + #{$rating-input-label-spacing});
        top: 50%;
        transform: translateY(-50%);
        line-height: 25px;
    }

    &_positive {
        height: 16px;
        fill: var(--color, $mid-gray);
    }

    &_neutral {
        height: 16px;
        @include fill-midGray;
    }

    &_error {
        @extend %input-error;
    }
}