html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

#model-container {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;  /* Align elements at the top */
  align-items: center;         /* Center the model horizontally */
  height: 100%;                /* Full height of the viewport */
  width: 100%;                 /* Full width of the viewport */
}

model-viewer {
  width: 100%;     /* Adjust the width of the model */
  height: 100%;    /* Adjust the height of the model */
  background-color: #080808; /* Ensure the background is black */
  display: block;
}


.annotation-display {
  position: relative;
  bottom: 5px;       /* Ensures it's at the bottom of the container */
  left: 13%;
  transform: translateX(-50%);
  padding: 5px;
  background-color: transparent;
  border-radius: 10px;
  font-family: Futura, Helvetica Neue, sans-serif;
   text-align: justify;
  overflow-wrap: break-word;
  width: 35%;          /* Adjust to make the annotation box not too narrow */
  max-width: 300px;    /* Ensures a readable width */
  z-index: 10;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
}

.annotation-title {
  font-weight: 300;
}

.annotation-body {
  font-weight: 200;
  text-align: justify; /* Ensures text is justified */
  display: block; /* Ensures proper rendering */
  word-wrap: break-word; /* Ensures long words break correctly */
}

.annotation-body p {
  margin-bottom: 10px; /* Adds space between each paragraph */
}

.annotation-body strong {
  font-weight: bold; /* Makes "Origin:", "Insertion:", etc. bold */
}



.Hotspot {
  background: white;
  border-radius: 28px;
  border: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  box-sizing: border-box;
  cursor: pointer;
  height: 18px;
  padding: 8px;
  position: relative;
  transition: opacity 0.3s;
  width: 18px;
}

.Hotspot:not([data-visible]) {
  background: transparent;
  border: 0;
  box-shadow: none;
  height: 32px;
  pointer-events: none;
  width: 32px;
}

.Hotspot:focus {
  border: 2px solid rgb(0, 128, 200);
  height: 24px;
  outline: none;
  width: 24px;
}

.Hotspot > * {
  opacity: 1;
  transform: translateY(-50%);
}

.HotspotAnnotation {
  display: none; /* Initially hide all annotations */
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  color: rgba(0, 0, 0, 0.8);
  font-family: Futura, Helvetica Neue, sans-serif;
  font-size: 12px;
  font-weight: 700;
  max-width: 128px;
  overflow-wrap: break-word;
  padding: 0.5em 1em;
  position: absolute;
  left: 30px; /* Adjust this value to position the title beside the hotspot */
  top: 50%; /* This will place it at the middle vertically */
  width: max-content;  
  z-index: 1; /* Ensure it stays on top of other elements */
}

.annotation-title {
font-weight: 250;
}

.annotation-body {
  font-weight: 200;
  display: none; /* Hide initially, will be shown below the model */
}

/* Style the section where the body content will be displayed below the model */
.annotation-display {
  margin-top: 10px;
  padding: 5px;
  background-color: #f5f5f5; opacity: 0.5;
  border-radius: 5px;
  font-family: Futura, Helvetica Neue, sans-serif;
}


.Hotspot:not([data-visible]) > * {
  opacity: 0;
  pointer-events: none;
  transform: translateY(calc(-50% + 4px));
  transition: transform 0.3s, opacity 0.3s;
}

.progress-bar {
  display: block;
  width: 33%;
  height: 10%;
  max-height: 2%;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate3d(-50%, -50%, 0);
  border-radius: 25px;
  box-shadow: 0px 3px 10px 3px rgba(0, 0, 0, 0.5), 0px 0px 5px 1px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  background-color: rgba(0, 0, 0, 0.5);
}

.progress-bar.hide {
  visibility: hidden;
  transition: visibility 0.3s;
}

.update-bar {
  background-color: rgba(255, 255, 255, 0.9);
  width: 0%;
  height: 100%;
  border-radius: 25px;
  float: left;
  transition: width 0.3s;
}

#ar-button {
  background-image: url(ar_icon.png);
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-position: 12px 50%;
  background-color: #fff;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  bottom: 16px;
  padding: 0px 16px 0px 40px;
  font-family: Roboto Regular, Helvetica Neue, sans-serif;
  font-size: 14px;
  color: #4285f4;
  height: 36px;
  line-height: 36px;
  border-radius: 18px;
  border: 1px solid #DADCE0;
}

#ar-button:active {
  background-color: #E8EAED;
}

#ar-button:focus {
  outline: none;
}

#ar-button:focus-visible {
  outline: 1px solid #4285f4;
}

@keyframes circle {
  from { transform: translateX(-50%) rotate(0deg) translateX(50px) rotate(0deg); }
  to   { transform: translateX(-50%) rotate(360deg) translateX(50px) rotate(-360deg); }
}

@keyframes elongate {
  from { transform: translateX(100px); }
  to   { transform: translateX(-100px); }
}

model-viewer > #ar-prompt {
  position: absolute;
  left: 50%;
  bottom: 60px;
  animation: elongate 2s infinite ease-in-out alternate;
  display: none;
}

model-viewer[ar-status="session-started"] > #ar-prompt {
  display: block;
}

model-viewer > #ar-prompt > img {
  animation: circle 4s linear infinite;
}



/* Responsive Design for Different Screen Sizes */

/* For small screens (phones) */
@media (max-width: 600px) {
  model-viewer {
    width: 100%;
    height: 60vh; /* Adjust the height for better view on small screens */
  }

  .annotation-display {
    width: 40%; /* Make annotation display take full width */
    max-width: none; /* Remove max-width restriction */
    left: 25%;
    transform: translateX(-50%);
  }

  .HotspotAnnotation {
    left: 10px; /* Adjust positioning for small screens */
    max-width: 100px;
  }

  #toggleHotspotsButton, button {
    font-size: 12px;
    padding: 8px;
  }
}

/* For tablets */
@media (min-width: 601px) and (max-width: 1024px) {
  model-viewer {
    width: 100%;
    height: 70vh;
  }

  .annotation-display {
    width: 100%;
    max-width: 250px;
    left: 20%;
  }

  .HotspotAnnotation {
    left: 12px;
    max-width: 120px;
  }
}

/* For larger screens */
@media (min-width: 1025px) {
  model-viewer {
    width: 100%;
    height: 80vh;
  }

  .annotation-display {
    width: 60%;
    max-width: 300px;
    left: 13%;
  }
}



.annotation-display {
  max-height: 80%; /* Set a max height for the box */
  overflow-y: auto; /* Enable vertical scrolling */
  padding: 10px;
  border: 1px solid #ccc; /* Optional: adds a border */
  background-color: white; /* Optional: better readability */
}

/* Custom scrollbar styling (optional) */
.annotation-display::-webkit-scrollbar {
  width: 8px; /* Scrollbar width */
}

.annotation-display::-webkit-scrollbar-thumb {
  background: #888; /* Scrollbar color */
  border-radius: 4px;
}

.annotation-display::-webkit-scrollbar-thumb:hover {
  background: #555; /* Scrollbar color on hover */
}


