/* ===========================
   (Search Panel)
   =========================== */
.search-panel {
	background: transparent;
	box-sizing: border-box;
	transition: all 0.4s ease;
	flex: 1 1 100%;
}

/* When moving to right (filter is open) */
.search-panel.move-right {
	flex: 0 0 60%;
}

/* When moving to left (map is open) */
.search-panel.move-left {
	flex: 0 0 50%;
}

/* ===========================
   FILTER PANEL
   =========================== */
.filter-panel {
	flex: 0 0 0;
	transition: all 0.4s ease;
}

.filter-panel.active {
	flex: 0 0 40%;
	padding-bottom: 4rem;
	box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* ===========================
   MAP PANEL (NEW)
   =========================== */
#mapPanel {
	left: 50%;
	width: 50%;
	z-index: 4;
}

#mapPanel.visible {
	transform: translateX(0);
}

#map {
	width: 100%;
	height: 100%;
}

/* ===========================
   SEARCH RESULT CARDS
   =========================== */
.org-card {
	background-color: white;
	border-radius: 12px;
	padding: 1rem;
	margin-bottom: 1rem;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	cursor: pointer;
	transition: background-color 0.8s ease;
	position: relative;
	overflow: visible;
	z-index: 1;
}

.org-card .fs-4 {
	position: absolute;
	right: 1rem;
	top: 50%;
	transform: translateY(-50%);
	padding: 0.5rem;
	cursor: pointer;
	pointer-events: auto;
}

.org-card.highlight {
	background-color: var(--primary-extralight);
}

/* Organization logo container */
.org-logo-container {
	width: 7.5rem;
	height: 7.5rem;
	border-radius: 0.375rem;
	background-color: rgba(108, 117, 125, 0.25);
	/* muted bg-secondary */
	overflow: hidden;
	flex-shrink: 0;
}

/* 
.text-block:
  - Applies a responsive font size to the entire text block (name, location, labels).
  - Ensures consistent scaling across all child text elements while preventing the text from becoming too small.
  - Adjust line-height to keep the vertical rhythm tight even at smaller font sizes.
*/
.text-block {
	/* stylelint-disable-next-line */
	font-size: clamp(0.8rem, 2vw, 1rem);
	line-height: 1.2;
}

/* Large display heading */
.display-heading {
	font-size: 6rem;
}

/* Extra margin for spacing below elements */
.mb-extra {
	margin-bottom: 10rem;
}

/* ===========================
   SEARCH RESULT PAGINATION
   =========================== */
#pagination {
	margin-bottom: 10vh;
}

#match-count {
	border-color: var(--primary);
}

.page-input-short {
	width: 4rem;
	padding: 0.25rem 0.5rem;
	border: none;
	border-bottom: 1px solid black;
	background: transparent;
	box-shadow: none;
}

.page-input-short:focus {
	outline: none;
}

/* ===========================
   FILTER BUBBLE
   =========================== */
.filter-bubble {
	padding: 0.4rem 0.75rem;
	border-radius: 2rem;
	background-color: var(--primary-extralight);
	color: var(--primary);
	font-size: 0.875rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.filter-bubble .close {
	cursor: pointer;
	font-weight: bold;
}

/* ===========================
   PRESEARCH RESULTS
   =========================== */
/* ===========================
   PRESEARCH RESULTS
   =========================== */
#preSearchResults {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background-color: transparent;
	z-index: 20;
	overflow: visible;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	border-bottom-left-radius: 0.375rem;
	border-bottom-right-radius: 0.375rem;
}

#preSearchResults .list-group-item {
	padding: 0.75rem 1rem;
}

#preSearchResults .list-group-item:first-child {
	border-top-left-radius: 0rem;
	border-top-right-radius: 0rem;
}

#preSearchResults .list-group-item:last-child {
	border-bottom-left-radius: 0.375rem;
	border-bottom-right-radius: 0.375rem;
}

#searchButton {
	border: 1px solid #ced4da;
	border-top-right-radius: 0.375rem !important;
	border-bottom-right-radius: 0.375rem !important;
	min-width: 3.8rem;
}

.input-group:focus-within {
	box-shadow: 0 0 0 0.25rem rgba(0, 128, 0, 0.25);
	border-radius: 0.375rem;
}

/* ===========================
   SEARCH BAR
   =========================== */
.search-bar-wrapper {
	width: 100%;
	position: relative;
}

#searchQuery:focus {
	box-shadow: none;
	outline: none;
}

#searchQuery {
	padding-top: 1rem;
	padding-bottom: 1rem;
}

/* When input is focused or has text */
input:focus + .floating-label,
input:not(:placeholder-shown) + .floating-label {
	top: 0.25rem;
	font-size: 0.75rem;
	color: #888;
	transform: none;
}

.ps-icon {
	padding-left: 2.2rem;
}

.custom-map-icon {
	font-size: 24px;
	color: var(--primary);
}

.organization-list-wrapper {
	min-height: 60vh;
}

#organization-container {
	min-height: 0;
}

/* ==========================================
   Close button should be hidden on desktop
   ==========================================*/
@media (min-width: 1025px) {
	.mobile-only {
		display: none !important;
	}

	/* Organization card container height */
	.org-container {
		height: 80vh;
	}

	#organization-container {
		overflow: auto;
	}
}

/* ===========================
   Mobile Responsive Styles
   =========================== */
@media (max-width: 1024px) {
	/* 
    .org-logo-container:
      - Ensures consistent and proportional logo display on tablets and smaller screens.
	*/
	.org-logo-container {
		width: 5rem !important;
		height: 5rem !important;
	}

	.main-layout {
		display: block !important;
		position: relative;
	}

	#mapPanel {
		left: 0 !important;
		width: 100vw !important;
	}

	.search-panel,
	.filter-panel,
	#mapPanel {
		width: 100vw;
		height: 100vh;
		position: absolute;
		top: 0;
		left: 0;
		transition: transform 0.3s ease;
		z-index: 1;
		overflow-y: auto;
		background-color: white;
	}

	.filter-panel,
	#mapPanel {
		transform: translateX(100%);
		pointer-events: none;
	}

	.filter-panel.active,
	#mapPanel.active {
		transform: translateX(0);
		z-index: 10;
		pointer-events: auto;
	}

	.search-panel {
		z-index: 0;
	}

	body.overlay-open {
		overflow: hidden;
	}

	.mobile-only {
		display: inline-block;
	}

	.close-overlay-btn {
		position: absolute;
		top: 1rem;
		right: 1rem;
		background-color: #333;
		color: #fff;
		border: none;
		padding: 0.5rem 1rem;
		font-size: 1rem;
		border-radius: 4px;
		z-index: 999;
	}

	.btn-show-map,
	.btn-refine-search {
		display: none !important;
	}

	.close-overlay-btn {
		position: absolute;
		top: 1rem;
		right: 2rem;
		z-index: 1000;
		background-color: rgba(0, 0, 0, 0.65);
		color: #fff;
		border: none;
		padding: 0.6rem;
		border-radius: 50%;
		font-size: 1.2rem;
		line-height: 1;
		width: 2.5rem;
		height: 2.5rem;
		display: flex;
		align-items: center;
		justify-content: center;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
		backdrop-filter: blur(4px);
		transition: background-color 0.2s ease;
	}

	.close-overlay-btn:hover {
		background-color: rgba(0, 0, 0, 0.85);
	}
}

.map-tooltip {
	position: absolute;
	padding: 0.375rem 0.625rem;
	/* approx 6px 10px */
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	border-radius: 0.375rem;
	/* ~6px */
	pointer-events: none;
	transition: opacity 0.3s;
	opacity: 0;
	z-index: 1000;
	font-size: 0.875rem;
	/* ~14px */
	box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.4);
	/* ~2px 6px */
	white-space: nowrap;
}

#rangeLabelText {
	margin-left: -0.3rem;
}

#emptySearchContainer {
	z-index: 10000 !important;
}

#emptySearch {
	position: absolute;
	/* This is the width of the search button on my computer (rounded up to the next number divisible by 5), don't ask any questions */
	right: 65px;
	border: none !important;
}
