/**
 * Listings Pages Styles
 *
 * @package Together_Job_Board
 * @since 1.0.0
 */

/* Page Header Styles (for Candidates page title) - Full Width */
.tjb-candidates-listing .page-header {
	background: #F0FDF4 !important; /* Light green background */
	padding: 60px 20px 40px !important;
	margin: 0 !important;
	border-bottom: none !important;
	position: relative !important;
	overflow: hidden !important;
	width: 100vw !important;
	position: relative !important;
	left: 50% !important;
	margin-left: -50vw !important;
	margin-right: -50vw !important;
	box-sizing: border-box !important;
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
}

/* Add soft blob shapes to page header */
.tjb-candidates-listing .page-header::before,
.tjb-candidates-listing .page-header::after {
	content: '';
	position: absolute;
	width: 400px;
	height: 400px;
	border-radius: 50% 30% 60% 40% / 50% 40% 60% 30%;
	z-index: 1;
	pointer-events: none;
}

.tjb-candidates-listing .page-header::before {
	top: -100px;
	right: -100px;
	background: rgba(107, 203, 119, 0.3); /* Light green blob */
	transform: rotate(45deg);
}

.tjb-candidates-listing .page-header::after {
	bottom: -80px;
	left: -80px;
	background: rgba(151, 195, 84, 0.4); /* Medium green blob */
	border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
	transform: rotate(-30deg);
}

.tjb-candidates-listing .page-header-inner {
	max-width: 1350px;
	width: 100%;
	position: relative;
	z-index: 2;
	padding: 0 20px;
	box-sizing: border-box;
	text-align: center;
}

.tjb-candidates-listing .page-header .page-title {
	font-size: 2.5em;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
	line-height: 1.3;
	position: relative;
	z-index: 2;
}

.tjb-listings-page {
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
}

.tjb-candidates-listing {
	background: #fff;
}

.tjb-candidates-listing .page-header {
	margin-bottom: 0;
}

/* Allow full-width breakouts for candidates listing page */
body:has(.tjb-candidates-listing) .together-page,
body:has(.tjb-candidates-listing) .container,
body:has(.tjb-candidates-listing) .page-content,
body:has(.tjb-candidates-listing) .entry-content {
	overflow-x: visible !important;
	max-width: none !important;
}

body:has(.tjb-candidates-listing) .together-page {
	padding: 0 !important;
	margin-top: 0 !important;
}

/* Wrapper to contain the listings container within normal flow */
.tjb-listings-container-wrapper {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.tjb-listings-container {
	display: grid;
	grid-template-columns: 300px 1fr;
	gap: 30px;
	align-items: start;
	width: 100%;
	padding: 40px 0;
	box-sizing: border-box;
}

/* Sidebar */
.tjb-listings-sidebar {
	position: sticky;
	top: 20px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 25px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tjb-filters-wrapper {
	width: 100%;
}

.tjb-filters-title {
	font-size: 1.4em;
	font-weight: 600;
	color: #1a1a1a;
	margin: 0 0 20px 0;
	padding-bottom: 15px;
	border-bottom: 2px solid #e0e0e0;
}

.tjb-filter-form {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.tjb-filter-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tjb-filter-field label {
	font-weight: 600;
	color: #333;
	font-size: 14px;
}

.tjb-filter-field .tjb-input,
.tjb-filter-field .tjb-select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 6px;
	font-size: 14px;
	transition: border-color 0.3s ease;
}

.tjb-filter-field .tjb-input:focus,
.tjb-filter-field .tjb-select:focus {
	outline: none;
	border-color: #447AB3;
	box-shadow: 0 0 0 3px rgba(61, 78, 243, 0.1);
}

.tjb-filter-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 10px;
}

.tjb-button {
	padding: 12px 24px;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	text-align: center;
	text-decoration: none;
	display: inline-block;
}

.tjb-button-primary {
	background: #447AB3;
	color: #fff !important;
}

.tjb-button-primary:hover {
	background: #3a6a9a;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(61, 78, 243, 0.3);
	color: #fff !important;
}

.tjb-button-secondary {
	background: #f5f5f5;
	color: #333;
	border: 1px solid #ddd;
}

.tjb-button-secondary:hover {
	background: #e8e8e8;
}

/* Main Content */
.tjb-listings-content {
	width: 100%;
}

.tjb-listings-header {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	margin-bottom: 30px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e0e0e0;
}

.tjb-listings-title-section {
	display: none; /* Hide title section for employers listing */
}

.tjb-listings-title {
	font-size: 2rem;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0;
}

.tjb-listings-count {
	font-size: 1rem;
	color: #666;
}

.tjb-results-count {
	color: #447AB3;
	font-weight: 600;
}

/* Grid */
.tjb-listings-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 25px;
	margin-bottom: 40px;
}

/* Candidates Grid - 2 columns on desktop for horizontal cards */
.tjb-candidates-listing .tjb-listings-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 20px;
}

/* Listing Cards */
.tjb-listing-card {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 12px;
	padding: 25px;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.tjb-listing-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
	border-color: #447AB3;
}

.tjb-card-header {
	margin-bottom: 20px;
	text-align: center;
}

.tjb-card-logo,
.tjb-card-avatar {
	width: 100px;
	height: 100px;
	margin: 0 auto;
	border-radius: 50%;
	overflow: hidden;
	background: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tjb-card-logo img,
.tjb-card-avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tjb-card-logo-placeholder,
.tjb-card-avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
}

.tjb-card-logo-placeholder .dashicons,
.tjb-card-avatar-placeholder .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: #999;
}

.tjb-card-body {
	flex: 1;
	margin-bottom: 20px;
	min-height: 0;
}

.tjb-card-title {
	font-size: 1.3em;
	font-weight: 600;
	margin: 0 0 15px 0;
}

.tjb-card-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 0.3s ease;
}

.tjb-card-title a:hover {
	color: #447AB3;
}

.tjb-card-location,
.tjb-card-category,
.tjb-card-jobs,
.tjb-card-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
	font-size: 14px;
	color: #666;
}

.tjb-card-location .dashicons,
.tjb-card-category .dashicons,
.tjb-card-jobs .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #447AB3;
}

.tjb-card-meta {
	display: flex;
	justify-content: space-between;
}

.tjb-meta-label {
	font-weight: 600;
	color: #333;
}

.tjb-meta-value {
	color: #666;
}

.tjb-card-footer {
	margin-top: auto;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
}

.tjb-card-footer .tjb-button {
	width: 100%;
	color: #fff !important;
	border-radius: 8px;
	padding: 12px 24px;
	font-size: 0.9375rem;
	font-weight: 600;
}

.tjb-card-footer a.tjb-button-primary {
	color: #fff !important;
}

.tjb-card-footer a.tjb-button-primary:hover {
	color: #fff !important;
}

/* No Results */
.tjb-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	background: #f9f9f9;
	border-radius: 12px;
	border: 1px dashed #ddd;
}

.tjb-no-results p {
	font-size: 18px;
	color: #666;
	margin: 0;
}

/* Pagination */
.tjb-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid #e0e0e0;
}

.tjb-pagination .page-numbers {
	display: inline-block;
	padding: 10px 16px;
	border: 1px solid #ddd;
	border-radius: 6px;
	color: #333;
	text-decoration: none;
	transition: all 0.3s ease;
}

.tjb-pagination .page-numbers:hover,
.tjb-pagination .page-numbers.current {
	background: #447AB3;
	color: #fff;
	border-color: #447AB3;
}

/* Loading State */
.tjb-listings-grid.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Responsive */
@media (max-width: 992px) {
	.tjb-listings-container {
		grid-template-columns: 1fr;
	}
	
	.tjb-listings-sidebar {
		position: static;
		margin-bottom: 30px;
	}
	
	.tjb-listings-grid {
		grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
		gap: 20px;
	}
}

@media (max-width: 768px) {
	.tjb-listings-page {
		padding: 20px 15px;
	}
	
	.tjb-listings-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}
	
	.tjb-listings-title {
		font-size: 1.6em;
	}
	
	.tjb-listings-grid {
		grid-template-columns: 1fr;
	}
	
	/* Candidates grid - single column on mobile */
	.tjb-candidates-listing .tjb-listings-grid {
		grid-template-columns: 1fr;
	}
	
	/* Responsive: Stack avatar and content vertically on mobile for horizontal cards */
	.tjb-candidate-card-horizontal .tjb-candidate-card-content {
		flex-direction: column;
		align-items: center;
		text-align: center;
	}
	
	.tjb-candidate-card-horizontal .tjb-card-avatar-wrapper {
		margin: 0 auto;
	}
	
	.tjb-candidate-card-horizontal .tjb-card-content-wrapper {
		width: 100%;
		align-items: center;
	}
	
	.tjb-candidate-card-horizontal .tjb-card-header-info {
		text-align: center;
	}
	
	.tjb-candidate-card-horizontal .tjb-card-details {
		align-items: flex-start;
		width: 100%;
	}
	
	.tjb-candidate-card-horizontal .tjb-card-detail-item {
		justify-content: center;
	}
	
}

/* Horizontal Candidate Card Style (Screenshot 2) */
.tjb-candidate-card-horizontal {
	padding: 25px;
	border-radius: 12px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	background: #fff;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	border: 1px solid #e0e0e0;
}

.tjb-candidate-card-horizontal:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Card Content Layout - Horizontal */
.tjb-candidate-card-horizontal .tjb-candidate-card-content {
	display: flex;
	flex-direction: row;
	align-items: flex-start;
	gap: 20px;
}

/* Avatar Wrapper (Left Side) */
.tjb-card-avatar-wrapper {
	flex-shrink: 0;
}

.tjb-card-avatar-circular {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	overflow: hidden;
	border: 2px solid #97C354;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
}

.tjb-card-avatar-circular img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tjb-card-avatar-circular.tjb-card-avatar-placeholder {
	background: #fff;
	border: 2px solid #97C354;
}

.tjb-card-avatar-circular.tjb-card-avatar-placeholder svg {
	width: 50px;
	height: 50px;
}

/* Content Wrapper (Right Side) */
.tjb-card-content-wrapper {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 16px;
	min-width: 0; /* Allow flex item to shrink */
}

/* Header Info (Name and Field) */
.tjb-card-header-info {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.tjb-candidate-card-horizontal .tjb-card-title {
	margin: 0;
	font-size: 1.25em;
	font-weight: 700;
	color: #1a1a1a;
	text-align: left;
}

.tjb-candidate-card-horizontal .tjb-card-title a {
	color: #1a1a1a;
	text-decoration: none;
	transition: color 0.3s ease;
}

.tjb-candidate-card-horizontal .tjb-card-title a:hover {
	color: #447AB3;
}

/* Field/Category */
.tjb-card-field {
	font-size: 0.9375rem;
	color: #97C354;
	margin: 0;
	line-height: 1.4;
	font-weight: 400;
	text-align: left;
}

/* Details Section */
.tjb-card-details {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 4px 0;
}

.tjb-card-detail-item {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	font-size: 0.875rem;
}

.tjb-card-detail-icon {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	stroke: #97C354;
	fill: none;
}

.tjb-card-detail-text {
	display: flex;
	gap: 4px;
	color: #333;
	line-height: 1.4;
}

.tjb-card-detail-label {
	font-weight: 500;
	color: #333;
}

.tjb-card-detail-value {
	color: #333;
}

/* View Profile Button */
.tjb-card-footer-button {
	margin-top: 4px;
	width: 100%;
}

.tjb-view-profile-button {
	display: block;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: all 0.3s ease;
	text-align: center;
	width: 100%;
	box-sizing: border-box;
	color: #fff !important;
}

.tjb-view-profile-button-green {
	background: #97C354;
	color: #fff !important;
}

.tjb-view-profile-button-green:hover {
	background: #7fa845;
	color: #fff !important;
	text-decoration: none;
}

.tjb-view-profile-button-blue {
	background: #447AB3;
	color: #fff !important;
}

.tjb-view-profile-button-blue:hover {
	background: #3a6a9a;
	color: #fff !important;
	text-decoration: none;
}

/* Legacy styles for backward compatibility */
.tjb-candidate-card-vertical {
	padding: 30px 25px;
	border-bottom: 1px solid #e0e0e0;
	border-radius: 0;
	box-shadow: none;
}

.tjb-card-footer-link {
	margin-top: auto;
}

.tjb-view-profile-link {
	color: #447AB3;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
	transition: color 0.3s ease;
}

.tjb-view-profile-link:hover {
	color: #3a6a9a;
	text-decoration: underline;
}
