/* ===== ESTILOS MODERNOS PARA LAS CARDS ===== */

/* Card principal con efectos modernos */
.animal-card-index {
	background: #fdf2f8;
	border: none !important;
	border-radius: 20px !important;
	box-shadow: 0 8px 25px rgba(0,0,0,0.08);
	/* Force transition to ensure it applies */
	transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
	overflow: hidden;
	position: relative;
	will-change: transform; /* Hint for browser */
	/* Animation moved to parent column (.animacion-entrada) */
}

.animal-card-index::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	border-radius: 20px;
	border: 3px solid transparent;
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
	z-index: 1;
}

.animal-card-index:hover {
	transform: translateY(-12px);
	box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

.animal-card-index:hover::before {
	opacity: 1;
}

/* Bordes hover según estado - CONSOLIDADO */
.animal-card-index:has(.estado-en-adopcion)::before,
.animal-card-index:has(.estado-en-adopcion-conjunta)::before {
	border-color: #dc2626;
}

.animal-card-index:has(.estado-reservado)::before,
.animal-card-index:has(.estado-reservada)::before {
	border-color: #3b82f6;
}

.animal-card-index:has(.estado-adoptado)::before,
.animal-card-index:has(.estado-adoptada)::before {
	border-color: #10b981;
}

.animal-card-index:has(.estado-en-acogida)::before {
	border-color: #f59e0b;
}

/* Header de la card */
.card-header-modern {
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border: none !important;
	padding: 12px 16px !important;
	color: white !important;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	font-size: 0.85rem;
	text-align: center !important;
}

/* Headers por estado con colores específicos */
.card-header-modern.estado-en-adopcion,
.card-header-modern.estado-en-adopcion-conjunta {
	background: linear-gradient(135deg, #dc2626, #991b1b) !important;
}

.card-header-modern.estado-reservado,
.card-header-modern.estado-reservada {
	background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
}

.card-header-modern.estado-adoptado,
.card-header-modern.estado-adoptada {
	background: linear-gradient(135deg, #10b981, #059669) !important;
}

.card-header-modern.estado-en-acogida {
	background: linear-gradient(135deg, #f59e0b, #d97706) !important;
}

/* Contenedor de imagen mejorado */
.image-container {
	position: relative;
	height: 180px;
	overflow: hidden;
	background: linear-gradient(45deg, #f0f2f5, #e9ecef);
}

.animal-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.animal-card-index:hover .animal-image {
	transform: scale(1.05);
}

/* Overlay para los botones */
.image-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: linear-gradient(45deg, rgba(0,0,0,0.1), transparent);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.animal-card-index:hover .image-overlay {
	opacity: 1;
}

/* Badge de estado sobre la imagen */
.estado-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 6px 12px;
	border-radius: 12px;
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	z-index: 12;
}

/* Botones de acción modernos */
.action-buttons {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	display: flex;
	justify-content: space-between;
	z-index: 10;
}

.btn-action {
	width: 44px;
	height: 44px;
	border-radius: 50% !important;
	border: none !important;
	background: rgba(255, 255, 255, 0.95) !important;
	color: #495057 !important;
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
}

.btn-action:hover {
	transform: scale(1.1);
	background: rgba(255, 255, 255, 1) !important;
	box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

/* Botón favorito específico */
.btn-favorito i {
	color: #6c757d !important;
	transition: all 0.3s ease;
}

.btn-favorito:hover i,
.btn-favorito.is-favorite i {
	color: white !important;
}

.btn-favorito:hover,
.btn-favorito.is-favorite {
	background: linear-gradient(135deg, #ff6b6b, #ee5a24) !important;
	transform: scale(1.1);
}

/* Botón compartir específico */
.btn-share:hover {
	background: linear-gradient(135deg, #00b894, #00a085) !important;
}

.btn-share:hover i {
	color: white !important;
}

/* Body de la card */
.card-body-modern {
	padding: 12px !important;
}

.animal-card-index .card-body {
	background: #fdf2f8 !important;
}

/* Título del animal */
.animal-name {
	font-size: 1.1rem;
	font-weight: 700;
	color: #2d3436;
	margin-bottom: 6px;
	text-align: center;
}

/* Información del animal */
.animal-info {
	background: linear-gradient(135deg, #f8f9fa, #e9ecef);
	border-radius: 12px;
	padding: 8px;
	margin-bottom: 8px;
	border-left: 4px solid #667eea;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.animal-info-line {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.85rem;
	color: #495057;
	font-weight: 500;
	padding: 3px 8px;
	background: rgba(255, 255, 255, 0.6);
	border-radius: 8px;
	transition: all 0.3s ease;
}

.animal-info-line:hover {
	background: rgba(255, 255, 255, 0.8);
	transform: translateY(-2px);
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.animal-info-line i {
	color: #667eea;
	width: 16px;
	text-align: center;
	flex-shrink: 0;
}

/* Información de ubicación y fecha */
.animal-meta {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-top: 6px;
}

.meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	color: #6c757d;
}

.meta-item i {
	color: #667eea;
	width: 14px;
	text-align: center;
}

/* ===== ESTADOS - CONSOLIDADOS (eliminados duplicados) ===== */
.estado-en-adopcion,
.estado-en-adopcion-conjunta {
	background: linear-gradient(135deg, #dc2626, #991b1b) !important;
	color: #fef2f2;
	box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.estado-reservado,
.estado-reservada {
	background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
	color: white;
	box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.estado-adoptado,
.estado-adoptada {
	background: linear-gradient(135deg, #10b981, #059669) !important;
	color: white;
	box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.estado-en-acogida {
	background: linear-gradient(135deg, #f59e0b, #d97706) !important;
	color: white;
	box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Clase para la animación de entrada en las columnas */
.animacion-entrada {
	animation: fadeInUp 0.6s ease-out forwards;
	opacity: 0;
	transform: translateY(30px);
}

/* Delays escalonados para las columnas */
.animacion-entrada:nth-child(1) { animation-delay: 0.1s; }
.animacion-entrada:nth-child(2) { animation-delay: 0.15s; }
.animacion-entrada:nth-child(3) { animation-delay: 0.2s; }
.animacion-entrada:nth-child(4) { animation-delay: 0.25s; }
.animacion-entrada:nth-child(5) { animation-delay: 0.3s; }
.animacion-entrada:nth-child(6) { animation-delay: 0.35s; }
.animacion-entrada:nth-child(7) { animation-delay: 0.4s; }
.animacion-entrada:nth-child(8) { animation-delay: 0.45s; }
.animacion-entrada:nth-child(n+9) { animation-delay: 0.5s; }

@keyframes rotate {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

/* Icono de cargando para favoritos */
.btn-favorito i.bi-hourglass-split {
	color: #6c757d;
	animation: rotate 1s linear infinite;
}

/* ===== CONTADOR SIMPLE CON EFECTO SUTIL ===== */
.contador-simple {
	font-size: 1.1rem;
	font-weight: 600;
	color: #495057;
	text-align: center;
	padding: 12px 0;
	position: relative;
	display: inline-block;
}

.contador-simple::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 0;
	height: 2px;
	background: linear-gradient(90deg, #667eea, #764ba2);
	transition: width 0.6s ease;
}

.contador-simple:hover::after {
	width: 100%;
}

.contador-numero {
	color: #667eea;
	font-weight: 700;
}

/* ===== BOTÓN DE FILTROS - ACCESIBLE AAA ===== */
.btn-filtros {
	background: linear-gradient(135deg, #0d47a1, #1565c0) !important;
	color: white !important;
	border: none !important;
	border-radius: 15px !important;
	padding: 10px 24px !important;
	font-weight: 600 !important;
	font-size: 0.9rem !important;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
	box-shadow: 0 4px 15px rgba(13, 71, 161, 0.25) !important;
	text-transform: uppercase;
	letter-spacing: 0.8px;
}

.btn-filtros:hover {
	background: linear-gradient(135deg, #0a3d8f, #115293) !important;
	color: white !important;
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(13, 71, 161, 0.4) !important;
}

.btn-filtros:focus {
	box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.3) !important;
	outline: none !important;
}

.btn-filtros i {
	transition: transform 0.3s ease;
	color: white !important;
}

.btn-filtros:hover i {
	transform: scale(1.1);
}

/* Estado activo del botón filtros */
.btn-filtros.active {
	background: linear-gradient(135deg, #0a3d8f, #115293) !important;
	color: white !important;
	transform: translateY(-2px);
	box-shadow: 0 8px 25px rgba(13, 71, 161, 0.5) !important;
}

.btn-filtros.active i {
	transform: scale(1.1) rotate(180deg);
	color: white !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
	.animal-card-index {
		margin-bottom: 20px;
	}

	.image-container {
		height: 160px;
	}

	.btn-action {
		width: 38px;
		height: 38px;
		font-size: 1rem;
	}

	.action-buttons {
		top: 8px;
		left: 8px;
		right: 8px;
	}

	.btn-filtros {
		padding: 6px 16px !important;
		font-size: 0.8rem !important;
		margin-right: 0 !important;
	}

	.contador-simple {
		font-size: 1rem !important;
		padding: 8px 0 !important;
	}

	/* Asegurar que siempre esté en línea horizontal */
	#div_numero_animales_filtros .col-auto {
		flex-wrap: nowrap !important;
		gap: 10px !important;
		justify-content: center !important;
	}
}

@media (max-width: 480px) {
	.btn-filtros {
		padding: 5px 12px !important;
		font-size: 0.75rem !important;
		letter-spacing: 0.3px !important;
	}

	.contador-simple {
		font-size: 0.85rem !important;
		padding: 6px 0 !important;
	}

	/* Mantener en línea incluso en pantallas muy pequeñas */
	#div_numero_animales_filtros .col-auto {
		gap: 8px !important;
	}
}

@media (max-width: 360px) {
	.btn-filtros {
		padding: 4px 10px !important;
		font-size: 0.7rem !important;
	}

	.contador-simple {
		font-size: 0.8rem !important;
	}

	/* Para pantallas muy pequeñas, asegurar que no se rompa */
	#div_numero_animales_filtros .col-auto {
		gap: 6px !important;
		flex-direction: row !important;
	}
}
