/*** background color of the overall page ***/
body {
    background-color: #dddddd;
    padding: 0;
    margin: 0;
    border: 0;
    outline: 0;
}

/* Dark Mode */
:root {
    --map-tiles-filter: brightness(0.6) contrast(3) saturate(0.3) invert(1) hue-rotate(200deg);
    --attrib-filter: brightness(0.7) contrast(2) invert(1) hue-rotate(200deg);
    --legend-filter: brightness(0.7) contrast(2) invert(0) hue-rotate(200deg);
    --overlay-filter: brightness(0.7) contrast(2) invert(0);
    --overlay-filter-invert: brightness(0.7) contrast(2) invert(1);
}

[data-theme="dark"] {
    .map-tiles {
        filter:var(--map-tiles-filter, none);
	}
    .leaflet-control-attribution {
        filter:var(--attrib-filter, none);
	}
    .leaflet-bar.leaflet-control-zoom {
	filter:var(--map-tiles-filter, none);
	}
    .leaflet-bar.leaflet-ruler {
	filter:var(--map-tiles-filter, none);
	}
    .leaflet-control-custom.leaflet-bar {
	filter:var(--map-tiles-filter, none);
	}
    .leaflet-control-layers {
	filter:var(--map-tiles-filter, none);
	}
    .leaflet-control-layers-expanded {
	filter:var(--overlay-filter, none);
	background-color: rgba(0,0,0,0.7);
	color: white;
	font-weight: bold;
	}
    #leaflet-control-layers-group-2 {
	filter:var(--overlay-filter-invert, none);
	color: black;
	font-weight: bold;
	}
    .leaflet-control-search {
	filter:var(--map-tiles-filter, none);
	}
    .leaflet-control-scale {
	filter:var(--map-tiles-filter, none);
	}
    .popupTabs {
	filter:var(--attrib-filter);
	background-color: rgba(0,0,0,0);
	}
    .linkPopupContent {
	filter:var(--attrib-filter);
	}
    #youAreHere {
	filter:var(--overlay-filter-invert,none);
	}
}
[data-theme="light"] {
    .map-tiles {
        filter: none;
	}
    .leaflet-control-attribution {
        filter: none;
	}
    .leaflet-bar {
	filter: none;
	}
    .leaflet-control-layers {
	filter: none;
	}
    .leaflet-control-search {
	filter: none;
	}
    .leaflet-control-scale {
	filter: none;
	}
    #youAreHere {
	filter: none;
	}
}

/*** This will change the size of the top left corner logo ***/
#pageLogo {
	width: 50px;
	vertical-align: middle;
}
#headerText {
    margin: 0;
}
/*** This will change the size of the map "container" ***/
/*** it should be left to default of 100%/100% of the window ***/
#meshmap {
	/*height: 700px;*/
	/*margin: 5px auto;*/
	/*width: 100%;*/
}
/*** this is the size of the map itself ***/
html, body {
	height: 100%;
	height: 100dvh;
	margin: 0;
	padding: 0;
	overflow: hidden;
	overscroll-behavior: none;
}
#map {
	width: 100%;
	height: 100%;
	height: 100dvh;
	overflow: hidden;
	touch-action: none;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom,
.leaflet-container {
	touch-action: none;
}

/* Mid-screen control corners (used by verticalcenterleft / right) */
.leaflet-verticalcenter {
	position: absolute;
	z-index: 1000;
	pointer-events: none;
	top: 50%;
	transform: translateY(-50%);
}
.leaflet-verticalcenter .leaflet-control {
	pointer-events: auto;
	margin-top: 6px;
	margin-bottom: 6px;
}
.leaflet-left.leaflet-verticalcenter {
	left: 0;
	padding-left: max(0px, env(safe-area-inset-left, 0px));
}

/* Short landscape: top-align the left rail so it can be dragged to reveal cut-off icons */
@media (max-height: 560px) {
	.leaflet-left.leaflet-verticalcenter {
		top: max(6px, env(safe-area-inset-top, 0px));
		bottom: auto;
		transform: none;
		pointer-events: auto;
		touch-action: none;
		max-height: none;
		overflow: visible;
	}
	.leaflet-left.leaflet-verticalcenter.meshmap-rail-overflow {
		cursor: ns-resize;
	}
}
.leaflet-right.leaflet-verticalcenter {
	right: 0;
	padding-right: max(0px, env(safe-area-inset-right, 0px));
}

/* Safe areas for standard Leaflet corners */
.leaflet-top {
	top: env(safe-area-inset-top, 0px);
}
.leaflet-bottom {
	bottom: env(safe-area-inset-bottom, 0px);
}
.leaflet-left {
	left: env(safe-area-inset-left, 0px);
}
.leaflet-right {
	right: env(safe-area-inset-right, 0px);
}

.leaflet-bar a,
.leaflet-control-layers-toggle,
.leaflet-control a,
.meshmap-view-as-list,
#legendLinkButton,
#legendLinkButtonHidden {
	touch-action: manipulation;
}
h1 {
    color: navy;
    margin-left: 20px;
}
.center {
    text-align: center;
}

.login {
	text-align: center;
}

.loginBoldText {
	text-align: center;
	font-weight: bold;
}

.boldText {
	font-weight: bold;
}
td.BackgroundColor {
	background-color: #dddddd;
}
/*wxc*/
boldText {
	font-weight: bold;
}
/*wxc*/
redText {
	color: red;
}
/*wxc*/
greenText {
	color: green;
}
/*wxc*/
a.normalTextLink {
	color: inherit;
	/*text-decoration: inherit;*/
	text-decoration: none;
}

/*wxc*/
tr:nth-child(even) {
	background-color: #c0c0c0;
}

/*wxc*/
tr:nth-child(odd) {
	background-color: #d0d0d0;
}

.linkButton {
	background: none;
	color: blue;
	border: none;
	padding: 0;
	font: inherit;
	cursor: pointer;
	display: inline;
}

.inlineForm {
	display: inline;
}

MapTitle {
    color: Black;
    font-weight:bold;
    font-size: 2em;
    vertical-align: middle;
}

Warning_MSG {
    color: Red;
    font-weight:bold;
    font-size: 1.5em;
    text-align: center;
}

Welcome_MSG {
    /* color: Blue; */
    font-weight:bold;
    font-size: 1.5em;
    text-align: center;
    display: inline;
}

/*wxc*/
Welcome_MSG2 {
	color: Black;
	font-weight: bold;
	text-align: center;
	display: inline;
}

Internet_MSG {
    color: Purple;
    font-weight:bold;
    font-size: 1em;
    text-align: center;
}
Mesh_MSG {
    color: Orange;
    font-weight:bold;
    font-size: 1em;
    text-align: center;
}
NodeTitle {
    color: blue;
    font-weight:bold;
    text-align: center;
}

Device_Linux {
    color: yellow;
}

Device_900MHz {
    color: magenta;
}

Device_24GHz {
    color: purple;
}

Device_3GHz {
    color: blue;
}

Device_5GHz {
    color: gold;
}

dtd_link {
    color: #808080;
}

Link_DTD {
    color: #A020F0;
}

Link_Tunnel {
    color: #808080;
}
Link_Infinite {
    Color: black;
}
MAP_DETAILS {
    color: Black;
    font-weight:bold;
    font-size: 1.25em;
}

/*NEW ADDITIONS*/
.maptitle {
    color: Black;
    font-weight:bold;
    font-size: 2em;
    vertical-align: middle;
    display: inline;
}
.welcomeMsg {
    font-weight:bold;
    font-size: 1.5em;
    text-align: center;
    display: inline;
}
.welcomeMsg2 {
	color: Black;
	font-weight: bold;
	text-align: center;
	display: inline;
}
.warningMsg {
    color: Red;
    font-weight:bold;
    font-size: 1.5em;
    text-align: center;
    display: inline;
}
.leaflet-control-layers-expanded, .leaflet-control-layers-list {
	height: auto;
	max-height: min(70vh, 500px);
	overflow-x: hidden;
	overflow-y: auto;
	width: 140px;
	touch-action: pan-y;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

/** New stuff for the popup tabs **/
.leaflet-popup-content{
	width: auto;
	max-width: min(350px, calc(100vw - 32px));
	margin: 3px 3px;
	max-height: min(60vh, 420px);
	overflow-y: auto;
	touch-action: pan-y;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
	background: #0000009c !important;
	color: #333;
	box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.popupTabs {
	position: relative;
	min-height: 250px;
	clear: both;
	margin: 3px 0;
}
/* Unpolled / simple popups: in-flow so Leaflet can size width (tab panes are absolute). */
.popupSimple {
	background: #f8f8f8;
	padding: 10px 8px;
	border-radius: 15px;
	min-width: 220px;
	max-width: 100%;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}
.popupTab {
	float: left;
	display: none;
}
.popupTab:first-of-type {
	display: inline-block;
}
.popupTabs-link {
	position: relative;
	top: -2px;
	height: 20px;
	left: -40px;
}
.popupTab-link {
	background:#eee;
    display: inline-block;
    padding:4px;
    -webkit-border-top-left-radius: 15px;
    -webkit-border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    border:1px solid #ccc;
    margin-left:-1px;
    position:relative;
    list-style-type: none;
    top:1px;
    cursor:pointer;
}
.popupTab-link {
	background: #f8f8f8;
}
.popupTabContent {
	background:#f8f8f8;
    position:absolute;
    overflow: auto;
    top:25px;
    left:0;
    right:0;
    bottom:0;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 5px;
    padding-left: 5px;
    border-top-color: rgb(204, 204, 204);
	border-top-style: solid;
	border-top-width: 1px;
	-webkit-border-bottom-left-radius: 15px;
	-webkit-border-bottom-right-radius: 15px;
    -webkit-border-top-right-radius: 15px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border-top-right-radius: 15px;
}
.popupTabs-fw {
	position: relative;
	min-height: 250px;
	color: red;
	font-weight: 900;
	text-align: center;
	clear: both;
	margin: 18px 0;
}
.popupTabContent-fw {
	text-align: left;
	font-weight: normal;
	color: black;
	background:#f8f8f8;
    position:absolute;
    overflow: auto;
    top:25px;
    left:0;
    right:0;
    bottom:0;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 5px;
    padding-left: 5px;
    border-top-color: rgb(204, 204, 204);
	border-top-style: solid;
	border-top-width: 1px;
	-webkit-border-bottom-left-radius: 15px;
	-webkit-border-bottom-right-radius: 15px;
    -webkit-border-top-right-radius: 15px;
    -webkit-border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
}
.popupTabs-nonmesh {
	position: relative;
	min-height: 250px;
	color: white;
	font-weight: 900;
	text-align: center;
	clear: both;
	margin: 18px 0;
}
.popupTab:target {
	display: block;
}
.viewAsListControl{
  height: 30px;
  width: 30px;
  background-image: url("../images/spreadsheet-icon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
}
.leaflet-ruler {
	height: 30px !important;
	width: 30px !important;
}
.leaflet-control-layers-toggle {
	height: 30px !important;
	width: 30px !important;
}
.meshmap-view-as-list {
	width: 30px;
	height: 30px;
}
.linkPopupContent {
	background-color: #f8f8f8;
	-webkit-border-bottom-left-radius: 15px;
	-webkit-border-bottom-right-radius: 15px;
    -webkit-border-top-right-radius: 15px;
    -webkit-border-top-left-radius: 15px;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    border-top-right-radius: 15px;
    border-top-left-radius: 15px;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 5px;
    padding-left: 5px;
}
#spiderfyActive {
	background: black;
	color: white;
	opacity: 0.5;
	position: absolute;
	width: 158px;
	font-size: 1em;
	text-align: center;
	z-index: 9999;
	top: max(2px, env(safe-area-inset-top, 0px));
	left: 50%;
	transform: translateX(-50%);
	border-radius: 5px;
	visibility: hidden;
	pointer-events: none;
}

.leaflet-control-layers-toggle {
	background-image: url(../images/cogs.svg);
}

.leaflet-ruler {
	background-image: url("../images/ruler-icon.png");
}
.leaflet-ruler:hover,
.leaflet-ruler-clicked,
.leaflet-ruler-paused {
	background-image: url("../images/ruler-icon-colored.png");
}
.leaflet-ruler-clicked {
	border-color: chartreuse !important;
}
.leaflet-ruler-paused {
	border-color: orange !important;
}
.attribution {
	font-weight: bold;
	color: inherit;
	text-decoration: none;
}

/* ----- Mobile / tablet ----- */
@media (pointer: coarse), (max-width: 900px) {
	.leaflet-bar a,
	.leaflet-control-layers-toggle,
	.meshmap-view-as-list,
	.leaflet-ruler {
		min-width: 44px !important;
		min-height: 44px !important;
		width: 44px !important;
		height: 44px !important;
		line-height: 44px !important;
	}
	.viewAsListControl {
		width: 44px;
		height: 44px;
		background-size: 26px 26px;
	}
	.leaflet-control-layers-toggle {
		background-size: 28px 28px !important;
	}
	.leaflet-ruler {
		background-size: 28px 28px !important;
	}
	#legendLinkButtonHidden,
	#legendLinkButton {
		min-height: 44px;
		min-width: 44px;
		padding: 8px 10px !important;
		font-size: 16px !important;
	}
}

@media (max-width: 700px) {
	.leaflet-control-layers-expanded,
	.leaflet-control-layers-list {
		width: min(90vw, 280px) !important;
		max-height: min(50dvh, 360px) !important;
		height: auto !important;
		overflow-y: auto !important;
	}
	.leaflet-control-layers label {
		padding: 8px 4px;
		font-size: 16px;
	}

	.leaflet-control-scale {
		display: none;
	}
	.leaflet-control-attribution {
		max-width: min(100vw - 16px, 360px);
		font-size: 10px;
		line-height: 1.25;
	}

	.popupTabs,
	.popupTabs-nonmesh,
	.popupTabs-fw {
		/* Absolute .popupTabContent needs a real height box to scroll inside */
		min-height: min(48dvh, 320px) !important;
		height: min(48dvh, 320px);
		max-height: min(52dvh, 340px);
	}
	.popupTabs-link {
		left: 0;
		height: auto;
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		z-index: 2;
	}
	/* Inner tab pane is the scroll surface (not the outer leaflet content) */
	.leaflet-popup-content {
		max-height: none;
		overflow: visible;
	}
	.popupTabContent,
	.popupTabContent-fw {
		touch-action: pan-y;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	.leaflet-control-search.search-exp {
		width: calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)) !important;
		max-width: calc(100vw - 24px);
	}
	.leaflet-control-search input {
		font-size: 16px !important;
	}
	.leaflet-control-search .search-tooltip {
		max-height: 40vh !important;
		overflow-y: auto;
		touch-action: pan-y;
		overscroll-behavior: contain;
	}

	#spiderfyActive {
		width: auto;
		max-width: 70vw;
		padding: 2px 10px;
		font-size: 0.85em;
	}

	#legend {
		width: min(200px, calc(100vw - 24px));
		max-width: calc(100vw - 24px);
	}
}

@media (max-width: 480px) {
	.leaflet-control-attribution {
		max-width: calc(100vw - 12px);
	}
}
