/**
 * Woo Gamified Hunts — Spawner Styles
 *
 * Base hunt-item shell, theme variants, floating / shimmer motion,
 * collection animation, and responsive adjustments.
 *
 * @package WooGamifiedHunts
 */

/* ── base item ──────────────────────────────────────────────────── */

.wgh-hunt-item {
	position: fixed;
	width: 60px;
	height: 60px;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	pointer-events: auto;
	animation: wghFloat 3s ease-in-out infinite;
	transition: transform 0.3s ease, opacity 0.4s ease;
	will-change: transform, opacity;
}

.wgh-hunt-item:hover,
.wgh-hunt-item:focus-visible {
	transform: scale(1.18);
	outline: none;
}

.wgh-hunt-inner {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	position: relative;
	overflow: visible;
}

.wgh-icon {
	width: 44px;
	height: 44px;
	display: block;
}

/* ── floating animation ─────────────────────────────────────────── */

@keyframes wghFloat {
	0%, 100% { transform: translateY(0);  }
	50%      { transform: translateY(-8px); }
}

/* ── shimmer overlay (pseudo-element) ───────────────────────────── */

.wgh-hunt-inner::after {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	animation: wghShimmer 2.4s ease-in-out infinite;
}

@keyframes wghShimmer {
	0%, 100% { opacity: 0;   transform: scale(1);   }
	50%      { opacity: 0.5; transform: scale(1.15); }
}

/* ── collection animation ───────────────────────────────────────── */

.wgh-hunt-item.wgh-collected {
	animation: wghCollect 0.55s ease-out forwards;
	pointer-events: none;
}

@keyframes wghCollect {
	0%   { transform: scale(1);   opacity: 1; }
	40%  { transform: scale(1.4); opacity: 0.8; }
	100% { transform: scale(0);   opacity: 0; }
}

/* ── theme: easter ──────────────────────────────────────────────── */

.wgh-theme-easter .wgh-hunt-inner {
	background: radial-gradient(circle at 30% 30%, #f8bbd0, #f48fb1);
	box-shadow: 0 4px 16px rgba(233, 30, 99, 0.25);
}

.wgh-theme-easter .wgh-hunt-inner::after {
	background: radial-gradient(circle, rgba(233, 30, 99, 0.3), transparent 70%);
}

/* ── theme: christmas ───────────────────────────────────────────── */

.wgh-theme-christmas .wgh-hunt-inner {
	background: radial-gradient(circle at 30% 30%, #ef5350, #c62828);
	box-shadow: 0 4px 16px rgba(198, 40, 40, 0.3);
}

.wgh-theme-christmas .wgh-hunt-inner::after {
	background: radial-gradient(circle, rgba(253, 216, 53, 0.35), transparent 70%);
}

/* ── theme: black_friday ────────────────────────────────────────── */

.wgh-theme-black_friday .wgh-hunt-inner {
	background: radial-gradient(circle at 30% 30%, #424242, #212121);
	box-shadow: 0 4px 16px rgba(253, 216, 53, 0.25);
}

.wgh-theme-black_friday .wgh-hunt-inner::after {
	background: radial-gradient(circle, rgba(253, 216, 53, 0.4), transparent 70%);
}

/* ── theme: custom (fallback) ───────────────────────────────────── */

.wgh-theme-custom .wgh-hunt-inner {
	background: radial-gradient(circle at 30% 30%, #b388ff, #7c4dff);
	box-shadow: 0 4px 16px rgba(124, 77, 255, 0.25);
}

.wgh-theme-custom .wgh-hunt-inner::after {
	background: radial-gradient(circle, rgba(124, 77, 255, 0.3), transparent 70%);
}

/* ── responsive: scale down on smaller screens ──────────────────── */

@media (max-width: 600px) {
	.wgh-hunt-item {
		width: 46px;
		height: 46px;
	}

	.wgh-icon {
		width: 32px;
		height: 32px;
	}
}

@media (max-width: 400px) {
	.wgh-hunt-item {
		width: 38px;
		height: 38px;
	}

	.wgh-icon {
		width: 26px;
		height: 26px;
	}
}

/* ── claim feedback toast (errors only in Step 5) ───────────────── */

.wgh-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(20px);
	max-width: 420px;
	width: calc(100% - 32px);
	padding: 14px 20px;
	border-radius: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #fff;
	text-align: center;
	z-index: 99995;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.35s ease, transform 0.35s ease;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.wgh-toast--visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
	pointer-events: auto;
}

.wgh-toast--success {
	background: #2e7d32;
}

.wgh-toast--error {
	background: #c62828;
}

/* ── success modal overlay ──────────────────────────────────────── */

.wgh-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	opacity: 0;
	transition: opacity 0.3s ease;
	padding: 16px;
}

.wgh-modal-overlay--visible {
	opacity: 1;
}

.wgh-modal-overlay--closing {
	opacity: 0;
	pointer-events: none;
}

/* ── modal card ─────────────────────────────────────────────────── */

.wgh-modal {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	border-radius: 16px;
	padding: 32px 28px 24px;
	text-align: center;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
	transform: scale(0.9) translateY(12px);
	transition: transform 0.3s ease, opacity 0.3s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.wgh-modal-overlay--visible .wgh-modal {
	transform: scale(1) translateY(0);
}

.wgh-modal-overlay--closing .wgh-modal {
	transform: scale(0.9) translateY(12px);
}

/* ── close button ───────────────────────────────────────────────── */

.wgh-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	color: #757575;
	cursor: pointer;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s, color 0.2s;
}

.wgh-modal-close:hover,
.wgh-modal-close:focus-visible {
	background: #f5f5f5;
	color: #212121;
	outline: none;
}

/* ── modal icon ─────────────────────────────────────────────────── */

.wgh-modal-icon-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 16px;
}

.wgh-modal-icon {
	width: 72px;
	height: 72px;
	animation: wghModalBounce 0.6s ease-out;
}

@keyframes wghModalBounce {
	0%   { transform: scale(0);   opacity: 0; }
	50%  { transform: scale(1.2); opacity: 1; }
	70%  { transform: scale(0.9); }
	100% { transform: scale(1);   }
}

/* ── modal content ──────────────────────────────────────────────── */

.wgh-modal-title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #212121;
}

.wgh-modal-message {
	font-size: 14px;
	line-height: 1.6;
	color: #555;
	margin: 0 0 20px;
}

/* ── coupon code display ────────────────────────────────────────── */

.wgh-modal-code-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 0 20px;
	flex-wrap: wrap;
}

.wgh-modal-code {
	display: inline-block;
	padding: 8px 16px;
	background: #f5f5f5;
	border: 1px dashed #bdbdbd;
	border-radius: 6px;
	font-family: "SF Mono", Monaco, "Cascadia Mono", monospace;
	font-size: 15px;
	font-weight: 600;
	color: #212121;
	letter-spacing: 0.5px;
	user-select: all;
	-webkit-user-select: all;
}

.wgh-modal-copy {
	padding: 8px 14px;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	background: #fafafa;
	font-size: 13px;
	font-weight: 500;
	color: #424242;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}

.wgh-modal-copy:hover,
.wgh-modal-copy:focus-visible {
	background: #eeeeee;
	border-color: #bdbdbd;
	outline: none;
}

.wgh-modal-copy--done {
	background: #e8f5e9;
	border-color: #66bb6a;
	color: #2e7d32;
}

/* ── continue button ────────────────────────────────────────────── */

.wgh-modal-continue {
	display: inline-block;
	padding: 10px 28px;
	border: none;
	border-radius: 8px;
	background: #424242;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.wgh-modal-continue:hover,
.wgh-modal-continue:focus-visible {
	background: #212121;
	outline: none;
}

/* ── theme-specific modal accents ───────────────────────────────── */

.wgh-theme-easter .wgh-modal {
	border-top: 4px solid #e91e63;
}

.wgh-theme-easter .wgh-modal-title {
	color: #c2185b;
}

.wgh-theme-easter .wgh-modal-continue {
	background: #e91e63;
}

.wgh-theme-easter .wgh-modal-continue:hover,
.wgh-theme-easter .wgh-modal-continue:focus-visible {
	background: #c2185b;
}

.wgh-theme-christmas .wgh-modal {
	border-top: 4px solid #c62828;
}

.wgh-theme-christmas .wgh-modal-title {
	color: #b71c1c;
}

.wgh-theme-christmas .wgh-modal-continue {
	background: #c62828;
}

.wgh-theme-christmas .wgh-modal-continue:hover,
.wgh-theme-christmas .wgh-modal-continue:focus-visible {
	background: #b71c1c;
}

.wgh-theme-black_friday .wgh-modal {
	border-top: 4px solid #fdd835;
}

.wgh-theme-black_friday .wgh-modal-title {
	color: #f9a825;
}

.wgh-theme-black_friday .wgh-modal-continue {
	background: #212121;
	border: 1px solid #fdd835;
	color: #fdd835;
}

.wgh-theme-black_friday .wgh-modal-continue:hover,
.wgh-theme-black_friday .wgh-modal-continue:focus-visible {
	background: #424242;
}

.wgh-theme-custom .wgh-modal {
	border-top: 4px solid #7c4dff;
}

.wgh-theme-custom .wgh-modal-title {
	color: #651fff;
}

.wgh-theme-custom .wgh-modal-continue {
	background: #7c4dff;
}

.wgh-theme-custom .wgh-modal-continue:hover,
.wgh-theme-custom .wgh-modal-continue:focus-visible {
	background: #651fff;
}

/* ── modal responsive ───────────────────────────────────────────── */

@media (max-width: 480px) {
	.wgh-modal {
		padding: 24px 18px 18px;
		border-radius: 12px;
	}

	.wgh-modal-icon {
		width: 56px;
		height: 56px;
	}

	.wgh-modal-title {
		font-size: 18px;
	}

	.wgh-modal-code {
		font-size: 13px;
		padding: 6px 12px;
	}
}

/* ── reduced motion preference ──────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
	.wgh-hunt-item {
		animation: none;
	}

	.wgh-hunt-inner::after {
		animation: none;
	}

	.wgh-hunt-item.wgh-collected {
		animation: none;
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	.wgh-modal-icon {
		animation: none;
	}

	.wgh-modal-overlay,
	.wgh-modal,
	.wgh-toast {
		transition: none;
	}
}
