/* Hệ thống đánh giá bài viết - CSS */
.post-rating-widget {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    padding: 10px;
}

.rating-header h3 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-weight: 600;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.average-rating {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rating-number {
    font-size: 32px;
    font-weight: 700;
    color: #ff6b35;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    font-size: 20px;
    color: #ddd;
    transition: color 0.2s ease;
    cursor: default;
}

.star.filled {
    color: #ff6b35;
}

.star.half-filled {
    background: linear-gradient(90deg, #ff6b35 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stars.interactive .star {
    cursor: pointer;
    transition: all 0.2s ease;
}

.stars.interactive .star:hover {
    transform: scale(1.1);
    color: #ff6b35;
}

.total-ratings {
    color: #666;
    font-size: 14px;
}

.rating-breakdown {
    margin: 20px 0;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.star-label {
    min-width: 40px;
    font-size: 14px;
    color: #666;
}

.bar-container {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.count {
    min-width: 30px;
    text-align: right;
    font-size: 14px;
    color: #666;
}

.rating-form {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.rating-form h4 {
    margin: 0 0 10px 0;
    color: #1a1a1a;
    font-size: 16px;
    font-weight: 600;
}

.stars-input {
    margin-bottom: 16px;
}

.stars-input .stars {
    justify-content: flex-start;
}

.stars-input .star {
    font-size: 28px;
    padding: 4px;
    border-radius: 4px;
}

.rating-comment {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.rating-comment:focus {
    outline: none;
    border-color: #ff6b35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.submit-rating-btn {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.submit-rating-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
}

.submit-rating-btn:active {
    transform: translateY(0);
}

.submit-rating-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.rating-message {
    margin-top: 16px;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

.rating-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.rating-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
   
    .rating-summary {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .rating-number {
        font-size: 24px;
    }
    
    .stars-input .star {
        font-size: 24px;
    }
}

/* Animation cho loading */
.rating-loading {
    opacity: 0.6;
    pointer-events: none;
}

.rating-loading .submit-rating-btn::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}