c/* Modern Theme Plugins Finder Widget */
.tpf-widget {
	max-width: 900px;
	margin: 2rem auto;
	padding: 2rem;
	border: none;
	border-radius: 16px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	box-shadow: 0 20px 40px rgba(0,0,0,0.1);
	font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
	position: relative;
	overflow: hidden;
}

.tpf-widget::before {
	content: '';
	position: absolute;
	top: -50%;
	right: -50%;
	width: 200%;
	height: 200%;
	background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
	animation: float 6s ease-in-out infinite;
}

@keyframes float {
	0%, 100% { transform: translateY(0px) rotate(0deg); }
	50% { transform: translateY(-20px) rotate(180deg); }
}

/* Form: compact card layout */
.tpf-form {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas:
		"label  label"
		"input  button"
		"status status";
	grid-column-gap: 12px;
	grid-row-gap: 10px;
	align-items: center;
	margin-bottom: 2rem;
	position: relative;
	z-index: 1;

	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 16px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
}

/* Focus ring for whole card when any control is focused */
.tpf-form:focus-within {
	box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
	border-color: #dde3ea;
}

/* Slightly stronger focus outline when any child receives focus */
.tpf-form:focus-within {
	box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
	border-color: #dde3ea;
}

/* Slightly stronger focus outline when any child receives focus */
.tpf-form:focus-within {
	box-shadow: 0 12px 28px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);
	border-color: #dbe2e8;
}

/* Label */
.tpf-form label[for="tpf-url"] {
	grid-area: label;
	font-weight: 700;
	color: #1f2937;
	font-size: 14px;
	letter-spacing: .2px;
	margin: 0;
}

/* URL input */
.tpf-form input[type="url"]#tpf-url {
	grid-area: input;
	padding: 0.875rem 1rem;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	font-size: 15px;
	width: 100%;
	background: #ffffff;
	transition: border-color .2s ease, box-shadow .2s ease, transform .12s ease;
	box-shadow: 0 1px 2px rgba(0,0,0,0.04);
	color: #111827;
}
.tpf-form input[type="url"]#tpf-url::placeholder {
	color: #6b7280;
	opacity: .85;
}
.tpf-form input[type="url"]#tpf-url:focus {
	outline: none;
	border-color: #667eea;
	box-shadow: 0 0 0 3px rgba(102,126,234,0.25);
	transform: translateY(-1px);
	background: #fff;
}
.tpf-form input[type="url"]#tpf-url:hover {
	border-color: #d1d5db;
}

.tpf-form input[type="url"]:focus {
	outline: none;
	border-color: #fff;
	background: #fff;
	box-shadow: 0 6px 25px rgba(0,0,0,0.15);
	transform: translateY(-2px);
}

/* Submit button */
.tpf-form button[type="submit"] {
	grid-area: button;
	padding: 1rem 1.75rem;
	border-radius: 12px;
	border: 1px solid #e5e7eb;
	background: linear-gradient(135deg, #667eea, #764ba2);
	color: #fff;
	font-weight: 800;
	font-size: 16px;
	cursor: pointer;
	transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
	box-shadow: 0 8px 18px rgba(102,126,234,0.26);
	position: relative;
	overflow: hidden;
	letter-spacing: .25px;
	min-width: 160px;
}

.tpf-form button[type="submit"]::before {
	content: '';
	position: absolute;
	top: 0;
	left: -120%;
	width: 120%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
	transition: left .5s ease;
}

.tpf-form button[type="submit"]:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(102,126,234,0.34);
}

.tpf-form button[type="submit"]:hover::before {
	left: 100%;
}

.tpf-form button[type="submit"]:active {
	transform: translateY(0);
}

/* Status line beneath the fields */
.tpf-status {
	grid-area: status;
	font-size: 14px;
	min-height: 1.5rem;
	padding: 0.25rem 0.5rem;
	margin: 0;
	border-radius: 6px;
	text-align: left;
	font-weight: 500;
	transition: all 0.3s ease;
	opacity: 0;
	transform: translateY(-6px);
}

.tpf-status.show {
	opacity: 1;
	transform: translateY(0);
}

.tpf-status.tpf-ok {
	background: rgba(16, 185, 129, 0.2);
	color: #065f46;
	border: 1px solid rgba(16, 185, 129, 0.3);
}

.tpf-status.tpf-error {
	background: rgba(239, 68, 68, 0.2);
	color: #b91c1c;
	border: 1px solid rgba(239, 68, 68, 0.3);
}

.tpf-results {
	display: grid !important;
	grid-template-columns: 1fr;
	grid-gap: 1.5rem;
	position: relative;
	z-index: 1;
	visibility: visible !important;
}

.tpf-card {
	border: none;
	border-radius: 16px;
	padding: 1.5rem;
	background: rgba(255,255,255,0.95);
	backdrop-filter: blur(10px);
	box-shadow: 0 8px 32px rgba(0,0,0,0.1);
	transition: all 0.3s ease;
	transform: translateY(20px);
	opacity: 0;
	animation: slideInUp 0.6s ease forwards;
	min-height: 100px;
	display: block !important;
	visibility: visible !important;
}

.tpf-card:nth-child(1) { animation-delay: 0.1s; }
.tpf-card:nth-child(2) { animation-delay: 0.2s; }
.tpf-card:nth-child(3) { animation-delay: 0.3s; }

/* Ensure results container is visible */
.tpf-results {
	display: grid !important;
	grid-template-columns: 1fr;
	grid-gap: 1.5rem;
	position: relative;
	z-index: 1;
	visibility: visible !important;
	min-height: 200px;
}

@keyframes slideInUp {
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

.tpf-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.tpf-card h3 {
	margin: 0 0 1rem 0;
	font-size: 20px;
	color: #1f2937;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: relative;
	padding-bottom: 0.5rem;
}

.tpf-card h3::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 50px;
	height: 3px;
	background: linear-gradient(135deg, #667eea, #764ba2);
	border-radius: 2px;
}

.tpf-plugin-list {
	list-style: none;
	margin: 1rem 0 0 0;
	padding: 0;
}

.tpf-plugin-list li {
	background: rgba(102, 126, 234, 0.1);
	margin: 0.5rem 0;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	transition: all 0.3s ease;
	border-left: 4px solid transparent;
}

.tpf-plugin-list li:hover {
	background: rgba(102, 126, 234, 0.2);
	border-left-color: #667eea;
	transform: translateX(5px);
}

.tpf-plugin-name {
	font-weight: 600;
	color: #1f2937;
	font-size: 16px;
}

.tpf-card p {
	margin: 0.75rem 0;
	color: #4b5563;
	line-height: 1.6;
}

.tpf-card a {
	color: #667eea;
	text-decoration: none;
	font-weight: 500;
	transition: color 0.3s ease;
}

.tpf-card a:hover {
	color: #764ba2;
	text-decoration: underline;
}

.tpf-card img {
	border-radius: 12px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
	transition: transform 0.3s ease;
}

.tpf-card img:hover {
	transform: scale(1.05);
}

.tpf-card em {
	color: #6b7280;
	font-style: italic;
	font-size: 14px;
}

.tpf-meta {
	margin-top: 1rem;
	padding: 1rem;
	background: rgba(102, 126, 234, 0.1);
	border-radius: 8px;
	font-size: 12px;
	color: #6b7280;
}

/* Vertical spacing between theme info rows */
.tpf-card .info-item {
	margin-top: 0.5rem;
}
.tpf-card .info-item:first-of-type {
	margin-top: 0.25rem;
}

@media (min-width: 768px) {
	/* On larger screens, keep layout tidy and align button baseline */
	.tpf-form {
		grid-template-columns: 1fr auto;
	}
	/* Two-column layout: Theme and Plugins side-by-side half width */
	.tpf-results {
		grid-template-columns: 1fr 1fr;
		align-items: start;
	}
	/* Ensure cards stretch nicely and align */
	.tpf-card {
		height: 100%;
	}
	/* Theme and Plugins common spacing tweaks */
	.tpf-card.tpf-theme,
	.tpf-card.tpf-plugins {
		margin: 0;
	}
	.tpf-widget {
		padding: 2.5rem;
	}
}

@media (min-width: 1024px) {
	/* Keep exactly two columns so Theme and Plugins remain half/half; Integrations wraps */
	.tpf-results {
		grid-template-columns: 1fr 1fr;
	}
}

/* Enhanced UI Components */
.info-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1rem 0;
}

.info-item {
	background: rgba(102, 126, 234, 0.1);
	padding: 1rem;
	border-radius: 8px;
	border-left: 4px solid #667eea;
	transition: all 0.3s ease;
}

.info-item:hover {
	background: rgba(102, 126, 234, 0.2);
	transform: translateX(5px);
}

.info-item strong {
	color: #667eea;
	font-weight: 600;
}

.info-item span {
	color: #1f2937;
	font-weight: 500;
}

.url-section {
	margin: 1rem 0;
}

.url-link {
	display: inline-block;
	background: rgba(102, 126, 234, 0.1);
	color: #667eea;
	padding: 0.75rem 1rem;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 500;
	transition: all 0.3s ease;
	border: 1px solid rgba(102, 126, 234, 0.3);
}

.url-link:hover {
	background: rgba(102, 126, 234, 0.2);
	color: #764ba2;
	border-color: #764ba2;
	transform: translateY(-2px);
}

.screenshot-section {
	margin: 1rem 0;
}

.screenshot-container {
	text-align: center;
	margin-top: 1rem;
}

.theme-screenshot {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 8px 25px rgba(0,0,0,0.15);
	transition: transform 0.3s ease;
}

.theme-screenshot:hover {
	transform: scale(1.05);
}

.no-screenshot {
	text-align: center;
	padding: 2rem;
	background: rgba(156, 163, 175, 0.1);
	border-radius: 8px;
	color: #6b7280;
}

.plugins-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1rem;
	margin: 1rem 0;
}

.plugin-item {
	background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
	padding: 1.25rem;
	border-radius: 12px;
	border: 1px solid rgba(102, 126, 234, 0.2);
	transition: all 0.3s ease;
	animation: slideInUp 0.6s ease forwards;
	opacity: 0;
}

.plugin-item:hover {
	transform: translateY(-5px) scale(1.02);
	box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
	border-color: #667eea;
}

.plugin-name {
	font-weight: 600;
	color: #1f2937;
	font-size: 16px;
	margin-bottom: 0.5rem;
}

.plugin-slug {
	color: #6b7280;
	font-size: 14px;
	margin-bottom: 0.5rem;
}

.plugin-confidence {
	background: rgba(16, 185, 129, 0.2);
	color: #065f46;
	padding: 0.25rem 0.75rem;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	display: inline-block;
}

.integrations-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1rem 0;
}

.integration-item {
	background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
	padding: 1rem;
	border-radius: 8px;
	border: 1px solid rgba(239, 68, 68, 0.2);
	transition: all 0.3s ease;
	animation: slideInUp 0.6s ease forwards;
	opacity: 0;
}

.integration-item:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
	border-color: #ef4444;
}

.integration-name {
	font-weight: 600;
	color: #1f2937;
	font-size: 14px;
	margin-bottom: 0.5rem;
}

.integration-confidence {
	background: rgba(245, 158, 11, 0.2);
	color: #92400e;
	padding: 0.25rem 0.5rem;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	display: inline-block;
}

.empty-state {
	text-align: center;
	padding: 3rem 1rem;
	background: rgba(156, 163, 175, 0.1);
	border-radius: 12px;
	color: #6b7280;
	font-style: italic;
}

.meta-info {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 1rem;
	padding: 1rem;
	background: rgba(102, 126, 234, 0.05);
	border-radius: 8px;
}

.meta-item {
	background: rgba(102, 126, 234, 0.1);
	padding: 0.5rem 1rem;
	border-radius: 20px;
	font-size: 12px;
	color: #4b5563;
	border: 1px solid rgba(102, 126, 234, 0.2);
}

/* Loading animations */
@keyframes pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.5; }
}

.loading {
	animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 767px) {
	.info-grid {
		grid-template-columns: 1fr;
	}
	
	.plugins-grid {
		grid-template-columns: 1fr;
	}
	
	.integrations-grid {
		grid-template-columns: 1fr;
	}
	
	.meta-info {
		flex-direction: column;
		gap: 0.5rem;
	}
}

/* Enhanced animations */
@keyframes slideInUp {
	from {
		transform: translateY(30px);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Respect reduced motion: disable animations but ensure visibility */
@media (prefers-reduced-motion: reduce) {
	.tpf-card {
		animation: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}

/* Hydration fallback: if JS marks container as hydrated, force visibility even if animations fail */
.tpf-results.tpf-hydrated .tpf-card {
	animation: none !important;
	opacity: 1 !important;
	transform: none !important;
}