:root{
  --bg:#0f1724;      /* scuro */
  --card:#0b1220;
  --muted:#9aa7b2;
  --accent:#2dd4bf;  /* turchese */
  --glass: rgba(255,255,255,0.04);
  --radius:12px;
}

html,body{
  height:100%;
  margin:0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:linear-gradient(180deg, #071226 0%, #071a2b 60%);
  color:#e6eef3;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

#top-banner, #footer, #main-content {
    text-align: center;
}

#top-banner {
    height: 6vh;
    padding: 2vh;
    align-content: center;
    display: flex;
    font-size: 4vh;
    justify-content: flex-end;
}

#top-menu {
    display: flex;
    align-items: center;
    max-width: 18vw;
}

#top-menu > * {
    padding-right: 5%;
}

#logo-title {
    font-size: 4vh;
    font-weight: bold;
    color: #eaf8f6;
    cursor: pointer;
    margin-right: auto ;
}

/* Search bar */
#searchbar {
  width:100%;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg,#071427 0%, #071827 100%);
  color:var(--muted);
  outline:none;
  transition: box-shadow .15s, border-color .15s;
  font-size:14px;
}
#searchbar:focus{
  box-shadow:0 4px 18px rgba(45,212,191,0.12);
  border-color:rgba(45,212,191,0.35);
  color:#eaf8f6;
}


#footer {
    height: 10vh;
    font-size: 3vh;
    background-color: #09244f;
    display: flex;
    align-items: center;
    justify-content: center;
    bottom: 0;
    width: 100%;
    position: absolute;
}

#main-content {
    height: 69vh;
}

/* map container */
.map-container{
  background:var(--glass);
  border-radius:var(--radius);
  box-shadow: 0 8px 30px rgba(2,6,23,0.7);
  height: 100%;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,0.04);
}

.place-searched-div {
  position: absolute;
  top: 10vh;
  z-index: 1000;
  right: 1vw;
  margin: 0;
  background-color:#0b1220;
  max-height: 60vh;
  border-radius: 0 0 10px 10px;
  overflow: scroll;
}

.place-searched-p {
  padding: 5%;
  margin: 0;
}

.place-searched-p:hover{
  cursor: pointer;
  background-color: #09244f;  
}

.info-panel {
  font-size: 10pt;
  position: absolute;
  top: 20vh;
  z-index: 999;
  right: 2%;
  background-color:#071a2b;
  padding: 2%;
  border-radius: 10px;
  max-width: 20vw;
  max-height: 45vh;
  overflow: scroll;
  box-shadow: 0 8px 30px rgba(2,6,23,0.7);
}

.info-panel-close {
  position: absolute;
  top: 5%;
  right: 5%;
  cursor: pointer;
  font-size: 1.2em;
  color: var(--muted);
  background-color:#09244f;
  padding: 1% 2%;
  border-radius: 5px;
}

.info-panel-close:hover {
  color: var(--accent);
}

.thematic-elements-div {
  position: absolute;
  bottom: 8vh;
  z-index: 999;
  max-height: 4vh !important;
  min-height: auto;
  display: flex;
  background-color: #0f1724;
  width: 94vw;
  padding: 2%;
  align-items: center;
  margin: 1%;
  border-radius: 15px;
}

.thematic-elements-div > h4 {
  font-size: 11pt;
  color: #9aa7b2;
  position: absolute;
  margin-top: -40px;
  font-weight: bold;
}

.thematic-element {
  margin: 2%;
  background-color: #071a2b;
  border-radius: 10px;
  padding: 0% 5%;
  text-align: center;
  font-size: 11pt;
  max-height: 8vh;
  align-content: center;
}

.thematic-element > h3 {
  font-size: 10pt;
  font-weight: normal;
}

.thematic-element:hover {
  cursor: pointer;
  background-color: #09244f;  
}

.timeline-panel {
  position: absolute;
  max-height: 52vh;
  overflow: scroll;
  top: 12vh;
  z-index: 1000;
  max-width: 30vw;
  background-color:#0b1220;
  left: 1vw;
  border-radius: 10px;
  padding: 2%;
  font-size: 10pt;
}

.timeline-entry {
  padding: 1%;
  text-align: justify;
}

.timeline-entry > img {
  border-radius: 10px;
  display: inline-block;
  max-width: 50%;
  max-height: 75px;
  margin: 1%;
}

.timeline-entry > img:hover {
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(45,212,191,0.5);
}

.timeline-entry:hover {
  cursor: pointer;
  background-color: #09244f;
}

.timeline-panel-close {
  position: absolute;
  top: 5%;
  right: 5%;
  cursor: pointer;
  font-size: 1.2em;
  color: var(--muted);
  background-color:#09244ff3;
  padding: 1% 2%;
  border-radius: 5px;
}

.document-overview-model, .document-overview-image {
  top: 4vh;
  left: 15vw;
  position: absolute;
  z-index: 2000;
  height: auto;
  max-height: 75vh !important;
  width: 70vw !important;
  background-color:#09244f;
  overflow: scroll;
  text-align: center;
  padding: 2%;
  border-radius: 20px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(2,6,23,0.7);
}

.document-overview-image > img {
  max-width: 100%;
  height: auto;
}


.document-overview-model > model-viewer {
  width: 100%;
  height: 80vh !important;
}

#model_viewer_div {
  min-height: 500px;
}

.document-overview {
  top: 4vh;
  left: 40vw;
  position: absolute;
  z-index: 2000;
  height: auto;
  max-height: 55vh !important;
  width: 30vw !important;
  background-color:#09244f;
  overflow: scroll;
  text-align: center;
  padding: 2%;
  border-radius: 20px;
  margin: 0 auto;
  box-shadow: 0 8px 30px rgba(2,6,23,0.7);
}

.document-overview img {
  max-width: 90%;
  height: auto;
  margin: 2% 0;
} 

#method {
  color: var(--muted);
  margin-right: 1%;
  align-self: center;
  font-size: 2.5vh;
  border-radius: 10px;
  border: solid thin #3498db;
  padding: 0.5vh 1vh;
  font-weight: 600;
}

#method:hover {
  cursor: pointer;
  background-color: #3498db;  
}

.animation-name-span {
  background-color: #0f1724;
  color: var(--muted);
  margin-right: 1%;
  align-self: center;
  font-size: 2.5vh;
  border-radius: 10px;
  border: solid thin #3498db;
  padding: 0.5vh 1vh;
  font-weight: 600;
  font-size: 12pt;
}

.animation-name-span:hover {
  cursor: pointer;
  background-color: #3498db;  
} 

.model-viewer-controls {
  display: flex;
  justify-content: center;
  position: absolute;
  top: 10vh;
  width: 60vw;
  z-index: 3000;
  flex-wrap: wrap;
  gap: 1vh;
}

a {
  color:#9aa7b2;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5); /* overlay semi-trasparente */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  visibility: hidden; /* nascosto di default */
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#loading-overlay.active {
  visibility: visible;
  opacity: 1;
}

.spinner {
  border: 6px solid #f3f3f3; /* colore esterno */
  border-top: 6px solid #3498db; /* colore spinner */
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}