/* Deployed copy of styles; synced from /css/indexStyles.css */
/* Grouped action buttons for Add Line and Add Polygon */
.action-btn-group {
	position: absolute;
	top: 16px;
	left: 75px;
	z-index: 1003;
	display: flex;
	gap: 8px;
}

.action-btn {
	padding: 8px 16px;
	background: #6a9e7a;
	border: none;
	border-radius: 8px;
	font-weight: bold;
	font-size: 14px;
	cursor: pointer;
	margin: 0;
	box-sizing: border-box;
}

@media screen and (max-width: 768px) {
	.action-btn-group {
		top: 12px;
		left: 12px;
		gap: 6px;
	}
	.action-btn {
		padding: 6px 12px;
		font-size: 12px;
	}
}

@media screen and (max-width: 480px) {
	.action-btn-group {
		top: 8px;
		left: 8px;
		gap: 4px;
	}
	.action-btn {
		padding: 4px 8px;
		font-size: 10px;
	}
}
/* ==================== GLOBAL STYLES ==================== */
html,
body {
	height: 100%;
	margin: 0;
	padding: 0;
	font-family: Verdana, sans-serif;
}

body {
	height: 100vh;
	width: 100vw;
	overflow: hidden;
	position: relative;
}

/* Unified map edit panel (pins / lines / polygons) */
.map-edit-panel {
	display: block;
	position: fixed;
	left: 0;
	right: 0;
	/* Placement: directly above the subbar + bottom bar stack */
	bottom: calc(var(--bottom-bar-height) * 2 + var(--separator-height));
	background: rgba(0,0,0,0.92);
	color: #fff;
	z-index: 5150; /* above subbar layer (5100) and bottom bar (5000) */
	padding: 10px 14px 14px 14px;
	border-top: 1px solid #111;
	max-height: 42vh;
	overflow-y: auto;
	box-sizing: border-box;
	font-family: Verdana, sans-serif;
	backdrop-filter: saturate(140%) blur(2px);
	box-shadow: 0 -2px 8px rgba(0,0,0,0.45);
}

/* ==================== AUTHENTICATION STYLES ==================== */
.message {
	color: red;
	margin-bottom: 10px;
	font-size: 16px;
	position: absolute;
	top: 10px;
	left: 50%;
	transform: translateX(-50%);
	background: white;
	padding: 10px;
	border-radius: 5px;
	z-index: 1003;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100vw;
	height: 100vh;
	background: rgba(0, 0, 0, 0.8);
	z-index: 2000;
	display: flex;
	justify-content: center;
	align-items: center;
}

.form-container {
	background: white;
	padding: 30px;
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	width: 400px;
	max-width: 90vw;
}

.form-section {
	display: none;
}

.form-section.active {
	display: block;
}
 .new-user-info {
	background-color: #f0f8ff;
	padding: 20px;
	border-radius: 10px;
	margin-bottom: 20px;
}

.understand-button {
	background-color: #4caf50;
	color: white;
	padding: 12px 25px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	margin-top: 15px;
}

.understand-button:hover {
	background-color: #45a049;
}

.error-message {
	background-color: #ffebee;
	padding: 20px;
	border-radius: 10px;
	margin-bottom: 20px;
}

/* ==================== FORM ELEMENTS ==================== */
input[type="email"],
input[type="password"],
input[type="text"] {
	width: 100%;
	padding: 12px;
	margin-bottom: 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-sizing: border-box;
}

.button-group {
	margin-top: 15px;
}

.button-group input[type="submit"] {
	padding: 12px 25px;
	margin-right: 10px;
	cursor: pointer;
	background: #4caf50;
	color: white;
	border: none;
	border-radius: 4px;
}
/* (Removed stray duplicated active selector group) */

.button-group input[type="submit"]:hover {
	background: #45a049;
}

/* ...existing code... */
.pinPanelGrid label,
#linePanelForm label,
#polygonPanelForm label {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.formField {
	font-size: 16px;
	height: 32px;
	padding: 4px 8px;
	border-radius: 6px;
	border: 1px solid #444;
	background: #222;
	color: #fff;
	box-sizing: border-box;
	flex: 1 1 auto;
	min-width: 0;
}

/* For latitude/longitude fields, keep max-width if needed */
.formField.latlng {
	max-width: 120px;
}

/* ==================== USER INFO PANEL ==================== */
.user-info {
	position: absolute;
	bottom: 16px;
	left: 16px;
	z-index: 1002;
	background: white;
	padding: 10px 15px;
	border-radius: 8px;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logout-btn {
	background: #dc3545;
	color: white;
	border: none;
	padding: 8px 16px;
	border-radius: 4px;
	cursor: pointer;
	margin-top: 5px;
}

.logout-btn:hover {
	background: #c82333;
}

/* ==================== CUSTOM MARKERS ==================== */
.line-point-marker {
	background: #fff;
	border: 2px solid #333;
	border-radius: 50%;
	width: 8px;
	height: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.custom-x-marker {
	z-index: 9999 !important;
	position: relative;
}

.inverted {
	filter: invert(1) brightness(0.9);
	box-shadow: 0 0 0 2px #333 inset;
}

/* ==================== BOTTOM BAR STYLES ==================== */
:root {
	--bottom-bar-height: 60px;
	--separator-height: 3px;
}
:root {
	--map-sidebar-width: 320px;
}

/* Bottom gray bar */
#bottomBar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	height: var(--bottom-bar-height);
	background: #888;
	border: 1.5px solid #111;
	display: flex;
	align-items: stretch; /* make children fill full height */
	justify-content: flex-start; /* children will expand to fill */
	z-index: 5000;
	border-bottom: 2px solid #111;
}
/* 10px separator line between subbar row and bottom bar */
#barSeparator {
	position: fixed;
	left: 0;
	right: 0;
	bottom: var(--bottom-bar-height);
	height: var(--separator-height);
	background: #111;
	z-index: 5050;
}
.mainBarBtn {
	flex: 1 1 20%; /* 5 equal segments */
	height: 100%; /* fill bar height */
	display: flex; /* center label */
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1.5px solid #111;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.mainBarBtn.active {
	background: #111;
	color: #fff;
}

/* ==================== SUBBAR STYLES ==================== */
/* Subbar container */
.subbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: calc(var(--bottom-bar-height) + var(--separator-height));
	height: var(--bottom-bar-height);
	background: #888;
	color: #fff;
	display: none;
	z-index: 5100;
}
/* Rows inside subbars */
.subbar .subbarRow {
	display: flex;
	align-items: stretch;
	justify-content: flex-start;
	width: 100%;
	height: 100%;
}
/* Buttons inside subbars */
.subbar .subbarBtn {
	flex: 1 1 20%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1.5px solid #111;
	border-bottom: none;
	color: #fff;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

/* Active + pressed states */
.subbar .subbarBtn:active,
.subbar .subbarBtn.active {
	opacity: 0.8;
	background: #111;
}

/* Optional spacer elements */
.subbar .subbarSpacer {
	flex: 1 1 20%;
	height: 100%;
}

/* ==================== SIDE BAR STYLES ==================== */
#map {
	height: 100vh;
	width: 100vw;
	position: absolute;
	top: 0; 
	left: 0;
	z-index: 1;
}

/* Map sidebar (left), black with 50% opacity and resizable width */
#mapSidebar {
	position: fixed;
	top: 0;
	right: 0;
	bottom: calc(var(--bottom-bar-height) + var(--separator-height));
	width: var(--map-sidebar-width);
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: saturate(100%);
	display: none; /* hidden until Map clicked */
	z-index: 4000;
	color: #fff;
}
#mapSidebar.active {
	display: block;
}

#mapSidebarContent {
	font-family: Verdana, sans-serif;
	position: absolute;
	top: 0;
	left: 0;
	right: 8px;
	bottom: 0;
	overflow: auto;
	padding: 16px 14px 20px 14px;
	color: #fff;
}

/* Account sidebar (mirrors Map sidebar behavior) */
#accountSidebar {
	position: fixed;
	top: 0;
	right: 0;
	bottom: calc(var(--bottom-bar-height) + var(--separator-height));
	width: var(--map-sidebar-width);
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: saturate(100%);
	display: none; /* hidden until Map clicked */
	z-index: 4000;
	color: #fff;
}

#accountSidebar.active {
	display: block;
}

#accountSidebarContent {
	padding: 16px;
	font-family: Verdana, sans-serif;
}

/* Weather sidebar (same styling as map/account) */
#weatherSidebar {
	position: fixed;
	top: 0;
	right: 0;
	bottom: calc(var(--bottom-bar-height) + var(--separator-height));
	width: var(--map-sidebar-width);
	background: rgba(0, 0, 0, 0.8);
	backdrop-filter: saturate(100%);
	display: none;
	z-index: 4000;
	color: #fff;
}
#weatherSidebar.active { display: block; }
#weatherSidebarContent {
	font-family: Verdana, sans-serif;
	position: absolute;
	top: 0; left: 0; right: 8px; bottom: 0;
	overflow: auto;
	padding: 16px 14px 20px 14px;
	color: #fff;
}

.accountInfo {
	background: rgba(255,255,255,0.08);
	padding: 12px;
	border-radius: 8px;
	margin-top: 8px;
}

/* Vertical list of options */
.vlist {
	display: block;
}

.optionRow {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 0;
	background: transparent;
	border: none;
	color: #fff;
}
.sidebarMenuHeader {
	font-weight: bold;
	font-size: 1.4rem;
	margin: 12px 0 8px 0;
	cursor: pointer;
	user-select: none;
}
.sidebarMenuBold {
	font-weight: bold;
	font-size: 1.0rem;
	margin: 12px 0 8px 0;
	cursor: pointer;
	user-select: none;
}
.optionRow input {
	accent-color: #4aa3ff;
}



.leaflet-container {
	background: #000 !important;
}

/* Hide Leaflet’s default layers control (we use the sidebar) */
.leaflet-control-layers { display: none !important; }
#pinFormPanel #pinPanelForm {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 12px;
}


#pinFormPanel label {
	display: flex;
	align-items: center;
	font-size: 16px;
	gap: 8px;
	margin-bottom: 4px;
}

#pinFormPanel label > span,
#pinFormPanel label > br {
	display: none;
}

#pinFormPanel input,
#pinFormPanel select,
#pinFormPanel textarea {
	height: 32px;
	font-size: 16px;
	padding: 4px 8px;
}
#pinFormPanel textarea {
	resize: none;
}
.pinPanelGrid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 12px;
}
@media (max-width: 500px) {
	.pinPanelGrid,
	#pinFormPanel #pinPanelForm {
		grid-template-columns: 1fr;
	}
}

.active-adjust {
	background: #fff !important;
	color: #222 !important;
	border: 2px solid #222 !important;
}
