/**
 * Age Gate Rewarded Ads - Frontend Styles
 * Mobile-first, responsive, accessible.
 */

/* Prevent scrolling when popup is open */
body.agra-locked {
	overflow: hidden !important;
	touch-action: none;
}

/* Full-Screen Overlay (100vw × 100vh, z-index 999999) */
.agra-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.agra-overlay.agra-visible {
	opacity: 1;
	visibility: visible;
}

/* Dark blurred overlay */
.agra-overlay-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #000000cc;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	z-index: 1;
}

/* Container & Centered Card */
.agra-popup-container {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 440px;
	box-sizing: border-box;
}

.agra-popup-card {
	background: #14171f;
	color: #ffffff;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 20px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
	padding: 32px 24px;
	text-align: center;
	box-sizing: border-box;
	transform: scale(0.92);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.agra-overlay.agra-visible .agra-popup-card {
	transform: scale(1);
}

/* Stages */
.agra-stage {
	display: none;
	animation: agraFadeSlideIn 0.3s ease-out forwards;
}

.agra-stage.agra-stage-active {
	display: block;
}

@keyframes agraFadeSlideIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* 18+ Badge */
.agra-badge-wrapper {
	display: flex;
	justify-content: center;
	margin-bottom: 20px;
}

.agra-age-badge {
	width: 68px;
	height: 68px;
	border-radius: 50%;
	background: radial-gradient(circle, #e63946 0%, #d62828 100%);
	border: 3px solid #ffffff;
	box-shadow: 0 0 20px rgba(230, 57, 70, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
}

.agra-age-num {
	font-size: 24px;
	font-weight: 800;
	color: #ffffff;
	letter-spacing: -0.5px;
}

/* Heading & Typography */
.agra-heading {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.25;
	margin: 0 0 14px 0;
	color: #ffffff;
	letter-spacing: -0.3px;
}

.agra-description {
	font-size: 15px;
	line-height: 1.5;
	color: #a0aec0;
	margin-bottom: 24px;
}

.agra-description p {
	margin: 0 0 8px 0;
}

.agra-description p:last-child {
	margin-bottom: 0;
}

/* Buttons */
.agra-buttons-row {
	display: flex;
	gap: 14px;
	margin-top: 24px;
	margin-bottom: 16px;
}

.agra-btn {
	flex: 1;
	min-height: 48px;
	height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	border-radius: 12px;
	font-size: 17px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	box-sizing: border-box;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
}

.agra-btn-icon {
	font-size: 18px;
	font-weight: bold;
}

/* YES BUTTON: Green (#28a745) */
.agra-btn-yes {
	background-color: #28a745;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(40, 167, 69, 0.4);
}

.agra-btn-yes:hover {
	background-color: #218838;
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(40, 167, 69, 0.5);
}

.agra-btn-yes:active {
	background-color: #1e7e34;
	transform: translateY(0);
}

/* NO BUTTON: Red (#dc3545) */
.agra-btn-no {
	background-color: #dc3545;
	color: #ffffff;
	box-shadow: 0 4px 14px rgba(220, 53, 69, 0.4);
}

.agra-btn-no:hover {
	background-color: #c82333;
	transform: translateY(-2px);
	box-shadow: 0 6px 18px rgba(220, 53, 69, 0.5);
}

.agra-btn-no:active {
	background-color: #bd2130;
	transform: translateY(0);
}

/* Notice text */
.agra-notice-text {
	font-size: 12px;
	color: #718096;
	margin-top: 8px;
}

/* STAGE 2: Spinner & Ad playing state */
.agra-ad-spinner {
	margin: 20px auto 24px;
	width: 56px;
	height: 56px;
}

.agra-spinner-circle {
	width: 56px;
	height: 56px;
	border: 4px solid rgba(255, 255, 255, 0.15);
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: agraSpin 0.9s linear infinite;
}

@keyframes agraSpin {
	to {
		transform: rotate(360deg);
	}
}

.agra-ad-title {
	font-size: 20px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 10px;
}

.agra-ad-description {
	font-size: 14px;
	color: #a0aec0;
	line-height: 1.5;
	margin-bottom: 20px;
}

/* Progress bar */
.agra-progress-bar-wrap {
	width: 100%;
	height: 6px;
	background: rgba(255, 255, 255, 0.1);
	border-radius: 4px;
	overflow: hidden;
	margin: 16px 0;
}

.agra-progress-bar {
	width: 0%;
	height: 100%;
	background: linear-gradient(90deg, #3b82f6, #10b981);
	border-radius: 4px;
	transition: width 0.3s ease;
}

.agra-custom-ad-container {
	margin-top: 15px;
	min-height: 50px;
}

/* STAGE 3: Unlocked / Continue */
.agra-success-icon-wrap {
	margin: 10px auto 20px;
	width: 70px;
	height: 70px;
}

.agra-success-circle {
	width: 70px;
	height: 70px;
}

.agra-checkmark {
	width: 70px;
	height: 70px;
	border-radius: 50%;
	display: block;
	stroke-width: 3;
	stroke: #10b981;
	stroke-miterlimit: 10;
	box-shadow: inset 0px 0px 0px #10b981;
	animation: agraCheckFill 0.4s ease-in-out 0.4s forwards, agraCheckScale 0.3s ease-in-out 0.9s both;
}

.agra-checkmark-circle {
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
	stroke-width: 3;
	stroke-miterlimit: 10;
	stroke: #10b981;
	fill: none;
	animation: agraCheckStroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.agra-checkmark-check {
	transform-origin: 50% 50%;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
	animation: agraCheckStroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.6s forwards;
}

@keyframes agraCheckStroke {
	100% {
		stroke-dashoffset: 0;
	}
}

@keyframes agraCheckScale {
	0%, 100% {
		transform: none;
	}
	50% {
		transform: scale3d(1.1, 1.1, 1);
	}
}

@keyframes agraCheckFill {
	100% {
		box-shadow: inset 0px 0px 0px 30px rgba(16, 185, 129, 0.15);
	}
}

.agra-success-title {
	font-size: 22px;
	font-weight: 700;
	color: #ffffff;
	margin: 0 0 8px;
}

.agra-success-desc {
	font-size: 14px;
	color: #a0aec0;
	margin-bottom: 24px;
}

/* CONTINUE BUTTON */
.agra-btn-continue {
	width: 100%;
	min-height: 48px;
	height: 52px;
	background: linear-gradient(135deg, #2563eb, #1d4ed8);
	color: #ffffff;
	font-size: 17px;
	box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.agra-btn-continue:hover {
	background: linear-gradient(135deg, #1d4ed8, #1e40af);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.agra-btn-continue:active {
	transform: translateY(0);
}

.agra-btn-arrow {
	font-size: 20px;
	transition: transform 0.2s ease;
}

.agra-btn-continue:hover .agra-btn-arrow {
	transform: translateX(4px);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
	.agra-overlay {
		padding: 16px;
	}

	.agra-popup-card {
		padding: 28px 18px;
		border-radius: 18px;
	}

	.agra-heading {
		font-size: 23px;
	}

	.agra-buttons-row {
		flex-direction: column;
		gap: 12px;
	}

	.agra-btn {
		width: 100%;
		height: 50px;
	}
}
