@import url(https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap);

:root {
  --emerald-900: #064e3b;
  --emerald-800: #065f46;
  --emerald-700: #047857;
  --emerald-600: #059669;
  --emerald-500: #10b981;
  --emerald-400: #34d399;
  --emerald-300: #6ee7b7;
  --emerald-200: #a7f3d0;
  --emerald-100: #d1fae5;
  --emerald-50: #ecfdf5;
  --overlay: rgba(6, 95, 70, 0.85);
  --overlay-dark: #064e3bcb;
  --text-light: var(--emerald-50);
  --text-dark: var(--emerald-900);
  --shadow-sm: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  --shadow-md: 0 1rem 2rem rgba(0, 0, 0, 0.15);
  --border-radius-sm: 0.5rem;
  --border-radius-md: 1rem;
  --border-radius-lg: 1.5rem;
  --transition-standard: all 0.3s ease-in-out;
  --font-weight-bold: 700;
}

/* Base styles */
* {
  box-sizing: border-box;
  user-select: none;
  text-size-adjust: none;
  -webkit-tap-highlight-color: transparent;
}

body, html {
  padding: 0;
  margin: 0;
  font-family: "Geist", sans-serif;
  font-size: 16px;
  background-color: #000;
  color: var(--text-light);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

/* Pano container */
#pano {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Title bar */
#titleBar {
  position: absolute;
  top: 0;
  left: 0;
  right: 2rem;
  height: 2.5rem;
  text-align: center;
  z-index: 100;
  transition: var(--transition-standard);
}

body.multiple-scenes #titleBar {
  left: 3rem;
}

body.fullscreen-enabled #titleBar {
  right: 5.5rem;
}

#titleBar .sceneName {
  width: 100%;
  height: 100%;
  line-height: 1.5rem;
  padding: 0.5rem;
  background-color: var(--overlay-dark);
  border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  user-select: text;
  box-shadow: var(--shadow-sm);
  --tw-font-weight: var(--font-weight-bold);
  font-weight: var(--font-weight-bold);
}

/* Control buttons */
#fullscreenToggle,
#autorotateToggle,
#sceneListToggle {
  position: absolute;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background-color: var(--overlay);
  color: var(--emerald-400);
  z-index: 100;
  transition: var(--transition-standard);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

#fullscreenToggle:hover,
#autorotateToggle:hover,
#sceneListToggle:hover {
  background-color: var(--emerald-700);
}

#fullscreenToggle {
  display: none;
  right: 0;
  border-radius: 0;
}

#autorotateToggle {
  right: 0;
  border-radius: 0 0 0 var(--border-radius-sm);
}

#sceneListToggle {
  left: 0;
  border-radius: 0 0 var(--border-radius-sm) 0;
  z-index: 200;
}

#sceneListToggle.enabled {
  width: 15rem;
  border-radius: 0;
  background-color: var(--emerald-800);
}

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

body.fullscreen-enabled #autorotateToggle {
  right: 2.5rem;
}

.icon {
  width: 1.5rem;
  height: 1.5rem;
}

.icon.on {
  display: none;
}

.icon.off {
  display: block;
}

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

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

/* Scene list */
#sceneList {
  position: absolute;
  top: 0;
  left: -15rem;
  margin-top: 2.5rem;
  width: 15rem;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  margin-left: 0;
  transition: var(--transition-standard);
  z-index: 50;
}

#sceneList .scenes {
  width: 100%;
  background-color: var(--overlay);
  border-radius: 0 0 var(--border-radius-sm) 0;
  box-shadow: var(--shadow-md);
}

#sceneList.enabled {
  margin-left: 15rem;
}

#sceneList .scene {
  display: block;
  width: 100%;
  height: 2.5rem;
  transition: var(--transition-standard);
}

#sceneList .scene .text {
  width: 100%;
  height: 100%;
  padding: 0 1rem;
  line-height: 2.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#sceneList .scene.current,
#sceneList .scene:hover {
  background-color: var(--emerald-600);
}

/* Hotspots */
.link-hotspot {
  width: 3rem;
  height: 3rem;
  margin-left: -1.5rem;
  margin-top: -1.5rem;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.03s ease-in-out;
  transform: scale(1);
}

.link-hotspot:hover {
  opacity: 1;
  transform: scale(1.1);
}

.link-hotspot-icon {
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.link-hotspot-tooltip {
  position: absolute;
  left: 100%;
  top: 0.75rem;
  margin-left: 0.5rem;
  font-size: 1rem;
  max-width: 18.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius-sm);
  background-color: var(--overlay);
  color: var(--text-light);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-0.5rem);
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow-sm);
}

.link-hotspot:hover .link-hotspot-tooltip {
  opacity: 1;
  transform: translateX(0);
  pointer-events: all;
}

.tooltip-fallback .link-hotspot-tooltip {
  display: none;
}

.tooltip-fallback .link-hotspot:hover .link-hotspot-tooltip {
  display: block;
}

/* Info hotspots */
.info-hotspot {
  line-height: 1.2em;
  opacity: 0.9;
  transition: opacity 0.2s 0.2s;
}

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

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

.info-hotspot .info-hotspot-header {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--border-radius-md);
  background-color: var(--emerald-700);
  cursor: pointer;
  transition: width 0.3s ease-in-out 0.5s, border-radius 0.3s ease-in-out 0.5s;
  box-shadow: var(--shadow-sm);
}

.info-hotspot.visible .info-hotspot-header,
.info-hotspot .info-hotspot-header:hover {
  width: 16rem;
  border-radius: var(--border-radius-sm);
  transition: width 0.3s ease-in-out, border-radius 0.3s ease-in-out;
}

.info-hotspot.visible .info-hotspot-header {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.info-hotspot .info-hotspot-icon-wrapper {
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.info-hotspot.visible .info-hotspot-title-wrapper,
.info-hotspot .info-hotspot-header:hover .info-hotspot-title-wrapper {
  width: 13.5rem;
  padding: 0 0.5rem;
  transition: width 0s 0.4s, padding 0s 0.4s;
}

.info-hotspot .info-hotspot-title-wrapper:before,
.info-hotspot-modal .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;
  user-select: text;
}

.info-hotspot .info-hotspot-close-wrapper {
  position: absolute;
  left: 16rem;
  top: 0;
  height: 2.5rem;
  width: 2.5rem;
  border-top-right-radius: var(--border-radius-sm);
  background-color: var(--emerald-800);
  visibility: hidden;
  transform: perspective(12.5rem) rotateY(90deg);
  transform-origin: 0 50% 0;
  transition: transform 0.3s 0.3s, visibility 0s 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-hotspot.visible .info-hotspot-close-wrapper {
  visibility: visible;
  transform: perspective(12.5rem) rotateY(0deg);
  transition: transform 0.3s, visibility 0s 0s;
}

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

.info-hotspot .info-hotspot-text {
  position: absolute;
  width: 18.75rem;
  height: auto;
  max-height: 12.5rem;
  top: 2.5rem;
  left: 0;
  padding: 0.75rem;
  background-color: var(--emerald-800);
  border-bottom-right-radius: var(--border-radius-sm);
  border-bottom-left-radius: var(--border-radius-sm);
  overflow-y: auto;
  visibility: hidden;
  transform: perspective(12.5rem) rotateX(-89.999deg);
  transform-origin: 50% 0 0;
  transition: transform 0.3s, visibility 0s 0.3s;
  user-select: text;
  box-shadow: var(--shadow-md);
}

.info-hotspot.visible .info-hotspot-text {
  visibility: visible;
  transform: perspective(12.5rem) rotateX(0deg);
  transition: transform 0.3s 0.3s, visibility 0s 0s;
}

/* View control buttons */
.viewControlButton {
  display: none;
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5rem;
  background-color: var(--overlay);
  color: var(--emerald-400);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-standard);
  z-index: 50;
}

.viewControlButton:hover {
  background-color: var(--emerald-700);
}

body.view-control-buttons .viewControlButton {
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewControlButton .icon {
  width: 1.5rem;
  height: 1.5rem;
}

.viewControlButton-1 { margin-left: -9rem; }
.viewControlButton-2 { margin-left: -6rem; }
.viewControlButton-3 { margin-left: -3rem; }
.viewControlButton-4 { margin-left: 0.5rem; }
.viewControlButton-5 { margin-left: 3.5rem; }
.viewControlButton-6 { margin-left: 6.5rem; }

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

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

.info-hotspot-modal .info-hotspot-header {
  position: absolute;
  top: 3.75rem;
  left: 0.75rem;
  right: 0.75rem;
  width: auto;
  height: 3rem;
  background-color: var(--emerald-700);
  border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
  opacity: 0;
  transition: opacity 0.3s ease-in-out 0.2s;
  display: flex;
  align-items: center;
}

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

.info-hotspot-modal .info-hotspot-icon-wrapper {
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.info-hotspot-modal .info-hotspot-title-wrapper {
  position: absolute;
  top: 0;
  left: 3rem;
  right: 3rem;
  width: auto;
  height: 3rem;
  padding: 0 0.75rem;
  display: flex;
  align-items: center;
}

.info-hotspot-modal .info-hotspot-title {
  display: inline-block;
  vertical-align: middle;
  user-select: text;
}

.info-hotspot-modal .info-hotspot-close-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 3rem;
  height: 3rem;
  background-color: var(--emerald-800);
  border-top-right-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.info-hotspot-modal .info-hotspot-text {
  position: absolute;
  top: 6.75rem;
  bottom: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  padding: 0.75rem;
  background-color: var(--emerald-800);
  border-bottom-right-radius: var(--border-radius-sm);
  border-bottom-left-radius: var(--border-radius-sm);
  overflow-y: auto;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  user-select: text;
  box-shadow: var(--shadow-md);
}

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

/* Media queries for responsive design */
@media (max-width: 768px) {
  /* Handle scene list on smaller screens */
  #sceneList {
    left: -100%;
    width: 100%;
    height: 100%;
    margin-top: 3rem;
  }
  
  #sceneList.enabled {
    margin-left: 100%;
  }
  
  /* Adjust controls for smaller screens */
  #titleBar {
    height: 3rem;
  }
  
  /* body.multiple-scenes #titleBar {
    left: 3.5rem;
  }
  
  body.fullscreen-enabled #titleBar {
    right: 6.5rem;
  } */

  #titleBar .sceneName {
    line-height: 2rem;
  }
  
  #fullscreenToggle,
  #autorotateToggle,
  #sceneListToggle {
    /* width: 3rem; */
    height: 3rem;
  }
  
  #sceneListToggle.enabled {
    width: 100%;
  }

  /* body.fullscreen-enabled #autorotateToggle {
    right: 3rem;
  } */
  
  /* Hide control buttons on small screens */
  body.view-control-buttons .viewControlButton {
    display: none;
  }
  
  /* Display the info hotspot modal on small screens */
  .desktop .info-hotspot-modal {
    display: block;
  }
  
  /* Adjust hotspot size for touch */
  .link-hotspot {
    width: 3.5rem;
    height: 3.5rem;
    margin-left: -1.75rem;
    margin-top: -1.75rem;
  }
}

@media (min-width: 769px) {
  /* Hide the info hotspot modal on desktop */
  .info-hotspot-modal {
    display: none;
  }
  
  #sceneListToggle.enabled + #titleBar {
    left: 15.5rem;
  }
}