/**
 * HTSA Downloads - Component Styles
 *
 * @package HTSA_Child
 * @since 1.3.0
 */

/* ==========================================================================
   Download List Container
   ========================================================================== */

.htsa-downloads-wrapper {
	position: relative;
}

.htsa-downloads-wrapper.is-loading .htsa-downloads-list {
	opacity: 0.5;
	pointer-events: none;
}

.htsa-downloads-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	transition: opacity 0.2s ease;
}

/* ==========================================================================
   Single Download Item
   ========================================================================== */

.htsa-download-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 20px 24px;
	border-bottom: 1px solid #eee;
	transition: background-color 0.2s ease;
}

.htsa-download-item:last-child {
	border-bottom: none;
}

.htsa-download-item:hover {
	background-color: #FDF6E3;
}

/* ==========================================================================
   File Type Icon
   ========================================================================== */

.htsa-download-icon {
	width: 48px;
	height: 48px;
	min-width: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f5f0e8;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 700;
	font-family: 'Poppins', sans-serif;
	color: #666;
}

.htsa-download-icon--pdf {
	background: #fce8e8;
	color: #c0392b;
}

.htsa-download-icon--doc {
	background: #e8f0fc;
	color: #2980b9;
}

.htsa-download-icon--xls {
	background: #e8fce8;
	color: #27ae60;
}

.htsa-download-icon--ppt {
	background: #fce8d8;
	color: #d35400;
}

.htsa-download-icon--zip {
	background: #f0e8fc;
	color: #8e44ad;
}

.htsa-download-icon--default {
	background: #f5f0e8;
	color: #666;
}

/* ==========================================================================
   Download Content
   ========================================================================== */

.htsa-download-content {
	flex: 1;
}

.htsa-download-title {
	font-family: 'Poppins', sans-serif;
	font-size: 16px;
	font-weight: 600;
	color: #2D2D2D;
	margin: 0 0 4px 0;
}

.htsa-download-description {
	font-size: 14px;
	color: #666;
	margin: 0 0 8px 0;
	line-height: 1.4;
}

.htsa-download-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	font-size: 12px;
	color: #888;
}

.htsa-download-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.htsa-download-meta-pill {
	background: #f0ebe3;
	color: #8B1A1A;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 500;
}

.htsa-download-meta-separator {
	color: #ddd;
}

/* ==========================================================================
   Download Button
   ========================================================================== */

.htsa-download-action {
	flex-shrink: 0;
}

.htsa-download-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	background: #8B1A1A;
	color: #ffffff;
	border: none;
	border-radius: 6px;
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, transform 0.1s ease;
	white-space: nowrap;
}

.htsa-download-btn:hover {
	background: #D4A017;
	color: #2D2D2D;
	transform: translateY(-1px);
}

.htsa-download-btn:active {
	transform: translateY(0);
}

.htsa-download-btn svg {
	flex-shrink: 0;
}

/* ==========================================================================
   Section Heading
   ========================================================================== */

.htsa-downloads-section-heading {
	font-family: 'Poppins', sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: #2D2D2D;
	margin: 0 0 24px 0;
}

.htsa-downloads-section-heading::after {
	content: '';
	display: block;
	width: 60px;
	height: 3px;
	background: #D4A017;
	margin-top: 8px;
}

.htsa-downloads-sub-heading {
	font-family: 'Poppins', sans-serif;
	font-size: 17px;
	font-weight: 600;
	color: #2D2D2D;
	margin: 32px 0 12px 0;
}

.htsa-downloads-sub-heading:first-of-type {
	margin-top: 0;
}

/* ==========================================================================
   Filter Bar
   ========================================================================== */

.htsa-downloads-filter {
	background: #F8F4ED;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 16px 24px;
	margin-bottom: 24px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	align-items: center;
}

.htsa-downloads-filter-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.htsa-downloads-filter select,
.htsa-downloads-filter-select {
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 8px 32px 8px 12px;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	color: #2D2D2D;
	background: white;
	min-width: 180px;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
}

.htsa-downloads-filter select:focus,
.htsa-downloads-filter-select:focus {
	border-color: #8B1A1A;
	outline: none;
	box-shadow: 0 0 0 2px rgba(139, 26, 26, 0.1);
}

.htsa-downloads-filter-input {
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 8px 12px;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	color: #2D2D2D;
	background: white;
	min-width: 200px;
}

.htsa-downloads-filter-input:focus {
	border-color: #8B1A1A;
	outline: none;
	box-shadow: 0 0 0 2px rgba(139, 26, 26, 0.1);
}

/* ==========================================================================
   Active Filter Pills
   ========================================================================== */

.htsa-downloads-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	width: 100%;
}

.htsa-downloads-active-filters:empty {
	display: none;
}

.htsa-filter-pill {
	background: #8B1A1A;
	color: white;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.htsa-filter-pill-remove {
	cursor: pointer;
	opacity: 0.7;
	font-size: 14px;
	border: none;
	background: none;
	color: inherit;
	padding: 0;
	line-height: 1;
}

.htsa-filter-pill-remove:hover {
	opacity: 1;
	color: #D4A017;
}

.htsa-filter-clear {
	color: #8B1A1A;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
	background: none;
	border: none;
	padding: 4px 8px;
	font-family: 'Poppins', sans-serif;
}

.htsa-filter-clear:hover {
	color: #D4A017;
}

/* ==========================================================================
   Quick Jump Navigation
   ========================================================================== */

.htsa-downloads-jump-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.htsa-downloads-jump-btn {
	background: white;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 8px 16px;
	font-family: 'Poppins', sans-serif;
	font-size: 13px;
	color: #2D2D2D;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
}

.htsa-downloads-jump-btn:hover {
	border-color: #8B1A1A;
	color: #8B1A1A;
}

.htsa-downloads-jump-btn.active {
	background: #8B1A1A;
	color: white;
	border-color: #8B1A1A;
}

/* ==========================================================================
   Sticky Navigation
   ========================================================================== */

.htsa-downloads-sticky-nav {
	background: white;
	border: 1px solid #eee;
	border-radius: 8px;
	padding: 20px 24px;
	position: sticky;
	top: 20px;
	z-index: 10;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Category Sections
   ========================================================================== */

.htsa-downloads-category-section {
	padding: 48px 0;
}

.htsa-downloads-category-section:first-child {
	padding-top: 32px;
}

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

.htsa-downloads-empty {
	text-align: center;
	padding: 40px 20px;
	color: #888;
	font-style: italic;
}

.htsa-downloads-empty p {
	margin: 0 0 16px 0;
}

.htsa-downloads-empty--warning {
	background: #fff8e1;
	border: 1px solid #ffe082;
	border-radius: 8px;
	font-style: normal;
	color: #5d4037;
}

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

.htsa-downloads-pagination {
	display: flex;
	justify-content: center;
	gap: 4px;
	margin-top: 24px;
	padding-top: 24px;
	border-top: 1px solid #eee;
}

.htsa-downloads-pagination a,
.htsa-downloads-pagination span {
	padding: 8px 14px;
	border-radius: 4px;
	font-size: 14px;
	text-decoration: none;
	color: #2D2D2D;
	cursor: pointer;
}

.htsa-downloads-pagination .current {
	background: #8B1A1A;
	color: white;
}

.htsa-downloads-pagination a:hover {
	background: #f0ebe3;
}

/* ==========================================================================
   CTA Section (Downloads page specific)
   ========================================================================== */

.htsa-downloads-cta {
	background: #D4A017;
	padding: 48px 24px;
	text-align: center;
}

.htsa-downloads-cta h3 {
	font-family: 'Poppins', sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: #2D2D2D;
	margin: 0 0 8px 0;
}

.htsa-downloads-cta p {
	color: #2D2D2D;
	font-size: 15px;
	margin: 0 0 20px 0;
}

.htsa-downloads-cta .htsa-download-btn {
	background: #2D2D2D;
	color: white;
}

.htsa-downloads-cta .htsa-download-btn:hover {
	background: #8B1A1A;
	color: white;
}

/* ==========================================================================
   View All Link
   ========================================================================== */

.htsa-downloads-view-all {
	text-align: center;
	margin-top: 20px;
}

.htsa-downloads-view-all a {
	color: #8B1A1A;
	font-family: 'Poppins', sans-serif;
	font-size: 14px;
	font-weight: 500;
	text-decoration: underline;
}

.htsa-downloads-view-all a:hover {
	color: #D4A017;
}

/* ==========================================================================
   Info Box (contextual links)
   ========================================================================== */

.htsa-downloads-info-box {
	background: #f8f6f0;
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 12px 16px;
	margin-top: 16px;
	font-size: 13px;
	color: #666;
}

.htsa-downloads-info-box a {
	color: #8B1A1A;
	font-weight: 500;
}

.htsa-downloads-info-box a:hover {
	color: #D4A017;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
	.htsa-download-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 12px;
		padding: 16px;
	}

	.htsa-download-action {
		width: 100%;
	}

	.htsa-download-btn {
		width: 100%;
		justify-content: center;
	}

	.htsa-downloads-filter {
		flex-direction: column;
	}

	.htsa-downloads-filter select,
	.htsa-downloads-filter-select,
	.htsa-downloads-filter-input {
		width: 100%;
		min-width: unset;
	}

	.htsa-downloads-jump-nav {
		flex-wrap: wrap;
		overflow-x: visible;
		padding-bottom: 0;
	}

	.htsa-downloads-jump-btn {
		white-space: normal;
		flex-shrink: 1;
		font-size: 12px;
		padding: 6px 12px;
	}

	.htsa-downloads-section-heading {
		font-size: 19px;
	}

	.htsa-downloads-sticky-nav {
		position: static;
		box-shadow: none;
	}
}

@media (max-width: 480px) {
	.htsa-download-icon {
		width: 36px;
		height: 36px;
		min-width: 36px;
		font-size: 10px;
	}

	.htsa-download-title {
		font-size: 15px;
	}

	.htsa-downloads-category-section {
		padding: 32px 0;
	}
}
