/* ============================================ */
/* ARTvance Tour 360° - Hotspot & Viewer Styles */
/* ============================================ */

/* Viewer containers */
.hero__tour-viewer,
.demo__tour-viewer,
.problem__tour-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0a0f;
}

.hero__tour-viewer > div,
.demo__tour-viewer > div,
.problem__tour-viewer > div {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
}

.hero__tour-viewer > .tour360-title-bar,
.demo__tour-viewer > .tour360-title-bar,
.problem__tour-viewer > .tour360-title-bar,
.hero__tour-viewer > .tour360-scene-list,
.demo__tour-viewer > .tour360-scene-list,
.problem__tour-viewer > .tour360-scene-list {
  position: absolute !important;
  width: auto !important;
  height: auto !important;
}

.hero__tour-viewer canvas,
.demo__tour-viewer canvas,
.problem__tour-viewer canvas {
  display: block;
}

.demo__container {
  position: relative;
  overflow: hidden;
}

/* Scene list */
.tour360-scene-list {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  max-height: 100%;
  overflow-y: auto;
}

.tour360-scenes {
  list-style: none;
  margin: 0;
  padding: 0;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.tour360-scene-link {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(240, 240, 245, 0.6);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: all 0.2s ease;
  cursor: pointer;
}

.tour360-scene-link:hover {
  color: #f0f0f5;
  background: rgba(220, 38, 38, 0.1);
}

.tour360-scene-link.current {
  color: #f0f0f5;
  background: rgba(220, 38, 38, 0.15);
  border-left: 3px solid #3b82f6;
}

/* Title bar */
.tour360-title-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(220, 38, 38, 0.2);
}

.tour360-scene-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour360-control-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: rgba(240, 240, 245, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.tour360-control-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f0f0f5;
}

.tour360-control-btn.active {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.4);
  color: #60a5fa;
}

.tour360-control-btn svg {
  width: 16px;
  height: 16px;
}

/* Link hotspot */
.link-hotspot {
  width: 50px;
  height: 50px;
  margin-left: -25px;
  margin-top: -25px;
  opacity: 0.9;
  transition: opacity 0.2s;
}

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

.link-hotspot-marker {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid #3b82f6;
  background: none;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(220, 38, 38, 0.15);
  cursor: pointer;
  animation: tour360-link-pulse 2s ease-in-out infinite;
  transform: scaleY(0.6);
  transition: all 0.3s;
}

.link-hotspot:hover .link-hotspot-marker {
  border-color: #60a5fa;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(220, 38, 38, 0.25);
  transform: scaleY(0.65) scale(1.1);
}

@keyframes tour360-link-pulse {
  0%, 100% { opacity: 0.8; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(220, 38, 38, 0.15); }
  50% { opacity: 1; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(220, 38, 38, 0.3); }
}

.link-hotspot-tooltip {
  position: absolute;
  left: 100%;
  top: 9px;
  margin-left: 3px;
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  max-width: 200px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #f0f0f5;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-8px);
  transition: transform 0.3s, opacity 0.3s;
  pointer-events: none;
}

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

/* Info hotspot */
.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: 40px;
  height: 40px;
  border-radius: 20px;
  background: rgba(220, 38, 38, 0.8);
  cursor: pointer;
  transition: width 0.3s ease-in-out 0.5s, border-radius 0.3s ease-in-out 0.5s;
  display: flex;
  align-items: center;
}

.info-hotspot.visible .info-hotspot-header {
  width: 220px;
  border-radius: 8px 0 0 0;
  transition: width 0.3s ease-in-out, border-radius 0.3s ease-in-out;
}

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

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

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

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

.info-hotspot.visible .info-hotspot-title-wrapper {
  width: 180px;
  padding: 0 8px;
  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;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  user-select: text;
}

.info-hotspot .info-hotspot-close-wrapper {
  position: absolute;
  left: 220px;
  top: 0;
  height: 40px;
  width: 40px;
  background: rgba(78, 88, 104, 0.8);
  border-radius: 0 8px 0 0;
  visibility: hidden;
  transform: perspective(200px) 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;
  cursor: pointer;
}

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

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

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

.info-hotspot .info-hotspot-text {
  position: absolute;
  width: 260px;
  max-height: 200px;
  top: 40px;
  left: 0;
  padding: 10px;
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow-y: auto;
  visibility: hidden;
  transform: perspective(200px) rotateX(-89.999deg);
  transform-origin: 50% 0 0;
  transition: transform 0.3s, visibility 0s 0.3s;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(240, 240, 245, 0.8);
  user-select: text;
}

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

/* Mobile adjustments */
@media (max-width: 768px) {
  .tour360-scene-list {
    width: 100%;
    left: 0;
    top: auto;
    bottom: 0;
    max-height: 40%;
    overflow-y: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .tour360-scenes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 8px;
    background: rgba(10, 10, 15, 0.95);
  }

  .tour360-scene-link {
    padding: 8px;
    font-size: 11px;
    text-align: center;
    border-radius: 6px;
    border-bottom: none;
    border: 1px solid rgba(255, 255, 255, 0.06);
  }

  .tour360-scene-link.current {
    border-left: 1px solid rgba(220, 38, 38, 0.6);
    border-color: rgba(220, 38, 38, 0.4);
  }

  .tour360-title-bar {
    padding: 6px 10px;
  }

  .tour360-scene-name {
    font-size: 12px;
  }

  .link-hotspot {
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
  }

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

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

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

  .info-hotspot .info-hotspot-title-wrapper,
  .info-hotspot.visible .info-hotspot-title-wrapper {
    display: none;
  }

  .info-hotspot .info-hotspot-close-wrapper,
  .info-hotspot.visible .info-hotspot-close-wrapper {
    display: none;
  }

  .info-hotspot .info-hotspot-text {
    position: fixed;
    top: auto;
    bottom: 60px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 40vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    visibility: hidden;
    opacity: 0;
    transform: none;
    transition: opacity 0.3s, visibility 0s 0.3s;
  }

  .info-hotspot.visible .info-hotspot-text {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity 0.3s, visibility 0s 0s;
  }
}
