/* Rating System Styles */
.rating {
    display: inline-flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-bottom: 20px;
    /* Lisätään marginaalia alaspäin, jotta tähdet eivät ole tekstikentän päällä */
    margin-bottom: 50px;
    /* Varmistetaan, että tähdet ovat omalla rivillään */
    width: 100%;
    clear: both;
}

.rating > input {
    display: none;
}

.rating > label {
    position: relative;
    width: 1.1em;
    font-size: 2.5em;
    color: #ddd;
    cursor: pointer;
    margin-right: 5px;
}

/* Tähti-ikoni näkyy aina */
.rating > label::before {
    content: "\2605"; /* Unicode star character */
    position: absolute;
    color: #ddd;
    opacity: 1;
}

/* Hover-tila muuttaa tähden värin */
.rating > label:hover:before,
.rating > label:hover ~ label:before {
    color: #FFD700 !important;
}

/* Valittu tähti on kultainen */
.rating > input:checked ~ label:before {
    color: #FFD700;
}

/* Valittu tähti pysyy kultaisena */
.rating > input:checked ~ label {
    color: #FFD700; /* Gold color */
}

/* Hover-tila valitun tähden päällä */
.rating:hover > input:checked ~ label:before {
    opacity: 0.8;
}

/* Hover-tila muuttaa tähden värin */
.rating > label:hover,
.rating > label:hover ~ label {
    color: #FFD700 !important;
}

/* Fallback for browsers that don't support ::before */
.rating > label:hover,
.rating > label:hover ~ label,
.rating > input:checked ~ label {
    color: #FFD700;
}

.comment-item {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-text {
    font-style: italic;
    margin: 5px 0;
}

.stars {
    color: #FFD700;
    margin-bottom: 5px;
}

.stars i.bi-star-fill {
    color: #FFD700;
}

.stars i.bi-star {
    color: #ddd;
}

.rating-count {
    color: #666;
    font-size: 0.9em;
    margin-left: 5px;
}

.average-rating {
    font-size: 1.2em;
    margin-bottom: 15px;
}

/* Hover effect for better UX */
.rating > label:hover:before,
.rating > label:hover ~ label:before,
.rating > input:checked ~ label:hover:before,
.rating > input:checked ~ label:hover ~ label:before {
    color: #FFED85; /* Light gold for hover */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rating > label {
        font-size: 1.8em;
    }
}

/* Clear fix for rating container */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Ensure Bootstrap icons are properly displayed */
.bi {
    display: inline-block;
    vertical-align: -0.125em;
}
