/* ==============================================
   Reward Plugin — Frontend Styles
   ============================================== */

/* --------------------------------------------------
   OVERLAY BASE
   -------------------------------------------------- */
.reward-overlay {
	display: none;
	z-index: 999999;
}

.reward-overlay.is-visible {
	display: flex;
}

/* --------------------------------------------------
   OVERLAY FULLSCREEN
   Cobre a viewport toda com blur no fundo
   -------------------------------------------------- */
.reward-overlay--fullscreen {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	align-items: center;
	justify-content: center;
}

.reward-overlay--fullscreen .reward-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.12);
	backdrop-filter: blur(8px) saturate(120%);
	-webkit-backdrop-filter: blur(8px) saturate(120%);
}

.reward-overlay--fullscreen .reward-overlay__center {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 660px;
	padding: 20px;
	box-sizing: border-box;
}

/* --------------------------------------------------
   OVERLAY POR CLASSE
   Sobrepõe apenas o elemento alvo
   -------------------------------------------------- */
.reward-overlay--class {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: inherit;
}

/* Para class overlay o card é posicionado absolutamente no topo */
.reward-overlay--class.is-visible {
	display: block;
}

.reward-overlay--class .reward-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.10);
	backdrop-filter: blur(8px) saturate(120%);
	-webkit-backdrop-filter: blur(8px) saturate(120%);
	border-radius: inherit;
}

.reward-overlay--class .reward-overlay__center {
	position: absolute;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	z-index: 1;
	width: 100%;
	max-width: 660px;
	padding: 0 20px;
	box-sizing: border-box;
}

/* --------------------------------------------------
   CARD
   -------------------------------------------------- */
.reward-card-wrap {
	margin: 0 auto;
}

.reward-card {
	background: #ffffff;
	border: 2px solid transparent;
	border-radius: 20px;
	padding: 36px 28px 28px;
	text-align: center;
	box-shadow:
		0 24px 64px rgba(0, 0, 0, 0.22),
		0 4px 16px  rgba(0, 0, 0, 0.10);
	width: 100%;
	box-sizing: border-box;
	position: relative;
	background-clip: padding-box;
}

/* Borda correndo ao redor do card */
.reward-card::before {
	content: '';
	position: absolute;
	inset: -4px;
	border-radius: 24px;
	padding: 4px;
	background: linear-gradient(135deg, #4F46E5, #9333EA, #EC4899, #F59E0B, #4F46E5);
	background-size: 300% 300%;
	-webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: running-border 2.5s linear infinite;
	pointer-events: none;
	z-index: -1;
}

/* Fallback para browsers sem suporte a mask */
@supports not (-webkit-mask-composite: xor) {
	.reward-card::before {
		inset: 0;
		z-index: 1;
		border-radius: 20px;
		background: linear-gradient(135deg, #4F46E5, #9333EA, #EC4899, #F59E0B, #4F46E5);
		background-size: 300% 300%;
		mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
		mask-composite: exclude;
	}
}

@keyframes running-border {
	0% {
		background-position: 0% 50%;
	}
	50% {
		background-position: 100% 50%;
	}
	100% {
		background-position: 0% 50%;
	}
}

/* Imagem: base */
.reward-card--image {
	overflow: hidden;
}

/* ---- Banner (imagem no topo) ---- */
.reward-card--image-banner {
	padding: 0;
}

.reward-card__image-banner {
	width: 100%;
	height: 160px;
	overflow: hidden;
	border-radius: 18px 18px 0 0;
}

.reward-card__image-banner img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Avatar (circular centralizado) ---- */
.reward-card--image-avatar {
	padding: 36px 28px 28px;
}

.reward-card__avatar-wrap {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: hidden;
	margin: 0 auto 16px;
	border: 3px solid rgba(0, 0, 0, 0.08);
}

.reward-card__avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ---- Lateral (imagem à esquerda) ---- */
.reward-card--image-lateral {
	padding: 0;
	display: flex;
	align-items: stretch;
}

.reward-card__lateral-img {
	width: 42%;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 18px 0 0 18px;
}

.reward-card__lateral-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.reward-card--image-lateral .reward-card__body {
	flex: 1;
	padding: 10px 10px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	text-align: center;
}

.reward-card--image-lateral .reward-card__title,
.reward-card--image-lateral .reward-card__subtitle,
.reward-card--image-lateral .reward-card__note {
	text-align: center !important;
}

.reward-card--image-lateral .reward-card__title {
	font-size: 16px !important;
	margin: 0 0 4px !important;
	line-height: 1.25 !important;
}

.reward-card--image-lateral .reward-card__subtitle {
	font-size: 12px !important;
	margin: 0 0 10px !important;
	line-height: 1.4 !important;
}

.reward-card--image-lateral .reward-card__btn {
	padding: 10px 12px !important;
	font-size: 11px !important;
}

.reward-card--image-lateral .reward-card__note {
	font-size: 11px !important;
}

/* ---- Cover (imagem de fundo, texto sobreposto com overlay escuro) ---- */
.reward-card--image-cover {
	padding: 0;
	overflow: hidden;
}

.reward-card__cover-hero {
	position: relative;
	width: 100%;
	height: 170px;
	border-radius: 18px 18px 0 0;
	overflow: hidden;
}

.reward-card__cover-hero img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.reward-card__cover-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.60) 45%, rgba(0,0,0,0.0) 100%);
}

.reward-card__cover-text {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 16px 20px;
	text-align: center;
}

.reward-card--image-cover .reward-card__cover-text .reward-card__title,
.reward-card--image-cover .reward-card__cover-text .reward-card__title--light {
	color: #ffffff !important;
}

.reward-card--image-cover .reward-card__cover-text .reward-card__subtitle,
.reward-card--image-cover .reward-card__cover-text .reward-card__subtitle--light {
	color: rgba(255,255,255,0.88) !important;
}

.reward-card__cover-bottom {
	padding: 16px 20px 20px;
	border-radius: 0 0 18px 18px;
}

/* ---- Split (imagem esq + texto dir em cima, botão abaixo) ---- */
.reward-card--image-split {
	padding: 0;
	overflow: hidden;
}

.reward-card__split-top {
	display: flex;
	align-items: center;
	gap: 0;
}

.reward-card__split-img {
	width: 42%;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 18px 0 0 0;
	height: 110px;
}

.reward-card__split-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.reward-card__split-text {
	flex: 1;
	padding: 14px 16px;
	text-align: left;
}

.reward-card__split-text .reward-card__title,
.reward-card__split-text .reward-card__subtitle {
	text-align: left !important;
}

.reward-card__split-bottom {
	padding: 16px 20px 20px;
	border-top: 1px solid rgba(0,0,0,0.06);
}

/* Corpo do card (banner + lateral) */
.reward-card__body {
	padding: 24px 28px 28px;
}

/* Ícone circular */
.reward-card__icon-wrap {
	width: 72px;
	height: 72px;
	background: #EEF2FF;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.reward-card__icon-wrap svg {
	width: 34px;
	height: 34px;
	stroke: #4F46E5;
	fill: none;
}

.reward-card__icon-emoji {
	font-size: 36px;
	line-height: 1;
}

.reward-card__icon-img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
}

/* Título */
.reward-card__title {
	font-size: 22px !important;
	font-weight: 700 !important;
	color: #111827 !important;
	margin: 0 0 8px !important;
	padding: 0 !important;
	line-height: 1.3 !important;
}

/* Subtítulo */
.reward-card__subtitle {
	font-size: 14px !important;
	color: #6B7280 !important;
	margin: 0 0 12px !important;
	padding: 0 !important;
	line-height: 1.6 !important;
}

/* Botão */
.reward-card__btn {
	display: block !important;
	width: 100% !important;
	padding: 15px 20px !important;
	background: #4F46E5;
	color: #ffffff !important;
	border: none !important;
	border-radius: 12px !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	cursor: pointer;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	text-decoration: none !important;
	text-align: center !important;
	line-height: 1.4 !important;
	transition: opacity 0.2s ease, transform 0.12s ease;
	box-sizing: border-box;
	outline: none;
}

.reward-card__btn--pulse {
	animation: pulse-btn 2s ease-in-out infinite;
}

@keyframes pulse-btn {
	0%, 100% {
		transform: scale(1);
		box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
	}
	50% {
		transform: scale(1.03);
		box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
	}
}

.reward-card__btn:hover,
.reward-card__btn:focus {
	opacity: 0.9;
	transform: translateY(-2px);
	color: #ffffff !important;
	text-decoration: none !important;
}

.reward-card__btn:active {
	transform: translateY(0);
	opacity: 1;
}

/* Texto abaixo do botão */
.reward-card__note {
	display: block;
	margin-top: 12px;
	font-size: 12px !important;
	color: #9CA3AF !important;
	line-height: 1.4;
}

/* --------------------------------------------------
   CARD INLINE (shortcode / parágrafo)
   -------------------------------------------------- */
.reward-inline-wrap {
	margin: 32px auto;
	max-width: 660px;
}

.reward-inline-wrap .reward-card {
	box-shadow:
		0 8px 32px rgba(0, 0, 0, 0.12),
		0 2px 8px  rgba(0, 0, 0, 0.06);
}

/* --------------------------------------------------
   Elemento alvo de overlay por classe
   Garante posicionamento relativo
   -------------------------------------------------- */
.reward-class-target-active {
	position: relative !important;
	overflow: hidden;
}

/* --------------------------------------------------
   PARAGRAPH BLUR GATE
   O conteúdo a partir do parágrafo N fica desfocado;
   o card flutua no topo da zona desfocada.
   -------------------------------------------------- */
.reward-para-gate {
	position: relative;
}

.reward-para-gate__blur {
	filter: blur(4px);
	pointer-events: none;
	user-select: none;
	-webkit-user-select: none;
	transform: translateZ(0); /* GPU acceleration */
}

.reward-para-gate__card {
	position: absolute;
	top: 24px;
	left: 50%;
	transform: translateX(-50%);
	will-change: transform;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	z-index: 10;
	width: 100%;
	max-width: 420px;
	padding: 0 20px;
	box-sizing: border-box;
}

.reward-para-gate--unlocked .reward-para-gate__blur {
	filter: none;
	pointer-events: auto;
	user-select: auto;
	-webkit-user-select: auto;
}

.reward-para-gate--unlocked .reward-para-gate__card {
	display: none;
}

/* --------------------------------------------------
   Trava scroll quando overlay fullscreen está ativo
   (classe adicionada via JS no body)
   -------------------------------------------------- */
body.reward-overlay-open {
	overflow: hidden;
}
