.simple-rating-widget {
    display: inline-block;
    position: relative;
    margin: 10px 0;
}

.rating-stars-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    position: relative;
}

.rating-stars {
    display: flex;
    gap: 2px;
}

.star {
    display: inline-block;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    width: 24px;
    height: 24px;
}

.star svg {
    width: 100%;
    height: 100%;
    display: block;
}

.star-outline {
    fill: #e4e5e9;
    stroke: #c1c4cd;
    stroke-width: 0.5;
    transition: fill 0.2s ease;
}

.star-fill {
    fill: #ffd700;
    transition: clip-path 0.3s ease;
}

/* Состояния звёзд при наведении - ВСЕ предыдущие подсвечиваются */
.rating-stars:not(.disabled) .star:hover .star-outline,
.rating-stars:not(.disabled) .star:hover ~ .star .star-outline {
    fill: #ffed8a;
}

/* Активные звёзды (после голосования) */
.star.active .star-outline {
    fill: #ffd700 !important;
}

/* Звезды при наведении */
.star.hover .star-outline {
    fill: #ffed8a !important;
}

/* Отключенные звезды */
.rating-stars.disabled .star {
    cursor: default;
}

.rating-stars-wrapper.voted .star {
    cursor: default;
}

/* Всплывающая подсказка */
.rating-header {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.rating-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    margin-bottom: 10px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

.rating-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.rating-tooltip strong {
    color: #ffd700;
    font-weight: 600;
}

.rating-tooltip small {
    opacity: 0.8;
    font-size: 11px;
}

.rating-stars-wrapper:hover .rating-tooltip {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

/* Анимация звезды при наведении */
.rating-stars:not(.disabled) .star:hover {
    transform: scale(1.2);
}

/* Сообщение */
.rating-message {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 100;
}

.rating-message.success {
    background: #4caf50;
    color: white;
    opacity: 1;
    transform: translateY(0);
}

.rating-message.error {
    background: #f44336;
    color: white;
    opacity: 1;
    transform: translateY(0);
}

/* Информация о пользовательской оценке */
.rating-info {
    margin-top: 5px;
    font-size: 12px;
    color: #666;
}

.user-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-rating-value {
    color: #ff9800;
    font-weight: bold;
}

/* Анимация звёзд при голосовании */
@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.star.voted {
    animation: starPulse 0.5s ease;
}

/* Адаптивность */
@media (max-width: 768px) {
    .star {
        width: 20px;
        height: 20px;
    }
    
    .rating-tooltip {
        font-size: 12px;
        padding: 6px 10px;
        white-space: normal;
        width: 140px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .star {
        width: 18px;
        height: 18px;
    }
    
    .rating-stars {
        gap: 1px;
    }
}