/**
 * css/demo-fixes.css
 * Z-Index Korrekturen und Demo-Karten Verbesserungen
 */

/* Demo Section - Z-Index Korrekturen */
.demo-map-container {
	position: relative;
	background: var(--bg-light);
	border-radius: var(--border-radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-md);
	z-index: 1;
	/* Basis Z-Index für Container */
}

.demo-map {
	height: 400px;
	width: 100%;
	position: relative;
	z-index: 1;
	/* Karte im Hintergrund */
}

.demo-overlay {
	position: absolute;
	top: 1rem;
	left: 1rem;
	right: 1rem;
	background: rgba(255, 255, 255, 0.95);
	padding: 1rem;
	border-radius: var(--border-radius);
	backdrop-filter: blur(10px);
	z-index: 500;
	/* Zwischen Controls (400) und Popups (600) */
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.3);
	pointer-events: none;
	/* Wichtig: Overlay soll Klicks durchlassen */
}

.demo-overlay h3 {
	margin: 0 0 0.5rem 0;
	color: var(--text-primary);
	font-size: 1.1rem;
	font-weight: 600;
}

.demo-overlay p {
	margin: 0;
	color: var(--text-secondary);
	font-size: 0.9rem;
}

/* Hero Demo Karte - Verbesserungen */
.demo-map-mini {
	height: 250px;
	width: 100%;
	background: var(--bg-light);
	border-radius: var(--border-radius);
	position: relative;
	overflow: hidden;
	border: 1px solid var(--border-light);
}

/* Leaflet spezifische Anpassungen für Hero-Karte */
#hero-demo-map {
	height: 250px !important;
	width: 100% !important;
	border-radius: var(--border-radius);
	overflow: hidden;
}

#hero-demo-map .leaflet-control-container {
	display: none;
	/* Verstecke alle Leaflet Controls in der Hero-Karte */
}

#hero-demo-map .leaflet-popup-close-button {
	display: none;
	/* Verstecke Close-Button in Hero-Popups */
}

/* Demo-Map spezifische Anpassungen */
#demo-map {
	height: 400px !important;
	width: 100% !important;
	border-radius: var(--border-radius-lg);
	z-index: 1;
}

#demo-map .leaflet-control-zoom {
	z-index: 400;
	/* Leaflet Standard für Controls */
}

#demo-map .leaflet-popup {
	z-index: 600 !important;
	/* Leaflet Standard für Popups */
}

/* Leaflet Popup Styling */
.leaflet-popup-content-wrapper {
	border-radius: var(--border-radius) !important;
	box-shadow: var(--shadow-md) !important;
}

.leaflet-popup-tip {
	background: white !important;
}

/* Leaflet Popup Pane - Standard Z-Index verwenden */
.leaflet-popup-pane {
	z-index: 600 !important;
}

/* Demo Marker Hover-Effekte */
.demo-marker:hover,
.hero-demo-marker:hover {
	transform: scale(1.1);
	z-index: 999;
}

/* Responsive Anpassungen für Demo-Karten */
@media (max-width: 768px) {
	.demo-overlay {
		position: relative;
		top: auto;
		left: auto;
		right: auto;
		margin-top: 1rem;
		z-index: 500;
		pointer-events: auto;
		/* Mobil wieder aktivieren */
	}

	.demo-map {
		height: 300px;
	}

	#demo-map {
		height: 300px !important;
	}

	#demo-map .leaflet-popup {
		z-index: 600 !important;
	}

	.demo-map-mini,
	#hero-demo-map {
		height: 200px !important;
	}
}

@media (max-width: 480px) {
	.demo-overlay {
		padding: 0.75rem;
	}

	.demo-overlay h3 {
		font-size: 1rem;
	}

	.demo-overlay p {
		font-size: 0.8rem;
	}

	.demo-map {
		height: 250px;
	}

	#demo-map {
		height: 250px !important;
	}
}

/* Loading States für Karten */
.map-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: var(--bg-light);
	color: var(--text-secondary);
	font-size: 1rem;
}

.map-loading i {
	margin-right: 0.5rem;
	animation: spin 1s linear infinite;
}

/* Error States für Karten */
.map-error {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	background: linear-gradient(135deg, #e74c3c, #c0392b);
	color: white;
	text-align: center;
	font-size: 1.1rem;
	border-radius: var(--border-radius);
}

.map-error i {
	font-size: 2.5rem;
	margin-bottom: 0.5rem;
	opacity: 0.8;
}

/* Demo Features Styling Verbesserungen */
.demo-features {
	position: relative;
	z-index: 2;
	/* Über der Karte */
}

.demo-feature {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	padding: 1rem;
	background: var(--bg-light);
	border-radius: var(--border-radius);
	transition: var(--transition);
}

.demo-feature:hover {
	background: rgba(231, 76, 60, 0.05);
	transform: translateX(5px);
}

.demo-feature i {
	width: 40px;
	height: 40px;
	background: var(--primary-color);
	color: var(--text-white);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	font-size: 1rem;
}

.demo-feature h4 {
	margin: 0 0 0.25rem 0;
	color: var(--text-primary);
	font-size: 1rem;
	font-weight: 600;
}

.demo-feature p {
	margin: 0;
	color: var(--text-secondary);
	font-size: 0.9rem;
	line-height: 1.4;
}