/* ================================================================
   MarktPlaner – Frontend-Karte
   ================================================================ */

.mp-frontend-wrap {
	width: 100%;
	margin: 1em 0;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0,0,0,.12);
}

.mp-frontend-map {
	width: 100%;
	min-height: 320px;
	background: #e8e4d9;
}

/* Stand-Status-Farben */
.mp-stall-free     { fill: #22c55e; fill-opacity: .35; stroke: #16a34a; stroke-width: 2; }
.mp-stall-reserved { fill: #f59e0b; fill-opacity: .40; stroke: #d97706; stroke-width: 2; }
.mp-stall-booked   { fill: #6b7280; fill-opacity: .30; stroke: #4b5563; stroke-width: 2; stroke-dasharray: 6 3; }
.mp-stall-ph       { fill: #3b82f6; fill-opacity: .20; stroke: #2563eb; stroke-width: 1.5; stroke-dasharray: 5 4; }

/* ── Popup ─────────────────────────────────────────────────── */
.mp-fe-popup .leaflet-popup-content-wrapper {
	border-radius: 10px;
	padding: 0;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0,0,0,.18);
	min-width: 220px;
}
.mp-fe-popup .leaflet-popup-content {
	margin: 0;
}
.mp-fe-popup .leaflet-popup-tip-container {
	margin-top: -1px;
}

.mp-popup-inner {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 14px;
}

/* Header */
.mp-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px 8px;
	border-bottom: 1px solid #f0f0f0;
}
.mp-popup-label {
	font-weight: 700;
	font-size: 16px;
	color: #111;
}
.mp-popup-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 20px;
	letter-spacing: .03em;
}
.mp-badge-free     { background: #dcfce7; color: #16a34a; }
.mp-badge-reserved { background: #fef3c7; color: #d97706; }
.mp-badge-booked   { background: #f3f4f6; color: #6b7280; }
.mp-badge-ph       { background: #dbeafe; color: #2563eb; }

/* Body */
.mp-popup-body {
	padding: 10px 14px;
}
.mp-popup-meta {
	display: flex;
	gap: 12px;
	font-size: 13px;
	color: #374151;
	margin-bottom: 8px;
}
.mp-popup-meta .mp-size { color: #6b7280; }
.mp-popup-meta .mp-price {
	font-weight: 700;
	color: #111;
}
.mp-popup-features {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	margin-top: 4px;
}
.mp-feat-tag {
	font-size: 12px;
	color: #374151;
	background: #f3f4f6;
	padding: 2px 7px;
	border-radius: 4px;
}

/* Footer */
.mp-popup-footer {
	padding: 8px 14px 12px;
}
.mp-book-btn {
	display: block;
	text-align: center;
	background: #16a34a;
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 14px;
	padding: 9px 16px;
	border-radius: 7px;
	transition: background .15s;
}
.mp-book-btn:hover { background: #15803d; color: #fff !important; }
.mp-booked-note {
	text-align: center;
	font-size: 12px;
	color: #9ca3af;
	padding: 4px 0;
}

/* Infra-Layer */
.mp-fe-infra-line { stroke-opacity: .7; fill: none; stroke-width: 2; }

/* Legende */
.mp-fe-legend {
	background: rgba(255,255,255,.92);
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 12px;
	line-height: 1.8;
	box-shadow: 0 1px 5px rgba(0,0,0,.15);
}
.mp-fe-legend-item { display: flex; align-items: center; gap: 6px; }
.mp-fe-legend-dot {
	width: 12px; height: 12px;
	border-radius: 3px;
	flex-shrink: 0;
}

.mp-error {
	color: #dc2626;
	padding: 8px;
	border: 1px solid #fca5a5;
	background: #fef2f2;
	border-radius: 4px;
}

/* Marktbeschreibung oberhalb der Karte */
.mp-market-description {
	padding: 14px 18px 10px;
	font-size: 15px;
	line-height: 1.65;
	color: #374151;
	border-bottom: 1px solid #e5e7eb;
	background: #fafafa;
}
.mp-market-description p:last-child { margin-bottom: 0; }

/* Marktdatum unter dem Titel */
.mp-market-date {
	padding: 8px 18px 6px;
	font-size: 13px;
	color: #6b7280;
	font-weight: 500;
	background: #fafafa;
	border-bottom: 1px solid #f3f4f6;
}

/* ════════════════════════════════════════════════════════════
   Planungsansicht (read-only Vollbild-Viewer)
   ════════════════════════════════════════════════════════════ */

/* Toggle-Button auf der Buchungskarte */
.mp-planner-toggle {
	background: #1d2327;
	color: #fff;
	border: none;
	padding: 7px 13px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 1px 5px rgba(0,0,0,.3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.mp-planner-toggle:hover { background: #2c3338; }

/* Vollbild-Overlay */
.mp-planner-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: #fff;
	display: flex;
	flex-direction: column;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mp-planner-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #1d2327;
	color: #fff;
	padding: 0 16px;
	height: 50px;
	flex-shrink: 0;
}
.mp-planner-title { font-weight: 600; font-size: 15px; }
.mp-planner-close {
	background: rgba(255,255,255,.12);
	color: #fff;
	border: none;
	padding: 7px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
}
.mp-planner-close:hover { background: rgba(255,255,255,.22); }

.mp-planner-body {
	flex: 1;
	display: flex;
	min-height: 0;
}

.mp-planner-sidebar {
	width: 240px;
	flex-shrink: 0;
	background: #f8f9fa;
	border-right: 1px solid #e5e7eb;
	overflow-y: auto;
	padding: 14px;
}
.mp-planner-map { flex: 1; min-width: 0; }

.mp-planner-groups h3 {
	margin: 0 0 10px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #6b7280;
}
.mp-grp-row {
	padding: 6px 0;
	font-size: 14px;
	border-bottom: 1px solid #f0f0f0;
}
.mp-grp-row label {
	display: flex;
	align-items: center;
	gap: 7px;
	cursor: pointer;
}
.mp-grp-all { margin-bottom: 6px; padding-bottom: 8px; border-bottom: 2px solid #e5e7eb; }
.mp-grp-dot {
	width: 13px; height: 13px;
	border-radius: 3px;
	flex-shrink: 0;
	display: inline-block;
}
.mp-grp-count { color: #9ca3af; font-size: 12px; margin-left: auto; }

/* Tooltips im Viewer */
.mp-infra-tip {
	background: rgba(255,255,255,.92);
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	color: #374151;
	padding: 2px 6px;
	box-shadow: none;
}
.mp-infra-tip::before { display: none; }

/* Mobile: Sidebar schmaler */
@media (max-width: 600px) {
	.mp-planner-sidebar { width: 160px; padding: 10px; }
}

/* Sidebar ein-/ausklappen */
.mp-planner-sidebar {
	transition: width .25s ease;
	overflow-y: auto;
	overflow-x: hidden;
}
.mp-planner-sidebar.mp-sidebar-collapsed {
	width: 0 !important;
	padding: 0 !important;
	min-width: 0 !important;
}
/* Toggle-Button: schmales Tab zwischen Sidebar und Karte, flex-shrink:0 */
.mp-sidebar-toggle {
	flex-shrink: 0;
	width: 16px;
	background: #e5e7eb;
	border: none;
	border-left: 1px solid #d1d5db;
	border-right: 1px solid #d1d5db;
	cursor: pointer;
	font-size: 10px;
	color: #374151;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
	z-index: 1;
}
.mp-sidebar-toggle:hover { background: #c8d0d8; }

.mp-fixture-tip {
	background: rgba(120,113,108,.92);
	color: #fff; border: none; border-radius: 4px;
	font-size: 11px; font-weight: 600; padding: 2px 7px; box-shadow: none;
}
.mp-fixture-tip::before { display: none; }

/* Planner Mess-Button */
.mp-planner-measure {
	background: rgba(255,255,255,.12);
	color: #fff;
	border: none;
	padding: 7px 14px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 13px;
	margin-right: 8px;
}
.mp-planner-measure:hover { background: rgba(255,255,255,.22); }
.mp-planner-measure.mp-active { background: #0ea5e9; }
/* Sammel-Toggle Feste Bauten */
.mp-grp-fixture-all {
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid #e5e7eb;
}
