/**
 * XenWord Rating System Styles
 * 
 * Dedicated CSS file for the rating system functionality
 * 
 * @package XenWordTheme
 * @subpackage Ratings
 * @version 1.0.0
 */

/* XenWord Rating System Styles */
.xenword-rating-system {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 8px;
    padding: 10px;
    margin: 10px auto;
    max-width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
}

.rating-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rating-stars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
    position: relative;
}

.interactive-star {
    cursor: pointer;
    padding: 5px;
    background: none;
    border: none;
    font-size: 32px;
    color: #ddd;
    transition: all 0.2s ease;
    border-radius: 4px;
    line-height: 1;
}

.interactive-star:hover {
    color: #ffdb4d;
    transform: scale(1.15);
    background: rgba(255, 193, 7, 0.1);
}

.interactive-star.filled {
    color: #ffc107;
    text-shadow: 0 0 2px rgba(255, 193, 7, 0.3);
}

.interactive-star.selected {
    color: #ffc107;
    text-shadow: 0 0 2px rgba(255, 193, 7, 0.3);
}

.interactive-star:hover ~ .interactive-star {
    color: #ddd;
}

.rating-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.rating-text {
    font-weight: 500;
    color: #333;
}

.rating-count {
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.rating-message {
    margin-top: 12px;
    font-size: 13px;
    min-height: 20px;
    font-weight: 500;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.rating-message.success {
    color: #28a745;
}

.rating-message.success::before {
    content: "✓";
    display: inline-block;
}

.rating-message.error {
    color: #dc3545;
}

.rating-message.error::before {
    content: "✕";
    display: inline-block;
}

.rating-message.info {
    color: #17a2b8;
}

.rating-message.info::before {
    content: "ℹ";
    display: inline-block;
}

/* Loading state */
.xenword-rating-system.loading .interactive-star {
    pointer-events: none;
    opacity: 0.6;
}

.xenword-rating-system.loading .rating-message::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #17a2b8;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Admin rating column styles */
.admin-rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-rating-stars {
    color: #ffc107;
    font-size: 14px;
}

.admin-rating-text {
    font-size: 12px;
    color: #666;
}

/* Meta box styles */
.xenword-rating-meta-box {
    padding: 10px;
}

.xenword-rating-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.xenword-rating-summary .rating-average {
    font-weight: bold;
    color: #333;
}

.xenword-rating-summary .rating-count {
    font-size: 12px;
    color: #666;
}

.xenword-rating-summary .reset-button {
    margin-top: 10px;
    padding: 5px 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.xenword-rating-summary .reset-button:hover {
    background: #c82333;
}

/* Responsive styles */
@media (max-width: 768px) {
    .xenword-rating-system {
        padding: 15px;
        margin: 15px 0;
    }
    
    .rating-stars .star {
        font-size: 20px;
        margin: 0 1px;
    }
    
    .interactive-stars .star {
        font-size: 24px;
        margin: 0 2px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .xenword-rating-system {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .rating-text {
        color: #a0aec0;
    }
    
    .rating-label {
        color: #e2e8f0;
    }
    
    .rating-stars .star {
        color: #4a5568;
    }
    
    .rating-stars .star.filled {
        color: #f6e05e;
    }
    
    .interactive-stars .star {
        color: #4a5568;
    }
    
    .interactive-stars .star:hover,
    .interactive-stars .star.hover {
        color: #f6e05e;
    }
    
    .interactive-stars .star.selected {
        color: #f6e05e;
    }
}