/**
 * HSAFP Resources - Single Resource Styles
 * BuddyBoss-inspired layout for resource pages
 */

/* Resource Header */
.hsafp-resource-header {
	background: #f7f7f7;
	border-bottom: 1px solid #e1e1e1;
	padding: 40px 0;
	margin-bottom: 40px;
}

.hsafp-resource-header .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.hsafp-resource-header .entry-title {
	margin: 0 0 20px 0;
	font-size: 2.5rem;
	line-height: 1.2;
	color: #333;
	font-weight: 700;
}

/* Resource Meta */
.hsafp-resource-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 20px;
	margin-bottom: 10px;
}

.hsafp-resource-meta span {
	display: inline-block;
	font-size: 0.95rem;
	color: #666;
}

.hsafp-resource-meta strong {
	color: #333;
}

.hsafp-badge {
	background: #1a8545;
	color: white !important;
	padding: 4px 12px;
	border-radius: 15px;
	font-size: 0.85rem !important;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* Main Content Layout */
.hsafp-resource-content .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.hsafp-resource-layout {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 60px;
	align-items: start;
}

/* Main Content Area */
.hsafp-resource-main {
	min-height: 400px;
}

.hsafp-description-header {
	margin: 0 0 25px 0;
	font-size: 1.8rem;
	color: #333;
	font-weight: 600;
	padding-bottom: 15px;
	border-bottom: 3px solid #1a8545;
}

.hsafp-resource-main .entry-content {
	font-size: 1.1rem;
	line-height: 1.7;
	color: #444;
	margin-bottom: 40px;
}

.hsafp-resource-main .entry-content p {
	margin-bottom: 20px;
}

.hsafp-resource-main .entry-content h2,
.hsafp-resource-main .entry-content h3,
.hsafp-resource-main .entry-content h4 {
	margin-top: 30px;
	margin-bottom: 15px;
	color: #333;
}

/* CTA Button */
.hsafp-resource-cta {
	margin-top: 30px;
}

.hsafp-cta-button {
	display: inline-block;
	background: #1a8545;
	color: white;
	padding: 10px 20px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.875rem;
	transition: all 0.3s ease;
	border: none;
	cursor: pointer;
	text-transform: none;
	letter-spacing: 0.5px;
}

.hsafp-cta-button:hover {
	background: #0b5729;
	color: white;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(26, 133, 69, 0.3);
}

/* Sidebar */
.hsafp-resource-sidebar {
	position: sticky;
	top: 20px;
}

/* Featured Image */
.hsafp-resource-image {
	margin-bottom: 30px;
}

.hsafp-featured-image {
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
	transition: transform 0.3s ease;
}

.hsafp-featured-image:hover {
	transform: scale(1.02);
}

/* Resource Info Box */
.hsafp-resource-info {
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 12px;
	padding: 25px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hsafp-resource-info h3 {
	margin: 0 0 20px 0;
	font-size: 1.3rem;
	color: #333;
	font-weight: 600;
	border-bottom: 2px solid #1a8545;
	padding-bottom: 10px;
}

.hsafp-info-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #f0f0f0;
}

.hsafp-info-item:last-child {
	border-bottom: none;
}

.hsafp-info-item strong {
	color: #333;
	font-weight: 600;
	flex: 1;
}

.hsafp-info-item span {
	color: #666;
	text-align: right;
	max-width: 60%;
}

/* ================================
   ARCHIVE STYLES
   ================================ */


/* Archive Container */
.hsafp-resources-archive .container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Archive Header */
.hsafp-archive-header {
	text-align: center;
	margin-bottom: 50px;
	padding: 40px 0;
	background: #f7f7f7;
	border-radius: 12px;
}

.hsafp-archive-header .page-title {
	margin: 0 0 15px 0;
	font-size: 2.8rem;
	color: #333;
	font-weight: 700;
}

.hsafp-archive-header .archive-description {
	font-size: 1.2rem;
	color: #666;
	line-height: 1.6;
	max-width: 800px;
	margin: 0 auto;
}

/* Search and Filter Bar */
.hsafp-search-filter-bar {
	margin-bottom: 20px;
}

.hsafp-search-container {
	display: flex;
	gap: 15px;
	align-items: center;
	background: #fff;
	border: 2px solid #e1e1e1;
	border-radius: 12px;
	padding: 8px;
	box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
	transition: border-color 0.3s ease, box-shadow 0.3s ease;
	overflow: hidden;
	min-height: 50px;
}

.hsafp-search-container:focus-within {
	border-color: #1a8545;
	box-shadow: 0 2px 20px rgba(26, 133, 69, 0.15);
}

.hsafp-main-search {
	flex: 1;
	padding: 10px 20px;
	border: none;
	background: transparent;
	font-size: 1rem;
	color: #333;
	outline: none;
	line-height: 1.4;
	height: auto;
	display: flex;
	align-items: center;
}

.hsafp-main-search::placeholder {
	color: #999;
	font-style: normal;
	font-size: 1rem;
}

.hsafp-filter-dropdown {
	border-left: 1px solid #e1e1e1;
	padding-left: 15px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
}

.hsafp-filter-type-select {
	padding: 10px 20px;
	border: none;
	background: transparent;
	font-size: 1rem;
	color: #666;
	cursor: pointer;
	outline: none;
	min-width: 280px;
	width: auto;
	white-space: nowrap;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg fill="%23666" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 15px center;
	background-size: 20px;
	padding-right: 50px;
	height: auto;
	min-height: 40px;
	line-height: normal;
	box-sizing: border-box;
}

.hsafp-filter-type-select:focus {
	color: #1a8545;
}

/* Ensure dropdown text is not cut off - override any theme styles */
.hsafp-search-filter-bar select.hsafp-filter-type-select {
	min-width: 280px !important;
	width: auto !important;
	max-width: none !important;
	overflow: visible !important;
	text-overflow: clip !important;
	white-space: nowrap !important;
	height: auto !important;
	min-height: 40px !important;
	line-height: normal !important;
	box-sizing: border-box !important;
	padding: 10px 50px 10px 20px !important;
}

/* Filter Chips */
.hsafp-filter-chips {
	margin-bottom: 20px;
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 12px;
	padding: 20px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.hsafp-chips-group {
	margin-bottom: 15px;
}

.hsafp-chips-group:last-child {
	margin-bottom: 0;
}

.hsafp-chips-label {
	display: inline-block;
	font-weight: 600;
	color: #333;
	margin-right: 15px;
	margin-bottom: 10px;
	font-size: 0.95rem;
}

.hsafp-filter-chip {
	display: inline-block;
	padding: 8px 16px;
	margin: 4px 6px 4px 0;
	background: #f7f7f7;
	border: 2px solid #e1e1e1;
	border-radius: 25px;
	font-size: 0.9rem;
	font-weight: 500;
	color: #555;
	cursor: pointer;
	transition: all 0.3s ease;
	text-transform: none;
}

.hsafp-filter-chip:hover {
	background: #1a8545;
	border-color: #1a8545;
	color: white;
	transform: translateY(-1px);
	box-shadow: 0 3px 8px rgba(26, 133, 69, 0.2);
}

.hsafp-filter-chip.active {
	background: #1a8545;
	border-color: #1a8545;
	color: white;
	box-shadow: 0 3px 8px rgba(26, 133, 69, 0.3);
}

/* Active Filters */
.hsafp-active-filters {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 30px;
	padding: 15px 20px;
	background: #f0f8f4;
	border: 1px solid #1a8545;
	border-radius: 8px;
}

.hsafp-active-filters-label {
	font-weight: 600;
	color: #0b5729;
	font-size: 0.95rem;
}

.hsafp-active-filter-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	flex: 1;
}

.hsafp-active-filter-tag {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 12px;
	background: #1a8545;
	color: white;
	border-radius: 20px;
	font-size: 0.85rem;
	font-weight: 500;
}

.hsafp-active-filter-tag .remove-filter {
	background: none;
	border: none;
	color: white;
	cursor: pointer;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1;
	opacity: 0.8;
	transition: opacity 0.3s ease;
}

.hsafp-active-filter-tag .remove-filter:hover {
	opacity: 1;
}

.hsafp-clear-filters {
	padding: 6px 12px;
	background: transparent;
	border: 1px solid #0b5729;
	color: #0b5729;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.3s ease;
}

.hsafp-clear-filters:hover {
	background: #0b5729;
	color: white;
}

/* Resources Grid */
.hsafp-resources-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
	gap: 30px;
	margin-bottom: 60px;
}

/* Resource Card */
.hsafp-resource-card {
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.hsafp-resource-card:hover {
	transform: translateY(-5px);
	box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Card Image */
.hsafp-card-image {
	position: relative;
	height: 200px;
	overflow: hidden;
}

.hsafp-resource-thumbnail {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.hsafp-resource-card:hover .hsafp-resource-thumbnail {
	transform: scale(1.05);
}

.hsafp-placeholder-image {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: linear-gradient(135deg, #1a8545, #0b5729);
	color: white;
}

.hsafp-placeholder-image .dashicons {
	font-size: 3rem;
}

/* Card Badge */
.hsafp-card-badge {
	position: absolute;
	top: 15px;
	left: 15px;
	background: #1a8545;
	color: white;
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0.5px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Inline Badge (positioned with audience info) */
.hsafp-card-badge-inline {
	position: static !important;
	background: #1a8545;
	color: white;
	padding: 6px 16px;
	border-radius: 15px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: inline-block;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Login Gate Styles */
.hsafp-login-required {
	position: relative;
}

/* Login Gate Button */
.hsafp-login-gate-btn {
	cursor: pointer;
	border: none;
	background: #1a8545 !important;
	color: white !important;
}

.hsafp-login-gate-btn:hover {
	background: #156b37 !important;
}

/* Modal Styles */
.hsafp-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hsafp-modal-content {
	background: white;
	border-radius: 8px;
	max-width: 500px;
	width: 90%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hsafp-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid #e1e1e1;
}

.hsafp-modal-header h3 {
	margin: 0;
	font-size: 1.5rem;
	color: #333;
}

.hsafp-modal-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #666;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hsafp-modal-close:hover {
	color: #333;
}

.hsafp-modal-body {
	padding: 24px;
}

.hsafp-modal-body p {
	margin-bottom: 20px;
	color: #555;
	line-height: 1.6;
}

.hsafp-modal-buttons {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.hsafp-login-btn,
.hsafp-register-btn {
	padding: 12px 24px;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 600;
	transition: all 0.3s ease;
	flex: 1;
	text-align: center;
	min-width: 120px;
}

.hsafp-login-btn {
	background: #1a8545;
	color: white;
}

.hsafp-login-btn:hover {
	background: #156b37;
	color: white;
}

.hsafp-register-btn {
	background: #f7f7f7;
	color: #333;
	border: 1px solid #ddd;
}

.hsafp-register-btn:hover {
	background: #e9e9e9;
	color: #333;
}

/* Featured Star Indicator */
.hsafp-featured-star {
	position: absolute;
	top: 15px;
	right: 15px;
	background: #ffd700;
	color: #0b5729;
	width: 35px;
	height: 35px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.1rem;
	font-weight: bold;
	box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
	z-index: 2;
}

/* Card Content */
.hsafp-card-content {
	padding: 25px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.hsafp-card-title {
	margin: 0 0 15px 0;
	font-size: 1.3rem;
	line-height: 1.3;
}

.hsafp-card-title a {
	color: #333;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.3s ease;
}

.hsafp-card-title a:hover {
	color: #1a8545;
}

.hsafp-card-meta {
	margin-bottom: 15px;
	font-size: 0.9rem;
	color: #666;
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}

.hsafp-card-audience {
	flex: 1;
	min-width: 0;
}

.hsafp-card-audience strong {
	color: #333;
}

.hsafp-card-excerpt {
	color: #555;
	line-height: 1.6;
	margin-bottom: 20px;
	flex-grow: 1;
	font-size: 0.95rem;
}

/* Card CTA */
.hsafp-card-cta {
	margin-top: auto;
	flex-shrink: 0;
}

.hsafp-card-button {
	display: inline-block;
	background: #1a8545;
	color: white;
	padding: 12px 24px;
	border-radius: 8px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	transition: all 0.3s ease;
	text-transform: none;
	letter-spacing: 0.5px;
	width: 100%;
	text-align: center;
}

.hsafp-card-button:hover {
	background: #0b5729;
	color: white;
	text-decoration: none;
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(26, 133, 69, 0.3);
}

/* No Results */
.hsafp-no-resources,
.hsafp-no-results {
	text-align: center;
	padding: 60px 20px;
	background: #f7f7f7;
	border-radius: 12px;
	margin: 40px 0;
}

.hsafp-no-resources h3,
.hsafp-no-results h3 {
	color: #333;
	margin-bottom: 15px;
	font-size: 1.5rem;
}

.hsafp-no-resources p,
.hsafp-no-results p {
	color: #666;
	font-size: 1.1rem;
}

/* Pagination */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 40px 0;
}

.pagination .page-numbers {
	padding: 10px 15px;
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 6px;
	text-decoration: none;
	color: #333;
	font-weight: 500;
	transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
	background: #1a8545;
	color: white;
	border-color: #1a8545;
}

/* Responsive Design */
@media (max-width: 1024px) {
	.hsafp-resource-layout {
		gap: 40px;
	}
	
	.hsafp-resources-grid {
		grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
		gap: 25px;
	}
	
	.hsafp-filters {
		gap: 15px;
	}
}

@media (max-width: 768px) {
	.hsafp-resource-layout {
		grid-template-columns: 1fr;
		gap: 30px;
	}
	
	.hsafp-resource-sidebar {
		order: -1;
		position: static;
	}
	
	.hsafp-resource-header .entry-title {
		font-size: 2rem;
	}
	
	.hsafp-resource-meta {
		flex-direction: column;
		gap: 10px;
	}
	
	.hsafp-info-item {
		flex-direction: column;
		align-items: flex-start;
		gap: 5px;
	}
	
	.hsafp-info-item span {
		max-width: 100%;
		text-align: left;
	}
	
	/* Archive Responsive */
	.hsafp-archive-header .page-title {
		font-size: 2.2rem;
	}
	
	.hsafp-archive-header .archive-description {
		font-size: 1.1rem;
	}
	
	.hsafp-search-container {
		flex-direction: column;
		gap: 10px;
	}
	
	.hsafp-filter-dropdown {
		border-left: none;
		border-top: 1px solid #e1e1e1;
		padding-left: 0;
		padding-top: 15px;
	}
	
	.hsafp-filter-type-select {
		min-width: 100% !important;
		width: 100% !important;
		padding: 15px 20px;
	}
	
	.hsafp-active-filters {
		flex-direction: column;
		align-items: flex-start;
		gap: 10px;
	}
	
	.hsafp-resources-grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.hsafp-resource-header {
		padding: 20px 0;
		margin-bottom: 20px;
	}
	
	.hsafp-resource-header .entry-title {
		font-size: 1.75rem;
	}
	
	.hsafp-resource-content .container,
	.hsafp-resource-header .container,
	.hsafp-resources-archive .container {
		padding: 0 15px;
	}
	
	.hsafp-cta-button {
		width: 100%;
		text-align: center;
		padding: 18px 20px;
	}
	
	.hsafp-archive-header {
		padding: 20px;
		margin-bottom: 30px;
	}
	
	.hsafp-archive-header .page-title {
		font-size: 1.8rem;
	}
	
	.hsafp-filters {
		padding: 20px;
	}
	
	.hsafp-card-content {
		padding: 20px;
	}
}

/* Integration with BuddyBoss Theme */
.buddyboss-theme .hsafp-resource-single {
	background: transparent;
}

.buddyboss-theme .hsafp-resource-header {
	background: #f8f9fa;
}

.buddyboss-theme .hsafp-cta-button,
.buddyboss-theme .hsafp-card-button {
	background: var(--bb-primary-color, #1a8545);
}

.buddyboss-theme .hsafp-cta-button:hover,
.buddyboss-theme .hsafp-card-button:hover {
	background: var(--bb-primary-color-hover, #0b5729);
}

.buddyboss-theme .hsafp-badge,
.buddyboss-theme .hsafp-card-badge {
	background: var(--bb-accent-color, #1a8545);
}

/* Fix filter dropdown text cutoff in BuddyBoss theme */
.buddyboss-theme .hsafp-search-filter-bar .hsafp-filter-type-select,
body.buddyboss-theme .hsafp-search-filter-bar .hsafp-filter-type-select,
.bb-theme .hsafp-search-filter-bar .hsafp-filter-type-select {
	min-width: 300px !important;
	width: auto !important;
	height: auto !important;
	min-height: 40px !important;
	padding: 10px 55px 10px 20px !important;
	white-space: nowrap !important;
	overflow: visible !important;
	text-overflow: clip !important;
	line-height: 1.4 !important;
	font-size: 1rem !important;
	box-sizing: border-box !important;
	background-position: right 15px center !important;
}

/* Print Styles */
@media print {
	.hsafp-resource-cta,
	.hsafp-resource-info,
	.hsafp-filters,
	.hsafp-card-cta {
		display: none;
	}
	
	.hsafp-resource-layout {
		grid-template-columns: 1fr;
	}
	
	.hsafp-resources-grid {
		grid-template-columns: 1fr;
	}
} 