/**
 * JUBU Ratings - Star Widget Styles
 * 
 * Art Deco themed rating widget with gold stars
 * 
 * @package JUBU_Ratings
 * @since 1.0.0
 */

/* ============================================
   Variables
   ============================================ */
:root {
    --jubu-gold: #d4af37;
    --jubu-gold-light: #f4d03f;
    --jubu-gold-dark: #b8941e;
    --jubu-black: #0a0a0a;
    --jubu-dark-gray: #1a1a1a;
}

/* ============================================
   Rating Display (Read-only in Grid)
   ============================================ */
.jubu-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 0;
    font-family: 'Montserrat', sans-serif;
}

/* Indicateur visuel : utilisateur a voté */
.jubu-rating-display.user-voted {
    position: relative;
    padding-left: 24px;
}

.jubu-rating-display.user-voted::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--jubu-gold);
    font-size: 16px;
    font-weight: bold;
    animation: checkPulse 2s ease-in-out infinite;
}

@keyframes checkPulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translateY(-50%) scale(1.1);
    }
}

.jubu-stars-display {
    display: flex;
    gap: 2px;
    line-height: 1;
}

.jubu-star {
    display: inline-block;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s ease;
}

.jubu-star-full {
    color: var(--jubu-gold);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.jubu-star-half {
    background: linear-gradient(90deg, var(--jubu-gold) 50%, rgba(212, 175, 55, 0.2) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.jubu-star-empty {
    color: rgba(212, 175, 55, 0.2);
}

.jubu-rating-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.jubu-rating-average {
    color: var(--jubu-gold);
    font-weight: 600;
}

.jubu-rating-count {
    color: rgba(255, 255, 255, 0.5);
}

/* Message de remerciement pour les utilisateurs qui ont voté */
.jubu-rating-display.user-voted .jubu-rating-count {
    color: var(--jubu-gold);
    font-weight: 500;
    font-style: italic;
}

/* Animation subtile du message */
.jubu-rating-display.user-voted .jubu-rating-count {
    animation: thankYouFade 3s ease-in-out;
}

@keyframes thankYouFade {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    20%, 80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Interactive Rating Widget (Modal)
   ============================================ */
.jubu-rating-widget {
    padding: 20px;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.6), rgba(10, 10, 10, 0.8));
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    margin: 20px 0;
}

.jubu-rating-header {
    margin-bottom: 15px;
}

.jubu-rating-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    color: var(--jubu-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    display: block;
}

.jubu-rating-stars {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    justify-content: center;
}

.jubu-rating-star {
    font-size: 36px;
    color: rgba(212, 175, 55, 0.2);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    position: relative;
    user-select: none;
}

.jubu-rating-star:hover {
    transform: scale(1.15);
}

/* Star states */
.jubu-rating-star.full {
    color: var(--jubu-gold);
    text-shadow: 
        0 0 10px rgba(212, 175, 55, 0.6),
        0 0 20px rgba(212, 175, 55, 0.3);
    animation: starPulse 0.3s ease-out;
}

.jubu-rating-star.half {
    background: linear-gradient(90deg, var(--jubu-gold) 50%, rgba(212, 175, 55, 0.2) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.jubu-rating-star.hover-full {
    color: var(--jubu-gold);
    opacity: 0.8;
}

.jubu-rating-star.hover-half {
    background: linear-gradient(90deg, var(--jubu-gold) 50%, rgba(212, 175, 55, 0.2) 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.8;
}

.jubu-rating-star.empty {
    color: rgba(212, 175, 55, 0.2);
}

@keyframes starPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Widget states */
.jubu-rating-widget.submitting {
    opacity: 0.6;
    pointer-events: none;
}

.jubu-rating-widget.submitting .jubu-rating-stars::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--jubu-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Rating info */
.jubu-rating-info {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.jubu-rating-current {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}

.jubu-rating-value {
    color: var(--jubu-gold);
    font-weight: 600;
}

.jubu-rating-message {
    display: none;
    padding: 10px;
    margin-top: 10px;
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--jubu-gold);
    text-align: center;
}

.jubu-rating-message.error {
    background: rgba(255, 68, 68, 0.1);
    border-color: rgba(255, 68, 68, 0.3);
    color: #ff4444;
}

/* ============================================
   Trending Badge
   ============================================ */
.jubu-trending-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: linear-gradient(135deg, rgba(255, 69, 0, 0.2), rgba(255, 140, 0, 0.2));
    border: 2px solid rgba(255, 69, 0, 0.4);
    border-radius: 4px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ff8c00;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 15px;
    animation: trendingPulse 2s ease-in-out infinite;
}

.jubu-trending-badge::before {
    content: 'ðŸ”¥';
    font-size: 1.2em;
    animation: flameDance 1s ease-in-out infinite;
}

@keyframes trendingPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 69, 0, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 69, 0, 0.6);
    }
}

@keyframes flameDance {
    0%, 100% {
        transform: scale(1) rotate(-5deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* ============================================
   Rating Distribution (Admin/Modal)
   ============================================ */
.jubu-rating-distribution {
    margin-top: 20px;
    padding: 15px;
    background: rgba(10, 10, 10, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 4px;
}

.jubu-distribution-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    color: var(--jubu-gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.jubu-distribution-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.jubu-distribution-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    min-width: 30px;
}

.jubu-distribution-bar {
    flex: 1;
    height: 20px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.jubu-distribution-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--jubu-gold-dark), var(--jubu-gold));
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.jubu-distribution-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    min-width: 40px;
    text-align: right;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .jubu-rating-star {
        font-size: 28px;
        gap: 6px;
    }
    
    .jubu-rating-stars {
        gap: 6px;
    }
    
    .jubu-star {
        font-size: 14px;
    }
    
    .jubu-rating-widget {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .jubu-rating-star {
        font-size: 24px;
    }
    
    .jubu-rating-stars {
        gap: 4px;
    }
    
    .jubu-star {
        font-size: 12px;
    }
    
    .jubu-rating-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

/* ============================================
   Art Deco Decorative Elements
   ============================================ */
.jubu-rating-widget::before,
.jubu-rating-widget::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(212, 175, 55, 0.4);
}

.jubu-rating-widget::before {
    top: 8px;
    left: 8px;
    border-right: none;
    border-bottom: none;
}

.jubu-rating-widget::after {
    bottom: 8px;
    right: 8px;
    border-left: none;
    border-top: none;
}

/* Diamond separator */
.jubu-rating-separator {
    width: 10px;
    height: 10px;
    background: var(--jubu-gold);
    transform: rotate(45deg);
    margin: 0 auto;
    opacity: 0.4;
}
