/**
 * Directory page – two-column layout, filter sidebar, list/grid view.
 * White and light blue background; fonts match homepage (Poppins, Plus Jakarta Sans).
 */

.cenai-directory-page .cenai-home-footer { margin-top: 0; }

/* Glowy shape position (base in cenai-home.css) */
.cenai-dir-banner .cenai-glowy-shape { top: -20%; right: -10%; animation: cenai-glowy-pulse 5s ease-in-out infinite; }
.cenai-dir-main { position: relative; overflow: hidden; }
.cenai-dir-main .cenai-glowy-shape { bottom: -20%; left: -10%; animation: cenai-glowy-pulse 6s ease-in-out infinite 0.5s; }

/* ========== Banner – background image, dark text ========== */
.cenai-dir-banner {
	position: relative;
	background: #fff url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=1600&q=80') center center / cover no-repeat;
	padding: 3rem 1.5rem 3.5rem;
	text-align: center;
	overflow: hidden;
	border-bottom: 1px solid rgba(0, 67, 157, 0.08);
}
.cenai-dir-banner::before {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.88) 50%, rgba(0, 67, 157, 0.04) 100%);
	pointer-events: none;
	z-index: 0;
}
input#cenai-dir-search-input:focus{
	outline:none !important;
}
input#cenai-dir-search-input {
    border: 0 !important;
}
.cenai-dir-banner-inner {
	position: relative;
	z-index: 1;
	max-width: 720px;
	margin: 0 auto;
}

.cenai-dir-banner-title {
	margin: 0 0 0.5rem;
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	font-weight: 800;
	font-family: 'Plus Jakarta Sans', sans-serif;
	color: #111;
	line-height: 1.25;
	letter-spacing: -0.02em;
}
.cenai-dir-banner .cenai-heading-accent {
	color: #00439d;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.cenai-dir-banner-sub {
	margin: 0 0 1.5rem;
	font-size: 16px;
	font-weight: 400;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.7);
	line-height: 1.5;
}

.cenai-dir-search-wrap {
	width: 100%;
}

.cenai-dir-search-bar {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid rgba(0, 67, 157, 0.2);
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 67, 157, 0.08);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cenai-dir-search-bar:focus-within {
	border-color: rgba(0, 67, 157, 0.4);
	box-shadow: 0 4px 24px rgba(0, 67, 157, 0.12);
}

.cenai-dir-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 1rem;
	color: rgba(0, 0, 0, 0.45);
}

.cenai-dir-search-input {
	flex: 1;
	min-width: 0;
	padding: 1rem 0.5rem 1rem 0;
	font-size: 16px;
	font-family: 'Poppins', sans-serif;
	color: #111;
	border: none;
	outline: none;
	background: transparent;
}

.cenai-dir-search-input::placeholder {
	color: rgba(0, 0, 0, 0.45);
}

.cenai-dir-filters-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 1rem 1.25rem;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	color: #fff;
	background: #00439d;
	border: none;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
}

.cenai-dir-filters-btn:hover {
	background: #00439d;
}

/* ========== Main two-column layout ========== */
.cenai-dir-main {
	background: #f5f7fa;
	padding: 2rem 1.5rem 4rem;
	min-height: 60vh;
}

.cenai-dir-inner {
	max-width: 1280px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 2rem;
	align-items: start;
}

@media (max-width: 992px) {
	.cenai-dir-inner {
		grid-template-columns: 1fr;
		gap: 1.5rem;
		padding: 0 1rem;
	}
	.cenai-dir-banner-inner { padding: 0 1rem; }
}
@media (max-width: 768px) {
	.cenai-dir-banner { padding: 2.5rem 1rem; }
	.cenai-dir-banner-inner { padding: 0 1rem; max-width: 100%; }
	.cenai-dir-banner-title { font-size: clamp(1.5rem, 4vw, 2rem); }
	.cenai-dir-banner-sub { font-size: 15px; }
	/* Keep icon + input in one row (white), button full-width below (blue) */
	.cenai-dir-search-bar {
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-rows: auto auto;
		align-items: stretch;
	}
	.cenai-dir-search-icon {
		grid-column: 1;
		grid-row: 1;
		align-self: center;
		padding: 0 0.75rem 0 1rem;
		min-height: 48px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.cenai-dir-search-input {
		grid-column: 2;
		grid-row: 1;
		min-width: 0;
		min-height: 48px;
		padding: 0.75rem 1rem 0.75rem 0.5rem;
		font-size: 16px;
		align-self: stretch;
	}
	.cenai-dir-filters-btn {
		grid-column: 1 / -1;
		grid-row: 2;
		justify-content: center;
		min-height: 48px;
		padding: 0.875rem 1rem;
	}
	.cenai-dir-inner { padding: 0 1rem; }
	.cenai-dir-main { padding: 1.5rem 1rem 3rem; }
	.cenai-dir-content-header { flex-direction: column; align-items: stretch; }
	.cenai-dir-toolbar { flex-direction: column; align-items: stretch; gap: 0.75rem; }
	.cenai-dir-toolbar-right { flex-wrap: wrap; }
	.cenai-dir-select, .cenai-dir-select-cat { min-width: 0; width: 100%; }
}
@media (max-width: 480px) {
	.cenai-dir-banner { padding: 2rem 0.75rem; }
	.cenai-dir-banner-inner { padding: 0 0.75rem; }
	.cenai-dir-search-icon { padding: 0 0.5rem 0 0.75rem; }
	.cenai-dir-search-input { padding: 0.75rem 0.75rem 0.75rem 0.25rem; }
	.cenai-dir-filters-btn { font-size: 14px; padding: 0.875rem 0.75rem; }
	.cenai-dir-sidebar { position: static; }
	.cenai-dir-inner { padding: 0 0.75rem; gap: 1rem; }
	.cenai-dir-main { padding: 1.25rem 0.75rem 2.5rem; }
	.cenai-dir-tabs { flex-wrap: wrap; }
	.cenai-dir-pagination { flex-wrap: wrap; gap: 0.5rem; }
}

/* ========== Left sidebar – Filter Tools ========== */
.cenai-dir-sidebar {
	position: sticky;
	top: 60px;
	background: #fff;
	border-radius: 12px;
	border: 1px solid rgba(0, 67, 157, 0.12);
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.cenai-dir-filter-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	background: #00439d;
	color: #fff;
}

.cenai-dir-filter-title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	font-family: 'Plus Jakarta Sans', sans-serif;
	letter-spacing: 0.02em;
}

.cenai-dir-filter-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	border-radius: 8px;
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.cenai-dir-filter-toggle:hover {
	background: rgba(255, 255, 255, 0.3);
}

.cenai-dir-filter-body {
	padding: 1rem;
}

.cenai-dir-filter-section {
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cenai-dir-filter-section:last-child { border-bottom: none; }

.cenai-dir-filter-section-head {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.75rem 0.5rem;
	font-size: 15px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	color: #111;
	background: transparent;
	border: none;
	cursor: pointer;
	text-align: left;
	transition: background 0.2s ease;
}

.cenai-dir-filter-section-head:hover {
	background: rgba(0, 67, 157, 0.06);
}

.cenai-dir-filter-chevron {
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.cenai-dir-filter-section-body {
	padding: 0 0.5rem 1rem;
}

.cenai-dir-filter-section-body[hidden] {
	display: none;
}

.cenai-dir-check {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4rem 0;
	font-size: 14px;
	font-weight: 400;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.8);
	cursor: pointer;
}

.cenai-dir-check input {
	width: 18px;
	height: 18px;
	accent-color: #00439d;
}

.cenai-dir-all-tags {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.5rem;
	padding: 0.5rem 0;
	font-size: 13px;
	font-weight: 500;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.6);
	background: transparent;
	border: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.cenai-dir-all-tags:hover {
	color: #00439d;
}

.cenai-dir-select {
	width: 100%;
	padding: 0.6rem 0.75rem;
	font-size: 14px;
	font-family: 'Poppins', sans-serif;
	color: #111;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 8px;
	cursor: pointer;
}

/* ========== Right content ========== */
.cenai-dir-content {
	min-width: 0;
}

.cenai-dir-content-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.5rem;
}

.cenai-dir-count {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 800;
	font-family: 'Plus Jakarta Sans', sans-serif;
	color: #111;
	line-height: 1.2;
}

.cenai-dir-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
}

.cenai-dir-tabs {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.cenai-dir-tab {
	padding: 0.5rem 1rem;
	font-size: 14px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.7);
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cenai-dir-tab:hover {
	background: rgba(0, 67, 157, 0.08);
	border-color: rgba(0, 67, 157, 0.2);
	color: #111;
}

.cenai-dir-tab.active {
	background: #00439d;
	border-color: #00439d;
	color: #fff;
}

.cenai-dir-toolbar-right {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.cenai-dir-select-cat {
    width: auto;
    min-width: 151px;
}
.cenai-dir-view-toggle {
	display: flex;
	align-items: center;
	gap: 0.25rem;
}

.cenai-dir-view-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 10px;
	color: rgba(0, 0, 0, 0.6);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cenai-dir-view-btn:hover {
	background: rgba(0, 67, 157, 0.08);
	border-color: rgba(0, 67, 157, 0.2);
	color: #00439d;
}

.cenai-dir-view-btn.active {
	background: #00439d;
	border-color: #00439d;
	color: #fff;
}

/* ========== Tool list – Grid view (default) ========== */
.cenai-dir-list {
	display: grid;
	gap: 1.5rem;
}

.cenai-dir-view-grid {
	grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1100px) {
	.cenai-dir-view-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.cenai-dir-view-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.cenai-dir-view-list .cenai-dir-card {
		grid-template-columns: auto 1fr;
		padding: 0.85rem 1rem;
	}
	.cenai-dir-view-list .cenai-dir-card-btn {
		grid-column: 2;
		grid-row: auto;
		justify-self: start;
	}
}

@media (max-width: 480px) {
	.cenai-dir-view-list .cenai-dir-card-logo {
		width: 40px;
		height: 40px;
		font-size: 1.1rem;
	}
	.cenai-dir-view-list .cenai-dir-card {
		gap: 0.25rem 0.75rem;
		padding: 0.75rem 1rem;
	}
}

/* ========== Tool list – List view ========== */
.cenai-dir-view-list {
	grid-template-columns: 1fr;
	max-width: 100%;
}

.cenai-dir-view-list .cenai-dir-card {
	display: grid;
	grid-template-columns: auto 1fr auto;
	grid-template-rows: auto auto auto auto;
	gap: 0.35rem 1rem;
	align-items: center;
	text-align: left;
	padding: 1rem 1.25rem;
}

.cenai-dir-view-list .cenai-dir-card-logo {
    grid-row: auto;
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.cenai-dir-view-list .cenai-dir-card-name {
    grid-column: 2;
    margin: 0;
    font-size: 20px;
}
.cenai-dir-view-list .cenai-dir-card-cat {
	grid-column: 2;
}

.cenai-dir-view-list .cenai-dir-card-desc {
    grid-column: 2;
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cenai-dir-view-list .cenai-dir-card-tags {
	grid-column: 2;
}

.cenai-dir-view-list .cenai-dir-card-btn {
	grid-column: 3;
	grid-row: 1 / -1;
	align-self: center;
	padding: 0.5rem 0.85rem;
	font-size: 14px;
}

/* ========== Tool card ========== */
.cenai-dir-card {
	position: relative;
	background: #fff;
	border: 1px solid rgba(0, 67, 157, 0.12);
	border-radius: 12px;
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	text-align: center;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cenai-dir-card:hover {
	border-color: rgba(0, 67, 157, 0.25);
	box-shadow: 0 8px 24px rgba(0, 67, 157, 0.1);
}

.cenai-dir-card-external {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 0;
	color: rgba(0, 0, 0, 0.4);
	text-decoration: none;
	border-radius: 8px;
	transition: color 0.2s ease, background 0.2s ease;
}

.cenai-dir-card-external::after {
	content: '';
	width: 18px;
	height: 18px;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center;
	mask-size: contain;
	-webkit-mask-size: contain;
}

.cenai-dir-card-external:hover {
	color: #00439d;
	background: rgba(0, 67, 157, 0.1);
}

.cenai-dir-card-logo {
	width: 52px;
	height: 52px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	font-weight: 700;
	font-family: 'Plus Jakarta Sans', sans-serif;
	color: #fff;
	background: #00439d;
	border-radius: 12px;
}

.cenai-dir-card-name {
    margin: 0;
    font-size: 18px;
    padding-bottom: 13px;
    padding-top: 10px;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: #00439d;
    line-height: 1.3;
}
.cenai-dir-card-cat {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    border-radius: 100px;
    align-self: center;
    max-width: max-content;
}

.cenai-dir-tag-blue {
	background: rgba(0, 67, 157, 0.15);
	color: #00439d;
}

.cenai-dir-tag-green {
	background: rgba(34, 197, 94, 0.15);
	color: #16a34a;
}

.cenai-dir-tag-lightblue {
	background: rgba(56, 189, 248, 0.2);
	color: #0ea5e9;
}

.cenai-dir-tag-purple {
	background: rgba(139, 92, 246, 0.15);
	color: #7c3aed;
}

.cenai-dir-card-desc {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    padding-top: 10px;
    font-family: 'Poppins', sans-serif;
    color: rgba(0, 0, 0, 0.7);
    line-height: 1.5;
    flex: 1;
    padding-bottom: 18px;
}
.cenai-dir-card-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	justify-content: center;
}

.cenai-dir-card-tag {
	padding: 0.25rem 0.5rem;
	font-size: 12px;
	font-weight: 500;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.6);
	background: rgba(0, 0, 0, 0.06);
	border-radius: 6px;
}

.cenai-dir-card-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	padding: 0.6rem 1.25rem;
	font-size: 14px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	color: #fff;
	background: #00439d;
	border-radius: 8px;
	text-decoration: none;
	transition: background 0.2s ease, opacity 0.2s ease;
}

.cenai-dir-card-btn:hover {
	background: #00439d;
}

/* ========== Pagination ========== */
.cenai-dir-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 2.5rem;
	flex-wrap: wrap;
}

.cenai-dir-page {
	min-width: 40px;
	height: 40px;
	padding: 0 0.75rem;
	font-size: 14px;
	font-weight: 600;
	font-family: 'Poppins', sans-serif;
	color: rgba(0, 0, 0, 0.7);
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cenai-dir-page:hover {
	background: rgba(0, 67, 157, 0.08);
	border-color: rgba(0, 67, 157, 0.2);
	color: #111;
}

.cenai-dir-page.active {
	background: #00439d;
	border-color: #00439d;
	color: #fff;
}

.cenai-dir-page-last {
	padding: 0 1rem;
}

/* ── Dynamic additions ─────────────────────────────────── */

/* Term count next to checkbox label */
.cenai-dir-check-count {
	margin-left: 4px;
	font-size: 11px;
	color: #aab0bd;
	font-weight: 400;
}

/* Pagination wrap spacing */
#cenai-dir-pagination-wrap { margin-top: 2rem; }

/* Mobile sidebar slide-in */
@media (max-width: 768px) {
	#cenai-dir-sidebar {
		display: none;
		position: fixed;
		inset: 0;
		z-index: 999;
		background: #fff;
		overflow-y: auto;
		padding: 1.5rem;
		box-shadow: 4px 0 24px rgba(0,0,0,0.15);
	}
	#cenai-dir-sidebar.cenai-dir-sidebar-open {
		display: block;
	}
}
