/* ==========================================================================
   AlPromptHub All Tools Directory (/tools/)
   ========================================================================== */

.aph-dir-wrap {
	font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	color: #0f172a;
	background: #f8f9fc;
}

.aph-dir-container {
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 24px;
}

/* 1. Compact Hero */
.aph-dir-hero {
	position: relative;
	background: linear-gradient(135deg, #f7f5ff 0%, #ede9fe 46%, #e0e7ff 100%);
	padding: 52px 0 44px;
	overflow: hidden;
	border-bottom: 1px solid rgba(99, 102, 241, 0.14);
	text-align: center;
}

.aph-dir-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(rgba(91, 70, 246, 0.16) 1.3px, transparent 1.3px),
		linear-gradient(to right, rgba(99, 102, 241, 0.04) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
	background-size: 24px 24px, 48px 48px, 48px 48px;
	-webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 45%, #000 40%, transparent 100%);
	mask-image: radial-gradient(ellipse 85% 85% at 50% 45%, #000 40%, transparent 100%);
	pointer-events: none;
}

.aph-dir-hero__inner {
	position: relative;
	z-index: 1;
	max-width: 780px;
	margin: 0 auto;
	padding: 0 24px;
}

.aph-dir-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px;
	border-radius: 999px;
	background: #ffffff;
	color: #4f46e5;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	border: 1px solid rgba(99, 102, 241, 0.18);
	box-shadow: 0 2px 10px rgba(79, 70, 229, 0.08);
	margin-bottom: 14px;
}

.aph-dir-h1 {
	font-size: clamp(1.9rem, 3.2vw, 2.7rem);
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.025em;
	color: #0f172a;
	margin: 0 0 10px;
}

.aph-dir-subtitle {
	font-size: 1.04rem;
	font-weight: 600;
	color: #334155;
	margin: 0 0 10px;
}

.aph-dir-desc {
	font-size: 0.95rem;
	line-height: 1.6;
	color: #475569;
	margin: 0 auto;
	max-width: 660px;
}

/* 2. Search & Filtering Bar */
.aph-dir-controls-wrap {
	padding: 28px 0 18px;
}

.aph-dir-controls {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 18px 20px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
	display: grid;
	grid-template-columns: 1.6fr 1fr 0.8fr auto auto;
	gap: 12px;
	align-items: center;
}

.aph-dir-search-box {
	position: relative;
	display: flex;
	align-items: center;
}

.aph-dir-search-box svg {
	position: absolute;
	left: 13px;
	color: #94a3b8;
	pointer-events: none;
}

.aph-dir-input,
.aph-dir-select {
	width: 100%;
	height: 44px;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	background: #f8fafc;
	color: #0f172a;
	font-size: 0.9rem;
	font-family: inherit;
	padding: 0 12px;
	outline: none;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.aph-dir-input {
	padding-left: 38px;
}

.aph-dir-input:focus,
.aph-dir-select:focus {
	border-color: #6366f1;
	background: #ffffff;
}

.aph-dir-btn {
	height: 44px;
	padding: 0 20px;
	border-radius: 10px;
	border: none;
	background: linear-gradient(135deg, #5b46f6 0%, #6d28d9 100%);
	color: #ffffff;
	font-size: 0.88rem;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	white-space: nowrap;
}

.aph-dir-btn--ghost {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aph-dir-meta-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 16px 0 4px;
	font-size: 0.88rem;
	color: #475569;
	font-weight: 500;
}

/* 3. Dynamic Tool Grid */
.aph-dir-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
	padding: 12px 0 32px;
}

.aph-dir-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 20px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 16px;
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.aph-dir-card:hover {
	transform: translateY(-3px);
	border-color: #a5b4fc;
	box-shadow: 0 12px 26px rgba(79, 70, 229, 0.09);
}

.aph-dir-card__top {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
}

.aph-dir-card__head {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.aph-dir-card__icon {
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: #eef2ff;
	color: #4f46e5;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.aph-dir-card__cat {
	font-size: 0.72rem;
	font-weight: 700;
	color: #4f46e5;
	background: #eef2ff;
	padding: 3px 10px;
	border-radius: 999px;
	max-width: 170px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.aph-dir-card__title {
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	color: #0f172a;
	margin: 0;
}

.aph-dir-card__desc {
	font-size: 0.84rem;
	line-height: 1.5;
	color: #64748b;
	margin: 0;
}

.aph-dir-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	align-self: flex-start;
	padding: 8px 16px;
	border-radius: 8px;
	background: linear-gradient(135deg, #5b46f6 0%, #6d28d9 100%);
	color: #ffffff;
	font-size: 0.83rem;
	font-weight: 600;
	text-decoration: none;
}

.aph-dir-empty {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 48px 24px;
	text-align: center;
	margin: 12px 0 32px;
}

/* Pagination */
.aph-dir-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 0 44px;
}

.aph-dir-page {
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 10px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	color: #334155;
	font-size: 0.88rem;
	font-weight: 600;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.aph-dir-page:hover {
	border-color: #6366f1;
	color: #4f46e5;
}

.aph-dir-page--active {
	background: #5b46f6;
	border-color: #5b46f6;
	color: #ffffff;
}

.aph-dir-page--disabled {
	opacity: 0.45;
	pointer-events: none;
}

/* 4. Promotional Banner */
.aph-dir-banner {
	border-radius: 18px;
	background: linear-gradient(115deg, #5b46f6 0%, #7c3aed 100%);
	padding: 30px 36px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	color: #ffffff;
	margin-bottom: 48px;
	box-shadow: 0 16px 32px rgba(91, 70, 246, 0.2);
}

.aph-dir-banner__left {
	display: flex;
	align-items: center;
	gap: 18px;
}

.aph-dir-banner__icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.16);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.aph-dir-banner h2 {
	font-size: 1.35rem;
	font-weight: 800;
	color: #ffffff;
	margin: 0 0 4px;
}

.aph-dir-banner p {
	font-size: 0.92rem;
	color: rgba(255, 255, 255, 0.9);
	margin: 0;
	max-width: 560px;
}

.aph-dir-banner__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 22px;
	border-radius: 8px;
	background: #ffffff;
	color: #4f46e5;
	font-size: 0.9rem;
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
}

/* 5. Editorial & 6. FAQ */
.aph-dir-section--white {
	background: #ffffff;
	border-top: 1px solid #e2e8f0;
	padding: 56px 0;
}

.aph-dir-editorial {
	max-width: 960px;
	margin: 0 auto 48px;
}

.aph-dir-editorial h2 {
	font-size: 1.5rem;
	font-weight: 800;
	color: #0f172a;
	margin: 26px 0 12px;
}

.aph-dir-editorial h2:first-child {
	margin-top: 0;
}

.aph-dir-editorial h3 {
	font-size: 1.08rem;
	font-weight: 700;
	color: #1e293b;
	margin: 14px 0 6px;
}

.aph-dir-editorial p,
.aph-dir-editorial li {
	font-size: 0.95rem;
	line-height: 1.7;
	color: #475569;
}

.aph-dir-editorial a {
	color: #4f46e5;
	font-weight: 600;
	text-decoration: underline;
}

.aph-dir-ed-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	margin: 16px 0 22px;
}

.aph-dir-ed-box {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 18px 20px;
}

.aph-dir-ed-box h3 {
	margin-top: 0;
}

.aph-dir-ed-box p:last-child {
	margin-bottom: 0;
}

.aph-dir-faq-section {
	padding: 56px 0;
	border-top: 1px solid #e2e8f0;
}

.aph-dir-faq {
	max-width: 960px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 0.36fr 0.64fr;
	gap: 28px;
	align-items: start;
}

.aph-dir-faq__intro {
	background: #f5f3ff;
	border: 1px solid #e9d5ff;
	border-radius: 16px;
	padding: 26px 24px;
}

.aph-dir-faq__intro h2 {
	font-size: 1.35rem;
	font-weight: 800;
	margin: 0 0 8px;
}

.aph-dir-faq__intro p {
	font-size: 0.88rem;
	color: #64748b;
	line-height: 1.55;
	margin: 0;
}

.aph-dir-faq__list {
	display: grid;
	gap: 10px;
}

.aph-dir-faq__item {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
}

.aph-dir-faq__item[open] {
	border-color: #a5b4fc;
}

.aph-dir-faq__q {
	list-style: none;
	cursor: pointer;
	padding: 15px 18px;
	font-size: 0.94rem;
	font-weight: 700;
	color: #0f172a;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.aph-dir-faq__q::-webkit-details-marker {
	display: none;
}

.aph-dir-faq__a {
	padding: 0 18px 16px;
	font-size: 0.89rem;
	line-height: 1.6;
	color: #475569;
}

/* Responsive */
@media (max-width: 1080px) {
	.aph-dir-controls {
		grid-template-columns: 1fr 1fr;
	}
	.aph-dir-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.aph-dir-faq {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 680px) {
	.aph-dir-controls,
	.aph-dir-grid,
	.aph-dir-ed-grid {
		grid-template-columns: 1fr;
	}
	.aph-dir-banner {
		flex-direction: column;
		align-items: flex-start;
		padding: 24px;
	}
}
