/**
 * Dashboard Modal
 *
 * Achievement celebration modal with animations.
 *
 * @package AgenticWP
 */

/* ==========================================================================
   Component: Achievement Celebration Modal
   ========================================================================== */

.agenticwp-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.agenticwp-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.agenticwp-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(4px);
}

.agenticwp-modal-content {
	position: relative;
	background: white;
	border-radius: 24px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	max-width: 400px;
	width: 90%;
	padding: 32px;
	text-align: center;
	transform: scale(0.9) translateY(20px);
	transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.agenticwp-modal.is-open .agenticwp-modal-content {
	transform: scale(1) translateY(0);
}

.agenticwp-modal-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--agenticwp-bg-gray);
	border-radius: 50%;
	font-size: 20px;
	color: var(--agenticwp-text-muted);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.agenticwp-modal-close:hover {
	background: var(--agenticwp-bg-light);
	color: var(--agenticwp-text-primary);
}

.agenticwp-modal-header {
	margin-bottom: 24px;
}

.agenticwp-modal-confetti-text {
	font-size: 40px;
	display: block;
	margin-bottom: 12px;
	animation: celebrateBounce 0.6s ease infinite alternate;
}

@keyframes celebrateBounce {
	from {
		transform: scale(1);
	}
	to {
		transform: scale(1.1);
	}
}

.agenticwp-modal-title {
	font-size: 24px;
	font-weight: 700;
	color: var(--agenticwp-text-primary);
	margin: 0;
	background: linear-gradient(135deg, #2563eb, #1e3a8a);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.agenticwp-modal-body {
	margin-bottom: 24px;
}

.agenticwp-modal-badge-container {
	position: relative;
	width: 140px;
	height: 140px;
	margin: 0 auto 20px;
}

.agenticwp-modal-badge {
	position: relative;
	z-index: 1;
}

.agenticwp-modal-badge-wrapper {
	position: relative;
	display: inline-block;
}

.agenticwp-modal-badge-svg {
	display: block;
	animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.agenticwp-modal-badge-emoji {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	font-size: 48px;
	line-height: 1;
	z-index: 2;
	animation: emojiPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes emojiPop {
	0% {
		transform: translate(-50%, -50%) scale(0) rotate(-20deg);
		opacity: 0;
	}
	100% {
		transform: translate(-50%, -50%) scale(1) rotate(0deg);
		opacity: 1;
	}
}

.agenticwp-modal-badge-glow {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 160px;
	height: 160px;
	transform: translate(-50%, -50%);
	border-radius: 50%;
	opacity: 0.3;
	filter: blur(30px);
	animation: glowPulse 2s ease-in-out infinite;
	z-index: 0;
}

@keyframes glowPulse {
	0%, 100% {
		opacity: 0.2;
		transform: translate(-50%, -50%) scale(1);
	}
	50% {
		opacity: 0.4;
		transform: translate(-50%, -50%) scale(1.1);
	}
}

.agenticwp-modal-achievement-name {
	font-size: 20px;
	font-weight: 700;
	color: var(--agenticwp-text-primary);
	margin: 0 0 8px 0;
}

.agenticwp-modal-achievement-desc {
	font-size: 14px;
	color: var(--agenticwp-text-secondary);
	margin: 0 0 16px 0;
	line-height: 1.5;
}

.agenticwp-modal-tier-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: white;
}

.agenticwp-modal-footer {
	display: flex;
	justify-content: center;
}

.agenticwp-modal-btn {
	padding: 12px 32px;
	border: none;
	border-radius: 12px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.agenticwp-modal-btn-primary {
	background: linear-gradient(135deg, #2563eb, #1e3a8a);
	color: white;
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.agenticwp-modal-btn-primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.agenticwp-modal-btn-primary:active {
	transform: translateY(0);
}

/* Body class when modal is open */
body.agenticwp-modal-open {
	overflow: hidden;
}
