:root {
  --nav-h: 56px;
  --nav-h-mobile: 62px;
  --nav-bg: rgba(0, 0, 0, 0.38);
  --nav-border: rgba(255, 255, 255, 0.14);
  --nav-blur: 28px;
  --nav-shadow: 0 2px 20px rgba(0, 0, 0, 0.22);
  --focus-ring: rgba(255, 255, 255, 0.85);
  --text: #fafafa;
  --text-muted: rgba(255, 255, 255, 0.5);
  --panel-bg: rgba(0, 0, 0, 0.36);
  --panel-border: rgba(255, 255, 255, 0.1);
  --btn-ghost-hover: rgba(255, 255, 255, 0.12);
  --btn-active: rgba(255, 255, 255, 0.18);
  --btn-active-border: rgba(255, 255, 255, 0.22);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --dock-bg: rgba(0, 0, 0, 0.34);
  --transition-fast: 0.2s ease;
  --scene-drawer-w: 288px;
}

* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -ms-text-size-adjust: none;
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  -ms-content-zooming: none;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

html, body {
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 16px;
  background-color: #0a0a0a;
  color: var(--text);
}

a, a:hover, a:active, a:visited {
  text-decoration: none;
  color: inherit;
}

#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* ——— Barra superior (navbar) ——— */

.app-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-h);
  padding: 8px 12px;
  background: var(--nav-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border-bottom: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
}

.mobile .app-navbar {
  min-height: var(--nav-h-mobile);
  padding: 10px 12px;
}

.nav-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

body.fullscreen-disabled .nav-tools {
  display: none;
}

.nav-title-cluster {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
  padding: 0 8px;
}

.nav-brand {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

#titleBar .sceneName {
  width: 100%;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  background: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.mobile #titleBar .sceneName {
  font-size: 0.88rem;
}

.nav-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: inherit;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform 0.15s ease;
}

.nav-icon-btn:hover {
  background: var(--btn-ghost-hover);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-icon-btn:active {
  transform: scale(0.96);
}

.nav-icon-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.mobile .nav-icon-btn {
  width: 48px;
  height: 48px;
}

.nav-icon-btn .icon {
  position: absolute;
  width: 26px;
  height: 26px;
  object-fit: contain;
  opacity: 0.92;
}

.mobile .nav-icon-btn .icon {
  width: 28px;
  height: 28px;
}

.mars2-vr-btn {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text);
}

.mars2-vr-btn.active {
  background: var(--btn-active);
  border-color: var(--btn-active-border);
}

#fullscreenToggle {
  display: none;
}

body.fullscreen-enabled .nav-tools #fullscreenToggle {
  display: flex;
}

#fullscreenToggle .icon.on,
#sceneListToggle .icon.on {
  display: none;
}

#fullscreenToggle .icon.off,
#sceneListToggle .icon.off {
  display: block;
}

#fullscreenToggle.enabled .icon.on,
#sceneListToggle.enabled .icon.on {
  display: block;
}

#fullscreenToggle.enabled .icon.off,
#sceneListToggle.enabled .icon.off {
  display: none;
}

#sceneListToggle.enabled {
  background: var(--btn-active);
  border-color: var(--btn-active-border);
}

/* ——— Panel lateral de escenas ——— */

#sceneList {
  position: fixed;
  top: 0;
  left: calc(-1 * var(--scene-drawer-w));
  padding-top: var(--nav-h);
  width: var(--scene-drawer-w);
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  margin-left: 0;
  z-index: 350;
  -webkit-transition: margin-left 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  transition: margin-left 0.42s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.18);
}

.mobile #sceneList {
  padding-top: var(--nav-h-mobile);
}

#sceneList .scenes {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 10px 0 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid var(--panel-border);
  border-bottom-right-radius: var(--radius-md);
}

.mobile #sceneList {
  width: 100%;
  height: 100%;
  left: -100%;
  border-bottom-right-radius: 0;
}

.mobile #sceneList.enabled {
  margin-left: 100%;
}

.mobile #sceneList .scenes {
  height: 100%;
  border-bottom-right-radius: 0;
}

#sceneList.enabled {
  margin-left: var(--scene-drawer-w);
}

#sceneList .scene {
  display: block;
  min-height: 40px;
  margin: 0 8px;
  width: calc(100% - 16px);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.mobile #sceneList .scene {
  min-height: 44px;
}

#sceneList .scene .text {
  width: 100%;
  height: 100%;
  min-height: 40px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  line-height: 1.3;
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: inherit;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.mobile #sceneList .scene .text {
  min-height: 44px;
  font-size: 0.9rem;
}

.no-touch #sceneList .scene:hover {
  background: var(--btn-ghost-hover);
}

#sceneList .scene.current {
  background: var(--btn-active);
  color: #fff;
  box-shadow: inset 0 0 0 1px var(--btn-active-border);
}

#sceneList .scene-nuvola-link {
  margin-top: auto;
  border-top: 1px solid var(--panel-border);
  padding-top: 10px;
}

#sceneList .scene-nuvola-link .text {
  gap: 0;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #9aa6bf;
  font-family: "Segoe UI", "Inter", "Plus Jakarta Sans", sans-serif;
  letter-spacing: 0.02em;
  line-height: 1.2;
  padding-top: 4px;
  padding-bottom: 6px;
}

#sceneList .scene-nuvola-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* Hide scene list when only a single scene exists */
body.single-scene #sceneList, body.single-scene #sceneListToggle {
  display: none;
}

/* Link hotspot */

.link-hotspot {
  width: 60px;
  height: 60px;
  margin-left: -30px;
  margin-top: -30px;
  opacity: 0.9;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}

.no-touch .link-hotspot:hover {
  opacity: 1;
}

.mobile .link-hotspot {
  width: 70px;
  height: 70px;
}

.link-hotspot-icon {
    width: 100%;
    height: 100%;
    cursor: pointer;
    --hotspot-rotation: 0rad;
    border-radius: 50%; 
    
    /* Fondo blanco difuminado */
    background-color: rgba(255, 255, 255, 0.226);
    backdrop-filter: blur(4px); 
    
    /* Animaciones */
    animation: 
        moveUpDown 1.5s ease-in-out infinite,
        glowBreathe 3s ease-in-out infinite;
        
    transform: translateY(0) rotate(var(--hotspot-rotation));
}

.link-hotspot-icon[src$=".gif"],
.link-hotspot-icon[src$=".GIF"] {
  animation: none;
  transform: rotate(var(--hotspot-rotation));
}

@keyframes glowBreathe {
    0%, 100% {
        /* Sombra muy pegada al borde, casi invisible */
        box-shadow: 0 0 0 0px rgba(0, 0, 0, 0.4), 
                    0 0 5px rgba(0, 0, 0, 0.2);
        transform: translateY(0) rotate(var(--hotspot-rotation)) scale(0.95);
    }
    50% {
        /* Sombra expandida: el tercer valor (20px) es la expansión hacia afuera */
        box-shadow: 0 0 0 15px rgba(0, 0, 0, 0), 
                    0 0 30px rgba(0, 0, 0, 0.6);
        transform: translateY(0) rotate(var(--hotspot-rotation)) scale(1.05);
    }
}

@keyframes moveUpDown {
  0% {
    transform: translateY(0) rotate(var(--hotspot-rotation));
  }
  50% {
    transform: translateY(-8px) rotate(var(--hotspot-rotation));
  }
  100% {
    transform: translateY(0) rotate(var(--hotspot-rotation));
  }
}

.link-hotspot-tooltip {
  position: absolute;
  left: 100%;
  top: 14px; /* ( 60 - (16 + 2*8) ) / 2 */

  margin-left: 3px;

  font-size: 16px;

  max-width: 300px;

  padding: 8px 10px;

  border-radius: 5px;

  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);

  color: #fff;

  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;

  cursor: pointer;

  opacity: 0;

  -ms-transform: translateX(-8px);
  -webkit-transform: translateX(-8px);
  transform: translateX(-8px);

  -webkit-transition: -ms-transform 0.3s,
                      -webkit-transform 0.3s,
                      transform 0.3s,
                      opacity 0.3s;
  transition: -ms-transform 0.3s,
              -webkit-transform 0.3s,
              transform 0.3s,
              opacity 0.3s;
}

.mobile .link-hotspot {
  top: 19px; /* ( 70 - (16 + 2*8) ) / 2 */
}

.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  -ms-transform: translateX(0);
  -webkit-transform: translateX(0);
  transform: translateX(0);
}

/* Prevent tooltip from triggering */
.link-hotspot-tooltip {
  pointer-events: none;
}
.no-touch .link-hotspot:hover .link-hotspot-tooltip {
  pointer-events: all;
}

/* Fallback mode without pointer-events (IE8-10) */
.tooltip-fallback .link-hotspot-tooltip {
  display: none;
}
.no-touch .tooltip-fallback .link-hotspot:hover .link-hotspot-tooltip {
  display: block;
}

/* Info hotspot */

.info-hotspot {
  line-height: 1.2em;
  opacity: 0.9;
  -webkit-transition: opacity 0.2s 0.2s;
  transition: opacity 0.2s 0.2s;
}

.no-touch .info-hotspot:hover {
  opacity: 1;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}

.info-hotspot.visible {
  opacity: 1;
}

.info-hotspot .info-hotspot-header {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background-color: rgb(103,115,131);
  cursor: pointer;
  -webkit-transition: width 0.3s ease-in-out 0.5s,
                      border-radius 0.3s ease-in-out 0.5s;
  transition: width 0.3s ease-in-out 0.5s,
              border-radius 0.3s ease-in-out 0.5s;
}

.mobile .info-hotspot .info-hotspot-header {
  width: 50px;
  height: 50px;
  border-radius: 25px;
}

.desktop.no-touch .info-hotspot .info-hotspot-header:hover {
  width: 260px;
  border-radius: 5px;
  -webkit-transition: width 0.3s ease-in-out,
                      border-radius 0.3s ease-in-out;
  transition: width 0.3s ease-in-out,
              border-radius 0.3s ease-in-out;
}

.desktop .info-hotspot.visible .info-hotspot-header,
.desktop.no-touch .info-hotspot.visible .info-hotspot-header:hover {
  width: 260px;
  border-radius: 5px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  -webkit-transition: width 0.3s ease-in-out,
                      border-radius 0.3s ease-in-out;
  transition: width 0.3s ease-in-out,
              border-radius 0.3s ease-in-out;
}

.info-hotspot .info-hotspot-icon-wrapper {
  width: 40px;
  height: 40px;
}

.mobile .info-hotspot .info-hotspot-icon-wrapper {
  width: 50px;
  height: 50px;
}

.info-hotspot .info-hotspot-icon {
  width: 90%;
  height: 90%;
  margin: 5%;
}

.info-hotspot .info-hotspot-title-wrapper {
  position: absolute;
  left: 40px;
  top: 0;
  width: 0;
  height: 40px;
  padding: 0;
  overflow: hidden;
  -webkit-transition: width 0s 0.4s,
                      padding 0s 0.4s;
  transition: width 0s 0.4s,
              padding 0s 0.4s;
}

.desktop .info-hotspot.visible .info-hotspot-title-wrapper,
.desktop.no-touch .info-hotspot .info-hotspot-header:hover .info-hotspot-title-wrapper {
  width: 220px;
  padding: 0 5px;
  -webkit-transition: width 0s 0.4s,
                      padding 0s 0.4s;
  transition: width 0s 0.4s,
              padding 0s 0.4s;
}

.info-hotspot .info-hotspot-title-wrapper:before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  height: 100%;
}

.info-hotspot .info-hotspot-title {
  display: inline-block;
  vertical-align: middle;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.info-hotspot .info-hotspot-close-wrapper {
  position: absolute;
  left: 260px;
  top: 0;
  height: 40px;
  width: 40px;
  border-top-right-radius: 5px;
  background-color: rgb(78,88,104);
  visibility: hidden;
  -ms-transform: perspective(200px) rotateY(90deg);
  -webkit-transform: perspective(200px) rotateY(90deg);
  transform: perspective(200px) rotateY(90deg);
  -ms-transform-origin: 0 50% 0;
  -webkit-transform-origin: 0 50% 0;
  transform-origin: 0 50% 0;
  -webkit-transition: -ms-transform 0.3s 0.3s,
                      -webkit-transform 0.3s 0.3s,
                      transform 0.3s 0.3s,
                      visibility 0s 0.6s;
  transition: -ms-transform 0.3s 0.3s,
              -webkit-transform 0.3s 0.3s,
              transform 0.3s 0.3s,
              visibility 0s 0.6s;
}

.desktop .info-hotspot.visible .info-hotspot-close-wrapper {
  visibility: visible;
  -ms-transform: perspective(200px) rotateY(0deg);
  -webkit-transform: perspective(200px) rotateY(0deg);
  transform: perspective(200px) rotateY(0deg);
  -webkit-transition: -ms-transform 0.3s,
                      -webkit-transform 0.3s,
                      transform 0.3s,
                      visibility 0s 0s;
  transition: -ms-transform 0.3s,
              -webkit-transform 0.3s,
              transform 0.3s,
              visibility 0s 0s;
}

.info-hotspot .info-hotspot-close-icon {
  width: 70%;
  height: 70%;
  margin: 15%;
}

.info-hotspot .info-hotspot-text {
  position: absolute;
  width: 300px;
  height: auto;
  max-height: 200px;
  top: 40px;
  left: 0;
  padding: 10px;
  background-color: rgb(58,68,84);
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  overflow-y: auto;
  visibility: hidden;
  /* rotate(90deg) causes transition flicker on Firefox 58 */
  -ms-transform: perspective(200px) rotateX(-89.999deg);
  -webkit-transform: perspective(200px) rotateX(-89.999deg);
  transform: perspective(200px) rotateX(-89.999deg);
  -ms-transform-origin: 50% 0 0;
  -webkit-transform-origin: 50% 0 0;
  transform-origin: 50% 0 0;
  -webkit-transition: -ms-transform 0.3s,
                      -webkit-transform 0.3s,
                      transform 0.3s,
                      visibility 0s 0.3s;
  transition: -ms-transform 0.3s,
              -webkit-transform 0.3s,
              transform 0.3s,
              visibility 0s 0.3s;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.desktop .info-hotspot.visible .info-hotspot-text {
  visibility: visible;
  -ms-transform: perspective(200px) rotateX(0deg);
  -webkit-transform: perspective(200px) rotateX(0deg);
  transform: perspective(200px) rotateX(0deg);
  -webkit-transition: -ms-transform 0.3s 0.3s,
                      -webkit-transform 0.3s 0.3s,
                      transform 0.3s 0.3s,
                      visibility 0s 0s;
  transition: -ms-transform 0.3s 0.3s,
              -webkit-transform 0.3s 0.3s,
              transform 0.3s 0.3s,
              visibility 0s 0s;
}

/* Info hotspot modal */

.desktop .info-hotspot-modal {
  display: none;
}

.info-hotspot-modal {
  top: 0;
  left: 0;
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 11000 !important;
  background-color: rgba(0,0,0,.5);
  line-height: 1.2em;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.2s ease-in-out 0.5s,
                      visibility 0s 0.7s;
  transition: opacity 0.2s ease-in-out 0.5s,
              visibility 0s 0.7s;
}

.info-hotspot-modal.visible {
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.2s ease-in-out,
                      visibility 0s 0s;
  transition: opacity 0.2s ease-in-out,
              visibility 0s 0s;
}

.info-hotspot-modal .info-hotspot-header {
  position: absolute;
  top: 60px;
  left: 10px;
  right: 10px;
  width: auto;
  height: 50px;
  background-color: rgb(103,115,131);
  background-color: rgba(103,115,131,0.8);
  opacity: 0;
  -webkit-transition: opacity 0.3s ease-in-out 0.2s;
  transition: opacity 0.3s ease-in-out 0.2s;
}

.info-hotspot-modal.visible .info-hotspot-header {
  opacity: 1;
  -webkit-transition: opacity 0.3s ease-in-out 0.2s;
  transition: opacity 0.3s ease-in-out 0.2s;
}

.info-hotspot-modal .info-hotspot-icon-wrapper {
  width: 50px;
  height: 50px;
}

.info-hotspot-modal .info-hotspot-icon {
  width: 90%;
  height: 90%;
  margin: 5%;
}

.info-hotspot-modal .info-hotspot-title-wrapper {
  position: absolute;
  top: 0;
  left: 50px;
  right: 50px;
  width: auto;
  height: 50px;
  padding: 0 10px;
}

.info-hotspot-modal .info-hotspot-title-wrapper:before {
  content: '';
  display: inline-block;
  vertical-align: middle;
  height: 100%;
}

.info-hotspot-modal .info-hotspot-title {
  display: inline-block;
  vertical-align: middle;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.info-hotspot-modal .info-hotspot-close-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 50px;
  height: 50px;
  background-color: rgb(78,88,104);
  background-color: rgba(78,88,104,0.8);
  cursor: pointer;
}

.info-hotspot-modal .info-hotspot-close-icon {
  width: 70%;
  height: 70%;
  margin: 15%;
}

.info-hotspot-modal .info-hotspot-text {
  position: absolute;
  top: 110px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  padding: 10px;
  background-color: rgb(58,68,84);
  background-color: rgba(58,68,84,0.8);
  overflow-y: auto;
  opacity: 0;
  -webkit-transition: opacity 0.3s ease-in-out;
  transition: opacity 0.3s ease-in-out;

  -moz-user-select: text;
  -webkit-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

.info-hotspot-modal.visible .info-hotspot-text {
  opacity: 1;
  -webkit-transition: opacity 0.3s ease-in-out 0.4s;
  transition: opacity 0.3s ease-in-out 0.4s;
}

/* View control dock */

.view-controls-dock {
  display: none;
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--dock-bg);
  backdrop-filter: blur(var(--nav-blur));
  -webkit-backdrop-filter: blur(var(--nav-blur));
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

body.view-control-buttons .view-controls-dock {
  display: flex;
}

@media (max-width: 600px) {
  body.view-control-buttons .view-controls-dock {
    display: none;
  }
}

.viewControlButton {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.viewControlButton:hover {
  background: var(--btn-ghost-hover);
  border-color: rgba(255, 255, 255, 0.06);
}

.viewControlButton .icon {
  position: absolute;
  width: 24px;
  height: 24px;
  object-fit: contain;
  opacity: 0.9;
}

.viewControlButton-1,
.viewControlButton-2,
.viewControlButton-3,
.viewControlButton-4,
.viewControlButton-5,
.viewControlButton-6 {
  margin-left: 0;
}
