/**
 * Feature Images Section
 *
 * "Generate Images with AI" section with blue blob background.
 * Uses a centered showcase design with progressive animation.
 *
 * @package AgenticWP
 */

/* Animated blob background container - extends both directions */
/* Top extends -160px to smoothly blend into the lightweight Create section above */
.images-background {
	top: -160px;
	bottom: -120px;
	filter: url('#images-plasma');
}

/* Blob color customization for images section */
.images-background .images-blob {
	background: radial-gradient(
		circle,
		var(--feature-images-bg, #dbeafe) 0%,
		rgba(219, 234, 254, 0.1) 100%
	);
}

/* Blob animations with unique timings */
#images-blob-1 {
	animation: blob-float-1 26s ease-in-out infinite;
}

#images-blob-2 {
	animation: blob-float-2 30s ease-in-out infinite 5s;
}

#images-blob-3 {
	animation: blob-float-3 28s ease-in-out infinite 10s;
}

#images-blob-4 {
	animation: blob-float-4 27s ease-in-out infinite 3s;
}

#images-blob-5 {
	animation: blob-float-5 32s ease-in-out infinite 7s;
}

/* Content wrapper */
.images-content-wrapper {
	position: relative;
	z-index: 1;
	max-width: 1000px;
	margin: 0 auto;
	text-align: center;
}

/* Gradient accent for heading */
.feature-images h2 .accent {
	background: var(--gradient-blue);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: #1E40AF;
}

/* Lead text */
.feature-images .lead {
	font-size: 1.25rem;
	color: var(--muted);
	max-width: 600px;
	margin: 0 auto 3rem;
}

/* ============================================
   Progressive Animation Showcase
   ============================================ */

.images-showcase {
	margin: 3rem 0;
}

.generation-demo {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	max-width: 600px;
	margin: 0 auto;
}

/* Prompt Card */
.prompt-card {
	background: rgba(255, 255, 255, 0.9);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	padding: 1.5rem;
	border-radius: 16px;
	border: 1px solid var(--line);
	text-align: left;
	box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.prompt-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #3B82F6;
	margin-bottom: 0.5rem;
}

.prompt-text {
	font-size: 1rem;
	line-height: 1.6;
	color: var(--ink);
	display: flex;
	align-items: flex-start;
}

/* Typing animation */
.typing-text {
	overflow: hidden;
	white-space: nowrap;
	width: 0;
}

.typing-cursor {
	display: inline-block;
	width: 2px;
	height: 1.2em;
	background: #3B82F6;
	margin-left: 2px;
	animation: cursor-blink 1s step-end infinite;
}

/* Trigger animations when visible */
.images-showcase.in-view .typing-text {
	animation: typing 3s steps(80) 0.5s forwards;
}

.images-showcase.in-view .typing-cursor {
	animation: cursor-blink 1s step-end infinite, cursor-hide 0s 3.5s forwards;
}

@keyframes typing {
	from { width: 0; }
	to { width: 100%; }
}

@keyframes cursor-blink {
	50% { opacity: 0; }
}

@keyframes cursor-hide {
	to { opacity: 0; }
}

/* Generated Image Container */
.generated-image-container {
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 16px;
	overflow: hidden;
	background: linear-gradient(135deg, #dbeafe, #bfdbfe);
	border: 1px solid var(--line);
	box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

/* Shimmer loading effect */
.image-shimmer {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent 0%,
		rgba(255, 255, 255, 0.6) 50%,
		transparent 100%
	);
	background-size: 200% 100%;
	opacity: 0;
}

.images-showcase.in-view .image-shimmer {
	animation: shimmer 1.5s ease-in-out 3.5s forwards, shimmer-fade 0s 5s forwards;
}

@keyframes shimmer {
	0% {
		opacity: 1;
		background-position: 200% 0;
	}
	100% {
		opacity: 1;
		background-position: -200% 0;
	}
}

@keyframes shimmer-fade {
	to { opacity: 0; }
}

/* Generated image reveal */
.generated-image {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
}

.images-showcase.in-view .generated-image {
	animation: image-reveal 0.8s ease-out 5s forwards;
}

@keyframes image-reveal {
	from {
		opacity: 0;
		transform: scale(0.95);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.generated-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.image-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	color: #3B82F6;
	padding: 2rem;
	background: rgba(255, 255, 255, 0.8);
	border-radius: 12px;
}

.image-placeholder svg {
	width: 64px;
	height: 64px;
}

.image-placeholder span {
	font-size: 0.875rem;
	font-weight: 500;
}

/* ============================================
   Feature Highlight Cards Grid
   ============================================ */

.images-features-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	margin-top: 3rem;
	text-align: left;
}

.images-feature-card {
	background: rgba(255, 255, 255, 0.8);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	padding: 1.5rem;
	border-radius: 16px;
	border: 1px solid var(--line);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.images-feature-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

.images-feature-card .feature-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #dbeafe, #bfdbfe);
	border-radius: 12px;
	color: #1E40AF;
	margin-bottom: 1rem;
}

.images-feature-card h3 {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 0.5rem;
	text-align: left;
}

.images-feature-card p {
	font-size: 0.9375rem;
	color: var(--muted);
	line-height: 1.6;
	margin: 0;
	text-align: left;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 900px) {
	.images-features-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 768px) {
	.feature-images .lead {
		font-size: 1.125rem;
	}

	.prompt-text {
		font-size: 0.9375rem;
	}

	/* Disable typing animation on mobile for better UX */
	.typing-text {
		width: 100%;
		white-space: normal;
	}

	.typing-cursor {
		display: none;
	}

	.images-showcase.in-view .typing-text {
		animation: none;
	}

	.images-showcase.in-view .image-shimmer {
		animation: shimmer 1.5s ease-in-out 1s forwards, shimmer-fade 0s 2.5s forwards;
	}

	.images-showcase.in-view .generated-image {
		animation: image-reveal 0.8s ease-out 2.5s forwards;
	}

	.images-features-grid {
		grid-template-columns: 1fr;
		gap: 1rem;
	}

	.images-feature-card {
		padding: 1.25rem;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.typing-text {
		width: 100%;
		white-space: normal;
	}

	.typing-cursor {
		display: none;
	}

	.images-showcase.in-view .typing-text,
	.images-showcase.in-view .image-shimmer,
	.images-showcase.in-view .generated-image {
		animation: none;
	}

	.image-shimmer {
		display: none;
	}

	.generated-image {
		opacity: 1;
	}

	#images-blob-1,
	#images-blob-2,
	#images-blob-3,
	#images-blob-4,
	#images-blob-5 {
		animation: none;
	}
}
