/**
 * AI Tools Directory
 *
 * @package AITeluguLo_AI_Tools
 */

/* ==========================================================================
   Directory
   ========================================================================== */

.ait-ai-tools-directory {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px 20px;
	box-sizing: border-box;
}

/* ==========================================================================
   Header
   ========================================================================== */

.ait-directory-header {
	margin-bottom: 25px;
	text-align: center;
}

.ait-directory-title {
	margin: 0 0 8px;
	font-size: 36px;
	line-height: 1.2;
	font-weight: 700;
}

.ait-directory-description {
	margin: 0;
	font-size: 16px;
	line-height: 1.6;
}

/* ==========================================================================
   Search
   ========================================================================== */

.ait-directory-search {
	margin-bottom: 30px;
}

.ait-tools-search-input {
	display: block;
	width: 100%;
	height: 50px;
	padding: 0 16px;
	border: 1px solid #d9d9d9;
	border-radius: 8px;
	background: #fff;
	box-sizing: border-box;
	font-size: 15px;
	outline: none;
}

.ait-tools-search-input:focus {
	border-color: #999;
}

/* ==========================================================================
   Category Grid
   ========================================================================== */

.ait-category-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 22px;
}

/* ==========================================================================
   Category Card
   ========================================================================== */

.ait-category-card {
	min-width: 0;
	padding: 0 16px;
	border: 1px solid #dcdcdc;
	border-radius: 12px;
	background: #fff;
	box-sizing: border-box;
	overflow: hidden;
}

/* ==========================================================================
   Category Header
   ========================================================================== */

.ait-category-header {
	padding: 18px 0 14px;
	border-bottom: 2px solid #222;
}

.ait-category-title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
}

/* ==========================================================================
   Tool List
   ========================================================================== */

.ait-category-tools {
	width: 100%;
}

.ait-category-tool-row {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	border-bottom: 1px solid #e5e5e5;
	box-sizing: border-box;
}

.ait-category-tool-row:last-child {
	border-bottom: 0;
}

.ait-tool-number {
	width: 25px;
	flex: 0 0 25px;
	font-size: 14px;
	text-align: right;
}

.ait-tool-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	border-radius: 50%;
	background: #f3f3f3;
	font-size: 10px;
	font-weight: 600;
	overflow: hidden;
}

.ait-tool-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ait-tool-row-name {
	min-width: 0;
	flex: 1;
	font-size: 15px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ait-tool-external-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	font-size: 19px;
	line-height: 1;
	text-decoration: none;
}

/* ==========================================================================
   See All Category
   ========================================================================== */

.ait-category-see-all {
	display: block;
	margin: 0 -16px;
	padding: 15px 16px;
	border-top: 1px solid #dcdcdc;
	background: #f5f5f5;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	box-sizing: border-box;
}

.ait-category-see-all:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Category Page
   ========================================================================== */

.ait-category-page {
	width: 100%;
}

.ait-category-page-title {
	margin: 0 0 6px;
	font-size: 32px;
	line-height: 1.25;
	font-weight: 700;
}

.ait-category-page-count {
	margin: 0 0 22px;
	font-size: 15px;
}

.ait-category-full-list {
	max-width: 800px;
	border: 1px solid #dcdcdc;
	border-radius: 10px;
	padding: 0 16px;
	background: #fff;
}

.ait-category-full-list .ait-category-tool-row {
	min-height: 52px;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.ait-tools-empty {
	padding: 50px 20px;
	border: 1px dashed #dcdcdc;
	border-radius: 10px;
	text-align: center;
}

.ait-tools-empty h2 {
	margin: 0 0 8px;
	font-size: 22px;
}

.ait-tools-empty p {
	margin: 0;
	font-size: 14px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 800px) {

	.ait-category-grid {
		grid-template-columns: 1fr;
	}

}

@media (max-width: 600px) {

	.ait-ai-tools-directory {
		padding: 20px 12px;
	}

	.ait-directory-title {
		font-size: 28px;
	}

	.ait-category-card {
		padding: 0 12px;
	}

	.ait-category-see-all {
		margin: 0 -12px;
		padding-left: 12px;
		padding-right: 12px;
	}

	.ait-tool-row-name {
		font-size: 14px;
	}

}

/* ==========================================================================
   Category Page - Final
   ========================================================================== */

.ait-category-page {
	width: calc(100vw - 80px);
	max-width: none;
	margin-left: calc((100% - 100vw) / 2 + 40px);
	text-align: left;
	box-sizing: border-box;
}

.ait-category-page-title {
	margin: 0 0 8px;
	font-size: 36px;
	line-height: 1.2;
	font-weight: 700;
}

.ait-category-page-count {
	margin: 0 0 28px;
	font-size: 16px;
	line-height: 1.5;
}



/* Tool Cards Grid */

.ait-category-tools-grid {
	width: 100%;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	align-items: stretch;
}

/* Tool Card */

.ait-category-tool-card {
	width: 100%;
	min-width: 0;
	min-height: 375px;
	display: flex;
	flex-direction: column;
	padding: 24px;
	border: 1px solid #dedede;
	border-radius: 14px;
	background: #fff;
	box-sizing: border-box;
}

/* Card Top */

.ait-category-tool-card-top {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	margin-bottom: 18px;
}

.ait-category-tool-number {
	flex: 0 0 auto;
	font-size: 15px;
	font-weight: 600;
}

.ait-category-card-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border: 1px solid #eeeeee;
	border-radius: 50%;
	background: #fafafa;
	overflow: hidden;
}

.ait-category-card-logo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.ait-category-tool-name {
	min-width: 0;
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
}

/* Description */

.ait-category-tool-description {
	flex: 1 1 auto;
	margin: 0 0 20px;
	font-size: 14px;
	line-height: 1.7;
	text-align: left;
	overflow-wrap: break-word;
	word-break: normal;
}

/* Category + Pricing + Rating */

.ait-category-tool-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: auto 0 18px;
}

.ait-category-tool-tag {
	display: inline-flex;
	align-items: center;
	padding: 7px 10px;
	border-radius: 7px;
	background: #f5f5f5;
	font-size: 10px;
	line-height: 1.2;
	white-space: normal;
	max-width: 100%;
	box-sizing: border-box;
}

.ait-category-tool-rating {
	margin-left: auto;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	white-space: nowrap;
}

/* Footer */

.ait-category-tool-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid #eeeeee;
	box-sizing: border-box;
}

/* View Tool + Telugu Guide */

.ait-category-tool-view,
.ait-category-tool-guide {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 14px;
	border-radius: 6px;
	background: #f5f5f5;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	white-space: nowrap;
	box-sizing: border-box;
}

.ait-category-tool-view:hover,
.ait-category-tool-guide:hover {
	background: #eeeeee;
	text-decoration: none;
}

/* Category Page Footer */

.ait-category-page-footer {
	padding: 35px 0;
	text-align: center;
}

.ait-category-page-footer p {
	margin: 0 0 10px;
}

.ait-back-to-categories {
	text-decoration: none;
}

/* Category Empty State */

.ait-tools-empty {
	padding: 50px 20px;
	border: 1px dashed #dcdcdc;
	border-radius: 10px;
	text-align: center;
}

.ait-tools-empty h2 {
	margin: 0 0 8px;
	font-size: 22px;
}

.ait-tools-empty p {
	margin: 0;
	font-size: 14px;
}

/* Hide Main Directory Header/Search on Category Pages */

.ait-is-category-page .ait-directory-header,
.ait-is-category-page .ait-directory-search {
	display: none;
}

/* Responsive */

@media (max-width: 1000px) {

	.ait-category-page {
		width: calc(100vw - 40px);
		margin-left: calc((100% - 100vw) / 2 + 20px);
	}

	.ait-category-tools-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

}

@media (max-width: 650px) {

	.ait-category-page {
		width: calc(100vw - 24px);
		margin-left: calc((100% - 100vw) / 2 + 12px);
	}

	.ait-category-tools-grid {
		grid-template-columns: 1fr;
	}

	.ait-category-tool-card {
		min-height: 0;
	}

	.ait-category-page-title {
		font-size: 28px;
	}

	.ait-category-tool-footer {
		flex-wrap: wrap;
	}

	.ait-category-tool-view,
	.ait-category-tool-guide {
		padding: 8px 12px;
		font-size: 13px;
	}

}

/* ==========================================================================
   Site-wide Link Underline
   ========================================================================== */

a,
a:visited {
	text-decoration: none !important;
}

a:hover,
a:focus {
	text-decoration: none !important;
}

.ait-category-page-title {
	display: inline-block;
	margin: 0 16px 20px 0;
}

.ait-category-page-count {
	display: inline-block;
	margin: 0 0 20px;
	vertical-align: baseline;
}

/* ==========================================================================
   Category Page Filter Bar
   ========================================================================== */

.ait-category-filter-bar {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin: 0 0 28px;
	padding: 18px 20px;
	border: 1px solid #e4e8ef;
	border-radius: 18px;
	background: #fff;
	box-shadow: 0 4px 16px rgba(20, 35, 60, 0.06);
	box-sizing: border-box;
}

.ait-category-filter-left,
.ait-category-filter-right {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.ait-category-filter-left {
	flex-wrap: nowrap;
	flex-shrink: 0;
}

.ait-category-filter-right {
	margin-left: auto;
	flex-shrink: 0;
}

.ait-filter-search-button,
.ait-filter-pill,
.ait-category-filter-select {
	height: 44px;
	box-sizing: border-box;
	border: 1px solid #e4e8ef;
	background: #fff;
	color: #24324a;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
}

.ait-filter-search-button {
	width: 44px;
	padding: 0;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 25px;
	line-height: 1;
}

.ait-filter-search-button:hover,
.ait-filter-search-button:focus {
	border-color: #cfd8e6;
	background: #f8fafc;
}

.ait-filter-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 13px;
	border-radius: 22px;
	white-space: nowrap;
	cursor: pointer;
}

.ait-filter-pill:hover,
.ait-filter-pill:focus {
	border-color: #cfd8e6;
	background: #f8fafc;
}

.ait-filter-pill:hover {
	color: #fff !important;
	background: #1677d2 !important;
	border-color: #1677d2 !important;
}

.ait-filter-pill.is-active {
	border-color: #b9d4ff;
	background: #eef5ff;
	color: #1769c2;
}

.ait-filter-dot {
	width: 11px;
	height: 11px;
	flex: 0 0 11px;
	border-radius: 50%;
	display: inline-block;
}

.ait-filter-dot-free {
	background: #20b968;
}

.ait-filter-dot-freemium {
	background: #f39a12;
}

.ait-filter-dot-trial {
	background: #9b4de8;
}

.ait-filter-dot-paid {
	background: #ee4d55;
}

.ait-filter-verified {
	border-color: #b9d4ff;
	background: #f2f7ff;
	color: #1769c2;
}

.ait-filter-verified span {
	font-size: 20px;
	line-height: 1;
}

.ait-filter-sort-label {
	margin-right: 4px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	white-space: nowrap;
}

.ait-category-filter-select {
	min-width: 190px;
	padding: 0 38px 0 15px;
	border-radius: 12px;
	cursor: pointer;
}

.ait-category-filter-select:focus {
	outline: none;
	border-color: #8bb9f5;
	box-shadow: 0 0 0 3px rgba(23, 105, 194, 0.08);
}

.ait-category-selector {
	min-width: 270px;
}

.ait-category-filter-bar[hidden] {
	display: none !important;
}

@media (max-width: 1100px) {
	.ait-category-filter-bar {
		align-items: flex-start;
		flex-direction: column;
	}

	.ait-category-filter-right {
		width: 100%;
		margin-left: 0;
	}

	.ait-category-filter-select {
		flex: 1 1 0;
	}

	.ait-category-selector {
		min-width: 0;
	}
}

@media (max-width: 650px) {
	.ait-category-filter-bar {
		padding: 14px;
		border-radius: 14px;
	}

	.ait-category-filter-left,
	.ait-category-filter-right {
		width: 100%;
	}

	.ait-filter-pill {
		padding: 0 14px;
	}

	.ait-filter-sort-label {
		display: none;
	}

	.ait-category-filter-select {
		min-width: 0;
		width: 50%;
	}
}

.ait-category-filter-search {
	display: none;
	width: 220px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid #e2e8f0;
	border-radius: 22px;
	opacity: 0;
	pointer-events: none;
	outline: none;
}

.ait-category-filter-search.is-open {
	display: block;
	opacity: 1;
	pointer-events: auto;
}

.ait-category-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 35px 0 25px;
}

.ait-pagination-button {
	min-width: 52px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid #d7dce5;
	border-radius: 8px;
	background: #fff;
	color: #1769c2;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
}

.ait-pagination-button:hover {
	background: #f5f8fc;
}

.ait-pagination-button.is-active {
	background: #1769c2;
	border-color: #1769c2;
	color: #fff;
}

.ait-pagination-next {
	min-width: 100px;
}

/* Subcategory rows */
.ait-category-subcategory-row {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 12px 0;
	border-bottom: 1px solid #e5e5e5;
	text-decoration: none;
	box-sizing: border-box;
}

.ait-category-subcategory-row:last-child {
	border-bottom: none;
}

.ait-subcategory-number {
	flex: 0 0 32px;
	text-align: right;
	margin-right: 12px;
}

.ait-subcategory-name {
	flex: 1;
}

.ait-subcategory-count {
	margin-left: 8px;
	white-space: nowrap;
}

.ait-subcategory-arrow {
	margin-left: auto;
	padding-left: 12px;
	white-space: nowrap;
}

/* Category Filter Right */
.ait-category-filter-right {
	display: grid;
	grid-template-columns:
		minmax(170px, 0.8fr)
		minmax(220px, 1fr)
		minmax(260px, 1.15fr);
	align-items: center;
	gap: 12px;
	flex: 1 1 0;
	min-width: 0;
}

.ait-category-filter-right .ait-category-filter-select {
	width: 100%;
	min-width: 0;
	max-width: none;
	box-sizing: border-box;

	font-size: 13px;
	padding: 8px 12px;
}

.ait-category-selector,
.ait-subcategory-selector {
	width: 100%;
	min-width: 0;
}

@media (max-width: 900px) {

	.ait-category-filter-right {
		display: flex;
		flex-wrap: wrap;
		width: 100%;
	}

	.ait-category-filter-right .ait-category-filter-select {
		flex: 1 1 220px;
		width: auto;
	}

}