/* Estilos para la sección de comentarios/opiniones */

/* Sección principal de comentarios */
.comments-section {
	position: relative;
}

.comments-section .card {
	transition: transform 0.2s ease-in-out;
}

.comments-section .card:hover {
	transform: translateY(-2px);
}

/* Estadísticas de opiniones */
.opinions-stats {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border-radius: 15px !important;
}

.opinions-stats .stat-item {
	transition: transform 0.2s ease-in-out;
}

.opinions-stats .stat-item:hover {
	transform: scale(1.05);
}

.opinions-stats .progress {
	border-radius: 10px;
	overflow: hidden;
}

/* Items de opiniones */
.opinion-item {
	transition: all 0.3s ease-in-out;
	border: 2px solid transparent !important;
	position: relative;
	overflow: hidden;
}

.opinion-item:hover {
	border-color: #0d6efd !important;
	box-shadow: 0 8px 25px rgba(13, 110, 253, 0.15);
	transform: translateY(-3px);
}

.opinion-item::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(45deg, #0d6efd, #6610f2);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.opinion-item:hover::before {
	opacity: 1;
}

/* Avatar de usuario en opiniones */
.opinion-avatar img,
.opinion-avatar div {
	transition: transform 0.3s ease;
}

.opinion-item:hover .opinion-avatar img,
.opinion-item:hover .opinion-avatar div {
	transform: scale(1.1);
}

/* Badges de valoración */
.opinion-rating .badge {
	font-size: 0.85rem;
	padding: 0.5rem 0.75rem;
	border-radius: 20px;
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 0.5px;
}

.badge.bg-success {
	background: linear-gradient(45deg, #198754, #20c997) !important;
}

.badge.bg-danger {
	background: linear-gradient(45deg, #dc3545, #fd7e14) !important;
}

/* Fotos de opiniones */
.opinion-photos .opinion-photo {
	border-radius: 8px;
	transition: all 0.3s ease;
	cursor: pointer;
	border: 3px solid transparent;
}

.opinion-photos .opinion-photo:hover {
	transform: scale(1.05);
	border-color: #0d6efd;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Acciones de opinión */
.opinion-actions {
	padding-top: 1rem;
	border-top: 1px solid #e9ecef;
}

.opinion-reactions small a {
	text-decoration: none;
	font-weight: 500;
}

.opinion-reactions small a:hover {
	text-decoration: underline;
}

.opinion-owner-actions .btn {
	border-radius: 20px;
	transition: all 0.3s ease;
}

.opinion-owner-actions .btn:hover {
	transform: translateY(-2px);
}

/* Botón cargar más opiniones */
#cargarMasOpiniones {
	border-radius: 25px;
	padding: 0.75rem 2rem;
	font-weight: 600;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

#cargarMasOpiniones:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(13, 110, 253, 0.3);
}

#cargarMasOpiniones::before {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
	transition: left 0.6s ease;
}

#cargarMasOpiniones:hover::before {
	left: 100%;
}

/* Sección de añadir opinión */
.add-opinion-section .alert {
	border-radius: 20px;
	border: 2px solid;
	position: relative;
	overflow: hidden;
}

.add-opinion-section .alert-light {
	border-color: #0d6efd;
	background: linear-gradient(135deg, #f8f9fa 0%, rgba(13, 110, 253, 0.05) 100%);
}

.add-opinion-section .alert-success {
	border-color: #198754;
	background: linear-gradient(135deg, #f8f9fa 0%, rgba(25, 135, 84, 0.05) 100%);
}

.add-opinion-section .btn {
	border-radius: 25px;
	padding: 0.75rem 2rem;
	font-weight: 600;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.add-opinion-section .btn:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Modal de nueva opinión */
#modalNuevaOpinion .modal-content {
	border-radius: 20px;
	border: none;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

#modalNuevaOpinion .modal-header {
	border-bottom: 2px solid #f8f9fa;
	border-radius: 20px 20px 0 0;
	padding: 1.5rem;
}

#modalNuevaOpinion .modal-body {
	padding: 2rem;
}

#modalNuevaOpinion .modal-footer {
	border-top: 2px solid #f8f9fa;
	border-radius: 0 0 20px 20px;
	padding: 1.5rem;
}

/* Información de entidad en modal */
.entidad-info {
	background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
	border: 2px solid #dee2e6;
	border-radius: 15px;
}

.entidad-info img {
	border: 3px solid white;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Botones de valoración */
.btn-group .btn-check:checked + .btn-outline-success {
	background: linear-gradient(45deg, #198754, #20c997);
	border-color: #198754;
	color: white;
	box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.btn-group .btn-check:checked + .btn-outline-danger {
	background: linear-gradient(45deg, #dc3545, #fd7e14);
	border-color: #dc3545;
	color: white;
	box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-group .btn {
	border-radius: 15px;
	padding: 0.75rem 1.5rem;
	font-weight: 600;
	transition: all 0.3s ease;
}

.btn-group .btn:hover {
	transform: translateY(-2px);
}

/* Textarea de opinión */
#opinionTexto {
	border-radius: 15px;
	border: 2px solid #dee2e6;
	padding: 1rem;
	resize: vertical;
	transition: all 0.3s ease;
	font-family: inherit;
	line-height: 1.6;
}

#opinionTexto:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
	transform: translateY(-2px);
}

/* Contador de caracteres */
#contadorCaracteres {
	font-weight: 600;
	transition: color 0.3s ease;
}

#contadorCaracteres.text-warning {
	color: #fd7e14 !important;
}

#contadorCaracteres.text-danger {
	color: #dc3545 !important;
}

/* Área de subida de fotos */
.photo-upload-area {
	border-color: #dee2e6 !important;
	border-radius: 15px;
	transition: all 0.3s ease;
	background: linear-gradient(135deg, #f8f9fa 0%, rgba(13, 110, 253, 0.02) 100%);
}

.photo-upload-area:hover {
	border-color: #0d6efd !important;
	background: linear-gradient(135deg, #f8f9fa 0%, rgba(13, 110, 253, 0.05) 100%);
}

.photo-upload-area.drag-over {
	border-color: #198754 !important;
	background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
}

/* Previsualización de fotos */
.photo-preview {
	position: relative;
	border-radius: 10px;
	overflow: hidden;
	transition: transform 0.3s ease;
}

.photo-preview:hover {
	transform: scale(1.05);
}

.photo-preview img {
	width: 100%;
	height: 80px;
	object-fit: cover;
	border-radius: 8px;
}

.photo-preview .remove-photo {
	position: absolute;
	top: 5px;
	right: 5px;
	background: rgba(220, 53, 69, 0.9);
	border: none;
	border-radius: 50%;
	width: 25px;
	height: 25px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 12px;
	transition: all 0.3s ease;
	cursor: pointer;
}

.photo-preview .remove-photo:hover {
	background: #dc3545;
	transform: scale(1.1);
}

/* Checkbox personalizado */
.form-check-input:checked {
	background-color: #0d6efd;
	border-color: #0d6efd;
}

.form-check-label {
	cursor: pointer;
	transition: color 0.3s ease;
}

.form-check-input:checked + .form-check-label {
	color: #0d6efd;
	font-weight: 600;
}

/* Botón de envío */
#btnEnviarOpinion {
	border-radius: 25px;
	padding: 0.75rem 2rem;
	font-weight: 600;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

#btnEnviarOpinion:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(13, 110, 253, 0.3);
}

#btnEnviarOpinion:disabled {
	opacity: 0.7;
	transform: none;
}

/* Spinner para carga */
.spinner-border-sm {
	width: 1rem;
	height: 1rem;
}

/* Modal de fotos */
#opinionPhotosModal .carousel-item img {
	max-height: 70vh;
	width: 100%;
	object-fit: contain;
	border-radius: 10px;
}

#opinionPhotosModal .carousel-control-prev,
#opinionPhotosModal .carousel-control-next {
	width: 5%;
	border-radius: 10px;
	background: rgba(0, 0, 0, 0.3);
	margin: auto 10px;
	height: max-content;
}

/* Alertas personalizadas */
.alert.alert-danger {
	border-radius: 15px;
	border-left: 5px solid #dc3545;
	background: linear-gradient(135deg, #f8d7da 0%, rgba(220, 53, 69, 0.1) 100%);
}

.alert.alert-success {
	border-radius: 15px;
	border-left: 5px solid #198754;
	background: linear-gradient(135deg, #d1e7dd 0%, rgba(25, 135, 84, 0.1) 100%);
}

.alert.alert-info {
	border-radius: 15px;
	border-left: 5px solid #0dcaf0;
	background: linear-gradient(135deg, #cff4fc 0%, rgba(13, 202, 240, 0.1) 100%);
}

/* Responsive */
@media (max-width: 768px) {
	.opinion-item {
		margin-bottom: 1rem;
	}

	.opinion-header {
		flex-direction: column;
		text-align: center;
	}

	.opinion-meta {
		text-align: center;
		margin-top: 1rem;
	}

	.opinion-rating {
		margin-top: 0.5rem;
	}

	.opinion-actions {
		flex-direction: column;
		gap: 1rem;
		text-align: center;
	}

	.btn-group {
		flex-direction: column;
	}

	.btn-group .btn {
		border-radius: 15px !important;
		margin-bottom: 0.5rem;
	}

	#modalNuevaOpinion .modal-body {
		padding: 1rem;
	}

	.photo-upload-area {
		padding: 2rem 1rem;
	}
}

/* Animaciones */
@keyframes slideInUp {
	from {
		opacity: 0;
		transform: translateY(30px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

.opinion-item {
	animation: slideInUp 0.5s ease-out;
}

.modal.show {
	animation: fadeIn 0.3s ease-out;
}

/* Estados de hover mejorados */
.cursor-pointer {
	cursor: pointer;
}

.hover-shadow {
	transition: box-shadow 0.3s ease;
}

.hover-shadow:hover {
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Mejoras tipográficas */
.font-caveat {
	font-family: "Playfair Display", Georgia, serif;
	font-weight: 600;
}

/* Label requeridos */
.form-label.required::after {
	content: " *";
	color: #dc3545;
	font-weight: bold;
}

/* Tooltips personalizados */
[data-bs-toggle="tooltip"] {
	cursor: help;
}

/* Estados de validación */
.was-validated .form-control:valid {
	border-color: #198754;
	background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='m2.3 6.73.94-.94 1.96-1.96.94-.94'/%3e%3c/svg%3e");
}

.was-validated .form-control: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 d='m5.8 4.6 1.4 1.4 1.4-1.4'/%3e%3c/svg%3e");
}
