/**
 * Tools Bento Grid CSS
 *
 * Unified bento layout for SEO tools landing page.
 * Hero tile spans 2x2, with 5 tool tiles arranged around it.
 *
 * @package AgenticWP
 */

/* ============================================
   Section Variables
   ============================================ */

.tools-section {
	--bento-cols: 3;
	--bento-gap: 1.5rem;
	--tile-radius: 20px;
	--tools-bg: #e0f7fa;

	position: relative;
	overflow: hidden;
}

/* ============================================
   Tool Gradient Assignments
   ============================================ */

/* Gradients from base.css: pink, orange, green, violet */
/* Gradients from features/variables.css: teal, blue, amber */
[data-tool="word-count"] { --tool-gradient: var(--gradient-teal); }
[data-tool="headline"] { --tool-gradient: var(--gradient-violet); }
[data-tool="readability"] { --tool-gradient: var(--gradient-green); }
[data-tool="serp"] { --tool-gradient: var(--gradient-blue); }
[data-tool="keyword"] { --tool-gradient: var(--gradient-orange); }

/* ============================================
   Blob Background Customization
   ============================================ */

.tools-background {
	filter: url('#tools-plasma');
}

.tools-background .tools-blob {
	background: radial-gradient(
		circle,
		var(--tools-bg) 0%,
		rgba(224, 247, 250, 0.1) 100%
	);
}

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

#tools-blob-2 {
	animation: blob-float-2 26s ease-in-out infinite 3s;
}

#tools-blob-3 {
	animation: blob-float-3 24s ease-in-out infinite 6s;
}

#tools-blob-4 {
	animation: blob-float-4 28s ease-in-out infinite 2s;
}

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

/* ============================================
   Bento Grid Layout
   ============================================ */

.tools-bento-grid {
	display: grid;
	grid-template-columns: repeat(var(--bento-cols), 1fr);
	grid-auto-flow: dense;
	gap: var(--bento-gap);
	position: relative;
	z-index: 1;
}

/* ============================================
   Base Tile Styles (Glassmorphism)
   ============================================ */

.bento-tile {
	background: linear-gradient(
		135deg,
		rgba(255, 255, 255, 0.7),
		rgba(255, 255, 255, 0.4)
	);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: var(--tile-radius);
	border: 1px solid rgba(255, 255, 255, 0.6);
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* ============================================
   Hero Tile
   ============================================ */

.bento-hero {
	grid-column: span 2;
	grid-row: span 2;
	padding: 2.5rem;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 400px;
}

.bento-hero-content {
	max-width: 460px;
}

.bento-hero h1 {
	font-size: clamp(2rem, 4vw, 2.75rem);
	font-weight: 700;
	color: var(--ink);
	line-height: 1.2;
	margin: 0 0 1rem;
}

.bento-hero h1 .accent {
	background: var(--gradient-teal);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: #14B8A6;
}

.bento-hero .lead {
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--muted);
	margin: 0;
}

.bento-hero-image {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	margin-top: auto;
}

.bento-hero-image svg,
.bento-hero-image img {
	max-width: 280px;
	height: auto;
	color: var(--accent);
	opacity: 0.6;
}

/* Placeholder styling */
.hero-illustration-placeholder {
	width: 100%;
	max-width: 280px;
}

/* ============================================
   Tool Tiles
   ============================================ */

.bento-tool {
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	min-height: 180px;
}

.bento-tool:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.bento-tool:focus {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Tool Icon */
.tool-icon {
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--tool-gradient);
	border-radius: 12px;
	color: #fff;
	margin-bottom: 1rem;
	flex-shrink: 0;
}

.tool-icon svg {
	width: 24px;
	height: 24px;
}

/* Tool Title */
.tool-title {
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--ink);
	margin: 0 0 0.5rem;
	line-height: 1.3;
}

/* Tool Description */
.tool-description {
	font-size: 0.9375rem;
	color: var(--muted);
	line-height: 1.5;
	margin: 0 0 auto;
	flex-grow: 1;
}

/* ============================================
   Coming Soon Badge
   ============================================ */

.coming-soon-badge {
	display: inline-block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 600;
	border-radius: 20px;
	background: #fef3c7;
	color: #78350f;
	margin-top: 1rem;
	align-self: flex-start;
}

/* ============================================
   Loading Skeleton (Future-proofing)
   ============================================ */

.bento-tool[data-loading] {
	position: relative;
	overflow: hidden;
	pointer-events: none;
}

.bento-tool[data-loading]::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		transparent,
		rgba(255, 255, 255, 0.4),
		transparent
	);
	animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
	0% {
		transform: translateX(-100%);
	}
	100% {
		transform: translateX(100%);
	}
}

/* ============================================
   Scroll Animation Stagger
   ============================================ */

/* Initial hidden state for scroll animations */
.animate-on-scroll {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.in-view {
	opacity: 1;
	transform: translateY(0);
}

/* Staggered delays - hero first, then tools */
.bento-hero.animate-on-scroll {
	transition-delay: 0s;
}

.bento-tool:nth-of-type(1).animate-on-scroll {
	transition-delay: 0.1s;
}

.bento-tool:nth-of-type(2).animate-on-scroll {
	transition-delay: 0.2s;
}

.bento-tool:nth-of-type(3).animate-on-scroll {
	transition-delay: 0.3s;
}

.bento-tool:nth-of-type(4).animate-on-scroll {
	transition-delay: 0.4s;
}

.bento-tool:nth-of-type(5).animate-on-scroll {
	transition-delay: 0.5s;
}

/* ============================================
   Responsive: Tablet (900px)
   ============================================ */

@media (max-width: 900px) {
	.tools-section {
		--bento-cols: 2;
	}

	.bento-hero {
		grid-column: span 2;
		grid-row: span 1;
		min-height: 300px;
	}

	.bento-hero-content {
		max-width: 100%;
	}

	.bento-hero-image {
		display: none;
	}
}

/* ============================================
   Responsive: Mobile (680px)
   ============================================ */

@media (max-width: 680px) {
	.tools-section {
		--bento-cols: 1;
		--bento-gap: 1rem;
	}

	.bento-hero {
		grid-column: span 1;
		padding: 2rem 1.5rem;
		min-height: auto;
	}

	.bento-hero h1 {
		font-size: 1.75rem;
	}

	.bento-hero .lead {
		font-size: 1rem;
	}

	.bento-tool {
		padding: 1.25rem;
		min-height: 150px;
	}

	.tool-icon {
		width: 40px;
		height: 40px;
	}

	.tool-icon svg {
		width: 20px;
		height: 20px;
	}

	.tool-title {
		font-size: 1rem;
	}

	.tool-description {
		font-size: 0.875rem;
	}
}

/* ============================================
   Accessibility: Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	.bento-tile {
		transition: none;
	}

	.animate-on-scroll {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.bento-tool[data-loading]::after {
		animation: none;
	}

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