/* Global Reset & Base Styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  /*background: linear-gradient(to bottom right, #e5e5e5, #fcfcfc);*/
  background-color: #ffffff;
}

@media only screen and (max-width:600px) {
  div.coords { display:none }
}

.banner {
  margin-top: 1em;
  display: block;
}

.banner img {
  display:block;
  width: auto;
  max-height: 50px;
  margin: 0 auto;
}

@font-face{
  font-family:'Akkurat-Light';
  src:
  url('./fonts/Akkurat-Light.ttf') format('ttf'),
  url('./fonts/Akkurat-Light.woff') format('woff'),
  url('./fonts/Akkurat-Light.woff2') format('woff2');
  font-display:swap;
  font-style:normal;
  font-weight:400;
}

.layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  margin-top: 1em;
}

.map-and-slider {
  position: relative;
  width: 100%;
  max-width: 1000px; /* optional */
  min-height: 40vh;
  aspect-ratio: 16 / 9; /* set desired ratio or use a fixed height instead */
}

.map-wrapper {
  display: relative;
  width: 100%;
  height: 90%;
  border-radius: 2vh;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

#map {
  height: 100%;
  width: 100%;
}

#search-icon {
  position: absolute;
  top: 10px;
  left: 50%;
  translate: -50%;
  background: rgba(250, 250, 250, 0.95);
  padding: 8px 2px 8px 12px;
  border-radius: 8px;
  display: flex;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  align-items: center;
}

#search-input {
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
}

.radius-wrapper {
  width: 100%;
  height: 10%;
  margin-top: -10px;
  padding: 20px 5px 10px 5px;
  background: #f4f4f4;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: left;
  color: #333333;
  min-height: 50px;
}

.value {
  display: inline-flex;
  flex-wrap: nowrap;
  text-wrap: nowrap;
  inline-size: 4ch;
}
#radius-slider {
  width: 100%;
  height: 40%;
  padding: 10px 0px;
  align-items: center;
  accent-color: #687363;
}

.radius-wrapper label {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 500;
  text-wrap: nowrap;
  margin-right: 5px;
  margin-left: 15px;
}

.coords {
  display: flex;
  flex-wrap: nowrap;
  width:fit-content;
  justify-content: left;
  font-size: 12px;
  font-weight: 300;
  padding: 2px;
}

.coords > label {
  margin-left: 1vw;
}
.coords > input {
  max-width: 70px;
  border-radius: 5px;
  border: none;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 300;
  width:fit-content;
}

#radius-num{
  max-width:25px;
  border-radius: 5px;
  border: none;
  background-color: #ffffff;
  font-size: 12px;
  font-weight: 300;
  width:fit-content;
}

/*
input[type="text"] {
  width: 100%;
  padding: 5px 6px;
  border-radius: 5px;
  border: 1px solid #cccccc;
  font-size: 13px;
  background: #ffffff;
  color: #222222;
}
*/

#engraving-wrapper {
  z-index: 3;
  position: absolute;
  display: flex;
  justify-content: center;
  width: 250px;
  text-align: center;
  bottom: 15px;
  height: 40px;
  left: 50%;
  translate: -50%;
  padding: 10px;
  border-radius: 8px;
  background-color: #e2d2c2;
  border: 1px solid #6f7764;
}
#engraving {
  border: none;
  background: none;
  text-align: center;
  min-width: calc(100% + 20px);
  min-height: calc(100% + 20px);
  translate: 0 -10px;
}
#engraving::placeholder {
  text-align: center;
}
#engraving-wrapper:hover {
  background-color: #f2e2d2;
}

.checkbox {
  text-align: right;
}

.advanced-toggle-wrapper {
  display: flex;
  align-items: center;
  margin-left: 20px;
}

.advanced-toggle-wrapper label {
  font-size: 10px;
  font-weight: 400;
  color: #666666;
  margin-left: 5px;
}


#advanced-settings {
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px 8px;
  text-align: left;
  font-size: 12px;
  margin-top: 10px;
  margin-bottom: 0px;
}


.field {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  flex: 0 1 auto;
}

#advanced-settings label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}
#advanced-settings input {
  accent-color: #687363;
}

#falloff-tooltip {
  margin-right: -17px;
}


#viewer {
  position: relative;
  min-height: 40vh;
  margin-top: 30px;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  flex: 0 0 auto; /* prevent flex from squishing it */
  border-radius: 2vh;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

#viewer > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#loadModelBtn {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 10px 20px;
  background: #6f7764;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  z-index: 9;
}

#loadModelBtn.running {
  background: #8f9784;
}

#loadModelBtn:hover {
  background: #8f9784;
}

.box {
  background: #f5f5f5;
  padding: 30px;
  text-align: center;
  border-radius: 8px;
  color: #333333;
}

#confirm-box {
  margin-top: 40px;
  background-color: #687363;
  color: white;
  font-size: 90%;
  padding: 20px;
  /*position: relative;
  right: 2%;
  bottom: 5%;
  height: auto;*/
  width: 250px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

#submit-model-button {
  margin-top: 10px;
  padding: 8px 16px;
  background-color: white;
  color: #6f7764;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

#submit-model-button:hover {
  background-color: #dfe7d4;
}

#access-code {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  border-radius: 6px;
  border: 1px solid #687363;
  background: #f0fff0;
  color: #003300;
  font-weight: bold;
}

#spinner {
  width: 24px;
  height: 24px;
  top: 17.5px;
  left: 140px;
  border: 3px solid rgba(0, 0, 0, 0.15); /* base ring */
  border-top-color: #666666;             /* visible part */
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  position: absolute;
  z-index: 9;
  display: none;
}

.footer {
  display: flex;
  background-color: #1f1f1f;
  width: 100%;
  height: 140px;
  max-height: 20vh;
  justify-content: left;
}
.footer p {
  display: inline-block;
  margin-left: 30px;
  margin-top: 15px;
  text-align: left;
  font-size: 19px;
  color: white;
  font-weight: 330;
}
.gradient {
  width: 100%;
  height: 10px;
  margin-top: 50px;
  background: #1F1F1F;
  background: linear-gradient(0deg, rgba(31, 31, 31, 1) 1%, rgba(255, 255, 255, 1) 100%);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: default;
  vertical-align: middle;
  color: rgba(50, 50, 50, 0.6);
}

/* Tooltip bubble */
.tooltip .tooltiptext {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;


  position: absolute;
  top: 50%;
  left: calc(100% + 6px);

  z-index: 1;

  font-size: small;
  line-height: 1.4;
  color: rgba(50, 50, 50, 0.85);
  background: #fff;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px;
  padding: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);

  /* keep inside screen */
  width: 150px;
  white-space: normal;
  overflow-wrap: break-word;
}

/* Show on hover */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

