/**
 * RankFlow AI Personalization
 * Isolated, responsive styles for recommendations, offers, and the customer hub.
 */

.rankflow-ai-section {
	clear: both;
	margin: clamp(36px, 7vw, 76px) 0;
	width: 100%;
}

.rankflow-ai-home-section {
	background: var(--rf-surface);
}

.rankflow-ai-home-section .rankflow-ai-section {
	margin: 0;
}

.rankflow-ai-section__header,
.rankflow-ai-dashboard__heading {
	align-items: flex-end;
	display: flex;
	gap: 24px;
	justify-content: space-between;
	margin-bottom: 24px;
}

.rankflow-ai-section__header h2,
.rankflow-ai-dashboard__heading h2 {
	font-size: clamp(1.65rem, 3vw, 2.35rem);
	margin: 4px 0 0;
}

.rankflow-ai-section__subtitle {
	color: var(--rf-muted);
	font-size: .92rem;
	line-height: 1.65;
	margin: 8px 0 0;
	max-width: 720px;
}

.rankflow-ai-kicker {
	color: var(--rf-primary);
	display: block;
	font-size: .72rem;
	font-weight: 800;
	letter-spacing: .11em;
	text-transform: uppercase;
}

.rankflow-ai-private-note {
	align-items: center;
	background: #ecfdf5;
	border: 1px solid #bbf7d0;
	border-radius: 999px;
	color: #047857;
	display: inline-flex;
	font-size: .72rem;
	font-weight: 750;
	padding: .5rem .8rem;
}

.rankflow-ai-private-note::before {
	background: #10b981;
	border-radius: 50%;
	content: "";
	height: 7px;
	margin-right: 7px;
	width: 7px;
}

.rankflow-ai-loading {
	align-items: center;
	background: linear-gradient(135deg, #f8fafc, #eff6ff);
	border: 1px solid var(--rf-line);
	border-radius: 18px;
	color: var(--rf-muted);
	display: flex;
	font-size: .9rem;
	font-weight: 700;
	gap: 12px;
	justify-content: center;
	min-height: 180px;
	padding: 30px;
}

.rankflow-ai-spinner {
	animation: rankflow-ai-spin .8s linear infinite;
	border: 3px solid #bfdbfe;
	border-radius: 50%;
	border-top-color: var(--rf-primary);
	height: 24px;
	width: 24px;
}

@keyframes rankflow-ai-spin {
	to { transform: rotate(360deg); }
}

.rankflow-ai-empty {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 16px;
	color: var(--rf-muted);
	padding: 24px;
	text-align: center;
}

.rankflow-ai-grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
}

.rankflow-ai-card {
	background: #fff;
	border: 1px solid var(--rf-line);
	border-radius: 18px;
	box-shadow: 0 10px 32px rgba(15, 23, 42, .07);
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	position: relative;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.rankflow-ai-card:hover {
	border-color: #bfdbfe;
	box-shadow: 0 18px 45px rgba(37, 99, 235, .13);
	transform: translateY(-5px);
}

.rankflow-ai-card__image {
	align-items: center;
	aspect-ratio: 16 / 10;
	background: linear-gradient(145deg, #f8fafc, #eef2ff);
	border-bottom: 1px solid var(--rf-line);
	display: flex;
	justify-content: center;
	overflow: hidden;
	padding: 12px;
	position: relative;
}

.rankflow-ai-card__image img {
	height: 100%;
	margin: 0;
	object-fit: contain;
	transition: transform .25s ease;
	width: 100%;
}

.rankflow-ai-card:hover .rankflow-ai-card__image img {
	transform: scale(1.025);
}

.rankflow-ai-badge {
	background: rgba(7, 17, 31, .91);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 999px;
	box-shadow: 0 5px 16px rgba(15, 23, 42, .17);
	color: #fff;
	font-size: .68rem;
	font-weight: 800;
	left: 12px;
	letter-spacing: .04em;
	padding: .45rem .7rem;
	position: absolute;
	text-transform: uppercase;
	top: 12px;
}

.rankflow-ai-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 19px;
}

.rankflow-ai-card__eyebrow {
	color: var(--rf-primary);
	font-size: .67rem;
	font-weight: 800;
	letter-spacing: .1em;
	margin: 0 0 7px;
	text-transform: uppercase;
}

.rankflow-ai-card__body h3 {
	font-size: 1.15rem;
	line-height: 1.3;
	margin: 0 0 9px;
}

.rankflow-ai-card__body h3 a {
	color: var(--rf-ink);
}

.rankflow-ai-card__body h3 a:hover {
	color: var(--rf-primary);
}

.rankflow-ai-card__description {
	color: var(--rf-muted);
	display: -webkit-box;
	font-size: .82rem;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-height: 1.6;
	margin: 0 0 16px;
	overflow: hidden;
}

.rankflow-ai-card__footer {
	border-top: 1px solid var(--rf-line);
	margin-top: auto;
	padding-top: 15px;
}

.rankflow-ai-price {
	color: var(--rf-ink);
	display: block;
	font-size: 1.08rem;
	font-weight: 850;
	margin-bottom: 11px;
}

.rankflow-ai-price del {
	color: #94a3b8;
	font-size: .8rem;
}

.rankflow-ai-price ins {
	text-decoration: none;
}

.rankflow-ai-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rankflow-ai-card__actions .button {
	flex: 1 1 auto;
	justify-content: center;
	margin: 0;
	min-width: 108px;
	text-align: center;
}

.rankflow-ai-offer {
	align-items: center;
	background:
		radial-gradient(circle at 85% 0, rgba(103, 232, 249, .19), transparent 30%),
		linear-gradient(135deg, #07111f, #12345a);
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 20px;
	box-shadow: 0 20px 48px rgba(7, 17, 31, .2);
	clear: both;
	color: #fff;
	display: grid;
	gap: 20px;
	grid-template-columns: auto minmax(0, 1fr) auto;
	margin: 34px 0;
	overflow: hidden;
	padding: clamp(22px, 4vw, 34px);
	position: relative;
}

.rankflow-ai-offer::after {
	border: 1px solid rgba(255, 255, 255, .07);
	border-radius: 50%;
	content: "";
	height: 180px;
	position: absolute;
	right: -70px;
	top: -105px;
	width: 180px;
}

.rankflow-ai-offer__icon {
	align-items: center;
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 16px;
	display: flex;
	height: 58px;
	justify-content: center;
	width: 58px;
}

.rankflow-ai-offer__icon svg {
	fill: #67e8f9;
	height: 27px;
	width: 27px;
}

.rankflow-ai-offer__content {
	min-width: 0;
}

.rankflow-ai-offer__content > span {
	color: #67e8f9;
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.rankflow-ai-offer__content h2 {
	color: #fff;
	font-size: clamp(1.35rem, 2.5vw, 1.85rem);
	margin: 5px 0 7px;
}

.rankflow-ai-offer__content p {
	color: #cbd5e1;
	font-size: .88rem;
	margin: 0;
	max-width: 690px;
}

.rankflow-ai-offer > .button {
	position: relative;
	white-space: nowrap;
	z-index: 1;
}

.rankflow-ai-login {
	background: #f8fafc;
	border: 1px solid var(--rf-line);
	border-radius: 18px;
	padding: 30px;
	text-align: center;
}

.rankflow-ai-dashboard {
	display: grid;
	gap: 26px;
	margin: 28px 0;
}

.rankflow-ai-dashboard__hero {
	align-items: center;
	background:
		radial-gradient(circle at 95% 10%, rgba(37, 99, 235, .42), transparent 34%),
		linear-gradient(135deg, #07111f, #102b4d);
	border-radius: 22px;
	color: #fff;
	display: flex;
	gap: 30px;
	justify-content: space-between;
	overflow: hidden;
	padding: clamp(28px, 5vw, 48px);
	position: relative;
}

.rankflow-ai-dashboard__hero h1 {
	color: #fff;
	font-size: clamp(2rem, 5vw, 3.25rem);
	margin: 7px 0 10px;
}

.rankflow-ai-dashboard__hero p {
	color: #cbd5e1;
	margin: 0;
	max-width: 650px;
}

.rankflow-ai-dashboard__hero .rankflow-ai-kicker {
	color: #67e8f9;
}

.rankflow-ai-dashboard__status {
	align-items: center;
	background: rgba(255, 255, 255, .08);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 18px;
	display: flex;
	flex: 0 0 145px;
	flex-direction: column;
	padding: 22px;
	position: relative;
	text-align: center;
}

.rankflow-ai-dashboard__status strong {
	color: #67e8f9;
	font-size: 2.6rem;
	line-height: 1;
}

.rankflow-ai-dashboard__status span {
	color: #e2e8f0;
	font-size: .72rem;
	font-weight: 700;
	margin-top: 8px;
	text-transform: uppercase;
}

.rankflow-ai-dashboard__panel {
	background: #fff;
	border: 1px solid var(--rf-line);
	border-radius: 20px;
	box-shadow: 0 12px 36px rgba(15, 23, 42, .06);
	padding: clamp(22px, 4vw, 32px);
}

.rankflow-ai-dashboard__heading {
	align-items: center;
}

.rankflow-ai-dashboard__heading h2 {
	font-size: clamp(1.45rem, 3vw, 2rem);
}

.rankflow-ai-dashboard__heading > a {
	color: var(--rf-primary);
	font-size: .8rem;
	font-weight: 800;
}

.rankflow-ai-dashboard__empty {
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
	padding: 22px;
}

.rankflow-ai-library {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rankflow-ai-library__product {
	align-items: center;
	background: #f8fafc;
	border: 1px solid var(--rf-line);
	border-radius: 14px;
	color: var(--rf-ink);
	display: flex;
	gap: 13px;
	min-width: 0;
	padding: 10px;
	transition: .2s ease;
}

.rankflow-ai-library__product:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	transform: translateY(-2px);
}

.rankflow-ai-library__product img {
	background: #fff;
	border-radius: 9px;
	height: 62px;
	object-fit: contain;
	width: 78px;
}

.rankflow-ai-library__product span {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rankflow-ai-library__product strong {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rankflow-ai-library__product small {
	color: var(--rf-muted);
	margin-top: 4px;
}

.rankflow-ai-downloads {
	border-top: 1px solid var(--rf-line);
	display: grid;
	gap: 8px;
	margin-top: 20px;
	padding-top: 20px;
}

.rankflow-ai-downloads a {
	align-items: center;
	border-radius: 9px;
	color: var(--rf-ink);
	display: flex;
	font-size: .85rem;
	justify-content: space-between;
	padding: 9px 11px;
}

.rankflow-ai-downloads a:hover {
	background: #eff6ff;
	color: var(--rf-primary);
}

.rankflow-ai-downloads strong {
	color: var(--rf-primary);
	font-size: .74rem;
	text-transform: uppercase;
}

.rankflow-ai-tips {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rankflow-ai-tip {
	background: #f8fafc;
	border: 1px solid var(--rf-line);
	border-radius: 15px;
	color: var(--rf-ink);
	display: grid;
	gap: 6px 10px;
	grid-template-columns: 34px 1fr;
	padding: 18px;
}

.rankflow-ai-tip > span {
	align-items: center;
	background: #dbeafe;
	border-radius: 9px;
	color: var(--rf-primary);
	display: flex;
	font-weight: 900;
	grid-row: 1 / 3;
	height: 34px;
	justify-content: center;
	width: 34px;
}

.rankflow-ai-tip strong {
	align-self: center;
}

.rankflow-ai-tip p {
	color: var(--rf-muted);
	font-size: .8rem;
	line-height: 1.55;
	margin: 0;
}

.rankflow-ai-tip:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: var(--rf-primary);
}

.rankflow-ai-privacy {
	align-items: center;
	background: #f8fafc;
	border: 1px solid var(--rf-line);
	border-radius: 16px;
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1fr) auto;
	padding: 20px;
}

.rankflow-ai-privacy p {
	color: var(--rf-muted);
	font-size: .78rem;
	margin: 4px 0 0;
}

.rankflow-ai-privacy__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rankflow-ai-privacy__actions .button {
	margin: 0;
}

.rankflow-ai-privacy__message {
	grid-column: 1 / -1;
}

.rankflow-ai-privacy__message.is-success {
	color: #047857;
	font-weight: 700;
}

.rankflow-ai-recent {
	margin-bottom: 0;
}

.rankflow-ai-block-preview {
	background: linear-gradient(135deg, #eff6ff, #ecfeff);
	border: 1px solid #bfdbfe;
	border-radius: 10px;
	color: #0f172a;
	padding: 22px;
}

.rankflow-ai-block-preview small {
	color: #64748b;
	display: block;
	margin-top: 6px;
}

.single-product .rankflow-ai-section {
	float: none;
}

.woocommerce-cart .rankflow-ai-section,
.woocommerce-checkout .rankflow-ai-section {
	margin-inline: auto;
	max-width: 1280px;
}

@media (max-width: 880px) {
	.rankflow-ai-offer {
		align-items: start;
		grid-template-columns: auto minmax(0, 1fr);
	}

	.rankflow-ai-offer > .button {
		grid-column: 2;
		justify-self: start;
	}

	.rankflow-ai-library,
	.rankflow-ai-tips {
		grid-template-columns: 1fr;
	}

	.rankflow-ai-privacy {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.rankflow-ai-section {
		margin: 36px 0;
	}

	.rankflow-ai-section__header,
	.rankflow-ai-dashboard__heading {
		align-items: flex-start;
		flex-direction: column;
		gap: 10px;
	}

	.rankflow-ai-private-note {
		align-self: flex-start;
	}

	.rankflow-ai-grid {
		grid-template-columns: 1fr;
		margin-inline: auto;
		max-width: 390px;
	}

	.rankflow-ai-offer {
		grid-template-columns: 1fr;
		text-align: left;
	}

	.rankflow-ai-offer > .button {
		grid-column: auto;
		justify-self: stretch;
		text-align: center;
	}

	.rankflow-ai-offer__icon {
		height: 48px;
		width: 48px;
	}

	.rankflow-ai-dashboard__hero {
		align-items: flex-start;
		flex-direction: column;
	}

	.rankflow-ai-dashboard__status {
		align-items: baseline;
		flex: none;
		flex-direction: row;
		gap: 10px;
		padding: 14px 18px;
		width: auto;
	}

	.rankflow-ai-dashboard__status strong {
		font-size: 1.8rem;
	}

	.rankflow-ai-library__product img {
		height: 54px;
		width: 66px;
	}

	.rankflow-ai-privacy__actions {
		flex-direction: column;
	}

	.rankflow-ai-privacy__actions .button {
		justify-content: center;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rankflow-ai-spinner {
		animation-duration: 1.8s;
	}

	.rankflow-ai-card,
	.rankflow-ai-card__image img,
	.rankflow-ai-library__product {
		transition: none;
	}
}
