/* Rating System CSS */
.rating-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1rem 0;
}

/* Compact Rating System */
.rating-container-compact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.rating-compact-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.rating-compact-header .rating-label {
    color: var(--text-primary);
    font-weight: 500;
}

.rating-compact-header .rating-score {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.rating-compact-header .rating-out-of {
    color: var(--text-muted);
    font-weight: 400;
}

.rating-compact-header .rating-count {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 400;
}

/* Rating Display with Stars */
.rating-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-stars-display {
    display: flex;
    gap: 0.15rem;
    align-items: center;
}

.rating-stars-display .star {
    width: 18px;
    height: 18px;
    fill: #e5e7eb;
    transition: all 0.2s ease;
}

.rating-stars-display .star.filled {
    fill: #fbbf24;
}

.rating-stars-display .star.half {
    fill: url(#half-star);
}

/* Hover Effects for Rating Stars */
.rating-stars-display:hover .star {
    transform: scale(1.05);
}

.rating-stars-display .star:hover {
    transform: scale(1.1);
    fill: #fbbf24;
}

.rating-stars-display .star:hover ~ .star {
    transform: scale(1.05);
}

.rating-score-container {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-form-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}

.rating-form-compact .rating-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

.rating-form-compact .rating-stars {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.rating-form-compact .rating-stars .star {
    width: 16px;
    height: 16px;
    transition: all 0.2s ease;
}

.rating-form-compact .rating-stars .star:hover {
    transform: scale(1.1);
}

.rating-form-compact .rating-selected {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 500;
}

.rating-submit-compact {
    padding: 0.4rem 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rating-submit-compact:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.rating-submit-compact:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.rating-login-notice-compact {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
}

.rating-login-notice-compact a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.rating-login-notice-compact a:hover {
    text-decoration: underline;
}

.rating-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.rating-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.rating-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-average {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rating-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.rating-out-of {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rating-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Rating Form */
.rating-form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--surface-hover);
    border-radius: 8px;
}

.rating-stars-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-stars-container label {
    font-weight: 500;
    color: var(--text-primary);
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
    pointer-events: auto;
}

.rating-selected {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rating-submit {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.rating-submit:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.rating-submit:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Star Rating Display */
.star-rating,
.rating-stars,
.user-rating-stars,
.overall-rating-stars {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.star {
    width: 24px;
    height: 24px;
    fill: #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
    pointer-events: auto;
}

.star:hover {
    transform: scale(1.1);
}

.star.filled {
    fill: #fbbf24;
}

.star.half {
    fill: url(#half-star);
}

/* Interactive stars for rating form */
.rating-stars .star {
    cursor: pointer;
}

.rating-stars .star:hover {
    fill: #fbbf24;
    transform: scale(1.1);
}

/* User rating display stars */
.user-rating-stars .star {
    cursor: default;
}

.user-rating-stars .star:hover {
    transform: none;
}

/* Overall rating display stars */
.overall-rating-stars .star {
    cursor: default;
}

.overall-rating-stars .star:hover {
    transform: none;
}

/* Rating Distribution */
.rating-distribution {
    margin-top: 1.5rem;
}

.rating-distribution h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.rating-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.rating-progress {
    flex: 1;
    height: 8px;
    background: var(--surface-hover);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.rating-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.rating-percentage {
    width: 40px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

/* User Rating Display */
.user-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-hover);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.user-rating-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.user-rating-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
}

.rating-delete-btn {
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--danger);
    color: white;
}

.rating-delete-btn:hover {
    background: var(--danger-hover);
}

/* Overall Rating Display */
.overall-rating {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--surface-hover);
    border-radius: 8px;
    text-align: center;
}

.overall-rating h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Login Notice */
.rating-login-notice {
    text-align: center;
    padding: 2rem;
    background: var(--surface-hover);
    border-radius: 8px;
    border: 1px dashed var(--border);
}

.rating-login-notice p {
    margin: 0 0 1rem 0;
    color: var(--text-muted);
}

.rating-login-notice .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.rating-login-notice .btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

/* Rating Success Message */
.rating-success {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 6px;
    color: #059669;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.rating-success svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Responsive */
@media (max-width: 768px) {
    .rating-container {
        padding: 1rem;
    }
    
    .rating-container-compact {
        padding: 0.75rem;
        margin: 0.75rem 0;
    }
    
    .rating-compact-header {
        gap: 0.25rem;
        margin-bottom: 0.5rem;
        font-size: 0.85rem;
    }
    
    .rating-compact-header .rating-score {
        font-size: 0.95rem;
    }
    
    .rating-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rating-stars-display .star {
        width: 16px;
        height: 16px;
    }
    
    .rating-form-compact {
        gap: 0.25rem;
        padding: 0.25rem 0;
    }
    
    .rating-form-compact .rating-label {
        font-size: 0.85rem;
    }
    
    .rating-form-compact .rating-stars {
        gap: 0.15rem;
    }
    
    .rating-form-compact .rating-stars .star {
        width: 14px;
        height: 14px;
    }
    
    .rating-form-compact .rating-selected {
        font-size: 0.8rem;
    }
    
    .rating-submit-compact {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
    
    .rating-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .rating-form {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .rating-stats {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rating-bars {
        gap: 0.75rem;
    }
    
    .rating-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .rating-progress {
        width: 100%;
    }
    
    .rating-percentage {
        text-align: left;
    }
}

/* Animation */
@keyframes ratingPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.rating-submit:active {
    animation: ratingPulse 0.2s ease;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .star {
        fill: #374151;
    }
    
    .star.filled {
        fill: #fbbf24;
    }
}