body,
html {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

#image-container {
  width: 140px; /* Set the width of the div */
  height: 25px;
  background-image: url("js/images/logo_v0.1.png");
  background-size: cover; /* Adjust to cover the entire div */
  background-repeat: no-repeat; /* Prevent repeating */
  background-position: center; /* Center the image */
}

#viewer-container {
  position: relative;
  width: 100%;
  height: 100%;
}

.controls {
  position: absolute;
  top: 5px;
  left: 5px;
  border: 1px solid black;
  border-radius: 4px;
  padding: 5px;
  background-color: rgba(255, 255, 255, 0.75);
  z-index: 3000;
}

.grid-label {
  position: absolute;
  transform: translateY(-100%);
  padding: 0px 5px;
  border-radius: 9999px 9999px 9999px 0px;
  color: var(--color, white);
  background-color: var(--background-color, rgba(0, 0, 0, 0.5));
  white-space: nowrap;
  font-size: var(--font-size, 16px);
  z-index: 1001;
}

.annotate-label {
  position: absolute;
  transform: translateY(-100%);
  padding: 0px 5px;
  border-radius: 9999px 9999px 9999px 0px;
  color: var(--color, white);
  background-color: var(--background-color, rgba(0, 0, 0, 0.5));
  white-space: nowrap;
  font-size: var(--font-size, 16px);
  z-index: 1002;
}

/* .annotation-overlay { */
/* outer wrapper — OSD controls positioning via transform */
/* } */

/* .annotate-label,
.grid-label {
  background: var(--background-color);
  color: var(--color);
  font-size: var(--font-size);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: auto; /* if you want clicks to reach the label */
/* display: inline-block; required for predictable transform origin */
/* transform-origin: center center; */
/* z-index: 1002; */
/* } */
*/ .rectangle-label {
  position: absolute;
  transform: translateY(-100%);
  padding: 0px 5px;
  border-radius: 9999px 9999px 9999px 0px;
  color: white;
  background-color: rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}
/* .annotate-crosshairs {
  position: absolute;
  transform: translate(-50%, -50%);
}
.annotate-crosshairs::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  transform: translate(-50%, -50%);
  background-color: green;
}
.annotate-crosshairs::after {
  content: "";
  position: absolute;
  width: 2px;
  height: 12px;
  transform: translate(-50%, -50%);
  background-color: green;
} */

.annotate-crosshairs {
  position: absolute;
  transform: translate(-50%, -50%);
}

.annotate-crosshairs::before,
.annotate-crosshairs::after {
  content: "";
  position: absolute;
  background-color: var(
    --crosshair-color,
    rgb(0, 128, 0)
  ); /* Default color is green */
  opacity: var(
    --crosshair-opacity,
    1
  ); /* Default opacity is 1 (fully visible) */
}

.annotate-crosshairs::before {
  width: 12px; /* Default width */
  height: var(--crosshair-line-weight, 2px);
  transform: translate(-50%, -50%);
}

.annotate-crosshairs::after {
  width: var(--crosshair-line-weight, 2px);
  height: 12px; /* Default height */
  transform: translate(-50%, -50%);
}

.measure-symbol {
  position: absolute;
  transform: translate(-50%, -50%);
}

.measure-symbol::before,
.measure-symbol::after {
  content: "";
  position: absolute;
  background-color: var(
    --crosshair-color,
    rgb(0, 128, 0)
  ); /* Default color is green */
  opacity: var(
    --crosshair-opacity,
    1
  ); /* Default opacity is 1 (fully visible) */
}

.measure-symbol::before {
  width: 12px; /* Default width */
  height: var(--crosshair-line-weight, 2px);
  transform: translate(-50%, -50%);
}

.measure-symbol::after {
  width: var(--crosshair-line-weight, 2px);
  height: 12px; /* Default height */
  transform: translate(-50%, -50%);
}

/*
.annotate-rect {
  border-style: solid;
  border-width: var(--rectangle-line-weight, 2px);
  border-color: var(--rectangle-color, green);
  background-color: rgba(0, 0, 0, 0.1);
  position: absolute;
  pointer-events: none;
}
*/

.grid-crosshairs {
  position: absolute;
  transform: translate(-50%, -50%);
}
.grid-crosshairs::before,
.grid-crosshairs::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 2px;
  transform: translate(-50%, -50%);
  background-color: var(
    --crosshair-color,
    rgb(0, 128, 0)
  ); /* Default color is green */
  opacity: var(
    --crosshair-opacity,
    1
  ); /* Default opacity is 1 (fully visible) */
}

.grid-crosshairs::before {
  width: 12px; /* Default width */
  height: var(--crosshair-line-weight, 2px);
  transform: translate(-50%, -50%);
}

.grid-crosshairs::after {
  width: var(--crosshair-line-weight, 2px);
  height: 12px; /* Default height */
  transform: translate(-50%, -50%);
}

.number-input {
  width: 40px;
}

.info-button {
  font-size: 10px;
  font-weight: bold;
  color: white;
  background-color: grey;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
}

/* Tooltip container */
.info-button:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

#info-button-desc {
  position: relative;
  cursor: pointer;
}

#tooltip-desc {
  position: absolute;
  background-color: #333;
  color: #fff;
  padding: 5px;
  border-radius: 4px;
  display: none;
  white-space: nowrap;
  z-index: 1000;
}

.hidden {
  display: none;
}

.tooltip-text {
  visibility: hidden;
  width: 200px;
  background-color: grey;
  color: #fff;
  text-align: center;
  border-radius: 5px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 125%; /* Position above the ? button */
  left: 50%;
  margin-left: -100px;
  opacity: 0;
  transition: opacity 0.3s;
}

/* Arrow at the bottom of the tooltip */
.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: black transparent transparent transparent;
}

#groupDropdown {
  width: 120px;
}

#sampleDropdown {
  width: 120px;
}

#count-id {
  width: 50px; /* Adjusted for a 3-4 digit number */
  text-align: center; /* Center the number */
}

#go-button {
  margin-top: 5px;
}
#count-text {
  width: 140px; /* Adjusted for a 3-4 digit number */
  text-align: left; /* Center the number */
}

/* #filterButton {
  width: 50px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#filterButton:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: grey;
  opacity: 0.5;
} */
/* 
#summarizeButton {
  width: 80px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#summarizeButton:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: grey;
  opacity: 0.5;
} */

/* #count-export {
  width: 50px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#count-export:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0;
  border-color: grey;
  opacity: 0.5;
} */

.input-success {
  border-color: green !important;
}

.file-input-container {
  position: relative;
}

.file-input {
  display: none; /* Hide the actual file input */
}

/* .file-label {
  display: inline-block;
  padding: 2px 2px;
  background-color: #f0f0f0;
  border: 1px solid #444;
  border-radius: 5px;
  font-size: 10px;
  cursor: pointer;
  text-align: center;
} */

/* General button styles */
.file-label {
  /* flex-shrink: 0; */
  display: inline-block;
  width: 50px;
  height: 14px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.file-label:hover {
  background-color: #b9b9b9;
}

#resultsModal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
}

#modalContent {
  position: relative;
  background-color: white;
  margin: 15% auto; /* Centered vertically and horizontally */
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 500px;
  text-align: center;
}

.closeButton {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 18px;
  cursor: pointer;
}

#includeDropdown {
  max-height: 200px; /* Adjust this height as needed */
  overflow-y: auto; /* Enable vertical scrolling */
  border: 1px solid #ccc; /* Optional: add a border */
  padding: 10px; /* Optional: add padding for better appearance */
  display: none; /* Initially hidden */
  position: absolute; /* Ensure it stays near the button */
  background-color: white; /* Ensure visibility */
  z-index: 1000; /* Bring it above other elements */
}

#includeDropdown div {
  margin-bottom: 5px; /* Optional: add spacing between checkboxes */
}

.aoi-rectangle {
  border: 2px solid red; /* Add a visible border */
  position: absolute; /* Ensure it's positioned correctly */
}

.button-container {
  display: flex; /* Flexbox for horizontal alignment */
  gap: 2px; /* Spacing between buttons */
  margin: 0px;
}

.arrow-container {
  display: flex; /* Flexbox for horizontal alignment */
  gap: 2px; /* Spacing between buttons */
  margin: 0px;
}

/* General button styles */
.custom-button {
  --button-width: 20px; /* Default width */
  width: var(--button-width);
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#apply-grid-settings {
  width: 50px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#apply-grid-settings:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0; /* Neutral background */
  border-color: grey;
  opacity: 0.5;
}

#restore-grid-settings {
  width: 60px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#clear-grid {
  width: 40px;
  height: 20px;
  padding: 2px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #f0f0f0;
  margin: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#clear-grid:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0; /* Neutral background */
  border-color: grey;
  opacity: 0.5;
}

#restore-grid-settings:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0; /* Neutral background */
  border-color: grey;
  opacity: 0.5;
}

/* Activated state */
.custom-button.active {
  background-color: #b9b9b9;
  color: white;
}

/* Hover state */
.custom-button:hover {
  background-color: #b9b9b9;
}

.custom-button:disabled {
  cursor: not-allowed;
  background-color: #f0f0f0; /* Neutral background */
  border-color: grey;
  opacity: 0.5;
}

/* Point (dot) button */
.crosshairs-button {
  width: 100%;
  height: 100%;
  /* width: 50px;
  height: 50px; */
}

/* Point (dot) button */
.polyline-button {
  width: 100%;
  height: 100%;
}

/* Rectangle button
.square {
  width: 10px;
  height: 10px;
  background-color: #444;
} */

.rectangle-button {
  width: 100%;
  height: 100%;
}

/* SVG container for polygon */
.polygon-button {
  width: 100%;
  height: 100%;
}

/* Trash can icon styles */
.trash-icon {
  width: 100%;
  height: 100%;
  fill: #444;
}

/* Wrench icon styles */
.gear-icon {
  width: 100%;
  height: 100%;
  fill: #444;
}

/* Trash can icon styles */
.repeat-icon {
  width: 100%;
  height: 100%;
  fill: #444;
}

/* .opacity-slider {
  width: 100px;
}

.slider-value {
  width: 75px;
} */

input[type="range"] {
  max-width: 100px; /* Set a max width if you want flexibility but no wider than this */
  width: 100%; /* Ensure the slider stretches to fit its container */
}

.dropdown-container {
  display: flex;
  align-items: flex-start; /* Align items to the left */
  gap: 2px; /* Add some space between the dropdown and the button */
}

/* Hidden menu styles */
#imageSettingsMenu {
  display: none;
  position: absolute;
  top: 50px;
  left: 50px;
  width: 220px;
  padding: 10px;
  border: 1px solid #000000;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

#imageSettingsMenu h4 {
  margin-top: 0;
  margin-bottom: 0;
}

#imageSettingsMenu label {
  display: inline-block;
  margin-top: 5px;
}

#imageSettingsMenu input[type="text"],
#imageSettingsMenu input[type="number"],
#imageSettingsMenu input[type="color"] {
  width: 20px;
  margin-top: 1px;
  padding: 1px;
}

#imageSettingsMenu button {
  margin-top: 15px;
  padding: 5px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

#imageSettingsMenu button:hover {
  background-color: #666;
}

/* Hidden menu styles */
.hiddenSettingsMenu {
  display: inline-block;
  position: absolute;
  top: 50px;
  left: 50px;
  width: 220px;
  padding: 10px;
  border: 1px solid #000000;
  border-radius: 5px;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.hiddenSettingsMenu h4 {
  margin-top: 0;
  margin-bottom: 0;
}

.hiddenSettingsMenu label {
  display: inline-block;
  margin-top: 5px;
}

.hiddenSettingsMenu input[type="text"],
.hiddenSettingsMenu input[type="number"],
.hiddenSettingsMenu input[type="color"] {
  width: 30px;
  margin-top: 1px;
  padding: 1px;
}

.hiddenSettingsMenu button {
  margin-top: 15px;
  padding: 5px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
}

.hiddenSettingsMenu button:hover {
  background-color: #666;
}

/* Button for loading annotation from JSON */
/* #loadAnnoFromJSONButton {
  display: none;
} */

#measurement-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000; /* Above viewer */
}

#annotation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000; /* Above viewer */
}

#circle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000; /* Above viewer */
}

/* Length display field */
#distance::-webkit-inner-spin-button,
#distance::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#distance {
  -moz-appearance: textfield; /* Hide arrows in Firefox */
  appearance: textfield;
  width: 200px; /* Custom width for this input */
}

#step-size {
  width: 50px;
}

#no-points {
  width: 50px;
}

.crosshair-floater {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none; /* Prevent interference with clicks */
  display: none;
}

.crosshair-floater::before,
.crosshair-floater::after {
  content: "";
  position: absolute;
  background: black;
}

.crosshair-floater::before {
  width: 10px;
  height: 2px;
  top: 4px;
  left: 0;
}

.crosshair-floater::after {
  width: 2px;
  height: 10px;
  left: 4px;
  top: 0;
}

.svg-floater {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none; /* Allows interactions through it */
  width: 100%;
  height: 100%;
  overflow: visible;
  border: 1px solid white; /* Thin white border */
  box-sizing: border-box; /* Ensures the border is included in the element size */
}

.polyline-floater {
  stroke: black;
  stroke-width: 2;
  fill: none;
  visibility: hidden; /* Hidden by default */
}

#load-sample-JSON {
  justify-content: center;
  align-items: center;
}

/* Styles for modal info pop-up*/
.modal {
  display: none; /* Hidden by default */
  position: fixed;
  z-index: 4000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 2% auto;
  padding: 10px;
  border-radius: 8px;
  width: 80%;
  height: 80%;
  max-width: 700px; /* Maximum width */
  max-height: 80vh; /* Limits height to 70% of viewport height */
  overflow-y: auto; /* Enables vertical scrolling when content overflows */
  box-shadow: 0px 0px 10px 2px rgba(0, 0, 0, 0.2);
  text-align: center;
  overflow-x: hidden; /* Prevents horizontal scrolling */
}

#modal-body {
  width: 100%; /* Make sure content fits inside */
  word-wrap: break-word; /* Prevents long text from overflowing */
  overflow-x: hidden; /* Ensure no horizontal scroll */
}

/* Force all images to resize within the modal */
#modal-body img {
  max-width: 100%; /* Images will never be wider than the modal */
  height: auto; /* Maintain aspect ratio */
  display: block; /* Prevents inline spacing issues */
  margin: 0 auto; /* Center image inside the modal */
  max-height: 300px; /* Adjust this value to control image height */
  object-fit: contain; /* Ensures image stays fully visible */
}

.close-btn {
  float: right;
  font-size: 20px;
  cursor: pointer;
}

.wide-number-input {
  width: 35px;
  min-width: 35px;
  box-sizing: content-box;
  flex-shrink: 0;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0px 0px;
}

.setting-row input[type="number"],
.setting-row input[type="color"] {
  width: 35px;
}

.setting-row label {
  margin-left: 4px;
  white-space: nowrap;
}

.button-group {
  margin-left: auto;
  /* display: flex; */
  gap: 4px;
  transform: translateY(-8px); /* need to get box in right position */
}

.apply-current-btn {
  /* border: 1px solid #ccc; */
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  width: 20px;
  vertical-align: middle;
  box-sizing: border-box;
  /* transform: translateY(-8px); need to get box in right position */
}

.apply-current-btn:hover {
  background-color: #f0f0f0;
}

.apply-current-btn svg {
  width: 100%; /* 15px */
  height: 100%; /* 15px */
  display: block;
  stroke: black;
}

.modal-prompt {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(255, 255, 255, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-prompt-content {
  background-color: white;
  padding: 20px;
  border-radius: 8px;
  width: 50vw; /* Set width to 50% of viewport */
  max-width: 600px; /* Optional: prevent it from being too wide */
  min-width: 300px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: translateY(-100%);
}

.modal-prompt-hidden {
  display: none;
}

.modal-prompt-visible {
  display: flex;
}
