/* =========================================================
   SITE MAPS PAGE
========================================================= */


/* =========================================================
   PAGE LAYOUT
========================================================= */

.siteMap {
	width: 100%;
	overflow: hidden;
	background-color: #eeeeee;
	border-radius: 8px;
}


/* =========================================================
   MAPLIBRE MAP
========================================================= */

.siteMap .maplibregl-map {
	width: 100%;
	height: 100%;
	border-radius: 8px;
}

.maplibregl-canvas {
	border-radius: 8px;
}

.maplibregl-popup-content {
	padding: 20px 40px;
	border-radius: 8px;
}

.maplibregl-popup-close-button {
	padding: 4px 8px;
	font-size: 20px;
}


/* =========================================================
   MAP POPUP CONTENT
========================================================= */

.mapMarker {
	color: #333333;
	font-size: 16px;
	line-height: 1.5;
}

.mapMarker h3 {
	margin-bottom: 10px;
	color: #2c4d34;
	font-size: 20px;
}

.mapMarker p {
	margin-bottom: 8px;
}

.mapMarker .btn {
	margin-top: 8px;
}


/* =========================================================
   MAP MARKER ICONS
========================================================= */

.grapeIcon {
	position: relative;
	top: -3px;
}


/* =========================================================
   SIDEBAR
========================================================= */

sidebarcomponent {
	display: block;
	min-height: 90vh;
	height: 100%;
	margin-right: 1rem !important;
	border-right: 1px solid #000000;
}


/* =========================================================
   MAP HEADER
========================================================= */

.siteMapHeader {
	margin-bottom: 1rem;
	text-align: center;
}

.siteMapHeader h2 {
	color: #2c4d34;
}

.siteMapHeader .btn {
	margin-top: 5px;
}


/* =========================================================
   MAP FILTER AREA
========================================================= */

.siteMapFilter {
	width: 100%;
}

.siteMapFilter .form-control,
.siteMapFilter .form-select {
	width: 100%;
}


/* =========================================================
   INLINE VINEYARD MAP
========================================================= */

.wineSiteInlineMap {
	width: 100%;
	height: 500px;
	min-height: 420px;
	margin-top: 18px;
	overflow: hidden;
	background-color: #e9ece8;
	border: 1px solid #d8d5ce;
	border-radius: 12px;
	box-shadow:
		inset 0 0 0 1px rgba(44, 77, 52, 0.04),
		0 5px 18px rgba(17, 17, 17, 0.07);
}

.wineSiteInlineMap > * {
	display: block;
	width: 100%;
	height: 100%;
}

.wineSiteInlineMap .maplibregl-map {
	width: 100%;
	height: 100%;
}


/* =========================================================
   VINEYARD MAP COMPONENT
========================================================= */

.vineyardMapEditor {
	width: 100%;
	overflow: hidden;
	background-color: #ffffff;
	border: 1px solid #d8d5ce;
	border-radius: 12px;
	box-shadow: 0 5px 18px rgba(17, 17, 17, 0.07);
}

.vineyardMapInstructions {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 18px;
	padding: 15px 18px;
	color: rgb(72, 83, 93);
	background-color: #f7f4eb;
	border-bottom: 1px solid #d8d5ce;
	font-family: G-Roboto-n4, Arial, sans-serif;
}

.vineyardMapInstructions strong {
	display: block;
	margin-bottom: 4px;
	color: #2c4d34;
	font-size: 14px;
	font-weight: 700;
}

.vineyardMapInstructions p {
	max-width: 760px;
	margin: 0;
	color: #6f7f8f;
	font-size: 12px;
	line-height: 1.5;
}

.vineyardMapCanvas {
	position: relative;
	width: 100%;
	height: 500px;
	min-height: 420px;
	overflow: hidden;
	border-radius: 12px;
	background-color: #d8ddd8;
}

.vineyardMap {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.vineyardMap .maplibregl-map,
.vineyardMap .maplibregl-canvas-container,
.vineyardMap .maplibregl-canvas {
	width: 100%;
	height: 100%;
}

.vineyardMap .maplibregl-canvas {
	outline: none;
}


/* =========================================================
   SITE EDIT INLINE MAP AREA
========================================================= */

.wineSiteMapSection {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 1px solid #e2ded5;
}

.wineSiteMapSectionHeader {
	margin-bottom: 14px;
}

.wineSiteMapSectionHeader h3 {
	margin: 0 0 5px;
	color: #2c4d34;
	font-family: G-Roboto-n4, Arial, sans-serif;
	font-size: 17px;
	font-weight: 700;
}

.wineSiteMapSectionHeader p {
	margin: 0;
	color: #6f7f8f;
	font-family: G-Roboto-n4, Arial, sans-serif;
	font-size: 12px;
	line-height: 1.5;
}

.wineSiteCalculatedAcres {
	margin-top: 12px;
	padding: 10px 13px;
	color: rgb(72, 83, 93);
	background-color: #f7f4eb;
	border: 1px solid #e2ded5;
	border-radius: 8px;
	font-family: G-Roboto-n4, Arial, sans-serif;
	font-size: 13px;
}

.wineSiteCalculatedAcres strong {
	color: #2c4d34;
}


/* =========================================================
   MAPLIBRE CONTROLS
========================================================= */

.vineyardMapCanvas .maplibregl-ctrl-group {
	overflow: hidden;
	border: 1px solid rgba(44, 77, 52, 0.18);
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(17, 17, 17, 0.12);
}

.vineyardMapCanvas .maplibregl-ctrl-group button {
	width: 36px;
	height: 36px;
	background-color: #ffffff;
}

.vineyardMapCanvas .maplibregl-ctrl-group button:hover {
	background-color: #f7f4eb;
}

.vineyardMapCanvas .maplibregl-ctrl-attrib {
	font-family: G-Roboto-n4, Arial, sans-serif;
	font-size: 10px;
}


/* =========================================================
   POLYGON DRAW CONTROLS
========================================================= */

.vineyardMapCanvas .mapbox-gl-draw_ctrl-draw-btn {
	background-color: #ffffff;
}

.vineyardMapCanvas .mapbox-gl-draw_ctrl-draw-btn:hover {
	background-color: #f7f4eb;
}

.vineyardMapCanvas .mapbox-gl-draw_polygon {
	border-bottom: 1px solid rgba(131, 10, 26, 0.7);
}

/* =========================================================
   SELECTED MAP DRAW BUTTONS
========================================================= */

/*
 * Polygon button while drawing mode is active.
 *
 * A lighter selected background keeps the built-in black
 * Mapbox Draw icon clearly visible.
 */
.vineyardMapCanvas
	.mapbox-gl-draw_polygon.mapDrawControlSelected {
	background-color: #dbe7dc !important;
	box-shadow:
		inset 4px 0 0 #2c4d34,
		inset 0 0 0 1px rgba(44, 77, 52, 0.28);
}

/* Keep selected color when hovering */
.vineyardMapCanvas
	.mapbox-gl-draw_polygon.mapDrawControlSelected:hover {
	background-color: #cbdccc !important;
}


/*
 * Trash button when a polygon is selected or has just
 * been deleted.
 */
.vineyardMapCanvas
	.mapbox-gl-draw_trash.mapDrawControlSelected {
	background-color: #ead8db !important;
	box-shadow:
		inset 4px 0 0 #7a2c37,
		inset 0 0 0 1px rgba(122, 44, 55, 0.5);
}

/* Keep selected color when hovering */
.vineyardMapCanvas
	.mapbox-gl-draw_trash.mapDrawControlSelected:hover {
	background-color: #dfc7cb !important;
}


/* Keyboard focus visibility */
.vineyardMapCanvas
	.mapbox-gl-draw_ctrl-draw-btn:focus-visible {
	position: relative;
	z-index: 2;
	outline: 3px solid rgba(122, 44, 55, 0.52);
	outline-offset: -3px;
}

/* =========================================================
   MAPLIBRE / MAPBOX DRAW CONTROLS
========================================================= */

.vineyardMapCanvas .maplibregl-control-container {
	z-index: 10;
	pointer-events: none;
}

.vineyardMapCanvas .maplibregl-ctrl-top-left,
.vineyardMapCanvas .maplibregl-ctrl-top-right,
.vineyardMapCanvas .maplibregl-ctrl-bottom-left,
.vineyardMapCanvas .maplibregl-ctrl-bottom-right {
	pointer-events: none;
}

.vineyardMapCanvas .maplibregl-ctrl,
.vineyardMapCanvas .maplibregl-ctrl-group,
.vineyardMapCanvas .maplibregl-ctrl-group button,
.vineyardMapCanvas .mapbox-gl-draw_ctrl-draw-btn {
	pointer-events: auto;
}

.vineyardMapCanvas .mapbox-gl-draw_ctrl-draw-btn {
	cursor: pointer;
}

/* =========================================================
   RESPONSIVE SITE MAP
========================================================= */

@media (min-width: 576px) {
	sidebarcomponent {
		margin-right: 3rem !important;
	}
}

@media (max-width: 991.98px) {
	sidebarcomponent {
		min-height: auto;
		margin-right: 0 !important;
		margin-bottom: 20px;
		border-right: none;
		border-bottom: 1px solid #cccccc;
	}

	.siteMap {
		min-height: 600px;
		height: 70vh;
	}

	.vineyardMapCanvas,
	.wineSiteInlineMap {
		height: 440px;
		min-height: 380px;
	}
}

@media (max-width: 767.98px) {
	.vineyardMapCanvas,
	.wineSiteInlineMap {
		height: 360px;
		min-height: 320px;
	}

	.vineyardMapInstructions {
		padding: 13px 14px;
	}

	.vineyardMapInstructions p {
		font-size: 11px;
	}

	.wineSiteMapSection {
		margin-top: 16px;
		padding-top: 16px;
	}
}

@media (max-width: 575.98px) {
	.siteMap {
		min-height: 500px;
		height: 65vh;
		border-radius: 6px;
	}

	.maplibregl-popup-content {
		max-width: calc(100vw - 40px);
		padding: 18px 22px;
	}

	.mapMarker {
		font-size: 14px;
	}

	.mapMarker h3 {
		font-size: 18px;
	}

	.vineyardMapCanvas,
	.wineSiteInlineMap {
		height: 320px;
		min-height: 300px;
		border-radius: 9px;
	}

	.vineyardMapInstructions {
		display: block;
	}

	.wineSiteMapSectionHeader h3 {
		font-size: 16px;
	}
}
/* =========================================================
   MY SITES MAP PAGE
========================================================= */

.mySitesMapContent {
	display: flex;
	flex-direction: column;

	height: calc(100vh - 180px);
	min-height: 500px;
}

/* =========================================================
   MAP PANEL
========================================================= */

.mySitesMapPanel {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;

	min-height: 0;
	overflow: hidden;

	border: 1px solid #dedbd2;
	border-radius: 16px;
	background: #ffffff;
	box-shadow: 0 10px 28px rgba(45, 55, 47, 0.08);
}


/* =========================================================
   MAP PANEL HEADER
========================================================= */

.mySitesMapPanelHeader {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 1.25rem;
	border-bottom: 1px solid #dedbd2;
	background: #f6f5f0;
}

.mySitesMapPanelTitle {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	min-width: 0;
}

.mySitesMapPanelIcon {
	display: inline-flex;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(122, 44, 55, 0.1);
	color: #7a2c37;
	font-size: 1rem;
}

.mySitesMapPanelTitle h2 {
	margin: 0;
	color: #2c4d34;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.25;
}

.mySitesMapPanelTitle p {
	margin: 0.2rem 0 0;
	color: #737873;
	font-size: 0.82rem;
	line-height: 1.4;
}

.mySitesMapCount {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 0.45rem;
	padding: 0.45rem 0.75rem;
	border: 1px solid #d8d8d2;
	border-radius: 999px;
	background: #ffffff;
	color: #59605a;
	font-size: 0.78rem;
	font-weight: 600;
	white-space: nowrap;
}

.mySitesMapCount i {
	color: #7a2c37;
	font-size: 0.75rem;
}


/* =========================================================
   MAP BODY
========================================================= */

.mySitesMapBody {
	position: relative;

	display: flex;
	flex: 1 1 auto;
	flex-direction: column;

	min-height: 0;
	padding: 0.65rem;

	background: #efeee9;
}

.siteMap.mySitesMap {
	position: relative;

	flex: 1 1 auto;

	width: 100%;
	height: auto !important;
	min-height: 0 !important;

	overflow: hidden;

	border: 1px solid #d5d3cb;
	border-radius: 12px;
	background: #e7e7e2;
}


/* =========================================================
   MAPLIBRE FILL
========================================================= */

.siteMap.mySitesMap .maplibregl-map,
.siteMap.mySitesMap.maplibregl-map,
.siteMap.mySitesMap .maplibregl-canvas-container,
.siteMap.mySitesMap .maplibregl-canvas {
	width: 100% !important;
	height: 100% !important;
}

/* =========================================================
   MAP CONTROLS
========================================================= */

.mySitesMap .maplibregl-ctrl-group {
	overflow: hidden;
	border: 1px solid #d8d8d2;
	border-radius: 8px;
	background: #ffffff;
	box-shadow: 0 5px 16px rgba(44, 52, 45, 0.12);
}

.mySitesMap .maplibregl-ctrl-group button {
	width: 34px;
	height: 34px;
}

.mySitesMap .maplibregl-ctrl-attrib {
	border-radius: 6px 0 0 0;
	font-size: 0.68rem;
}


/* =========================================================
   MAP POPUPS
========================================================= */

.mySitesMap .maplibregl-popup-content {
	min-width: 220px;
	padding: 1rem;
	border: 1px solid #dedbd2;
	border-radius: 10px;
	color: #3f443f;
	box-shadow: 0 10px 28px rgba(45, 55, 47, 0.18);
}

.mySitesMap .maplibregl-popup-close-button {
	top: 0.35rem;
	right: 0.45rem;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	color: #59605a;
	font-size: 1.15rem;
	line-height: 28px;
}

.mySitesMap .maplibregl-popup-close-button:hover {
	background: #f1f2ee;
	color: #7a2c37;
}


/* =========================================================
   EMPTY MAP STATE
========================================================= */

.mySitesMapEmpty {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 5;
	width: calc(100% - 3rem);
	max-width: 390px;
	padding: 2rem;
	border: 1px solid rgba(216, 216, 210, 0.95);
	border-radius: 14px;
	background: rgba(255, 255, 255, 0.96);
	text-align: center;
	box-shadow: 0 12px 35px rgba(45, 55, 47, 0.15);
	transform: translate(-50%, -50%);
	backdrop-filter: blur(4px);
}

.mySitesMapEmptyIcon {
	display: inline-flex;
	width: 58px;
	height: 58px;
	align-items: center;
	justify-content: center;
	margin-bottom: 1rem;
	border-radius: 50%;
	background: rgba(44, 77, 52, 0.1);
	color: #2c4d34;
	font-size: 1.35rem;
}

.mySitesMapEmpty h3 {
	margin: 0;
	color: #2c4d34;
	font-size: 1.15rem;
	font-weight: 700;
}

.mySitesMapEmpty p {
	max-width: 310px;
	margin: 0.55rem auto 1.15rem;
	color: #6f756f;
	font-size: 0.88rem;
	line-height: 1.55;
}

.mySitesEmptyButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.65rem 1rem;
	border: 1px solid #2c4d34;
	border-radius: 8px;
	background: #2c4d34;
	color: #ffffff;
	font-size: 0.88rem;
	font-weight: 600;
}

.mySitesEmptyButton:hover,
.mySitesEmptyButton:focus {
	border-color: #3d6546;
	background: #3d6546;
	color: #ffffff;
}


/* =========================================================
   RESPONSIVE MAP LAYOUT
========================================================= */

@media (max-width: 991.98px) {
	.mySitesMapBody {
		min-height: 600px;
	}

	.mySitesMap {
		height: 600px;
		min-height: 600px;
	}
}

@media (max-width: 767.98px) {
	.mySitesMapPanelHeader {
		align-items: flex-start;
		padding: 1rem;
	}

	.mySitesMapCount {
		margin-top: 0.15rem;
	}

	.mySitesMapBody {
		min-height: 520px;
		padding: 0.6rem;
	}

	.mySitesMap {
		height: 520px;
		min-height: 520px;
		border-radius: 10px;
	}
}

@media (max-width: 575.98px) {
	.mySitesMapPanelHeader {
		flex-direction: column;
	}

	.mySitesMapCount {
		align-self: flex-start;
	}

	.mySitesMapBody {
		min-height: 470px;
	}

	.mySitesMap {
		height: 470px;
		min-height: 470px;
	}

	.mySitesMapEmpty {
		width: calc(100% - 2rem);
		padding: 1.5rem 1rem;
	}
}
/* =========================================================
   MY SITES MAP POPUP
========================================================= */

.mySitesMapPopup {
	min-width: 220px;
	color: #3f443f;
}

.mySitesMapPopup h3 {
	margin: 0 1.25rem 0.65rem;
	color: #2c4d34;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
}

.mySitesMapPopup p {
	margin: 0;
	color: #555c56;
	font-size: 0.78rem;
	line-height: 1.7;
}

.mySitesMapPopupBlock {
	display: inline-flex;
	margin-bottom: 0.65rem;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	background: rgba(122, 44, 55, 0.1);
	color: #7a2c37;
	font-size: 0.7rem;
	font-weight: 700;
}

.mySitesMapPopupAction {
	margin-top: 0.75rem;
	padding-top: 0.65rem;
	border-top: 1px solid #e3e1da;
	color: #7a2c37;
	font-size: 0.72rem;
	font-weight: 700;
	text-align: right;
}

.mapPopupInstructions {
	margin-bottom: 1rem;
	padding: 0.85rem 1rem;

	background: #f7f4eb;
	border: 1px solid #dedbd2;
	border-radius: 10px;
}

.mapPopupInstructionsTitle {
	margin: 0 0 0.35rem;

	color: #2c4d34;
	font-size: 1rem;
	font-weight: 700;
}

.mapPopupInstructionsText {
	margin: 0;

	color: #60675f;
	font-size: 0.88rem;
	line-height: 1.5;
}

.mapPopupActions {
	display: flex;
	justify-content: flex-end;
	margin-top: 1rem;
}

.mapPopupActions .btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.validationErrors ul {
	padding-left: 1.25rem;
}