/* ═══════════════════════════════════════════════════════════════════════════
   HOTSPOT COMPONENT - Giuliano Tartufi
   ═══════════════════════════════════════════════════════════════════════════ */

/* Container - position:absolute per posizionamento libero nella scena */
.hotspot {
  position: absolute;
  width: 61px;
  height: 61px;
  z-index: 100;
  cursor: pointer;
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hotspot.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Reset per il button interno */
.hotspot__btn {
  position: relative;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  outline: none;
}

/* ─── Pulse rings (idle animation) ─────────────────────────────────────────── */
.hotspot__pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: hotspot-pulse 2.8s ease-out infinite;
  pointer-events: none;
}

.hotspot__pulse:nth-child(1) {
  border: 1.5px solid rgba(235, 231, 221, 0.6);
  animation-duration: 2.6s;
  animation-delay: 0s;
}

.hotspot__pulse:nth-child(2) {
  border: 2.5px solid rgba(234, 185, 126, 0.7);
  animation-duration: 3.0s;
  animation-delay: 0.8s;
}

.hotspot__pulse:nth-child(3) {
  border: 1px solid rgba(235, 231, 221, 0.45);
  animation-duration: 3.4s;
  animation-delay: 1.6s;
}

@keyframes hotspot-pulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  100% {
    transform: translate(-50%, -50%) scale(4);
    opacity: 0;
  }
}

/* ─── Main circle (glass-dark style) ───────────────────────────────────────── */
.hotspot__circle {
  position: relative;
  width: 61px;
  height: 61px;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.34, 2.4, 0.64, 1);
}

.hotspot__btn:hover .hotspot__circle {
  transform: scale(1.2);
}

/* ─── Cross/Plus icon ──────────────────────────────────────────────────────── */
.hotspot__cross {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  transition: transform 0.35s cubic-bezier(0.34, 2.4, 0.64, 1);
  z-index: 3;
}

.hotspot__btn:hover .hotspot__cross {
  transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
}

.hotspot__cross path {
  transition: fill 0.3s ease;
}

.hotspot__btn:hover .hotspot__cross path {
  fill: #EAB97E;
}

/* ─── Tooltip ──────────────────────────────────────────────────────────────── */
.hotspot__tooltip {
  position: absolute;
  top: 50%;
  background: #EBE7DD;
  color: #1C1B1F;
  padding: 10px 16px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

/* Tooltip a sinistra (default) */
.hotspot__tooltip--left {
  right: calc(100% + 14px);
  transform: translateY(-50%) translateX(10px);
}

.hotspot__tooltip--left::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-left-color: #ebe7dd;
  border-right: none;
}

/* Tooltip a destra */
.hotspot__tooltip--right {
  left: calc(100% + 14px);
  transform: translateY(-50%) translateX(-10px);
}

.hotspot__tooltip--right::after {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #ebe7dd;
  border-left: none;
}

/* Tooltip sopra */
.hotspot__tooltip--top {
  bottom: calc(100% + 14px);
  left: 50%;
  top: auto;
  transform: translateX(-50%) translateY(10px);
}

.hotspot__tooltip--top::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  top: auto;
  right: auto;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #EBE7DD;
  border-bottom: none;
}

/* Tooltip sotto */
.hotspot__tooltip--bottom {
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
}

.hotspot__tooltip--bottom::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: #ebe7dd;
  border-top: none;
}

/* Hover state per tooltip */
.hotspot__btn:hover .hotspot__tooltip--left {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.hotspot__btn:hover .hotspot__tooltip--right {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.hotspot__btn:hover .hotspot__tooltip--top {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hotspot__btn:hover .hotspot__tooltip--bottom {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Hover glow effect ────────────────────────────────────────────────────── */
.hotspot__btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 61px;
  height: 61px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196, 154, 60, 0.25) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.4s ease;
  z-index: 1;
  pointer-events: none;
}

.hotspot__btn:hover::before {
  transform: translate(-50%, -50%) scale(1.6);
}

/* ─── Touch device adjustments ─────────────────────────────────────────────── */
@media (hover: none) and (pointer: coarse) {
  /* Su touch il :hover resta "appiccicato" dopo il tap → niente tooltip */
  .hotspot__tooltip {
    display: none !important;
  }

  .hotspot {
    width: 70px;
    height: 70px;
  }
  
  .hotspot__circle {
    width: 70px;
    height: 70px;
  }
  
  /* Linee concentriche (pulse rings) disattivate su mobile */
  .hotspot__pulse {
    display: none;
  }

  .hotspot__cross {
    width: 38px;
    height: 38px;
  }
}

/* ─── Active/Clicked state ─────────────────────────────────────────────────── */
.hotspot--active .hotspot__cross {
  transform: translate(-50%, -50%) rotate(45deg);
}

.hotspot--active .hotspot__btn::before {
  transform: translate(-50%, -50%) scale(1.6);
}

/* ─── Visibility control per scene ─────────────────────────────────────────── */
.hotspot[data-scene] {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.hotspot[data-scene].hotspot--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Linee concentriche (pulse rings) disattivate su mobile (anche su mobile
   con puntatore fine, es. emulazione/preview), oltre alla query touch sopra */
@media (max-width: 767px) {
  .hotspot__pulse {
    display: none;
  }
}
