/* === MATRIX THEME COLORS === */
:root {
  --bg-color: #000;
  --sidebar-bg: rgba(0, 0, 0, 0.9);
  --text-color: #00ff00;
  --button-bg: #003300;
  --button-hover: #005500;
  --border-color: #00ff00;
}

/* === GENERAL BODY === */
body {
  margin: 0;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  background: var(--bg-color);
  color: var(--text-color);
  height: 100vh;
}

/* === FULL VIEWPORT MATRIX BG === */
.matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

/* === STICKY USER TABLE HEADER === */
#userTable thead th {
  position: sticky;
  top: 0;
  background-color: #005500;
  z-index: 1;
}

/* === FLOATING SIDEBAR LEFT === */
.sidebar {
  position: fixed;
  top: 0;
  left: -450px;
  width: 380px;
  height: 100vh;
  background: var(--sidebar-bg);
  box-shadow: 0 0 10px var(--border-color);
  transition: left 0.3s ease-in-out;
  padding: 15px;
  overflow-y: auto;
  z-index: 10;
  border-right: 2px solid var(--border-color);
}
.sidebar.show { left: 0; }

/* === FLOATING SIDEBAR RIGHT === */
.sidebarRight {
  position: fixed;
  top: 0;
  right: -450px;
  width: 380px;
  height: 100vh;
  background: var(--sidebar-bg);
  box-shadow: 0 0 10px var(--border-color);
  transition: right 0.3s ease-in-out;
  padding: 15px;
  overflow-y: auto;
  z-index: 10;
  border-right: 2px solid var(--border-color);
}
.sidebarRight.show { right: 0; }

/* === HAMBURGER BUTTONS === */
.hamburger {
  position: fixed;
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--button-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 24px;
  z-index: 9;
  border-radius: 5px;
  transition: 0.2s;
  text-shadow: 0 0 5px var(--border-color);
}
.hamburger:hover { background: var(--button-hover); }

.hamburgerRight {
  position: fixed;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--button-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 24px;
  z-index: 9;
  border-radius: 5px;
  transition: 0.2s;
  text-shadow: 0 0 5px var(--border-color);
}
.hamburgerRight:hover { background: var(--button-hover); }

/* === CONTROL PANEL BUTTON === */
#controlPanel {
  position: fixed;
  bottom: 15px;
  left: 15px;
  width: 40px;
  height: 40px;
  background: var(--button-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 24px;
  z-index: 9;
  border-radius: 5px;
  transition: 0.2s;
  text-shadow: 0 0 5px var(--border-color);
}

/* === INPUTS AND BUTTONS === */
input, button {
  width: 95%;
  padding: 8px;
  margin: 5px 0;
  border: 1px solid var(--border-color);
  background: var(--button-bg);
  color: var(--text-color);
  border-radius: 4px;
  text-shadow: 0 0 5px var(--border-color);
}
button { cursor: pointer; font-weight: bold; }
button:hover { background: var(--button-hover); }

input, textarea, select, button { font-size: 12px; }

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: var(--button-bg);
  border: 1px solid var(--border-color);
}
th, td {
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}
th { background: var(--button-hover); }

/* === MAIN CANVAS AREA === */
.canvas-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: block;
  margin: 0;
  padding: 0;
}
.canvasA {
  width: 95vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  margin: 20px auto;
  background: var(--sidebar-bg);
  box-shadow: 0 0 10px var(--border-color);
  position: relative;
}
@media screen and (min-aspect-ratio: 10/16) {
  .canvasA { width: 95vw; height: 90vh; }
}
#map { width: 100%; height: 100%; }
#map * { cursor: default !important; }

/* === FLOATING COUNTER === */
.counter {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--text-color);
  padding: 10px;
  border-radius: 5px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  text-shadow: 0 0 5px var(--border-color);
  z-index: 20;
}

/* === CALCULATOR CONTAINER === */
#calculator-container {
  position: fixed;
  bottom: 0px;
  width: 300px;
  left: 0px;
  border: 2px solid #0f0;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.8);
  box-shadow: 0 0 10px #0f0;
  display: none;
  z-index: 1000;
}
#calculator {
  background-color: #000;
  border: 2px solid green;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-gap: 5px;
}
#calculator input[type="button"] {
  width: 100%;
  height: 50px;
  background-color: #000;
  color: #0f0;
  border: 1px solid #0f0;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
  font-size: 1.2em;
  box-sizing: border-box;
}
#calculator input[type="button"]:hover {
  background-color: #0f0;
  color: #000;
}

/* === FOOTER === */
.footer {
  background-color: rgba(0, 0, 0, 1);
  padding: 10px;
  position: fixed;
  bottom: 0px;
  left: 10px;
  width: 255px;
  z-index: 10;
  display: none;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

/* === DROPDOWN MENUS === */
.dropdown-menu .submenu li {
  background-color: #000 !important;
  color: #fff !important;
}
.dropdown-menu .submenu li:hover { background-color: #222 !important; }
#dropdownHeader, .dropdown-header {
  background-color: #000 !important;
  color: #fff !important;
  outline: 2px solid lightgreen !important;
  outline-offset: 2px !important;
}
.dropdown-menu .group-header {
  background-color: #000 !important;
  color: #fff !important;
  outline-offset: 2px !important;
}
#dropdownMenu { background-color: #000 !important; margin: 0; padding: 0; }
#dropdownMenu, #dropdownMenu .group, #dropdownMenu .submenu {
  list-style: none !important;
  margin: 0;
  padding: 0;
}
#dropdownMenu .group-header, #dropdownHeader {
  background-color: #000 !important;
  color: #fff !important;
  border-left: none !important;
  padding: 8px 12px;
}
#dropdownMenu .submenu li {
  background-color: #000 !important;
  color: #fff !important;
  padding: 6px 12px;
  list-style: none !important;
}
#dropdownMenu .submenu li::marker { content: none !important; }
#dropdownMenu .submenu li:hover { background-color: #222 !important; }

/* === FOOTER BUTTONS === */
.footer button {
  background-color: #000 !important;
  color: #fff !important;
  outline: 2px solid lightgreen;
  border: 1px solid #444;
}
.footer button:hover { background-color: #222 !important; }

/* === GENERAL BUTTONS === */
button, input[type="file"], select, input[type="text"], input[type="decimal"] {
  background-color: #003300;
  color: rgb(225, 231, 225);
  border: 1px solid #0F0;
  padding: 8px 12px;
  font-size: 1rem;
  font-family: monospace;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.1s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
}
button.btn-30 { width: 30%; height: 100%; right: 0; }
button.btn-20 {
  width: 20%;
  height: 100%;
  height: 40px;
  line-height: 20px;
  padding: 0 10px;
  cursor: pointer;
}
button.btn-10 { width: 10%; height: 100%; }
.myButton-20:hover { background-color: #218838; }
.gm-style-mtc { display: flex !important; align-items: center !important; }

/* === GPS BUTTON === */
.gps-button {
  background: white;
  border: none;
  padding: 8px 20px;
  font-size: 16px;
  font-weight: bold;
  color: black;
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  margin: 5px;
  text-transform: uppercase;
}
.gps-button:hover { background: #f0f0f0; }

/* === HIDDEN DIVS === */


/* Shared base styles for all matrix modal panels */
#hiddenFormDiv,
#hiddenDiv,
#hiddenUserACtion {
  display: none;
  position: fixed;
  top: 2.5%;
  left: 2.5%;
  width: 95vw;
  height: 95vh;
  /*min-width: 900px;
  min-height: 600px;*/
  background-color: #000;
  color: #0f0;
  border: 2px solid #00ff00;
  box-sizing: border-box;
  padding: 20px;
  font-family: monospace;
  overflow-x: auto;
  overflow-y: auto;
  border-radius: 12px;
  box-shadow: 0 0 24px 2px #00FF00AA, 0 0 4px #0f0 inset;
}

.dist-input::-webkit-inner-spin-button,
.dist-input::-webkit-outer-spin-button {  
  -webkit-appearance: none; 
  margin: 0;
}
.dist-input {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;      /* Other browsers */
}

#hiddenFormDiv::-webkit-scrollbar { width:10px; height:10px; }
#hiddenFormDiv::-webkit-scrollbar-track { background:#000; }
#hiddenFormDiv::-webkit-scrollbar-thumb { background:#0f0; border-radius:5px; }
#hiddenFormDiv { scrollbar-width: thin; scrollbar-color: #0f0 #000; }

/* Unique z-index per panel */
#hiddenFormDiv      { z-index: 100; }
#hiddenDiv          { z-index: 200; }
#hiddenUserACtion   { z-index: 250; }

/* When shown, use flex for layout (if you want columns/rows inside) */
#hiddenFormDiv.show,
#hiddenDiv.show,
#hiddenFloatingDiv.show,
#hiddenUserACtion.show {
  display: flex !important;
  flex-direction: column;
}

/* Example for dialog and assist (keep as is) */
#hiddenDialogDiv {
  overflow: auto;
  z-index: 300;
  display: none;
}

#hiddenDialogDiv.show {
  display: flex !important;
  flex-direction: column;
}

/* ...Other popups... */
#showAngle {
  display: none;
  position: fixed;
  top: 2.5%;
  left: 2.5%;
  width: 95vw;
  height: 60vh;
  max-height: 60vh;
  background-color: #000;
  color: #0f0;
  border: 2px solid #00ff00;
  box-sizing: border-box;
  padding: 20px;
  font-family: monospace;
  overflow: auto;
  z-index: 200; /* or override as needed */
}

#hiddenPtsAssist {
  display: none;
  position: fixed;
  right: 0;
  bottom: 0;
  width: 95vw;
  height: 95vh;
  background-color: #000;
  color: #0f0;
  border: 2px solid #00ff00;
  box-sizing: border-box;
  padding: 20px 0 0 20px; /* Top/left only, right/bottom flush */
  font-family: monospace;
  overflow: hidden; /* "none" is not a valid value; use 'hidden' */
  z-index: 200; /* or override as needed */
}


#showAngle.show,
#hiddenPtsAssist.show {
  display: flex !important;
  flex-direction: column;
}

/* === HIDDEN FLOATING DIV === */
#hiddenFloatingDiv {
  position: fixed;
  width: 300px;
  height: 150px;
  background: black;
  color: #00FF00;
  border: 1px solid #00FF00;
  overflow-y: auto;
  z-index: 100000;
  display: block;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* === SIGN-IN PANEL === */
#signin-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: black;
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  font-family: monospace;
  color: #0f0;
  overflow: hidden;
}

#signin-container.show {
  display: flex !important;
}


#signin-header {
  width: 100%;
  font-size: 20px;
  border-bottom: 1px solid #00ff00;
}
#signin-footer {
  position: absolute;
  top: 70vh;
  width: 100%;
  border-top: 1px solid #00ff00;
  background: black;
  text-align: center;
  padding: 15px 0;
}
#matrix {
  flex-grow: 1;
  width: 100%;
  min-height: 40vh;
  overflow: hidden;
  position: relative;
  background: black;
}
.cover {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: auto;
  height: 60%;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cover img {
  width: auto;
  height: 100%;
  object-fit: contain;
}
#content { display: none; }
#google-signin {
  background: #003300;
  color: #00ff00;
  border: 1px solid #00ff00;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  transition: 0.3s;
}
#google-signin:hover { background: #005500; }

/* === MATRIX TEXTAREA === */
.matrix-textarea {
  display: block;
  width: 100%;
  height: 80%;
  margin-bottom: 10px;
  background-color: #000;
  color: #0f0;
  font-family: monospace;
  border: 2px solid #00ff00;
  padding: 10px;
  box-sizing: border-box;
  resize: none;
}

/* === LDC TABLE === */
.table-container {
  width: 100%;
  margin-bottom: 20px;
}
.table-container table {
  width: 100%;
  border: 1px solid #2a2a2a;
  border-collapse: collapse;
}
.table-container th,
.table-container td {
  border: 1px solid #2a2a2a;
  padding: 8px;
  text-align: left;
}

.matrix-inputs table { border-collapse: collapse; }
.matrix-inputs td {
  padding: 4px;
  border: 1px solid #2a2a2a;
  white-space: nowrap;
}
.matrix-inputs label {
  font-weight: bold;
  display: block;
  margin-bottom: 2px;
}
.matrix-inputs input,
.matrix-inputs select {
  width: auto;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid #2a2a2a;
  margin-top: 2px;
  display: inline-block;
  background: #024504;
  color: #0f0;
}
.matrix-inputs { margin-top: 10px; }
.LDCTable th,
.LDCTable td { white-space: nowrap; }
.LDCTable td { color: white; }
.LDCTable thead tr {
  background-color: darkgreen;
  color: white;
}
.LDCTable tbody tr:nth-child(4n+1),
.LDCTable tbody tr:nth-child(4n+2) { background-color: rgb(33, 33, 33); }
.LDCTable tbody tr:nth-child(4n+3),
.LDCTable tbody tr:nth-child(4n+4) { background-color: rgb(0, 0, 0); }
.LDCTable th:nth-child(1),
.LDCTable td:nth-child(1) { text-align: left; }
.LDCTable th:nth-child(n+2):nth-child(-n+5),
.LDCTable td:nth-child(n+2):nth-child(-n+5) { text-align: right; }
.LDCTable th:nth-child(n+6):nth-child(-n+9),
.LDCTable td:nth-child(n+6):nth-child(-n+9) { text-align: center; }

/* === MATRIX PANEL === */
#matrixPanel {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.9);
  box-shadow: 0 0 10px #0f0;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.162);
  transition: opacity 0.3s ease;
}
#matrixPanel table {
  border-collapse: collapse;
  border-spacing: 0;
  border: 0;
}
#matrixPanel td { padding: 0; border: 0; }
.matrix-btn {
  width: 50px;
  height: 50px;
  background-color: black;
  color: #0f0;
  font-size: 24px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  display: block;
}
.matrix-btn:hover {
  background-color: #003300;
  transform: scale(1.05);
}

/* === UTILITY CLASSES === */
.hidden { display: none; }
.visible { display: block; }

.mapCanvascontainer {
  position: fixed;
  top: 0.5vh;
  left: 2.5vw;
  width: 95vw;
  height: 95vh;
  z-index: 5;
  display: none;         /* hidden by default */
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  background: transparent;
}

/* (rest remains the same) */
.canvasM {
  width: 100%;
  height: 100%;
  background: transparent;
  border-radius: 18px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.13);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#canvass {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  background: #d6faea;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}

#canvass-controls {
  width: 100%;
  background: rgba(44, 44, 44, 0.85);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;         /* Center the button horizontally */
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-sizing: border-box;
}

#canvass-controls button {
  background: #444;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  border: none;
  border-radius: 12px;
  padding: 10px 28px;
  font-size: 1.15em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  /* FORCE content width only: */
  width: auto !important;     /* <------ THIS FORCES NO STRETCHING */
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  text-shadow:
    0 0 8px #00ff77,
    0 0 2px #fff;
}
#canvass-controls button:hover {
  background: #2b2b2b;
}
