#top-lang-bar {
    position: fixed;
    top: 15px;
    right: 40px;
    z-index: 2147483647; /* Il valore massimo possibile in CSS */
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    pointer-events: auto; /* Fondamentale per ricevere i click */
}

#top-lang-bar a {
    text-decoration: none;
    transition: opacity 0.3s ease;
    pointer-events: auto; /* Forza la cliccabilità dei link */
}

#top-lang-bar .lang-btn {
    color: #ffffff;
    opacity: 0.5;
}

#top-lang-bar .lang-btn.active,
#top-lang-bar .lang-btn:hover {
    color: #d4af37;
    opacity: 1;
}

#top-lang-bar .lang-divider {
    color: #ffffff;
    opacity: 0.3;
}


/* ============================
   LAYOUT FISSO A SCHERMO INTERO (ZERO SCROLL)
   ============================ */

html, body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #111;
  font-family: 'Segoe UI', sans-serif;
  color: #fff;
}

body {
  display: flex;
  flex-direction: column;
}

header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.7);
  padding: 10px 20px;
  box-sizing: border-box;
}


@media (max-width: 768px) {
  .hide-on-mobile {
    display: none !important;
  }
}

.logo {
  height: 120px;
  margin-right: 15px;
}

main {
  flex: 1;
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: hidden;
}

#viewer-container {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#viewer-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

footer {
  flex-shrink: 0;
  background: rgba(0,0,0,0.8);
  text-align: center;
  padding: 5px;
  z-index: 10;
}


/* ============================
   GRUPPI HOTSPOT E FOTO FLUTTUANTI
   ============================ */

.hotspots-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.hotspot-group {
  position: absolute;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
}

.hotspot-photo {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  object-fit: cover;
  border: 3px solid #d4af37;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(212, 175, 55, 0.4);
  margin-bottom: 15px;
  pointer-events: auto;
  transition: transform 0.3s ease;
}

.hotspot-photo:hover {
  transform: scale(1.03);
}

.hotspot-item {
  pointer-events: auto;
  background: rgba(6, 15, 30, 0.85);
  border: 3px solid #d4af37;
  color: #ffffff;
  padding: 28px 56px;
  border-radius: 80px;
  font-family: 'Montserrat', sans-serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 2px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.hotspot-item:hover {
  background: #d66826;
  border-color: #ffffff;
  box-shadow: 0 0 40px rgba(214, 104, 38, 0.9);
  transform: scale(1.08);
}

.contact-spot {
  border-color: #d66826;
  background: rgba(214, 104, 38, 0.4);
  padding: 32px 68px;
  font-size: 36px;
}


/* ============================
   TOOLTIP INTERATTIVI AL HOVER
   ============================ */

.hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(10, 15, 25, 0.92);
  color: #f7e9b5;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1.5px;
  padding: 10px 18px;
  border: 1px solid #d4af37;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 5px 20px rgba(0,0,0,0.6);
  z-index: 100;
  text-transform: uppercase;
}

.hotspot-group:hover .hotspot-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}


/* ============================
   BUSSOLA / RADAR 3D
   ============================ */

#radar-compass {
  position: absolute;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: rgba(6, 15, 30, 0.85);
  border: 2px solid #d4af37;
  border-radius: 50%;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
  backdrop-filter: blur(6px);
}

#compass-needle {
  width: 2px;
  height: 35px;
  background: linear-gradient(to top, #d4af37 50%, #ffffff 50%);
  position: relative;
  transform-origin: bottom center;
  transition: transform 0.05s linear;
}

#radar-compass span {
  position: absolute;
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: #d4af37;
  top: 5px;
}


/* ============================
   POPUP MODALE CON TRANSIZIONE FLUIDA
   ============================ */

#modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
}

#modal-box {
  position: relative;
  width: 85vw;
  height: 85vh;
  background: rgba(10, 15, 25, 0.95);
  border: 3px solid #d4af37;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(212, 175, 55, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.92);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#modal-overlay.open {
  opacity: 1;
}

#modal-overlay.open #modal-box {
  transform: scale(1);
}

#modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: transparent;
  border: 2px solid #d4af37;
  color: #d4af37;
  font-size: 24px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

#modal-close:hover {
  background: #d4af37;
  color: #000;
}

#modal-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
}


/* ============================
   INDICATORE DI TRASCINAMENTO
   ============================ */

#drag-indicator {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0.85;
  transition: opacity 0.5s ease;
}

.drag-icon {
  width: 60px;
  height: 60px;
  border: 2px solid #d4af37;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 15, 30, 0.6);
  backdrop-filter: blur(5px);
  color: #d4af37;
  margin-bottom: 12px;
  animation: pulseDrag 2s infinite ease-in-out;
}

.drag-icon svg {
  width: 30px;
  height: 30px;
  animation: rotateIcons 6s linear infinite;
}

#drag-indicator span {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

@keyframes pulseDrag {
  0%, 100% { transform: scale(1); box-shadow: 0 0 15px rgba(212, 175, 55, 0.2); }
  50% { transform: scale(1.1); box-shadow: 0 0 30px rgba(212, 175, 55, 0.6); }
}

@keyframes rotateIcons {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-out {
  opacity: 0 !important;
  visibility: hidden;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}


/* ============================
   ANIMAZIONI ORO BANNER
   ============================ */

@keyframes glowBannerAligned {
  0% {
    filter: drop-shadow(-2px -2px 0 #000) drop-shadow(2px -2px 0 #000) drop-shadow(-2px 2px 0 #000) drop-shadow(2px 2px 0 #000) drop-shadow(0 0 6px rgba(212,175,55,0.0));
  }
  50% {
    filter: drop-shadow(-2px -2px 0 #000) drop-shadow(2px -2px 0 #000) drop-shadow(-2px 2px 0 #000) drop-shadow(2px 2px 0 #000) drop-shadow(0 0 25px rgba(212,175,55,0.9)) drop-shadow(0 0 45px rgba(214,104,38,0.7));
  }
  100% {
    filter: drop-shadow(-2px -2px 0 #000) drop-shadow(2px -2px 0 #000) drop-shadow(-2px 2px 0 #000) drop-shadow(2px 2px 0 #000) drop-shadow(0 0 6px rgba(212,175,55,0.0));
  }
}

.banner-oro-glow {
  animation: glowBannerAligned 3.4s ease-in-out infinite;
}




.hotspot-group {
    opacity: 0;
    transition: opacity 0.3s ease;
}


/* ==========================================================================
   INDICATORE DI NAVIGAZIONE 3D (WEB & MOBILE - INDIPENDENTE ITA/ENG)
   ========================================================================== */

/* Regole base comuni */
#drag-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    text-align: center;
}

/* --------------------------------------------------------------------------
   VERSIONE WEB / DESKTOP (> 768px)
   -------------------------------------------------------------------------- */
#drag-indicator.drag-it {
    top: 60%; /* Regola qui l'altezza web per l'italiano */
}

#drag-indicator.drag-en {
    top: 60%; /* Regola qui l'altezza web per l'inglese (es. 84% se vuoi alzarlo/abbassarlo) */
}

/* --------------------------------------------------------------------------
   VERSIONE MOBILE / SMARTPHONE (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  #drag-indicator.drag-it {
    top: 51% !important;
    transform: translateX(-50%) scale(0.75) !important;
  }

  #drag-indicator.drag-en {
    top: 29% !important;
    transform: translateX(-50%) scale(0.75) !important;
  }
}


@media (max-width: 768px) {
  /* Forza la riduzione su qualsiasi pulsante, link-bottone o input di tipo submit */
  a.btn, button, .filter-btn, input[type="submit"] {
    padding: 10px 24px !important;
    font-size: 14px !important;
    min-height: unset !important;
  }
}

@media (max-width: 768px) {
  /* Regola la posizione o la scala della toppa nadir su mobile */
  #nadir-patch, .nadir-logo {
    bottom: 15px !important; /* Spostala leggermente più in alto o in basso a seconda di dove è finita */
    transform: translateX(-50%) scale(0.9); /* Eventualmente riducila leggermente se con il FOV 100 risulta troppo grande */
  }
}
