/**
 * Creator Resource Finder Stylesheet
 *
 * Responsive cards, filter bar, badges, and accessible modal
 *
 * @package Afrobull_Resource_Tools
 */

:root {
	--afrb-primary: #2563eb;
	--afrb-primary-hover: #1d4ed8;
	--afrb-surface: #ffffff;
	--afrb-bg: #f8fafc;
	--afrb-border: #e2e8f0;
	--afrb-text-main: #0f172a;
	--afrb-text-muted: #475569;
	--afrb-radius: 8px;
	--afrb-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.08);
	--afrb-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
	--afrb-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.afrb-finder-container {
	margin: 32px 0;
	font-family: inherit;
	color: var(--afrb-text-main);
}

/* Filter Card */
.afrb-finder-filter-card {
	background: var(--afrb-surface);
	border: 1px solid var(--afrb-border);
	border-radius: 12px;
	padding: 24px;
	box-shadow: var(--afrb-shadow-sm);
	margin-bottom: 24px;
}

@media (max-width: 640px) {
	.afrb-finder-filter-card {
		padding: 16px;
	}
}

.afrb-search-row {
	margin-bottom: 16px;
}

.afrb-search-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.afrb-search-icon {
	position: absolute;
	left: 14px;
	color: #94a3b8;
	pointer-events: none;
}

.afrb-search-field {
	width: 100%;
	padding: 12px 40px 12px 42px;
	font-size: 15px;
	border: 1.5px solid var(--afrb-border);
	border-radius: 8px;
	background: #ffffff;
	color: var(--afrb-text-main);
	transition: all 0.15s ease;
	box-sizing: border-box;
}

.afrb-search-field:focus {
	outline: none;
	border-color: var(--afrb-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.afrb-clear-search {
	position: absolute;
	right: 12px;
	background: transparent;
	border: none;
	font-size: 20px;
	color: #94a3b8;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	border-radius: 4px;
}

.afrb-clear-search:hover {
	color: #0f172a;
	background: #f1f5f9;
}

.afrb-filter-controls-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr) auto;
	gap: 12px;
	align-items: center;
}

@media (max-width: 960px) {
	.afrb-filter-controls-row {
		grid-template-columns: 1fr 1fr;
	}
	.afrb-filter-action {
		grid-column: span 2;
	}
}

@media (max-width: 540px) {
	.afrb-filter-controls-row {
		grid-template-columns: 1fr;
	}
	.afrb-filter-action {
		grid-column: span 1;
	}
}

.afrb-filter-select {
	width: 100%;
	padding: 9px 12px;
	font-size: 13.5px;
	border: 1px solid var(--afrb-border);
	border-radius: 6px;
	background: #ffffff;
	color: #334155;
	transition: border-color 0.15s ease;
	box-sizing: border-box;
}

.afrb-filter-select:focus {
	outline: none;
	border-color: var(--afrb-primary);
}

/* Results Meta Bar */
.afrb-results-meta-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 20px;
	padding: 0 4px;
}

.afrb-results-count {
	font-size: 14px;
	color: var(--afrb-text-muted);
}

.afrb-results-count strong {
	color: var(--afrb-text-main);
	font-weight: 700;
}

.afrb-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid #e2e8f0;
	border-top-color: var(--afrb-primary);
	border-radius: 50%;
	animation: afrbSpin 0.7s linear infinite;
}

@keyframes afrbSpin {
	to { transform: rotate(360deg); }
}

/* Cards Grid */
.afrb-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-bottom: 32px;
}

@media (max-width: 1024px) {
	.afrb-cards-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 640px) {
	.afrb-cards-grid {
		grid-template-columns: 1fr;
	}
}

/* Resource Card */
.afrb-card {
	background: var(--afrb-surface);
	border: 1px solid var(--afrb-border);
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	position: relative;
	box-shadow: var(--afrb-shadow-sm);
}

.afrb-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--afrb-shadow-md);
	border-color: #cbd5e1;
}

.afrb-card-cover {
	aspect-ratio: 16 / 9;
	background: #0f172a;
	overflow: hidden;
}

.afrb-card-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.25s ease;
}

.afrb-card:hover .afrb-card-cover img {
	transform: scale(1.03);
}

.afrb-card-inner {
	padding: 20px 22px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.afrb-card-mature {
	border-left: 3px solid #ef4444;
}

.afrb-card-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	margin-bottom: 12px;
}

.afrb-card-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.afrb-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 3px 8px;
	border-radius: 4px;
	line-height: 1.25;
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.afrb-badge-platform {
	background: #f1f5f9;
	color: #334155;
	border: 1px solid #e2e8f0;
}

.afrb-badge-verified {
	background: #dcfce7;
	color: #15803d;
	border: 1px solid #bbf7d0;
}

.afrb-badge-independent {
	background: #e0f2fe;
	color: #0369a1;
	border: 1px solid #bae6fd;
}

.afrb-badge-unverified {
	background: #fef3c7;
	color: #92400e;
	border: 1px solid #fde68a;
}

.afrb-badge-adult {
	background: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	font-weight: 700;
}

.afrb-type-caption {
	font-size: 11px;
	color: #64748b;
	white-space: nowrap;
}

.afrb-card-title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0 0 10px;
}

.afrb-card-title a {
	color: var(--afrb-text-main);
	text-decoration: none;
	transition: color 0.15s ease;
}

.afrb-card-title a:hover {
	color: var(--afrb-primary);
}

.afrb-card-summary {
	font-size: 13.5px;
	color: var(--afrb-text-muted);
	line-height: 1.5;
	margin: 0 0 14px;
	flex-grow: 1;
}

.afrb-card-meta-line {
	font-size: 12px;
	color: #64748b;
	background: #f8fafc;
	padding: 6px 10px;
	border-radius: 4px;
	margin-bottom: 14px;
	line-height: 1.4;
	border: 1px solid #f1f5f9;
}

.afrb-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	border-top: 1px solid #f1f5f9;
	padding-top: 14px;
	margin-top: auto;
}

.afrb-card-audit-date {
	font-size: 11.5px;
	color: #94a3b8;
}

.afrb-card-buttons {
	display: flex;
	align-items: center;
	gap: 10px;
}

.afrb-btn-link {
	font-size: 13px;
	font-weight: 600;
	color: #64748b;
	text-decoration: none;
	transition: color 0.15s ease;
}

.afrb-btn-link:hover {
	color: var(--afrb-primary);
}

.afrb-btn-sm {
	padding: 6px 12px;
	font-size: 12.5px;
	border-radius: 5px;
}

/* Empty State */
.afrb-empty-state {
	grid-column: 1 / -1;
	text-align: center;
	padding: 48px 24px;
	background: #ffffff;
	border: 1px solid var(--afrb-border);
	border-radius: 12px;
}

.afrb-empty-icon {
	font-size: 40px;
	margin-bottom: 12px;
	opacity: 0.6;
}

.afrb-empty-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--afrb-text-main);
	margin: 0 0 8px;
}

.afrb-empty-desc {
	font-size: 14px;
	color: var(--afrb-text-muted);
	margin: 0 auto 20px;
	max-width: 480px;
}

/* Pagination */
.afrb-pagination-wrap {
	display: flex;
	justify-content: center;
	margin-top: 24px;
}

.afrb-pagination-wrap ul.page-numbers {
	display: flex;
	list-style: none;
	padding: 0;
	margin: 0;
	gap: 6px;
}

.afrb-pagination-wrap .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 10px;
	border-radius: 6px;
	background: #ffffff;
	border: 1px solid var(--afrb-border);
	color: #334155;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.15s ease;
}

.afrb-pagination-wrap .page-numbers.current,
.afrb-pagination-wrap .page-numbers:hover {
	background: var(--afrb-primary);
	color: #ffffff;
	border-color: var(--afrb-primary);
}

/* Age Gate Modal */
.afrb-modal-backdrop {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 99999;
	padding: 16px;
}

.afrb-modal-content {
	background: #ffffff;
	border-radius: 12px;
	max-width: 500px;
	width: 100%;
	padding: 32px 28px;
	box-shadow: var(--afrb-shadow-lg);
	text-align: center;
	position: relative;
	animation: afrbModalIn 0.2s ease-out;
}

@keyframes afrbModalIn {
	from { opacity: 0; transform: scale(0.95); }
	to { opacity: 1; transform: scale(1); }
}

.afrb-modal-icon {
	font-size: 36px;
	color: #d97706;
	margin-bottom: 12px;
}

.afrb-modal-title {
	font-size: 20px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 12px;
}

.afrb-modal-body p {
	font-size: 14px;
	color: #475569;
	line-height: 1.55;
	margin: 0 0 24px;
}

.afrb-modal-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

@media (max-width: 480px) {
	.afrb-modal-actions {
		flex-direction: column;
	}
}
