/* ============================================================
   ACE Schools Map — ace-map.css
   ============================================================ */

/* Map container */
#ace-schools-map {
	width: 100%;
	border-radius: 8px;
	box-shadow: 0 2px 16px rgba( 0, 0, 0, 0.14 );
	overflow: hidden;
	min-height: 560px;
}

.ace-map-layout {
	--ace-panel-width: 360px;
	display: flex;
	flex-direction: column;
	gap: 16px;
	align-items: stretch;
}

.ace-map-layout--no-panel {
	display: block;
}

.ace-map-panel {
	width: 100%;
	border: 1px solid #d0d5dd;
	border-radius: 8px;
	background: #ffffff;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 0;
	box-shadow: 0 1px 8px rgba( 16, 24, 40, 0.08 );
}

.ace-panel__header {
	padding: 12px 14px;
	background: #f9fafb;
	border-bottom: 1px solid #eaecf0;
}

.ace-panel__header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.ace-panel__header h3 {
	margin: 0 0 4px;
	font-size: 16px;
	line-height: 1.3;
	color: #101828;
}

.ace-panel__toggle {
	border: 1px solid #d0d5dd;
	background: #ffffff;
	border-radius: 999px;
	padding: 5px 10px;
	font-size: 11px;
	font-weight: 600;
	color: #344054;
	cursor: pointer;
	white-space: nowrap;
}

.ace-panel__toggle:hover {
	background: #f2f4f7;
}

.ace-panel__header p {
	margin: 0;
	font-size: 12px;
	color: #667085;
}

.ace-panel__toolbar {
	margin-top: 10px;
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
}

.ace-panel__search {
	width: 100%;
	border: 1px solid #d0d5dd;
	border-radius: 6px;
	padding: 7px 9px;
	font-size: 13px;
	color: #101828;
	background: #fff;
}

.ace-panel__search:focus {
	outline: 2px solid #b2ddff;
	outline-offset: 1px;
	border-color: #84caff;
}

.ace-panel__reset {
	border: 1px solid #d0d5dd;
	background: #fff;
	border-radius: 6px;
	padding: 7px 10px;
	font-size: 12px;
	font-weight: 600;
	color: #344054;
	cursor: pointer;
}

.ace-panel__reset:hover {
	background: #f9fafb;
	border-color: #98a2b3;
}

.ace-panel__country-list {
	padding: 8px 10px;
	border-bottom: 1px solid #eaecf0;
	display: flex;
	align-items: center;
	gap: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	background: #fcfcfd;
}

.ace-panel__country {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	width: auto;
	flex: 0 0 auto;
	border: 1px solid #e4e7ec;
	background: transparent;
	padding: 6px 10px;
	border-radius: 999px;
	cursor: pointer;
	font-size: 12px;
	color: #344054;
	text-align: left;
}

.ace-panel__country:hover {
	background: #f2f4f7;
	border-color: #d0d5dd;
}

.ace-panel__country.is-active {
	background: #ecfdf3;
	border-color: #6ce9a6;
	color: #027a48;
}

.ace-panel__country strong {
	font-size: 11px;
	background: #ffffff;
	border: 1px solid #d0d5dd;
	border-radius: 999px;
	padding: 1px 8px;
	min-width: 28px;
	text-align: center;
	color: #475467;
}

.ace-panel__schools {
	padding: 14px 16px;
	flex: 0 1 auto;
	max-height: 230px;
	overflow-y: auto;
	font-size: 13px;
	color: #475467;
}

.ace-map-panel.is-collapsed .ace-panel__schools {
	display: none;
}

.ace-panel__schools h4 {
	margin: 0 0 10px;
	font-size: 15px;
	color: #101828;
}

.ace-panel__school-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 10px;
}

.ace-panel__school-item {
	padding: 8px 10px;
	border: 1px solid #eaecf0;
	border-radius: 6px;
	background: #fcfcfd;
	display: flex;
	flex-direction: column;
	gap: 3px;
	cursor: pointer;
}

.ace-panel__school-item:hover {
	background: #f9fafb;
	border-color: #d0d5dd;
}

.ace-panel__school-item a,
.ace-panel__school-item span {
	font-weight: 600;
	font-size: 13px;
	color: #175cd3;
	text-decoration: none;
}

.ace-panel__school-item a:hover {
	text-decoration: underline;
}

.ace-panel__school-item small {
	color: #667085;
	font-size: 12px;
}

/* ── Legend ─────────────────────────────────────────────── */
.ace-legend {
	background: rgba( 255, 255, 255, 0.92 );
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 13px;
	color: #2c3e50;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.18 );
	line-height: 1.6;
}

.ace-legend__dot {
	display: inline-block;
	width: 14px;
	height: 14px;
	border-radius: 3px;
	vertical-align: middle;
	margin-right: 5px;
}

/* ── Map Information control ────────────────────────────── */
.ace-map-info {
	background: rgba( 255, 255, 255, 0.92 );
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 12px;
	color: #344054;
	line-height: 1.7;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.18 );
	pointer-events: none;
}

.ace-map-info strong {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: #101828;
	margin-bottom: 2px;
}

/* ── School marker tooltips ─────────────────────────────── */
.leaflet-tooltip {
	border-radius: 6px !important;
	padding: 6px 10px !important;
	font-size: 12px !important;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.18 ) !important;
}

/* ── Popup wrapper ──────────────────────────────────────── */
.ace-leaflet-popup .leaflet-popup-content-wrapper {
	border-radius: 8px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba( 0, 0, 0, 0.2 );
}

.ace-leaflet-popup .leaflet-popup-content {
	margin: 0;
	min-width: 240px;
	max-width: 320px;
}

/* ── Popup inner ────────────────────────────────────────── */
.ace-popup {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ace-popup__title {
	margin: 0;
	padding: 14px 16px 10px;
	font-size: 16px;
	font-weight: 700;
	color: #1a252f;
	border-bottom: 2px solid #ecf0f1;
}

.ace-popup__count {
	margin: 0;
	padding: 6px 16px;
	font-size: 12px;
	color: #7f8c8d;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: #f8f9fa;
}

/* ── School list ────────────────────────────────────────── */
.ace-popup__list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 260px;
	overflow-y: auto;
}

.ace-popup__item {
	padding: 10px 16px;
	border-bottom: 1px solid #ecf0f1;
	line-height: 1.45;
}

.ace-popup__item:last-child {
	border-bottom: none;
}

.ace-popup__name {
	display: block;
	font-weight: 600;
	font-size: 14px;
	color: #2c3e50;
	text-decoration: none;
}

a.ace-popup__name {
	color: #2980b9;
}

a.ace-popup__name:hover {
	text-decoration: underline;
	color: #1a6393;
}

.ace-popup__city {
	font-size: 12px;
	color: #7f8c8d;
}

.ace-popup__desc {
	margin: 4px 0 0;
	font-size: 12px;
	color: #555;
	line-height: 1.4;
}

/* ── Scrollbar (Webkit) ─────────────────────────────────── */
.ace-popup__list::-webkit-scrollbar {
	width: 5px;
}

.ace-popup__list::-webkit-scrollbar-track {
	background: #f1f1f1;
}

.ace-popup__list::-webkit-scrollbar-thumb {
	background: #ccc;
	border-radius: 3px;
}

@media ( max-width: 980px ) {
	.ace-map-layout {
		flex-direction: column;
	}

	.ace-map-panel {
		min-height: 0;
	}

	#ace-schools-map {
		min-height: 420px;
	}
}
