/**
 * Pro Feature Gate Styles
 *
 * Styles for PRO badges, locked fields, upgrade modal,
 * visual preview cards with opacity overlay, and 3-column upsell grid.
 *
 * @package GenForm
 */

@use '../abstracts' as *;

/* ── PRO Badge ── */
.gfm-pro-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #f59e0b, #f97316);
	border-radius: 4px;
	line-height: 1.6;
	vertical-align: middle;
	box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
	animation: gfm-badge-glow 2s ease-in-out infinite alternate;
}

@keyframes gfm-badge-glow {
	0% {
		box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
	}

	100% {
		box-shadow: 0 2px 8px rgba(249, 115, 22, 0.5);
	}
}

.gfm-pro-badge-lg {
	padding: 4px 14px;
	font-size: 11px;
	border-radius: 6px;
}

/* ── Locked Tab ── */
.gfm-pro-tab-locked {
	position: relative;
	opacity: 0.7;
	cursor: pointer;
	transition: opacity 0.2s;

	&:hover {
		opacity: 1;
	}

	.gfm-pro-badge {
		margin-left: 6px;
		font-size: 8px;
		padding: 1px 6px;
	}
}

/* ── Locked Field Button ── */
.gfm-pro-field-locked {
	cursor: pointer !important;
}

/* ── Visual Preview Card (Opacity Style, No Blur) ── */
.gfm-pro-preview-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	overflow: hidden;
	transition: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	position: relative;

	&:hover {
		border-color: #c7d2fe;
		box-shadow: 0 12px 32px rgba(99, 102, 241, 0.14);
		transform: translateY(-4px);

		.gfm-pro-preview-image img {
			opacity: 1;
			transform: scale(1.03);
		}

		.gfm-pro-preview-overlay {
			opacity: 0;
		}

		.gfm-btn-pro-upgrade {
			background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
			box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
		}
	}
}

.gfm-pro-preview-image {
	position: relative;
	overflow: hidden;
	height: 200px;
	background: #f8fafc;

	img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		opacity: 0.85;
		transition: opacity 0.4s ease, transform 0.5s ease;
	}
}

/* Simple subtle overlay instead of blur */
.gfm-pro-preview-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg,
			transparent 40%,
			rgba(255, 255, 255, 0.6) 100%);
	pointer-events: none;
	transition: opacity 0.3s ease;
}

/* Lock icon centered on image */
.gfm-pro-preview-lock {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

	.dashicons {
		color: #6366f1;
		font-size: 16px;
		width: 16px;
		height: 16px;
	}
}

.gfm-pro-preview-content {
	padding: 18px 20px 20px;
}

.gfm-pro-preview-header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;

	.dashicons {
		color: #6366f1;
		font-size: 20px;
		width: 20px;
		height: 20px;
		flex-shrink: 0;
	}

	h4 {
		margin: 0;
		font-size: 15px;
		font-weight: 700;
		color: #1f2937;
		flex: 1;
	}
}

.gfm-pro-preview-content p {
	margin: 0 0 16px 0;
	font-size: 13px;
	line-height: 1.6;
	color: #6b7280;
}

.gfm-pro-preview-content .gfm-btn-pro-upgrade {
	width: 100%;
	justify-content: center;
	font-size: 12.5px;
	padding: 10px 16px;
	border-radius: 10px;
}

/* ── 3-Column Preview Grid ── */
.gfm-pro-preview-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	padding: 24px;
}

@media (max-width: 1200px) {
	.gfm-pro-preview-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.gfm-pro-preview-grid {
		grid-template-columns: 1fr;
	}
}

/* No-image card (icon-only variant) */
.gfm-pro-preview-card--no-image {
	.gfm-pro-preview-icon-area {
		height: 140px;
		background: linear-gradient(135deg, #eef2ff, #e0e7ff);
		display: flex;
		align-items: center;
		justify-content: center;

		.dashicons {
			font-size: 48px;
			width: 48px;
			height: 48px;
			color: #818cf8;
			opacity: 0.7;
		}
	}

	&:hover .gfm-pro-preview-icon-area .dashicons {
		opacity: 1;
		transform: scale(1.1);
		transition: all 0.3s ease;
	}
}

/* ── Pro Locked Card (Simple version without image) ── */
.gfm-pro-locked-card {
	background: linear-gradient(135deg, #fefce8, #fef3c7);
	border: 2px dashed #fbbf24;
	border-radius: 12px;
	padding: 24px;
	text-align: center;
}

.gfm-pro-locked-inner {
	max-width: 320px;
	margin: 0 auto;
}

.gfm-pro-locked-icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 12px;
	background: #fef3c7;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;

	.dashicons {
		font-size: 24px;
		width: 24px;
		height: 24px;
		color: #f59e0b;
	}
}

.gfm-pro-locked-card h3 {
	font-size: 16px;
	font-weight: 700;
	color: #92400e;
	margin: 0 0 6px;
}

.gfm-pro-locked-card p {
	font-size: 13px;
	color: #a16207;
	line-height: 1.5;
	margin: 0 0 14px;
}

.gfm-pro-locked-card .gfm-pro-badge-lg {
	display: inline-block;
	margin-bottom: 14px;
}

/* ── Pro Upgrade Button ── */
.gfm-btn-pro-upgrade {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 700;
	color: #fff !important;
	background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
	border: none;
	border-radius: 10px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.3s ease;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);

	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
	}

	&:hover {
		background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
		transform: translateY(-1px);
		box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
		color: #fff !important;
	}
}

/* ── Pro Fields Section in Sidebar ── */
.gfm-pro-fields-divider {
	margin: 16px 0 12px;
	padding-top: 16px;
	border-top: 1px dashed #e5e7eb;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #f59e0b;
	display: flex;
	align-items: center;
	gap: 6px;

	.dashicons {
		font-size: 14px;
		width: 14px;
		height: 14px;
	}
}

/* ── Pro Modal ── */
.gfm-pro-modal-content {
	text-align: center;
	max-width: 440px;
}

.gfm-pro-modal-body {
	padding: 32px 28px !important;
}

.gfm-pro-modal-icon {
	width: 64px;
	height: 64px;
	margin: 0 auto 16px;
	background: linear-gradient(135deg, #dbeafe, #ede9fe);
	border-radius: 20px;
	display: flex;
	align-items: center;
	justify-content: center;

	.dashicons {
		font-size: 30px;
		width: 30px;
		height: 30px;
		color: #6366f1;
	}
}

.gfm-pro-modal-body h2 {
	font-size: 20px;
	font-weight: 800;
	color: #1e293b;
	margin: 0 0 8px;
}

.gfm-pro-modal-body>p {
	color: #64748b;
	font-size: 14px;
	margin: 0 0 20px;
	line-height: 1.6;
}

.gfm-pro-feature-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 24px;
	text-align: left;
}

.gfm-pro-feature-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #374151;
	font-weight: 500;

	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
		color: #10b981;
	}
}

.gfm-pro-modal-body .gfm-btn-large {
	padding: 12px 28px;
	font-size: 15px;
	width: 100%;
	justify-content: center;
}

.gfm-pro-modal-note {
	margin-top: 10px;
	font-size: 12px;
	color: #9ca3af;
}

/* ── Pro Settings Header ── */
.gfm-pro-settings-header {
	padding: 24px 24px 0;

	h2 {
		margin: 0 0 4px;
		font-size: 18px;
		font-weight: 800;
		color: #1e293b;
		display: flex;
		align-items: center;
		gap: 6px;

		.dashicons {
			color: #6366f1;
		}
	}

	p {
		color: #64748b;
		font-size: 14px;
		margin: 0;
	}
}

/* ── Pro Upgrade Modal (Pricing) ── */
.gfm-pro-upgrade-modal-content {
	max-width: 780px !important;
	border-radius: 20px !important;
	overflow: hidden;
}

.gfm-pro-upgrade-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 24px;
	background: linear-gradient(135deg, #4f46e5, #7c3aed);
	color: #fff;

	.gfm-pro-upgrade-header-left {
		display: flex;
		align-items: center;
		gap: 10px;

		.dashicons {
			font-size: 22px;
			width: 22px;
			height: 22px;
		}

		h3 {
			margin: 0;
			font-size: 16px;
			font-weight: 700;
			color: #fff;
		}
	}

	.gfm-close-modal {
		color: rgba(255, 255, 255, 0.8);
		cursor: pointer;
		transition: color 0.2s;

		&:hover {
			color: #fff;
		}
	}
}

.gfm-pro-upgrade-body {
	padding: 24px;
}

/* Context banner */
.gfm-pro-upgrade-context {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	margin-bottom: 20px;
	background: linear-gradient(135deg, #fef3c7, #fde68a);
	border: 1px solid #fbbf24;
	border-radius: 10px;
	font-size: 13px;
	font-weight: 600;
	color: #92400e;

	.dashicons {
		font-size: 16px;
		width: 16px;
		height: 16px;
		color: #f59e0b;
	}
}

/* Pricing grid */
.gfm-pro-pricing-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
	margin-bottom: 20px;
}

@media (max-width: 700px) {
	.gfm-pro-pricing-grid {
		grid-template-columns: 1fr;
	}
}

/* Plan card */
.gfm-pro-plan-card {
	position: relative;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 20px 16px;
	text-align: center;
	transition: all 0.3s ease;

	&:hover {
		border-color: #c7d2fe;
		box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
		transform: translateY(-2px);
	}
}

.gfm-pro-plan-popular {
	border: 2px solid #6366f1;
	box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
	transform: scale(1.02);

	&:hover {
		transform: scale(1.04) translateY(-2px);
		border-color: #4f46e5;
	}
}

.gfm-pro-plan-badge {
	position: absolute;
	top: -10px;
	left: 50%;
	transform: translateX(-50%);
	padding: 3px 14px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #6366f1, #8b5cf6);
	border-radius: 20px;
	white-space: nowrap;
}

.gfm-pro-plan-header {
	margin-bottom: 16px;

	h4 {
		margin: 0 0 4px;
		font-size: 14px;
		font-weight: 700;
		color: #6b7280;
		text-transform: uppercase;
		letter-spacing: 0.5px;
	}
}

.gfm-pro-plan-price {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 2px;
	margin-bottom: 4px;
}

.gfm-pro-price-amount {
	font-size: 36px;
	font-weight: 800;
	color: #1e293b;
	line-height: 1;
}

.gfm-pro-price-period {
	font-size: 14px;
	color: #9ca3af;
	font-weight: 500;
}

.gfm-pro-plan-sites {
	font-size: 12px;
	color: #9ca3af;
}

.gfm-pro-plan-features {
	list-style: none;
	padding: 0;
	margin: 0 0 16px;
	text-align: left;

	li {
		display: flex;
		align-items: center;
		gap: 6px;
		padding: 5px 0;
		font-size: 13px;
		color: #374151;

		.dashicons {
			font-size: 16px;
			width: 16px;
			height: 16px;
			color: #10b981;
			flex-shrink: 0;
		}
	}
}

.gfm-plan-feature-muted {
	color: #d1d5db !important;

	.dashicons {
		color: #d1d5db !important;
	}
}

.gfm-pro-plan-btn {
	display: block !important;
	width: 100%;
	padding: 10px 16px !important;
	font-size: 13px !important;
	font-weight: 700;
	text-align: center;
	border-radius: 10px !important;
	text-decoration: none;
	transition: all 0.3s ease;
	border: 2px solid #e5e7eb;
	color: #4b5563 !important;
	background: #fff !important;
	box-shadow: none !important;

	&:hover {
		border-color: #6366f1;
		color: #6366f1 !important;
		background: #eef2ff !important;
	}
}

/* Popular plan button override */
.gfm-pro-plan-popular .gfm-pro-plan-btn {
	border: none !important;
	color: #fff !important;
	background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
	box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3) !important;

	&:hover {
		background: linear-gradient(135deg, #4f46e5, #7c3aed) !important;
		box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
	}
}

/* Trust indicators */
.gfm-pro-upgrade-trust {
	display: flex;
	justify-content: center;
	gap: 24px;
	padding: 16px 0;
	border-top: 1px solid #f3f4f6;
	margin-bottom: 8px;
}

.gfm-pro-trust-item {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #9ca3af;
	font-weight: 500;

	.dashicons {
		font-size: 14px;
		width: 14px;
		height: 14px;
		color: #10b981;
	}
}

@media (max-width: 700px) {
	.gfm-pro-upgrade-trust {
		flex-direction: column;
		align-items: center;
		gap: 8px;
	}
}

.gfm-pro-upgrade-footer {
	text-align: center;
	padding-bottom: 4px;
}

.gfm-pro-view-all-link {
	font-size: 13px;
	color: #6366f1;
	text-decoration: none;
	font-weight: 600;

	&:hover {
		text-decoration: underline;
		color: #4f46e5;
	}
}