/**
 * @fileoverview Star Rating System Fix for Chahua Web Store
 * @description Clean implementation of star rating with conflict resolution and enhanced UX
 * @dependencies 
 *   - global.css (CSS variables and base styles)
 *   - rating-system.css (base rating styles)
 * @features
 *   - Conflict-free star rating implementation
 *   - Interactive star selection with hover effects
 *   - Visual feedback for rating states
 *   - Mobile-optimized touch targets
 *   - Clean styling without conflicts
 * @fixes
 *   - Removes conflicting radio input styles
 *   - Resolves star display issues
 *   - Fixes rating interaction problems
 * @performance 
 *   - Optimized for smooth interactions
 *   - Hardware-accelerated transitions
 *   - Efficient star rendering
 * @calledBy plugins.html, rating components
 * @example
 * // Star rating usage:
 * <div class="star-rating">
 *   <button class="star" data-rating="5">★</button>
 *   <button class="star" data-rating="4">★</button>
 *   <button class="star" data-rating="3">★</button>
 * </div>
 */

/* 🌟 Star Rating System - Fixed and Clean */

/* Remove conflicting styles */
.radio-input {
    display: none !important;
}

/* Star Rating Container */
.card-rating {
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-top: 1px solid #333;
}

.rating-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rating-label {
    color: #888;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 4px;
}

/* Star Rating - Clean Implementation */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    gap: 2px;
    justify-content: flex-start;
    align-items: center;
}

.star-rating .star {
    appearance: none;
    width: 20px;
    height: 20px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.star-rating .star:before {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #444;
    font-size: 18px;
    transition: all 0.3s ease;
    user-select: none;
}

/* Hover effects */
.star-rating .star:hover:before,
.star-rating .star:hover ~ .star:before,
.star-rating .star.hover-highlight:before {
    color: #ffd700;
    transform: translate(-50%, -50%) scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Selected state */
.star-rating .star:checked:before,
.star-rating .star:checked ~ .star:before {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Focus state for accessibility */
.star-rating .star:focus {
    outline: 2px solid #00aaff;
    outline-offset: 2px;
    border-radius: 50%;
}

/* Disabled state */
.star-rating .star:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.star-rating .star:disabled:before {
    color: #333;
}

/* Animation for rating change */
.star-rating .star:checked:before {
    animation: starGlow 0.6s ease;
}

@keyframes starGlow {
    0% {
        transform: translate(-50%, -50%) scale(1);
        color: #444;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.3);
        color: #ffd700;
        text-shadow: 0 0 20px rgba(255, 215, 0, 1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        color: #ffd700;
        text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    }
}

/* Override any conflicting styles */
.plugin-card .star {
    all: unset;
    appearance: none;
    width: 20px;
    height: 20px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
}

.plugin-card .star:before {
    content: '★';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #444;
    font-size: 18px;
    transition: all 0.3s ease;
    user-select: none;
}

.plugin-card .star:hover:before {
    color: #ffd700;
    transform: translate(-50%, -50%) scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.plugin-card .star:checked:before {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .star-rating .star {
        width: 24px;
        height: 24px;
    }
    
    .star-rating .star:before {
        font-size: 20px;
    }
}
