/* Estilos para el sistema de calificación con estrellas */

/* Contenedor principal */
.rating-container {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Estrellas de visualización */
.stars-display {
    display: inline-block;
    font-size: 24px;
    color: #ddd;
    letter-spacing: 2px;
}

.stars-display .star {
    color: #ddd;
    transition: color 0.2s ease;
}

.stars-display .star.filled {
    color: #ffc107;
    text-shadow: 0 0 2px rgba(255, 193, 7, 0.5);
}

/* Promedio de calificación */
.rating-average {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.rating-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.rating-count {
    font-size: 14px;
    color: #666;
}

/* Input de calificación */
.rating-input {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.rating-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.stars-input {
    display: inline-block;
    font-size: 28px;
    cursor: pointer;
    user-select: none;
}

.stars-input .star {
    color: #ddd;
    transition: all 0.1s ease;
    display: inline-block;
    transform-origin: center;
}

.stars-input .star:hover,
.stars-input .star.hover {
    color: #ffc107;
    transform: scale(1.2);
    text-shadow: 0 0 4px rgba(255, 193, 7, 0.6);
}

.stars-input .star.selected,
.stars-input .star.filled {
    color: #ffc107;
    text-shadow: 0 0 2px rgba(255, 193, 7, 0.5);
}

/* Mensaje de calificación */
.rating-message {
    font-size: 14px;
    font-weight: 500;
    min-height: 20px;
    color: #28a745;
}

.rating-message.error {
    color: #dc3545;
}

/* Mensaje de agradecimiento */
.rating-thanks {
    padding: 10px 15px;
    background: #d4edda;
    color: #155724;
    border-radius: 5px;
    font-weight: 500;
    text-align: center;
}

/* Modal de calificación */
.rating-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rating-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
    position: relative;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.rating-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
}

.rating-modal-close:hover {
    color: #333;
}

.rating-modal-content h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 20px;
}

.rating-modal-content p {
    color: #666;
    margin-bottom: 20px;
    font-size: 14px;
}

.modal-stars-input {
    font-size: 36px;
    margin: 20px 0;
}

.modal-stars-input .star {
    color: #ddd;
    cursor: pointer;
    transition: all 0.1s ease;
    display: inline-block;
}

.modal-stars-input .star:hover,
.modal-stars-input .star.hover {
    color: #ffc107;
    transform: scale(1.3);
}

.modal-stars-input .star.selected {
    color: #ffc107;
}

.submit-rating-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 10px;
}

.submit-rating-btn:hover {
    background: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

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

/* Metabox en admin */
.rating-metabox {
    padding: 10px 0;
}

.rating-metabox .stars-display {
    font-size: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .rating-container {
        padding: 12px;
        margin: 15px 0;
    }
    
    .rating-average {
        gap: 8px;
    }
    
    .stars-display {
        font-size: 20px;
    }
    
    .stars-input {
        font-size: 24px;
    }
    
    .rating-input {
        gap: 10px;
    }
    
    .rating-modal-content {
        padding: 20px;
    }
    
    .modal-stars-input {
        font-size: 30px;
    }
}

/* Animaciones adicionales */
@keyframes starPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.star.animated {
    animation: starPulse 0.3s ease;
}

/* Estilos para diferentes estados */
.rating-container.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Integración con Elementor */
.elementor-widget-shortcode .rating-container {
    margin: 0;
    padding: 15px;
}

/* Personalización para tema Astra */
.ast-container .rating-container {
    max-width: 100%;
}

/* Estrellas en modo oscuro (si el tema lo soporta) */
@media (prefers-color-scheme: dark) {
    .rating-container {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .rating-text {
        color: #e2e8f0;
    }
    
    .rating-count {
        color: #a0aec0;
    }
    
    .rating-label {
        color: #e2e8f0;
    }
}