/* ============================================================
   Xplorra — Tour Viewer Styles
   ============================================================ */

/* ── Full-screen viewer ───────────────────────────────────── */
#tour-container {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  cursor: grab;
}
#tour-container:active { cursor: grabbing; }

/* Three.js canvas fills the container */
#tour-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ── Hotspot elements ─────────────────────────────────────── */
.hotspot-wrapper {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  z-index: 10;
}

.hotspot-blip {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  cursor: pointer;
  pointer-events: auto;
  transition: all 0.3s ease;
}

.blip-rings {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotateX(65deg);
  transform-style: preserve-3d;
  position: relative;
  transition: all 0.3s ease;
}

.blip-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid var(--accent, #6366f1);
  box-shadow: 0 0 15px var(--accent, #6366f1);
  transition: all 0.3s ease;
  pointer-events: none;
}

.ring-outer {
  width: 100%;
  height: 100%;
  animation: blipPulseOuter 3s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
}

.ring-inner {
  width: 65%;
  height: 65%;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: none;
  animation: blipPulseInner 3s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
}

.blip-core {
  position: absolute;
  width: 25%;
  height: 25%;
  background: var(--accent, #6366f1);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent, #6366f1);
  animation: blipPulseCore 1.5s ease-in-out infinite alternate;
}

.hotspot-blip:hover .blip-rings {
  transform: rotateX(65deg) scale(1.25);
}

.hotspot-blip:hover .ring-outer {
  border-color: #fff;
  box-shadow: 0 0 25px #fff, inset 0 0 15px var(--accent, #6366f1);
}

.hotspot-blip:hover .blip-core {
  background: #fff;
  box-shadow: 0 0 20px #fff;
  transform: scale(1.2);
}

.blip-tooltip {
  position: absolute;
  bottom: 55px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 12px;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.blip-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: rgba(10, 10, 20, 0.85) transparent transparent;
}

.blip-arrow {
  font-size: 8px;
  color: var(--accent, #6366f1);
  transform: rotate(90deg);
}

.hotspot-blip:hover .blip-tooltip {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@keyframes blipPulseOuter {
  0% { transform: scale(0.6); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes blipPulseInner {
  0% { transform: scale(0.4); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 0; }
}

@keyframes blipPulseCore {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.1); opacity: 1; }
}

/* ── Fade overlay (used during node transitions) ──────────── */
#fade-overlay {
  position: fixed;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.35s ease;
}
#fade-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── HUD: top bar ─────────────────────────────────────────── */
#tour-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
  z-index: 50;
  pointer-events: none;
}

.hud-client {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.hud-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: rgba(255,255,255,0.1);
}

.hud-client-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}

.hud-location {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.55);
}

.hud-controls {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.hud-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.hud-btn:hover {
  background: rgba(99,102,241,0.4);
  border-color: var(--accent);
  color: #fff;
}

/* ── Node map / minimap (bottom) ──────────────────────────── */
#node-map {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  z-index: 50;
  max-width: 90vw;
  overflow-x: auto;
  scrollbar-width: none;
}
#node-map::-webkit-scrollbar { display: none; }

.node-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.node-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.node-dot:hover:not(.active) {
  background: rgba(255,255,255,0.5);
}

/* ── Loading screen ───────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 200;
  transition: opacity 0.5s ease;
}
#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.loading-bar-wrap {
  width: 200px;
  height: 3px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--purple));
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

.loading-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Error screen ─────────────────────────────────────────── */
#error-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 200;
  text-align: center;
  padding: 32px;
}
#error-screen.visible { display: flex; }
.error-icon { font-size: 3rem; }
.error-title { font-family: var(--font-display); font-size: 1.5rem; }
.error-msg { color: var(--text-secondary); max-width: 420px; }

/* ── Gyroscope / VR toggle ────────────────────────────────── */
#gyro-btn {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 50;
}
#gyro-btn.active {
  background: rgba(99,102,241,0.4);
  border-color: var(--accent);
}

/* ── Mobile responsive ────────────────────────────────────── */
@media (max-width: 640px) {
  #tour-hud { padding: 12px 16px; }
  .hud-client-name { font-size: 0.875rem; }
  #node-map { bottom: 16px; }
  .hotspot-blip { transform: scale(0.8); }
}
