/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; border: none; }
html, body { height: 100%; font-family: 'Roboto', sans-serif; color: #3c4043; }
li { list-style: none; }
a { text-decoration: none; }
button { cursor: pointer; background: none; border: none; font-family: inherit; }

/* ── Map ── */
#map {
	position: absolute;
	inset: 0;
	height: 100%;
	background: rgb(43, 164, 210);
}

/* ── Top Bar (Google Maps style floating search) ── */
#topbar {
	position: absolute;
	top: 10px;
	left: 10px;
	right: 10px;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 0;
	pointer-events: none;
}

#menu-btn {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #5f6368;
	pointer-events: all;
	flex-shrink: 0;
	transition: background 0.15s;
}
#menu-btn:hover { background: #f1f3f4; }

#search-box {
	flex: 1;
	max-width: 480px;
	margin-left: 8px;
	height: 40px;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	display: flex;
	align-items: center;
	padding: 0 14px;
	gap: 8px;
	pointer-events: all;
}

#search-icon { flex-shrink: 0; }

#search-input {
	flex: 1;
	font-size: 15px;
	color: #3c4043;
	background: transparent;
	outline: none;
}
#search-input::placeholder { color: #9aa0a6; }

#search-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	padding: 0;
	flex-shrink: 0;
}
#search-clear:hover svg { stroke: #3c4043; }

/* Search results dropdown */
#search-results {
	position: absolute;
	top: 48px;
	left: 48px;
	right: 0;
	max-width: 480px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.25);
	overflow: hidden;
	pointer-events: all;
	display: none;
}
#search-results.active { display: block; }
#search-results .sr-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	cursor: pointer;
	font-size: 14px;
	color: #3c4043;
}
#search-results .sr-item:hover { background: #f1f3f4; }
#search-results .sr-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	flex-shrink: 0;
}

/* ── Sidebar ── */
#sidebar {
	position: absolute;
	top: 0;
	left: 0;
	bottom: 0;
	width: 300px;
	background: #fff;
	z-index: 20;
	display: flex;
	flex-direction: column;
	box-shadow: 2px 0 8px rgba(0,0,0,0.2);
	transform: translateX(-100%);
	transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
#sidebar.open { transform: translateX(0); }

#sidebar-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.35);
	z-index: 19;
	display: none;
}
#sidebar-overlay.active { display: block; }

#sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 16px 12px;
	border-bottom: 1px solid #e8eaed;
}
#sidebar-title {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 16px;
	font-weight: 500;
	color: #3c4043;
}
#close-sidebar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #5f6368;
	transition: background 0.15s;
}
#close-sidebar:hover { background: #f1f3f4; }

#admin-link {
	font-size: 12px;
	font-weight: 500;
	color: #1a73e8;
	background: #e8f0fe;
	padding: 4px 10px;
	border-radius: 12px;
	margin-right: 8px;
}
#admin-link:hover { background: #d2e3fc; }

#sidebar-content {
	flex: 1;
	overflow-y: auto;
	padding: 8px 0;
	scrollbar-width: thin;
	scrollbar-color: #dadce0 transparent;
}
#sidebar-content::-webkit-scrollbar { width: 6px; }
#sidebar-content::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 3px; }

/* ── Layer sections inside sidebar ── */
.types { width: 100%; }

.types .type { border-bottom: 1px solid #f1f3f4; }
.types .type:last-child { border-bottom: none; }

.types .type h3 {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	color: #80868b;
	padding: 14px 16px 6px;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 6px;
	user-select: none;
}
.types .type h3:hover { color: #3c4043; }

.types .type ul { padding: 4px 0 10px; }
.types .type.collapsed ul { display: none; }

.types .type li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 6px 16px;
	min-height: 36px;
}
.types .type li:hover { background: #f8f9fa; }

.types .type label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	flex: 1;
}

/* Hide native checkbox */
.types .type input[type="checkbox"] { display: none; }

/* Toggle switch */
.toggle-track {
	position: relative;
	width: 36px;
	height: 20px;
	background: #dadce0;
	border-radius: 10px;
	flex-shrink: 0;
	transition: background 0.2s;
}
.toggle-thumb {
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	background: #fff;
	border-radius: 50%;
	box-shadow: 0 1px 3px rgba(0,0,0,0.3);
	transition: left 0.2s;
}
input[type="checkbox"]:checked ~ .toggle-track { background: #1a73e8; }
input[type="checkbox"]:checked ~ .toggle-track .toggle-thumb { left: 18px; }
/* Also handle sibling selector for label > input > track */
.types .type label input[type="checkbox"]:checked + .toggle-track { background: #1a73e8; }
.types .type label input[type="checkbox"]:checked + .toggle-track .toggle-thumb { left: 18px; }

.layer-name {
	font-size: 14px;
	color: #3c4043;
	font-weight: 400;
}

.types .details {
	color: #9aa0a6;
	display: flex;
	align-items: center;
	padding: 4px;
	border-radius: 50%;
	transition: background 0.15s, color 0.15s;
}
.types .details:hover { background: #f1f3f4; color: #3c4043; }
.types .back { margin-right: 4px; }

/* Category detail list */
.listview {
	overflow-y: auto;
	max-height: 400px;
}
.listview li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 16px;
	cursor: pointer;
	transition: background 0.15s;
}
.listview li:hover { background: #f1f3f4; }

.location-color {
	width: 14px;
	height: 14px;
	border-radius: 3px;
	border: 2px solid;
	flex-shrink: 0;
}
.location-label {
	font-size: 13px;
	color: #3c4043;
}

/* ── Map Type Selector (bottom-right card) ── */
#map-type-selector {
	position: absolute;
	bottom: 24px;
	right: 10px;
	z-index: 10;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
	display: flex;
	overflow: hidden;
}
.map-type-btn {
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 500;
	color: #5f6368;
	background: #fff;
	transition: background 0.15s, color 0.15s;
	border-right: 1px solid #e8eaed;
}
.map-type-btn:last-child { border-right: none; }
.map-type-btn:hover { background: #f1f3f4; color: #3c4043; }
.map-type-btn.active { color: #1a73e8; background: #e8f0fe; }

/* ── InfoWindow Popup ── */
.gm-info-card {
	font-family: 'Roboto', sans-serif;
	min-width: 220px;
	max-width: 320px;
	padding: 0;
}
.gm-info-title {
	font-size: 16px;
	font-weight: 500;
	color: #3c4043;
	padding: 12px 16px 6px;
	border-bottom: 1px solid #e8eaed;
}
.gm-info-notes {
	font-size: 13px;
	color: #5f6368;
	line-height: 1.5;
	padding: 8px 16px;
}
.gm-info-section {
	padding: 8px 16px;
}
.gm-info-caption {
	display: block;
	font-size: 11px;
	color: #9aa0a6;
	margin-top: 4px;
}
.gm-info-footer {
	padding: 8px 16px 12px;
	border-top: 1px solid #e8eaed;
	margin-top: 4px;
}
.gm-info-footer a {
	font-size: 13px;
	font-weight: 500;
	color: #1a73e8;
}
.gm-info-footer a:hover { text-decoration: underline; }

/* Override Google Maps info window chrome */
.gm-style .gm-style-iw-c {
	border-radius: 8px !important;
	box-shadow: 0 2px 12px rgba(0,0,0,0.2) !important;
	padding: 0 !important;
}
.gm-style .gm-style-iw-d {
	overflow: auto !important;
	padding: 0 !important;
}
.gm-style .gm-style-iw-t::after { display: none; }

/* ── YouTube embed ── */
.youtubewrapper {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
}
.youtubewrapper iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border-radius: 4px;
}

/* ── Google Maps control positioning ── */
.gm-style-mtc { margin-top: 10px !important; }

/* ── Mobile ── */
@media (max-width: 600px) {
	#topbar { top: 8px; left: 8px; right: 8px; }
	#search-box { max-width: none; }
	#sidebar { width: 280px; }
	#map-type-selector { bottom: 16px; right: 8px; }
	.map-type-btn { padding: 7px 10px; font-size: 12px; }
}
