/**
 * Sistema de Reseñas - ConectaTerapia
 * @since 2026-02-05
 */

/* ============================================================================
   CONTENEDOR PRINCIPAL
   ============================================================================ */

.ct-reviews-section {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ============================================================================
   RESUMEN DE RATINGS
   ============================================================================ */

.ct-reviews-summary {
    display: flex;
    gap: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8fffe 0%, #e6fffa 100%);
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid rgba(15, 81, 84, 0.1);
}

.ct-reviews-average {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.ct-average-number {
    font-size: 3rem;
    font-weight: 700;
    color: #0f5154;
    line-height: 1;
}

.ct-average-stars {
    font-size: 1.5rem;
    color: #fbbf24;
    letter-spacing: 2px;
    margin: 0.5rem 0;
}

.ct-reviews-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.ct-reviews-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ct-rating-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ct-rating-label {
    min-width: 40px;
    font-size: 0.875rem;
    color: #374151;
    font-weight: 500;
}

.ct-rating-progress {
    flex: 1;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.ct-rating-fill {
    height: 100%;
    background: linear-gradient(90deg, #0f5154, #1aa7ab);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ct-rating-count {
    min-width: 30px;
    text-align: right;
    font-size: 0.875rem;
    color: #6b7280;
}

/* ============================================================================
   LISTA DE RESEÑAS
   ============================================================================ */

.ct-reviews-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ct-no-reviews {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-style: italic;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px dashed #e5e7eb;
}

.ct-review-item {
    padding: 1.25rem;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.ct-review-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.ct-review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.ct-review-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ct-review-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0f5154, #1aa7ab);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
}

.ct-review-meta {
    display: flex;
    flex-direction: column;
}

.ct-review-meta strong {
    color: #111827;
    font-size: 0.9375rem;
}

.ct-review-date {
    font-size: 0.8125rem;
    color: #6b7280;
}

.ct-review-rating {
    font-size: 1.125rem;
    color: #fbbf24;
    letter-spacing: 1px;
}

.ct-review-comment {
    margin: 0;
    color: #374151;
    line-height: 1.6;
    font-size: 0.9375rem;
}

/* ============================================================================
   FORMULARIO DE RESEÑA
   ============================================================================ */

.ct-review-form-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.ct-review-form-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
}

.ct-review-notice {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
}

.ct-review-notice--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.ct-review-form .ct-review-field {
    margin-bottom: 1.25rem;
}

.ct-review-form label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}

/* Rating Stars Input */
.ct-rating-stars-input {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.ct-rating-stars-input input {
    display: none;
}

.ct-rating-stars-input label {
    font-size: 2rem;
    color: #d1d5db;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}

.ct-rating-stars-input label:hover,
.ct-rating-stars-input label:hover ~ label,
.ct-rating-stars-input input:checked ~ label {
    color: #fbbf24;
}

.ct-review-form textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9375rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ct-review-form textarea:focus {
    outline: none;
    border-color: #0f5154;
    box-shadow: 0 0 0 3px rgba(15, 81, 84, 0.1);
}

.ct-review-form .ct-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #0f5154, #1aa7ab);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ct-review-form .ct-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 81, 84, 0.3);
}

.ct-review-form .ct-btn:active {
    transform: translateY(0);
}

/* Mensajes */
.ct-review-message {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    animation: ct-fade-in 0.3s ease;
}

.ct-review-message--success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.ct-review-message--error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.ct-review-login-msg {
    text-align: center;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 12px;
    color: #6b7280;
}

.ct-review-login-msg a {
    color: #0f5154;
    font-weight: 500;
    text-decoration: underline;
}

/* ============================================================================
   BADGE DE RATING (para listados)
   ============================================================================ */

.ct-rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border-radius: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 0.875rem;
}

.ct-rating-number {
    font-weight: 700;
    color: #0f5154;
}

.ct-rating-stars {
    color: #fbbf24;
    letter-spacing: -1px;
}

.ct-rating-count {
    color: #6b7280;
    font-size: 0.75rem;
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */

@keyframes ct-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 640px) {
    .ct-reviews-summary {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
    
    .ct-reviews-bars {
        width: 100%;
    }
    
    .ct-review-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .ct-rating-stars-input label {
        font-size: 1.75rem;
    }
}
