/**
 * Tracts Archive Page - Modern Design
 * @package CGT_Child
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

.tracts-archive-page {
	background: #f9fafb;
}

.tracts-hero {
	background: linear-gradient(135deg, #ce1010 0%, #a30f0f 100%);
	color: white;
	padding: 60px 0;
	margin-bottom: 40px;
	position: relative;
	overflow: hidden;
}

.tracts-hero::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 50%;
	height: 100%;
	background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="15" fill="rgba(255,255,255,0.05)"/><circle cx="80" cy="80" r="20" fill="rgba(255,255,255,0.05)"/><circle cx="50" cy="50" r="10" fill="rgba(255,255,255,0.03)"/></svg>');
	opacity: 0.5;
}

.tracts-hero__content {
	position: relative;
	z-index: 1;
	max-width: 800px;
}

.tracts-hero__badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, 0.2);
	backdrop-filter: blur(10px);
	padding: 8px 16px;
	border-radius: 50px;
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 24px;
	border: 1px solid rgba(255, 255, 255, 0.3);
}

.tracts-hero__badge svg {
	flex-shrink: 0;
}

.tracts-hero__title {
	font-size: 3rem;
	font-weight: 800;
	margin: 0 0 20px 0;
	line-height: 1.2;
}

.tracts-hero__description {
	font-size: 1.125rem;
	line-height: 1.6;
	margin: 0 0 32px 0;
	opacity: 0.95;
	max-width: 700px;
}

.tracts-hero__stats {
	display: flex;
	gap: 32px;
	flex-wrap: wrap;
}

.tracts-stat {
	display: flex;
	align-items: center;
	gap: 12px;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(10px);
	padding: 16px 24px;
	border-radius: 12px;
	border: 1px solid rgba(255, 255, 255, 0.2);
}

.tracts-stat svg {
	flex-shrink: 0;
	opacity: 0.9;
}

.tracts-stat strong {
	display: block;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1;
	margin-bottom: 4px;
}

.tracts-stat span {
	display: block;
	font-size: 0.875rem;
	opacity: 0.9;
}

/* ==========================================================================
   Container
   ========================================================================== */

.tracts-container {
	padding: 40px 0 80px 0;
}

/* ==========================================================================
   Filters Section
   ========================================================================== */

.tracts-filters-wrapper {
	background: white;
	border-radius: 16px;
	padding: 32px;
	margin-bottom: 40px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	border: 1px solid #e5e7eb;
}

.tracts-filters-header {
	margin-bottom: 24px;
}

.tracts-filters-header h2 {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 8px 0;
	color: #111827;
}

.tracts-filters-header p {
	margin: 0;
	color: #6b7280;
	font-size: 0.9375rem;
}

.tracts-filters {
	display: flex;
	gap: 16px;
	align-items: flex-end;
	flex-wrap: wrap;
}

.filter-group {
	flex: 1;
	min-width: 280px;
}

.filter-label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: 0.875rem;
	color: #374151;
	margin-bottom: 8px;
}

.filter-label svg {
	color: #ce1010;
	flex-shrink: 0;
}

.filter-select {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	font-size: 0.9375rem;
	background: white;
	color: #111827;
	transition: all 0.2s ease;
	appearance: none;
	background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23374151" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>');
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 40px;
	cursor: pointer;
}

.filter-select:hover {
	border-color: #ce1010;
}

.filter-select:focus {
	outline: none;
	border-color: #ce1010;
	box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.filter-submit,
.filter-reset {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
}

.filter-submit svg,
.filter-reset svg {
	flex-shrink: 0;
}

.btn-secondary {
	background: #f3f4f6;
	color: #374151;
	border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
	background: #e5e7eb;
	border-color: #d1d5db;
}

/* ==========================================================================
   Tracts Grid
   ========================================================================== */

.tracts-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
	gap: 24px;
	margin-bottom: 48px;
}

.tract-card {
	background: white;
	border-radius: 16px;
	padding: 24px;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	transition: all 0.3s ease;
	position: relative;
	overflow: hidden;
}

.tract-card__link {
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	gap: 20px;
	flex: 1;
	cursor: pointer;
}

.tract-card__link:hover {
	color: inherit;
}

.tract-card__link:focus {
	outline: 2px solid #ce1010;
	outline-offset: -2px;
	border-radius: 12px;
}

.tract-card::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 4px;
	background: linear-gradient(90deg, #ce1010 0%, #a30f0f 100%);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}

.tract-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(200, 16, 46, 0.15);
	border-color: #ce1010;
}

.tract-card:hover::before {
	transform: scaleX(1);
}

.tract-card__icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ce1010;
	flex-shrink: 0;
}

.tract-card__content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.tract-card__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.tract-card__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tract-card__date svg {
	flex-shrink: 0;
	color: #9ca3af;
}

.tract-card__badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tract-card__badge--private {
	background: #fff1f2;
	color: #ce1010;
	border: 1px solid #ffe4e6;
}

.tract-card__badge svg {
	width: 10px;
	height: 10px;
}

.tract-card__title {
	font-size: 1.125rem;
	font-weight: 700;
	line-height: 1.4;
	color: #111827;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.tract-card__branches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}

.tract-card__branch-tag {
	display: inline-block;
	padding: 4px 10px;
	background: #f3f4f6;
	color: #374151;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

.tract-card__branch-tag--more {
	background: #ce1010;
	color: white;
	border-color: #ce1010;
}

.tract-card__footer {
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid #f3f4f6;
}

.tract-card__download {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	background: #ce1010;
	color: white;
	font-weight: 600;
	font-size: 0.875rem;
	border-radius: 8px;
	text-decoration: none;
	transition: all 0.3s ease;
	width: 89%;
	justify-content: center;
}

.tract-card__download svg {
	flex-shrink: 0;
	transition: transform 0.3s ease;
}

.tract-card__download:hover {
	background: #a30f0f;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(200, 16, 46, 0.3);
}

.tract-card__download:hover svg {
	transform: translateY(2px);
}

.tract-card__locked {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	padding: 16px;
	background: #f9fafb;
	border-radius: 8px;
	text-align: center;
	border: 1px solid #e5e7eb;
}

.tract-card__locked svg {
	color: #9ca3af;
}

.tract-card__locked span {
	font-size: 0.875rem;
	color: #6b7280;
	font-weight: 600;
}

.tract-card__login-link {
	display: inline-flex;
	align-items: center;
	padding: 8px 16px;
	background: #ce1010;
	color: white;
	font-weight: 600;
	font-size: 0.875rem;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.tract-card__login-link:hover {
	background: #a30f0f;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.tracts-empty {
	text-align: center;
	padding: 80px 20px;
	background: white;
	border-radius: 16px;
	border: 2px dashed #e5e7eb;
}

.tracts-empty__icon {
	display: inline-flex;
	width: 96px;
	height: 96px;
	align-items: center;
	justify-content: center;
	background: #f9fafb;
	border-radius: 50%;
	margin: 0 auto 24px;
	color: #9ca3af;
}

.tracts-empty h3 {
	font-size: 1.5rem;
	font-weight: 700;
	color: #111827;
	margin: 0 0 12px 0;
}

.tracts-empty p {
	font-size: 1rem;
	color: #6b7280;
	margin: 0 0 24px 0;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.tracts-pagination {
	display: flex;
	justify-content: center;
	margin-top: 48px;
}

.tracts-pagination .pagination {
	display: flex;
	gap: 8px;
	list-style: none;
	padding: 0;
	margin: 0;
}

.tracts-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 16px;
	background: white;
	border: 2px solid #e5e7eb;
	border-radius: 8px;
	color: #374151;
	font-weight: 600;
	font-size: 0.9375rem;
	text-decoration: none;
	transition: all 0.2s ease;
	gap: 8px;
}

.tracts-pagination .page-numbers:hover {
	background: #f9fafb;
	border-color: #ce1010;
	color: #ce1010;
}

.tracts-pagination .page-numbers.current {
	background: #ce1010;
	border-color: #ce1010;
	color: white;
}

.tracts-pagination .page-numbers svg {
	flex-shrink: 0;
}

.tracts-pagination .dots {
	display: inline-flex;
	align-items: center;
	padding: 0 8px;
	color: #9ca3af;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.tracts-hero {
		padding: 40px 0;
	}

	.tracts-hero__title {
		font-size: 2rem;
	}

	.tracts-hero__description {
		font-size: 1rem;
	}

	.tracts-hero__stats {
		gap: 16px;
	}

	.tracts-stat {
		flex: 1 1 100%;
	}

	.tracts-filters-wrapper {
		padding: 24px;
	}

	.tracts-filters {
		flex-direction: column;
		align-items: stretch;
	}

	.filter-group {
		min-width: 100%;
	}

	.filter-submit,
	.filter-reset {
		width: 100%;
		justify-content: center;
	}

	.tracts-grid {
		grid-template-columns: 1fr;
	}

	.tracts-pagination .page-numbers {
		min-width: 40px;
		height: 40px;
		padding: 0 12px;
		font-size: 0.875rem;
	}
}

@media (max-width: 480px) {
	.tracts-hero__badge {
		font-size: 0.8125rem;
		padding: 6px 12px;
	}

	.tracts-hero__title {
		font-size: 1.75rem;
	}

	.tracts-filters-wrapper {
		padding: 20px;
	}

	.tract-card {
		padding: 20px;
	}
}
