/* ── Hello Asso Widget Styles ── */
/* Integrates HelloAsso Light donation form with Marche design system */

.donation-widget {
	position: relative;
	margin: 48px 0 40px;
	overflow: visible;
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.donation-widget-container {
	position: relative;
	overflow: visible;
	border-radius: 16px;
	background: rgba(255, 255, 255, 0.08);
	padding: 40px 32px;
	border: 1px solid rgba(255, 255, 255, 0.1);
	backdrop-filter: blur(10px);
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3);
	width: 100%;
	max-width: 600px;
	display: flex;
	justify-content: center;
	align-items: center;
}

.donation-widget iframe {
	display: block;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
	width: clamp(300px, 100%, 26rem) !important;
	margin: 0 auto !important;
	min-height: 600px;
}

/* Loading state - smooth skeleton loader */
.donation-widget iframe[style*="height: 0"],
.donation-widget iframe:not([style*="height"]) {
	height: 800px !important;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
	background-size: 200% 100%;
	animation: loading 1.5s infinite;
}

@keyframes loading {
	0% { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Tablet responsive */
@media (max-width: 1024px) {
	.donation-widget {
		margin: 40px 0 32px;
	}

	.donation-widget-container {
		padding: 36px 28px;
		max-width: 550px;
	}

	.donation-widget iframe {
		min-height: 700px;
	}
}

/* Mobile responsive - optimize for small screens */
@media (max-width: 768px) {
	.donation-widget {
		margin: 32px 0 24px;
	}

	.donation-widget-container {
		padding: 28px 20px;
		border-radius: 12px;
		background: rgba(255, 255, 255, 0.06);
		max-width: 100%;
	}

	.donation-widget iframe {
		min-height: 750px;
		border-radius: 8px;
	}
}

/* Small mobile devices */
@media (max-width: 480px) {
	.donation-widget {
		margin: 24px -20px;
	}

	.donation-widget-container {
		padding: 24px 16px;
		border-radius: 0;
		margin: 0 -20px;
		max-width: none;
		width: 100vw;
		position: relative;
		left: 50%;
		right: 50%;
		margin-left: -50vw;
		margin-right: -50vw;
	}

	.donation-widget iframe {
		min-height: 800px;
		width: 100% !important;
		max-width: 100% !important;
	}
}

/* Extra small devices */
@media (max-width: 360px) {
	.donation-widget-container {
		padding: 20px 12px;
	}

	.donation-widget iframe {
		min-height: 850px;
	}
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
	.donation-widget-container {
		background: rgba(255, 255, 255, 0.04);
		border-color: rgba(255, 255, 255, 0.08);
		box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
	}
}

/* Ensure proper stacking context */
#donation .donation-widget {
	position: relative;
	z-index: 1;
}

/* Focus state for accessibility */
.donation-widget iframe:focus {
	outline: 2px solid rgba(205, 103, 175, 0.5);
	outline-offset: 4px;
}

/* ── HelloAsso Donation Modal ── */

/* Modal backdrop */
#haWidgetModal {
	transition: opacity 0.3s ease, visibility 0.3s ease;
	opacity: 0;
	visibility: hidden;
}

#haWidgetModal.open {
	opacity: 1;
	visibility: visible;
}

/* Close button */
#closeHaWidgetBtn {
	transition: background 0.2s ease, transform 0.2s ease;
	background: #EFEFF4;
	cursor: pointer;
}

#closeHaWidgetBtn:hover {
	background: #E0E0E8;
	transform: scale(1.08);
}

#closeHaWidgetBtn:active {
	transform: scale(0.95);
}

#closeHaWidgetBtn svg {
	width: 24px;
	height: 24px;
	stroke: #333;
}

/* Modal content container */
#haWidgetModal .modal-content {
	height: 90vh;
	max-height: 90vh;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 20px 80px rgba(0, 0, 0, 0.3);
	animation: slideUp 0.3s ease;
	transform-origin: center;
}

@keyframes slideUp {
	from {
		opacity: 0;
		transform: translateY(20px) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

/* Modal iframe */
#haWidgetModal iframe {
	width: 100%;
	height: 100%;
	border: none;
	border-radius: 8px;
}

/* Mobile responsive */
@media (max-width: 600px) {
	#haWidgetModal {
		padding: 0;
	}

	#haWidgetModal .modal-content {
		height: 100%;
		max-height: 100%;
		width: 100%;
		border-radius: 0;
		max-width: none;
	}

	#closeHaWidgetBtn {
		top: 0.25rem;
		right: 0.75rem;
		width: 40px;
		height: 40px;
	}

	#closeHaWidgetBtn svg {
		width: 20px;
		height: 20px;
	}

	#haWidgetModal iframe {
		border-radius: 0;
	}
}

/* Very small devices */
@media (max-width: 360px) {
	#closeHaWidgetBtn {
		width: 36px;
		height: 36px;
		top: 0.5rem;
		right: 0.5rem;
	}

	#closeHaWidgetBtn svg {
		width: 18px;
		height: 18px;
	}
}

/* Prevent body scroll when modal is open */
body {
	transition: overflow 0.2s ease;
}

/* Accessibility focus state */
#openHaOverlay:focus,
#closeHaWidgetBtn:focus {
	outline: 2px solid rgba(205, 103, 175, 0.5);
	outline-offset: 2px;
}
