/* Star Rating Styles */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    direction: ltr;
}

.star-rating .stars {
    display: inline-flex;
    gap: 0.15rem;
}

.star {
    color: #ddd;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.star.filled {
    color: #fbbf24;
}

.star.half-filled {
    position: relative;
    color: #ddd;
}

.star.half-filled::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #fbbf24;
}

.rating-score {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin-right: 0.5rem;
}

/* Small variant */
.star-rating.small .star {
    font-size: 0.9rem;
}

.star-rating.small .rating-score {
    font-size: 0.85rem;
}

/* Large variant */
.star-rating.large .star {
    font-size: 1.8rem;
}

.star-rating.large .rating-score {
    font-size: 1.3rem;
}

/* Dashboard Card Rating */
.factory-card-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}

.factory-card-rating .star-rating {
    flex: 1;
}

/* Profile Header Rating */
.profile-header-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.profile-header-rating .star-rating {
    flex: 1;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-radius: 2rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.3);
}

.rating-badge .star {
    color: white;
}

/* Animation for star hover */
.star-rating:not(.static) .star:hover {
    transform: scale(1.1);
    cursor: pointer;
}

/* Rating Details */
.rating-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.rating-criterion {
    padding: 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
}

.rating-criterion-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.rating-criterion-value {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.rating-criterion-stars {
    margin-top: 0.25rem;
}

/* RTL Support */
[dir="rtl"] .star-rating {
    direction: ltr;
}

/* White stars variant for dark backgrounds */
.star-rating.white-stars .star {
    color: rgba(255, 255, 255, 0.3);
}

.star-rating.white-stars .star.filled {
    color: white;
}

.star-rating.white-stars .star.half-filled::before {
    color: white;
}

.star-rating.white-stars .rating-score {
    color: white;
}

/* Responsive */
@media (max-width: 640px) {
    .star-rating.large .star {
        font-size: 1.4rem;
    }
    
    .star-rating.large .rating-score {
        font-size: 1.1rem;
    }
    
    .rating-details {
        grid-template-columns: 1fr;
    }
}
