/*
 * Der Kartenstil-Umschalter.
 *
 * Wird im Frontend und im Backend geladen, deshalb bringt er sein eigenes
 * dunkles Glas mit, statt sich auf das Theme zu verlassen.
 */

.nb-basemap-ctrl {
	position: relative;
	background: rgba(10, 16, 26, 0.72) !important;
	border: 1px solid rgba(143, 163, 189, 0.16) !important;
	border-radius: 12px !important;
	backdrop-filter: blur(12px) saturate(140%);
	-webkit-backdrop-filter: blur(12px) saturate(140%);
	overflow: visible !important;
}

.nb-basemap-ctrl__toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 29px;
	height: 29px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #eef3fa;
	cursor: pointer;
}

.nb-basemap-ctrl__toggle svg {
	width: 17px;
	height: 17px;
}

.nb-basemap-ctrl.is-open .nb-basemap-ctrl__toggle,
.nb-basemap-ctrl__toggle:hover {
	color: #4fe0b0;
}

.nb-basemap-ctrl__panel {
	position: absolute;
	top: 0;
	right: calc(100% + 8px);
	min-width: 210px;
	padding: 8px;
	background: rgba(10, 16, 26, 0.92);
	border: 1px solid rgba(143, 163, 189, 0.22);
	border-radius: 12px;
	box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(14px) saturate(150%);
	-webkit-backdrop-filter: blur(14px) saturate(150%);
	z-index: 5;
}

.nb-basemap-ctrl__heading {
	margin: 2px 6px 8px;
	font-size: 10px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8698b3;
	font-family: inherit;
}

/*
 * !important here overrides maplibregl-gl.css's ".maplibregl-ctrl-group button"
 * rule (width/height: 29px, display: block, padding: 0), sized for the small
 * square zoom/compass buttons - it otherwise wins on specificity and squashes
 * every option into a 29x29 box, wrapping the label over itself.
 */
.nb-basemap-ctrl__option {
	display: flex !important;
	align-items: center;
	gap: 8px;
	width: 100% !important;
	height: auto !important;
	padding: 7px 8px !important;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #c3d0e2;
	font-size: 12.5px;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.nb-basemap-ctrl__option + .nb-basemap-ctrl__option {
	border-top: 0 !important;
}

.nb-basemap-ctrl__option:hover {
	background: rgba(143, 163, 189, 0.12);
	color: #eef3fa;
}

.nb-basemap-ctrl__option[aria-pressed="true"] {
	background: rgba(79, 224, 176, 0.14);
	color: #eef3fa;
}

.nb-basemap-ctrl__option[aria-pressed="true"] .nb-basemap-ctrl__swatch {
	border-color: #4fe0b0;
	box-shadow: 0 0 0 2px rgba(79, 224, 176, 0.28);
}

.nb-basemap-ctrl__swatch {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 5px;
	border: 1px solid rgba(143, 163, 189, 0.35);
}

.nb-basemap-ctrl__toggle:focus-visible,
.nb-basemap-ctrl__option:focus-visible {
	outline: 2px solid #4fe0b0;
	outline-offset: 1px;
}

/* Auf schmalen Schirmen klappt das Feld nach unten statt zur Seite. */
@media (max-width: 640px) {
	.nb-basemap-ctrl__panel {
		top: calc(100% + 8px);
		right: 0;
		min-width: 180px;
	}
}

/* Helle Karten: die dunkle Bedienleiste bleibt, bekommt aber mehr Kante. */
.nb-map-is-light .maplibregl-ctrl-group {
	border-color: rgba(20, 30, 46, 0.25) !important;
}
