/* */

/* Apply the same styles as input[type="text"] and input[type="number"] */
select {
  width: 100%; /* Match the width of inputs */
  max-width: 403px; /* Match the max-width of inputs */
  padding: 5px; /* Match the padding of inputs */
  margin: 3px 0; /* Match the margin of inputs */
  border: 1px solid #666; /* Match the border of inputs */
  border-radius: 5px; /* Match the border-radius of inputs */
  font-size: 16px; /* Match the font-size of inputs */
  font-family: Open Sans, sans-serif; /* Match the font-family of inputs */
  background-color: #555; /* Match the background-color of inputs */
  color: #fff; /* Match the text color of inputs */
  appearance: none; /* Remove default arrow */
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23fff" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>'); /* Custom arrow */
  background-repeat: no-repeat;
  background-position: right 8px center; /* Position of the arrow */
  padding-right: 30px; /* Add space for the arrow */
}

/* Focus state to match inputs */
select:focus {
  border-color: #777; /* Match the focus border color of inputs */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Match the focus box-shadow of inputs */
  outline: none; /* Remove default outline */
}

/* Style for disabled inputs */
input:disabled {
  background-color: #333; /* Darker background for disabled state */
  color: #888; /* Lighter text color for disabled state */
  border-color: #444; /* Adjust border color for disabled state */
  cursor: not-allowed; /* Change cursor to indicate it's not clickable */
  opacity: 0.7; /* Reduce opacity to make it look "disabled" */
}

/* Optional: Add a placeholder-like style for disabled inputs */
input:disabled::placeholder {
  color: #888; /* Match the placeholder color to the disabled text color */
}

/* Forms */
.container {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 10px;
  box-sizing: border-box;
  width: 100%;
}

form > div > input[type="text"] {
  width: calc(100% - 85px);
}

form > div > select {
  width: calc(100% - 73px);
}

form > div > input[type="number"] {
  width: calc(100% - 130px);
}

/* Input Styles */
form {
  display: block;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 15px;
  background-color: #333;
  border: 1px solid #555;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  max-width: 600px;
  width: 90%;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  max-width: 400px;
  padding: 5px;
  margin: 3px 0;
  border: 1px solid #666;
  border-radius: 5px;
  font-size: 16px;
  font-family: Open Sans, sans-serif;
  background-color: #555;
  color: #fff;
}

input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #777;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.unit {
  color: #fff;
  font-size: 14px;
  margin-left: 10px;
}

/* Miscellaneous */
.xml-title {
  font-size: 0.8em;
  font-weight: bold;
  color: #ffa07a; /* light orange color */
  margin-bottom: 0.1em; /* reduce the margin to 0.1em */
  padding: 15px;
  padding-bottom: 0px;
  display: inline-block; /* make the span an inline-block element to control its margin */
}

.xml-output-container {
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px;
  overflow-x: hidden;
}

#xml-output {
  white-space: pre;
  font-family: monospace;
  display: block;
  margin: 0 auto;
  box-sizing: border-box;
  border: 1px solid #333;
  background-color: #444;
  border-radius: 5px;
  color: #fff;
  overflow-y: auto;
  overflow-x: auto;
  margin-top: 10px;
  max-height: 90vh;
  width: 100%;
  max-width: 100%;
  padding: 15px;
}

/* Tooltips */

.tooltip {
  position: absolute;
  background-color: #444;
  color: #fff;
  padding: 5px;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 1;
  transition: opacity 0.2s;
  border: 1px solid #666;
}

.tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-width: 5px;
  border-style: solid;
  border-color: #444 transparent transparent transparent;
}

.button:hover .tooltip {
  visibility: visible;
  opacity: 1;
}

.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #222; /* dark background color */
  padding: 20px; /* increased padding for a wider popup */
  border: 1px solid #ccc;
  border-radius: 10px;
  display: none; /* hide the popup by default */
  max-width: 400px; /* set a fixed width for the popup */
  width: 95%; /* make the popup take the full width of its container */
  overflow-y: auto; /* add this line */
  max-height: 80vh; /* set a maximum height for the popup */
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.popup h2 {
  margin-top: 0;
  color: #fff;
}

.popup form {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popup label {
  margin-bottom: 2px; /* reduced margin */
  color: #fff;
}

.popup input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 5px; /* reduced padding */
  margin-bottom: 2px; /* reduced margin */
  border: 1px solid #ccc;
}

.popup button[type="button"] {
  width: 100%;
  padding: 5px; /* reduced padding */
  margin-top: 10px; /* reduced margin */
  border: none;
  border-radius: 10px;
  background-color: #4caf50;
  color: #fff;
  cursor: pointer;
}

.popup button[type="button"]:hover {
  background-color: #3e8e41;
}

.popup h3 {
  margin-top: 10px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #d0d0d0;
}

.popup-input {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.popup-input label {
  color: #aaaaaa;
  font-weight: bold;
  margin-right: 10px;
  width: 120px; /* adjust the width to fit your needs */
  text-align: right;
}

.popup-input .alt-text {
  font-size: 12px;
  color: #666;
  margin-right: 5px;
}

.popup-input input[type="text"] {
  padding: 5px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 100px; /* adjust the width to fit your needs */
}

.close-popup {
  font-size: 18px;
  cursor: pointer;
  position: absolute;
  top: 10px;
  right: 10px;
}

.close-popup:hover {
  color: #aaa;
}

/* Fix horizontal scrolling issues */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  padding: 0;
  margin: 0;
}
