/*   10/27/25   M. Brenner	*/


body {
	margin: 0;
	font-family: sans-serif;
	height: 100vh;
	display: flex;
	flex-direction: column;
}


:root {
	--ball-stroke: 1px solid rgba(0,0,0,.25); /* or 'none' */
	--status-bar-bg: #00c0ff;
	--status-bar-height: 46px;
	
	--ball-size: 22px;
	--ball-color: #B00000;
}

#status-bar {
	display: grid;
	grid-template-columns: auto 1fr auto auto;
	align-items: center;
	height: var(--status-bar-height);
	background: var(--status-bar-bg);
	padding: 0 12px;
	box-sizing: border-box;
	overflow: hidden;						/* prevents any accidental spillover */
}

/* center the logo horiztally and vertically				*/
/* Use height instead of only max-height; keep width auto	*/
#logo {
	display: block;
	justify-self: center;
	align-self: center;
	height: calc(var(--status-bar-height) - 12px);
	width: auto;
	object-fit: contain;				 /* safe with explicit height */
}

#status-bar .gps-status-wrap,
#status-bar .con-status-wrap {
	position: static;							/* override earlier absolute positioning */
	display: inline-flex;
	align-items: center;						/* vertical centering of dot + labels */
	gap: 8px;
}


/* Small labels flanking the dot */
.dot-label {
	font-size: .9rem;
	font-weight: normal;
}


.status-ball {
	position: relative;
	width: var(--ball-size);
	height: var(--ball-size);
	border-radius: 50%;
	background: var(--ball-color);							 /* solid base */
	border: none;
	/* subtle “3D” via two inset shadows (works well at 20–36px) */
	box-shadow:
		inset 0 -1px 2px rgba(0,0,0,.25),
		inset 0	1px 0.5px rgba(255,255,255,.55);
	cursor: pointer;
}

.status-ball::after {
	content: "";
	position: absolute;
	top: 18%;
	left: 22%;
	width: 20%;
	height: 20%;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255,255,255,.85), rgba(255,255,255,0) 70%);
	pointer-events: none;
}

/* Larger, square hit area equal to the status bar height */
.status-ball::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--status-bar-height);
	height: var(--status-bar-height);
 	transform: translate(-50%, -50%);
	border-radius: 0;			/* square (not rounded) */
	background: transparent;	/* invisible hit area   visible: background: rgba(0,255,255,.3); */
 	pointer-events: auto;		/* allow taps/clicks here */
}
 
 
#resizable-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

#main-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding-bottom: 10px;
}

.field {
	display: flex;
	margin: 10px;
	width: 80%;
	max-width: 600px;
}

.field label {
	width: 120px;
	line-height: 2em;
}

.field input {
	flex: 1;
	padding: 5px;
}

.button-row {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 20px;
}

button {
	padding: 5px 10px;
	font-size: 12px;
}

#divider {
	height: 6px;
	background: #ccc;
	cursor: row-resize;
	touch-action: none;		/* allow touch-drag to resize */
}

#custom-console {
	height: 150px;
	overflow-y: auto;
	background: #f0f0f0;
	font-family: monospace;
	font-size: 14px;
	padding: 10px;
	box-sizing: border-box;
	white-space: pre-wrap;
}

/*********************/
/* Sliding side menu */
/*********************/
#menu-toggle {
	border: 0;
	background: transparent;
	font-size: 1.25rem;
	margin-left: auto;	/* push to far right in a flex row */
	padding: 0;			/* no space on left/right */
	padding-left: 8px;
	cursor: pointer;
}

.side-menu {
	position: fixed;
	top: 0;
	left: 0;
	height: auto;
	max-height: 100vh;
	overflow-y: auto;
	width: 280px;
	max-width: 90vw;
	background: #eff;
	box-shadow: 2px 0 10px rgba(0,0,0,.2);
	transform: translateX(-100%);
	transition: transform 250ms ease;
	z-index: 1000;
	display: flex;
	flex-direction: column;
}

.side-menu.open { transform: translateX(0); }

.menu-header {
	font-weight: 600;
	padding: 1rem 1rem .5rem 1rem;
	border-bottom: 1px solid #eee;
}

.menu-list {
	list-style: none;
	margin: 0;
	padding: .5rem;
}

.menu-item {
	display: block;
	width: 100%;
	text-align: left;
	padding: .75rem 1rem;
	border: 0;
	background: transparent;
	cursor: pointer;
}

/* make the menu header (top line) in the menu larger */
.side-menu .menu-header { font-size: 1.125rem; }

/* bump only the slide-out menu buttons */
.side-menu .menu-item { font-size: 1rem; }   /* ~18px; use 1.25rem for ~20px */

.menu-item:focus { outline: 2px solid #999; }

.menu-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0,0,0,.25);
	opacity: 0;
	transition: opacity 200ms ease;
	z-index: 999;
	pointer-events: none;
}

/* NEW: Only accept taps when the side menu is open */
.side-menu.open + .menu-backdrop {
	opacity: 1;
	pointer-events: auto;
}


[hidden] {
	display: none !important;
}

.hidden {
	display: none !important;
}



/* Styling for About (manu choice) */
.about-container {
	display: flex;
	justify-content: center;
	align-items: center;
	height: auto;
	flex-direction: column;
}

#about-button {
	padding: 10px 20px;
	font-size: 16px;
}

#about-screen {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background-color: #eff;
	padding: 20px;
	border: 2px solid #b00;
	border-radius: 10px;
	z-index: 1000;
	width: 80%;
	max-width: 400px;
	text-align: center;
}

#about-title {
	font-size: 2em;
	color: #B00;
	display: block;
	margin-bottom: .5em;
}

#about-title sup {
	font-size: .55em;
	line-height: 0;
	vertical-align: super;
}

#trademark, #web-site {
	font-size: 10px;
}


/* Styling for Survey Config and Settings (menu choice) */
#loc-survey-screen,
#settings-screen {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	background-color: #fff;
	padding: 20px;
	border: 2px solid #b00;
	border-radius: 10px;
	z-index: 1000;
	width: 90%;
	max-width: 640px;
	max-height: 90vh;
	overflow-y: auto;
}

#settings-screen {
	background-color: #eff;
}


#loc-survey-screen {
	display: flex;
	flex-direction: column;
 	overflow: hidden;           /* let only the middle region scroll */
}
.loc-survey-container {
	display: flex;
	flex-direction: column;
	flex: 1;                    /* fill the dialog */
	min-height: 0;              /* allow child overflow areas to shrink */
}
.loc-survey-form {
	display: flex;
	flex-direction: column;
	flex: 1;                    /* fill the dialog */
	min-height: 0;              /* allow child overflow areas to shrink */
}
.loc-survey-scroll {
	flex: 1;                    /* take remaining space between header and buttons */
	overflow-y: auto;           /* the only scroller */
	min-height: 0;
}

.loc-survey-title {
	margin: 0 0 .5rem 0;
	text-align: center;
}

.loc-survey-fieldset {
	border: 1px solid #ccc;
	padding: .75rem 1rem 1rem 1rem;
	margin-top: .5rem;
	background: #e0ffff;   /* very pale cyan */
}

/* Survey Parameters background + alternating section fills
.loc-survey-fieldset { 
	background: #e0ffff;
}
*/

.loc-survey-row {
	display: grid;
	grid-template-columns: 160px 1fr;
	align-items: center;
	gap: 8px;
	margin: .5rem 0;
}

#sectors-fieldset .loc-survey-row {
	grid-template-columns: 1fr;
}
#sectors-fieldset .sectors-row > label {
	display: none;
}


#sectors-fieldset .sectors-row + .sectors-row {
	border-top: 1px solid #8faf8f;
	margin-top: 8px;
	padding-top: 8px;
}


#sectors-fieldset .inline-group {
	display: grid;													/* override the generic flex		*/
	grid-template-columns: max-content max-content 1fr auto auto;	/* Dec | Hex | input | button		*/
	grid-template-rows: auto auto;									/* row 1: radios, row 2: controls	*/
	column-gap: 10px;
	row-gap: 6px;
	align-items: start;
	justify-content: center;										/* center the text+button pair		*/
}
#sectors-fieldset .inline-group > label {
	display: inline-flex;											/* radio + text inline				*/
	align-items: center;
	gap: 8px;
}
#sectors-fieldset .inline-group > label:nth-of-type(1) { grid-row: 1; grid-column: 2; }
#sectors-fieldset .inline-group > label:nth-of-type(2) { grid-row: 1; grid-column: 3; }
#sectors-fieldset .inline-group > .sector-ecgi { grid-row: 2; grid-column: 1; }

#sectors-fieldset .inline-group > input[type="text"] { grid-row: 2; grid-column: 2 / span 2; }
/*
#sectors-fieldset .inline-group > input[type="text"] { grid-row: 2; grid-column: 2; }
*/
#sectors-fieldset .inline-group > .sector-add { grid-row: 2; grid-column: 4; }
#sectors-fieldset .inline-group > .sector-del { grid-row: 2; grid-column: 4; }

#sectors-fieldset {
	background: #eaffea;
}

.loc-survey-row .inline-group {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

.loc-survey-row .narrow {
	max-width: 120px;
}

.loc-survey-id-row input[type="text"] {
	max-width: 260px;
}

.loc-survey-select {
	padding: 6px 10px;
}

.suffix {
	min-width: 52px;
	text-align: left;
}


.loc.survey-form {
	display: flex;
	flex-direction: column;
}
.loc-survey-scroll {
	flex: 1;
	overflow-y: auto;
	min-height: 0;
}

.loc-survey-buttons {
	display: flex;
	justify-content: center;
	gap: 20px;
	margin-top: 16px;
}


.loc-survey-row input[type="text"],
.loc-survey-row input[type="number"] {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 8px;
}

/* Start Pos read-only look */
#loc-survey-screen #start-pos {
	background: #eee;
	width: auto;
	max-width: 100%;
	flex: 0 1 auto;
	white-space: nowrap;
}

html {
  height: 100%;
}

#map {
  flex: 1;
  width: 100%;
  position: relative;
  min-height: 200px; /* safety fallback if flex fails */
}


/* Override global button styles inside Leaflet controls */
.leaflet-bar .easy-button-button {
	padding: 0;
	font-size: 18px;
	text-align: center;
}


/* Size of the up-arrow inside the compass */
.guide-n-label {
	font-size: 2rem;
}


/* Guide-to-Location dialog */
#guide-dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%,-50%);
	background-color: #eff;
	padding: 20px;
	border: 2px solid #b00;
	border-radius: 10px;
	z-index: 1000;
	width: 90%;
	max-width: 360px;
	text-align: center;
}

.guide-title {
	font-weight: 600;
	margin-bottom: .5rem;
}

.guide-compass {
	position: relative;
	margin: 10px auto;
	width: 220px;
	height: 220px;
	border: 2px solid #333;
	border-radius: 50%;
	box-shadow: inset 0 0 8px rgba(0,0,0,.1);
}

.guide-needle {
	position: absolute;
	left: 50%;
	bottom: 50%;
	width: 2px;
	height: 42%;
	background: #b00;
	transform-origin: 50% 100%;
	transform: translateX(-50%) rotate(0deg);
}

.guide-n-label {
	position: absolute;
	top: -6px;
	left: 50%;
	transform: translateX(-50%);
	font-weight: 600;
}

.guide-distance {
	font-size: 1.1rem;
	margin-top: 10px;
}

/* heading readout inside the compass (center-anchored) */
.guide-heading {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	font-weight: 600;
	font-size: 1.25rem;
	line-height: 1;
	pointer-events: none;
	user-select: none;
}

.guide-heading.above {
	margin-top: -0.75em;
}


/* Capture widgets overlay near the bottom of the map */
#map {
	position: relative; /* needed so #capture-wrap positions against the map */
}

#capture-wrap {
	position: absolute;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1002;
}

#capture-inner {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;		/* “close together” */
}

input#capture-text {
	width: 200px;
	min-height: 30px;
	padding: 2px 6px;
	background: #eee !important;
	backgruond-color: #eee !important;
	pointer-events: none;
}

#capture-button {
	height: 28px;
	padding: 0 10px;
}


.guide-heading.below {
	margin-top: 0.75em;
}


/* Force light-gray background for Start Pos (must be last) */
#loc-survey-screen input#start-pos[readonly],
#loc-survey-screen input#start-pos[readonly]:focus {
	background: #eee !important;
	background-image: none !important;   /* neutralize any themed gradient */
	outline: none !important;            /* remove thick focus outline */
 	box-shadow: none !important;         /* remove UA focus glow */
 	border: 1px solid #ccc !important;   /* match other text fields */
}
