﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

.modern-rating {
    text-align: center;
    margin: 0 auto;
    /*    max-width: 90%;
*/ padding: 0.5rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    width: 100%;
}

.star-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.25rem;
    padding: 0.5rem;
    position: relative;
}

.star {
    border: none;
    cursor: pointer;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #fbbf24;
    text-shadow: 0 1px 8px rgba(251, 191, 36, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 44px;
    height: 44px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f8fafc, #e2e8f0);
    box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.08), -6px -6px 12px rgba(255, 255, 255, 0.9), inset 1px 1px 3px rgba(255, 255, 255, 0.85), inset -1px -1px 3px rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

    /* Active/selected state */
    .star.active {
        background: linear-gradient(145deg, #fef3c7, #fcd34d);
        box-shadow: 8px 8px 16px rgba(251, 191, 36, 0.25), -8px -8px 16px rgba(255, 255, 255, 0.95), inset 3px 3px 6px rgba(255, 255, 255, 0.9), inset -3px -3px 6px rgba(254, 243, 199, 0.6), 0 0 20px rgba(251, 191, 36, 0.4);
        color: #d97706;
        text-shadow: 0 3px 12px rgba(251, 191, 36, 0.6);
        transform: scale(1.06);
    }

    /* Hover states */
    .star:hover {
        transform: translateY(-2px) scale(1.08);
        background: linear-gradient(145deg, #fef3c7, #fcd34d);
        box-shadow: 8px 8px 16px rgba(251, 191, 36, 0.2), -8px -8px 16px rgba(255, 255, 255, 0.95), 0 0 24px rgba(251, 191, 36, 0.35);
        z-index: 10;
    }

        .star:hover::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(circle, rgba(251, 191, 36, 0.12) 0%, transparent 70%);
            animation: ripple 0.5s ease-out;
        }

    .star:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.3), 6px 6px 12px rgba(0, 0, 0, 0.08), -6px -6px 12px rgba(255, 255, 255, 0.9);
    }

    .star:active {
        transform: translateY(-1px) scale(1.03);
    }

/* Sequential hover effect */
.star-container:hover .star:nth-child(1):hover ~ .star,
.star-container:hover .star:nth-child(2):hover ~ .star,
.star-container:hover .star:nth-child(3):hover ~ .star,
.star-container:hover .star:nth-child(4):hover ~ .star {
    opacity: 0.35;
}

.feedback-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.review-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.02em;
    line-height: 1.3;
}

.stat-count {
    color: #2cD3B0;
    font-weight: 800;
}

.cta-text {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
    margin: 0;
    letter-spacing: 0.03em;
    transition: color 0.3s ease;
}

.modern-rating:hover .cta-text {
    color: #1cb5e0;
}

/* Animations */
@keyframes ripple {
    0% {
        transform: scale(0.7);
        opacity: 1;
    }

    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

/* Responsive - Perfect center alignment at all sizes */
@media (max-width: 480px) {
    .modern-rating {
        max-width: 90%;
        padding: 0.75rem;
        margin: 2.5rem auto;
    }

    .star-container {
        gap: 5px;
        padding: 0.25rem;
    }

    .star {
        width: 38px;
        height: 38px;
        font-size: 1.75rem;
    }

    .review-text {
        font-size: 1rem;
    }

    .cta-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .star-container {
        gap: 4px;
    }

    .star {
        width: 36px;
        height: 36px;
        font-size: 1.6rem;
    }

    .feedback-text {
        gap: 0.3rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .star,
    .star::before {
        transition: none;
        animation: none;
    }

        .star:hover {
            transform: none;
        }
}

@media (prefers-contrast: high) {
    .star {
        border: 2px solid rgba(0, 0, 0, 0.2);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .star {
        background: linear-gradient(145deg, #1e293b, #334155);
        box-shadow: 6px 6px 12px rgba(0, 0, 0, 0.35), -6px -6px 12px rgba(51, 65, 85, 0.75);
    }

        .star.active {
            background: linear-gradient(145deg, #713f12, #d97706);
        }

    .review-text {
        color: #f1f5f9;
    }

    .cta-text {
        color: #cbd5e1;
    }
}
