* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: system-ui, -apple-system, sans-serif; }
#viewer { width: 100%; height: 100%; }

.hotspot {
  position: absolute;
  cursor: pointer;
  transition: transform 0.2s ease;
  z-index: 10;
}
.hotspot:hover { transform: translate(-50%, -50%) scale(1.15) !important; }

.hotspot-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hotspot-transition .hotspot-icon { animation: pulse 2s infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(249, 115, 22, 0); }
}

.hotspot-label {
  position: absolute;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transform: translateY(-100%) translateX(-50%);
  top: -8px;
  left: 50%;
  pointer-events: none;
}

.scene-title {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 20;
  color: white;
}
.scene-title h2 { font-size: 16px; margin: 0 0 4px 0; }
.scene-title p { font-size: 11px; opacity: 0.7; margin: 0; }

.home-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}
.home-btn:hover { background: rgba(0,0,0,0.9); }
.home-btn.hidden { display: none; }

.autorotate-btn {
  position: absolute;
  top: 16px;
  right: 68px;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
}
.autorotate-btn:hover { background: rgba(0,0,0,0.9); }
.autorotate-btn.active { 
  background: rgba(249, 115, 22, 0.9);
  color: white;
}
.autorotate-btn.active svg {
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 120px;
  width: 44px;
  height: 44px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
}
.fullscreen-btn:hover { background: rgba(0,0,0,0.9); }
.fullscreen-btn.active {
  background: rgba(59, 130, 246, 0.9);
}

.thumbnail-gallery {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  padding: 12px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border-radius: 12px;
  z-index: 20;
}

.thumbnail {
  width: 80px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  position: relative;
}
.thumbnail:hover { border-color: rgba(255,255,255,0.5); }
.thumbnail.active { border-color: #f97316; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; }
.thumbnail .home-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #f97316;
  border-radius: 4px 0 0 0;
  padding: 2px;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  z-index: 100;
}
.loading.hidden { display: none; }

.info-popup {
  position: absolute;
  background: rgba(20,20,25,0.95);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  max-width: 340px;
  min-width: 280px;
  z-index: 30;
  overflow: hidden;
}
.info-popup.hidden { display: none; }
.info-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.info-popup-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: white;
  margin: 0;
}
.info-popup-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.info-popup-close:hover { background: rgba(255,255,255,0.1); }
.info-popup-images {
  position: relative;
}
.info-popup-images img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.info-popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
}
.info-popup-nav.prev { left: 8px; }
.info-popup-nav.next { right: 8px; }
.info-popup-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.info-popup-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
}
.info-popup-dot.active { background: white; }
.info-popup-content {
  padding: 12px 16px;
}
.info-popup-content p {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  line-height: 1.5;
  margin: 0;
  white-space: pre-wrap;
}
.info-popup-content.scrollable {
  max-height: 200px;
  overflow-y: auto;
}
.info-popup-empty {
  padding: 24px;
  text-align: center;
  color: rgba(255,255,255,0.5);
  font-size: 13px;
}

/* Fullscreen Image Viewer */
.fullscreen-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fullscreen-viewer.hidden { display: none; }
.fullscreen-viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}
.fullscreen-viewer-close:hover { background: rgba(255,255,255,0.2); }
.fullscreen-controls {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 8px;
}
.fullscreen-controls button {
  padding: 8px 12px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  font-size: 14px;
}
.fullscreen-controls button:hover { background: rgba(255,255,255,0.2); }
.fullscreen-controls button:disabled { opacity: 0.5; cursor: not-allowed; }
.fullscreen-controls .zoom-level {
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border-radius: 8px;
  color: white;
  font-size: 14px;
}
.fullscreen-image-container {
  overflow: auto;
  max-width: 100%;
  max-height: 100%;
  padding: 32px;
}
.fullscreen-image-container img {
  transition: transform 0.2s;
  max-width: none;
}
.info-popup-expand-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: background 0.2s;
}
.info-popup-expand-btn:hover { background: rgba(0,0,0,0.8); }

/* Gallery Toggle */
.gallery-toggle-btn {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 28px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border: none;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.2s;
}
.gallery-toggle-btn:hover { background: rgba(0,0,0,0.9); }
.gallery-toggle-btn.gallery-hidden {
  bottom: 16px;
  border-radius: 8px;
}
.thumbnail-gallery.collapsed {
  transform: translateX(-50%) translateY(calc(100% + 8px));
  opacity: 0;
  pointer-events: none;
}