/**
 * COA Centers - Find a Center Styles
 *
 * Styles for the [coa_find_center] shortcode
 * Two-column layout: sidebar with search/cards + interactive Leaflet map
 */

/* Screen reader only - visually hidden but accessible */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.find-center-container {
	display: flex;
	height: 100vh;
	max-height: 800px;
}

/* Left Sidebar */
.find-center-sidebar {
	width: 420px;
	min-width: 420px;
	display: flex;
	flex-direction: column;
	border-right: 1px solid #e0e0e0;
}

/* Header / Search Section */
.find-center-header {
	padding: 24px;
}

.find-center-title {
	font-size: 24px;
	font-weight: 700;
	color: #FFFFFF;
	margin-top: 0;
	margin-bottom: 20px;
}

.find-center-search {
	display: flex;
	gap: 12px;
}

.search-input-wrap {
	flex: 1;
	position: relative;
}

.search-input {
	width: 100%;
	padding: 14px 20px;
	border: none;
	border-radius: 50px;
	font-size: 14px;
	color: #FFFFFF !important;
	background: rgba(255, 255, 255, 0.15);
	transition: background-color 0.2s;
	-webkit-text-fill-color: #FFFFFF !important;
}

.search-input:focus {
	outline: none;
	background: rgba(255, 255, 255, 0.25);
	color: #FFFFFF !important;
	-webkit-text-fill-color: #FFFFFF !important;
}

.search-input:active,
.search-input:valid {
	color: #FFFFFF !important;
	-webkit-text-fill-color: #FFFFFF !important;
}

.search-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
}

.distance-select {
	padding: 14px 20px;
	border: none;
	border-radius: 50px;
	font-size: 14px;
	color: #FFFFFF;
	background: rgba(255, 255, 255, 0.15);
	cursor: pointer;
	min-width: 110px;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 16px center;
	padding-right: 40px;
}

.distance-select:focus {
	outline: none;
	background-color: rgba(255, 255, 255, 0.25);
}

.distance-select option {
	background: #1a3a4a;
	color: #FFFFFF;
}

/* Results Count */
.results-count {
	padding: 16px 24px;
	font-size: 14px;
	font-weight: 700;
	color: #FFFFFF;
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Results List */
.results-list {
	flex: 1;
	overflow-y: auto;
	padding: 0;
	padding-right: 6px;
	scrollbar-width: thin;
	scrollbar-color: #FFFFFF transparent;
}

.results-list::-webkit-scrollbar {
	width: 6px;
}

.results-list::-webkit-scrollbar-track {
	background: transparent;
}

.results-list::-webkit-scrollbar-thumb {
	background: #FFFFFF;
	border-radius: 3px;
}

/* Location Card */
.location-card {
	background: #ffffff;
	border-radius: 12px;
	border: 6px solid transparent;
	overflow: hidden;
	margin: 16px;
	cursor: pointer;
	transition: box-shadow 0.2s, border-color 0.2s;
}

.location-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.location-card.active {
	border-color: rgb(0, 163, 227);
}

.location-card:focus {
	outline: none;
}

.location-card:focus-visible {
	outline: 3px solid #0d5c6a;
	outline-offset: 2px;
}

.location-card-body {
	padding: 20px;
}

/* Center Name */
.location-name {
	font-size: 18px;
	font-weight: 700;
	color: #1a1a1a;
	margin-top: 0;
	margin-bottom: 10px;
}

.location-name .campus {
	color: #555;
	font-weight: 700;
}

/* Address */
.location-address {
	font-size: 14px;
	color: #1a1a1a;
	text-decoration: underline;
	line-height: 1.5;
	margin-bottom: 6px;
}

/* Hours */
.location-hours {
	font-size: 14px;
	color: #333;
	margin-bottom: 4px;
}

/* Status Badge */
.location-status {
	display: inline-block;
	padding: 5px 14px;
	border-radius: 4px;
	font-size: 13px;
	font-weight: 600;
	margin-top: 10px;
	margin-bottom: 16px;
}

.location-status.open {
	background: #d4edda;
	color: #155724;
}

.location-status.closed {
	background: #f8d7da;
	color: #721c24;
}

/* Phone */
.location-phone {
	display: flex;
	width: fit-content;
	align-items: center;
	gap: 10px;
	padding: 8px 20px;
	background: #fce4ec;
	border-radius: 25px;
	margin-bottom: 32px;
}

.location-phone a {
	color: #1a1a1a;
	text-decoration: none;
	font-size: 14px;
	font-weight: 500;
}

.location-phone a:hover {
	text-decoration: underline;
}

.phone-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #1a1a1a;
}

.phone-icon svg {
	width: 18px;
	height: 18px;
}

/* Action Buttons */
.location-actions {
	display: flex;
	gap: 12px;
}

.location-actions a {
	flex: 1;
	padding: 10px 24px;
	border-radius: 25px;
	text-align: center;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.btn-schedule,
.btn-schedule:hover,
.btn-schedule:visited,
.btn-schedule:active {
	background: #a41e8a;
	color: #ffffff;
}

.btn-details,
.btn-details:hover,
.btn-details:visited,
.btn-details:active {
	background: #ffffff;
	color: #1a1a1a;
	border: 1px solid #a41e8a;
}

/* Map Container */
.find-center-map {
	flex: 1;
	position: relative;
}

#coa-find-center-map {
	width: 100%;
	height: 100%;
}

/* Custom Map Popup */
.leaflet-popup-content-wrapper {
	border-radius: 8px;
	padding: 0;
}

.leaflet-popup-content {
	margin: 0;
	min-width: 250px;
}

.map-popup {
	padding: 16px;
}

.map-popup-name {
	font-size: 15px;
	font-weight: 700;
	color: #1a1a1a;
	margin-bottom: 8px;
}

.map-popup-address {
	font-size: 13px;
	color: #666;
	margin-bottom: 6px;
}

.map-popup-phone {
	font-size: 13px;
	color: #333;
	margin-bottom: 10px;
}

.map-popup-link {
	display: inline-block;
	color: #a41e8a;
	font-size: 13px;
	text-decoration: none;
}

.map-popup-link:hover {
	text-decoration: underline;
}

/* No Results */
.no-results {
	padding: 40px 24px;
	text-align: center;
	color: #666;
}

.no-results .icon {
	font-size: 48px;
	margin-bottom: 16px;
	opacity: 0.5;
}

.no-results p {
	font-size: 14px;
	line-height: 1.6;
}

/* Loading State */
.loading {
	padding: 40px 24px;
	text-align: center;
	color: #666;
}

.loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e0e0e0;
	border-top-color: #0d5c6a;
	border-radius: 50%;
	animation: coaFindCenterSpin 1s linear infinite;
	margin: 0 auto 16px;
}

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

/* Responsive */
@media screen and (max-width: 900px) {
	.find-center-container {
		display: flex;
		flex-direction: column;
		height: auto;
		max-height: none;
	}

	.find-center-sidebar {
		display: contents;
	}

	.find-center-header {
		order: 1;
		width: 100%;
	}

	.find-center-map {
		order: 2;
		height: 300px !important;
		min-height: 300px;
		width: 100%;
		flex: none;
	}

	#coa-find-center-map {
		height: 300px !important;
	}

	.results-count {
		order: 3;
		width: 100%;
	}

	.results-list {
		order: 4;
		width: 100%;
		max-height: none;
		overflow-y: visible;
	}
}

@media screen and (max-width: 480px) {
	.find-center-search {
		flex-direction: column;
	}

	.distance-select {
		width: 100%;
	}

	.location-actions {
		flex-direction: column;
	}
}
