/**
 * Estilos mejorados para el sistema de reseñas de productos
 * Sistema de calificación con estrellas y formulario de comentarios
 */

/* ==========================================================================
   Contenedor de Reseñas
   ========================================================================== */

.formulario-resena {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    padding: 35px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.formulario-resena:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.formulario-resena h5 {
    color: #3f111c;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3f111c;
}

/* ==========================================================================
   Sistema de Calificación con Estrellas (Interactivo)
   ========================================================================== */

.rating-input {
    padding: 20px;
    background-color: #fff;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
    transition: all 0.3s ease;
}

.rating-input:hover {
    border-color: #3f111c;
    background-color: #f8f9fa;
}

.stars-clickable {
    font-size: 2.5rem;
    cursor: pointer;
    display: inline-block;
    padding: 10px 0;
}

.star-input {
    color: #ddd;
    transition: all 0.2s ease;
    margin: 0 5px;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.star-input:hover {
    color: #ffc107;
    transform: scale(1.15);
}

.star-input.active {
    color: #ffc107;
    text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.star-input:hover ~ .star-input {
    color: #ddd;
    transform: scale(1);
}

.rating-input small {
    display: block;
    margin-top: 10px;
    font-style: italic;
}

/* ==========================================================================
   Formulario de Reseña
   ========================================================================== */

.formulario-resena .form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.formulario-resena .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.formulario-resena .form-control:focus {
    border-color: #3f111c;
    box-shadow: 0 0 0 0.25rem rgba(63, 17, 28, 0.15);
    background-color: #fff;
}

.formulario-resena textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.formulario-resena .invalid-feedback {
    font-size: 0.875rem;
    margin-top: 8px;
}

#btn-submit-review {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

#btn-submit-review:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(63, 17, 28, 0.3);
}

#btn-submit-review:active:not(:disabled) {
    transform: translateY(0);
}

/* ==========================================================================
   Mensaje de Respuesta
   ========================================================================== */

#review-message {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

#review-message i {
    font-size: 1.2rem;
    margin-right: 10px;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Lista de Reseñas
   ========================================================================== */

.resena-item {
    background-color: #fff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.resena-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.resena-item:last-child {
    margin-bottom: 0;
}

.resena-header {
    margin-bottom: 15px;
}

.resena-header h6 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.resena-header .stars {
    margin-bottom: 5px;
}

.resena-header .stars i {
    font-size: 0.9rem;
    margin-right: 2px;
}

.resena-item p {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ==========================================================================
   Resumen de Rating
   ========================================================================== */

.resumen-rating {
    background: linear-gradient(135deg, #3f111c 0%, #5a1828 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(63, 17, 28, 0.3);
}

.resumen-rating h3 {
    color: white;
    font-weight: 700;
    margin-bottom: 20px;
}

.resumen-rating .rating-number {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.resumen-rating .stars {
    margin-bottom: 15px;
}

.resumen-rating .stars i {
    margin: 0 3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.resumen-rating p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0;
}

/* ==========================================================================
   Alert de Login Requerido
   ========================================================================== */

.alert-info {
    border-radius: 12px;
    border: 2px solid #0dcaf0;
    background-color: #cff4fc;
    padding: 25px;
}

.alert-info strong {
    color: #055160;
}

.alert-info .btn {
    margin-top: 5px;
}

/* ==========================================================================
   Estado Vacío (Sin Reseñas)
   ========================================================================== */

.text-center.py-4 i.fa-comments {
    opacity: 0.3;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .formulario-resena {
        padding: 25px 20px;
    }
    
    .stars-clickable {
        font-size: 2rem;
    }
    
    .star-input {
        margin: 0 3px;
    }
    
    .resumen-rating {
        padding: 25px 20px;
        margin-bottom: 30px;
    }
    
    .resumen-rating .rating-number {
        font-size: 3rem;
    }
    
    .resena-item {
        padding: 20px 15px;
    }
    
    #btn-submit-review {
        padding: 12px 20px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .stars-clickable {
        font-size: 1.8rem;
    }
    
    .resumen-rating .rating-number {
        font-size: 2.5rem;
    }
    
    .formulario-resena h5 {
        font-size: 1.1rem;
    }
}

/* ==========================================================================
   Animaciones Adicionales
   ========================================================================== */

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.star-input.active {
    animation: pulse 0.3s ease;
}

/* ==========================================================================
   Estados de Validación
   ========================================================================== */

.form-control.is-invalid {
    border-color: #dc3545;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-valid {
    border-color: #198754;
}

/* ==========================================================================
   Mejoras de Accesibilidad
   ========================================================================== */

.star-input:focus {
    outline: 2px solid #3f111c;
    outline-offset: 3px;
    border-radius: 4px;
}

.btn:focus {
    outline: 2px solid #3f111c;
    outline-offset: 3px;
}
