/* AWO Kartenprojekt - Stylesheet */

:root {
	--bg: #ffffff;
	--text: #111827;
	--accent: #E30613;
	--awo-rot: #E30613;
	--awo-gelb: #FFC107;
	--awo-gruen: #4CAF50;
	--awo-blau: #2196F3;
}

html, body {
	height: 100%;
	margin: 0;
	padding: 0;
}

body {
	font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	-webkit-font-smoothing: antialiased;
}

.container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 1rem;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Karten-Container */
#map-container {
	width: 100%;
	height: 100vh;
	position: relative;
}

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

/* Header über der Karte */
.map-header {
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.98);
	padding: 18px 35px;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 1000;
	text-align: center;
	border: 2px solid rgba(227, 6, 19, 0.1);
	backdrop-filter: blur(10px);
}

.map-header h1, .map-header h1 a {
	margin: 0;
	font-size: 1.6rem;
	color: #E30613;
	font-weight: 700;
	letter-spacing: -0.5px;
}

.map-header p {
	margin: 6px 0 0 0;
	font-size: 0.95rem;
	color: #555;
	font-weight: 400;
}

/* Loading-Spinner */
.loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2000;
	background: rgba(255, 255, 255, 0.95);
	padding: 20px 40px;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* AWO Marker Styling */
.awo-marker-icon {
	filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
	transition: transform 0.2s ease;
	z-index: 600 !important; /* Höher als Cluster-Kreise */
}

.awo-marker-icon:hover {
	transform: scale(1.1);
}

/* Popup Styling */
.awo-popup .leaflet-popup-content-wrapper {
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.awo-popup .leaflet-popup-content {
	margin: 15px;
	font-family: Inter, system-ui, -apple-system, sans-serif;
}

.awo-popup .leaflet-popup-tip {
	background: white;
}

/* Legende */
.map-legend {
	position: absolute;
	bottom: 20px;
	right: 20px;
	background: rgba(255, 255, 255, 0.98);
	padding: 18px 22px;
	border-radius: 12px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.15);
	z-index: 1000;
	font-size: 0.85rem;
	max-width: 280px;
	max-height: 70vh;
	overflow-y: auto;
	border: 2px solid rgba(227, 6, 19, 0.1);
	backdrop-filter: blur(10px);
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.map-legend.hidden {
	opacity: 0;
	pointer-events: none;
	transform: translateX(calc(100% + 20px));
}

.map-legend h4 {
	margin: 0 0 15px 0;
	color: #E30613;
	font-size: 1.1rem;
	font-weight: 700;
}

.legend-toggle-all {
	margin-bottom: 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid rgba(0,0,0,0.1);
}

.legend-toggle-btn {
	width: 100%;
	padding: 8px 12px;
	background: #E30613;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.legend-toggle-btn:hover {
	background: #C1050F;
}

.map-legend-item {
	display: flex;
	align-items: center;
	margin: 10px 0;
	gap: 10px;
}

.legend-checkbox {
	margin: 0;
	cursor: pointer;
	width: 18px;
	height: 18px;
	accent-color: #E30613;
}

.legend-label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	flex: 1;
	user-select: none;
}

.map-legend-color {
	width: 28px;
	height: 28px;
	border-radius: 6px;
	border: 2px solid #fff;
	box-shadow: 0 2px 4px rgba(0,0,0,0.2);
	flex-shrink: 0;
}

.map-legend-text {
	color: #333;
	font-size: 0.9rem;
	flex: 1;
}

.map-legend-item.disabled .map-legend-text {
	opacity: 0.5;
}

.map-legend-item.disabled .map-legend-color {
	opacity: 0.4;
}

/* Toggle-Button für Legende */
.legend-toggle-btn {
	position: fixed;
	top: 15px;
	right: 15px;
	z-index: 1001;
	padding: 10px 16px;
	background: #E30613;
	color: white;
	border: none;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.3);
	transition: all 0.3s ease;
	font-family: Inter, system-ui, -apple-system, sans-serif;
	display: flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
    max-width: 9rem
}

.legend-toggle-btn:hover {
	background: #C1050F;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}

.legend-toggle-btn .hamburger {
	font-size: 1.2rem;
	line-height: 1;
}

.legend-toggle-btn .btn-text {
	font-size: 0.9rem;
}

/* Mobile Styles */
@media (max-width: 768px) {
	.map-header {
		top: 10px;
		padding: 12px 20px;
		width: calc(100% - 40px);
		max-width: 90%;
	}
	
	.map-header h1 {
		font-size: 1.2rem;
	}
	
	.map-header p {
		font-size: 0.85rem;
	}
	
	.map-legend {
		position: fixed;
		bottom: 0;
		right: 0;
		left: 0;
		max-width: 100%;
		max-height: 70vh;
		border-radius: 20px 20px 0 0;
		transform: translateY(100%);
		transition: transform 0.3s ease;
	}
	
	.map-legend:not(.hidden) {
		transform: translateY(0);
	}
	
	.legend-toggle-btn {
		top: 10px;
		right: 10px;
		padding: 8px 12px;
		font-size: 0.85rem;
	}
	
	.legend-toggle-btn .hamburger {
		font-size: 1.1rem;
	}
	
	.legend-toggle-btn .btn-text {
		font-size: 0.85rem;
	}
}

/* Tablet Styles */
@media (min-width: 769px) and (max-width: 1024px) {
	.map-legend {
		max-width: 240px;
		font-size: 0.8rem;
	}
	
	.map-header {
		padding: 15px 25px;
	}
}

/* Cluster-Kreise z-index anpassen */
.marker-cluster {
	z-index: 500 !important;
}

/* Scrollbar für Legende */
.map-legend::-webkit-scrollbar {
	width: 6px;
}

.map-legend::-webkit-scrollbar-track {
	background: rgba(0,0,0,0.05);
	border-radius: 3px;
}

.map-legend::-webkit-scrollbar-thumb {
	background: rgba(227, 6, 19, 0.3);
	border-radius: 3px;
}

.map-legend::-webkit-scrollbar-thumb:hover {
	background: rgba(227, 6, 19, 0.5);
}

