.joe-popup-ad.popup-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 16px;
	background: rgba(15, 23, 42, 0.95);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	z-index: 99999;
	animation: joePopupFadeIn 0.3s ease-out;
}

.joe-popup-ad .popup-container {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 90%;
	max-width: 720px;
	padding: 40px 30px;
	transform: translate(-50%, -50%);
	background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
	border-radius: 20px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	overflow: visible;
}

.joe-popup-ad .close-button {
	position: absolute;
	top: 15px;
	right: 15px;
	width: 36px;
	height: 36px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: rgba(239, 68, 68, 0.1);
	color: #ef4444;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	z-index: 10;
}

.joe-popup-ad .close-button::before,
.joe-popup-ad .close-button::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 2px;
	border-radius: 99px;
	background: currentColor;
}

.joe-popup-ad .close-button::before {
	transform: rotate(45deg);
}

.joe-popup-ad .close-button::after {
	transform: rotate(-45deg);
}

.joe-popup-ad .close-button:hover {
	background: #ef4444;
	color: #fff;
	transform: rotate(90deg) scale(1.1);
}

.joe-popup-ad .close-button:active {
	transform: rotate(90deg) scale(0.95);
}

.joe-popup-ad .popup-decoration {
	position: absolute;
	top: -50%;
	right: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
	z-index: 0;
	animation: joePopupFloat 6s ease-in-out infinite;
}

.joe-popup-ad .progress-indicator {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 25px;
	padding: 15px;
	background: rgba(99, 102, 241, 0.1);
	border-radius: 12px;
}

.joe-popup-ad .progress-bar {
	flex: 1;
	height: 8px;
	overflow: hidden;
	background: #e2e8f0;
	border-radius: 4px;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.joe-popup-ad .progress-fill {
	width: 0;
	height: 100%;
	background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
	transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.joe-popup-ad .progress-text {
	min-width: 72px;
	font-size: 14px;
	font-weight: 600;
	text-align: right;
	color: #4f46e5;
}

.joe-popup-ad .popup-header {
	position: relative;
	z-index: 1;
	margin-bottom: 30px;
	text-align: center;
}

.joe-popup-ad .popup-title {
	margin: 0 0 10px;
	font-size: 28px;
	font-weight: 700;
	color: #1e293b;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.joe-popup-ad .popup-subtitle {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	color: #64748b;
}

.joe-popup-ad .popup-subtitle + .popup-subtitle {
	margin-top: 6px;
}

.joe-popup-ad .popup-content {
	position: relative;
	z-index: 1;
}

.joe-popup-ad .ad-container {
	min-height: 240px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 25px;
}

.joe-popup-ad .ad-card {
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	cursor: pointer;
	background: #f8fafc;
}

.joe-popup-ad .ad-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.joe-popup-ad .ad-card img {
	display: block;
	width: 100%;
	height: auto;
}

.joe-popup-ad .random-ad-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	margin-bottom: 20px;
	padding: 16px 24px;
	border: none;
	border-radius: 12px;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	overflow: hidden;
	background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
	box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.joe-popup-ad .random-ad-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.joe-popup-ad .random-ad-button:active {
	transform: translateY(0);
}

.joe-popup-ad .random-ad-button:disabled {
	opacity: 0.7;
	cursor: wait;
	transform: none;
}

.joe-popup-ad .random-ad-button::before {
	content: '';
	position: absolute;
	top: -50%;
	left: -60%;
	width: 20px;
	height: 200%;
	background: rgba(255, 255, 255, 0.3);
	transform: rotate(25deg);
	transition: all 0.6s;
}

.joe-popup-ad .random-ad-button:hover::before {
	left: 130%;
}

.joe-popup-ad .button-icon {
	font-size: 20px;
}

.joe-popup-ad .status-message {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 20px;
	padding: 15px;
	background: rgba(99, 102, 241, 0.1);
	border-radius: 12px;
	transition: all 0.3s ease;
}

.joe-popup-ad .status-icon {
	font-size: 24px;
}

.joe-popup-ad .status-text {
	font-size: 16px;
	font-weight: 500;
	color: #065f46;
}

.joe-popup-ad .completion-screen {
	position: relative;
	z-index: 1;
	display: none;
	padding: 40px 20px;
	text-align: center;
	animation: joePopupFadeIn 0.5s ease-out;
}

.joe-popup-ad .completion-screen.is-visible {
	display: block;
}

.joe-popup-ad .completion-icon {
	margin-bottom: 20px;
	font-size: 60px;
	animation: joePopupBounce 0.6s ease-out;
}

.joe-popup-ad .completion-title {
	margin-bottom: 15px;
	font-size: 32px;
	font-weight: 700;
	color: #1e293b;
	background: linear-gradient(135deg, #10b981 0%, #059669 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.joe-popup-ad .completion-text {
	margin-bottom: 30px;
	font-size: 18px;
	line-height: 1.6;
	color: #64748b;
}

.joe-popup-ad .enter-button {
	padding: 16px 48px;
	border: none;
	border-radius: 12px;
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
	box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
	transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.joe-popup-ad .enter-button:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.joe-popup-ad .enter-button:active {
	transform: translateY(0);
}

.joe-popup-ad .popup-footer {
	position: relative;
	z-index: 1;
	margin-top: 20px;
	text-align: center;
}

.joe-popup-ad .footer-note {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #94a3b8;
}

.joe-popup-ad .ad-card.disabled {
	opacity: 0.5;
	pointer-events: none;
	cursor: not-allowed;
}

body.popup-open,
body.joe-popup-ad-open {
	overflow: hidden;
}

@keyframes joePopupFadeIn {
	from {
		opacity: 0;
	}
	to {
		opacity: 1;
	}
}

@keyframes joePopupFloat {
	0%,
	100% {
		transform: translateY(0) rotate(0deg);
	}
	50% {
		transform: translateY(-20px) rotate(180deg);
	}
}

@keyframes joePopupBounce {
	0%,
	100% {
		transform: scale(1);
	}
	50% {
		transform: scale(1.1);
	}
}

@media (max-width: 768px) {
	.joe-popup-ad.popup-overlay {
		padding: 10px;
	}

	.joe-popup-ad .popup-container {
		top: 50%;
		width: 95%;
		padding: 30px 20px;
		transform: translate(-50%, -50%);
	}

	.joe-popup-ad .popup-title {
		font-size: 24px;
	}

	.joe-popup-ad .ad-card {
		max-width: 100%;
	}

	.joe-popup-ad .random-ad-button {
		padding: 14px 20px;
		font-size: 15px;
	}

	.joe-popup-ad .completion-title {
		font-size: 24px;
	}

	.joe-popup-ad .enter-button {
		padding: 14px 36px;
		font-size: 16px;
	}

	.joe-popup-ad .close-button {
		width: 32px;
		height: 32px;
	}
}
