/* ========================================================================
== TỆP: CSS/HOTSPOT_NODE3.CSS
== CHỨC NĂNG: Giao diện Nút 3D Hotspot & Popup Thông Tin tại Node 3 (Tone Xanh Dương Đồng Bộ)
======================================================================== */

@keyframes border-rotate-node3 {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse-wave-node3 {
  0% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7), 0 0 15px rgba(37, 99, 235, 0.5);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(56, 189, 248, 0), 0 0 25px rgba(56, 189, 248, 0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), 0 0 15px rgba(37, 99, 235, 0.5);
  }
}

@keyframes modal-zoom-in-node3 {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ================= NÚT 3D TRONG KHÔNG GIAN PANO (XANH DƯƠNG) ================= */
.btn-hotspot-node3 {
  position: absolute;
  top: -18px;
  left: -18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(135deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%);
  color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, box-shadow 0.3s ease;
  animation: pulse-wave-node3 2.5s infinite;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.5), 0 0 20px rgba(56, 189, 248, 0.4);
  user-select: none;
  touch-action: manipulation;
}

/* Vòng xoay phát sáng Neon Xanh Cyan quanh nút */
.btn-hotspot-node3::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  padding: 2px;
  box-sizing: border-box;
  z-index: -1;
  background: conic-gradient(
    from 0deg,
    transparent 60%,
    rgba(56, 189, 248, 0.4) 80%,
    #38bdf8 100%
  );
  animation: border-rotate-node3 3s linear infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: destination-out;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

.btn-hotspot-node3 svg {
  width: 18px;
  height: 18px;
  fill: #ffffff;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s ease;
}

.btn-hotspot-node3:hover {
  transform: scale(1.18);
  filter: brightness(1.15);
  box-shadow: 0 6px 22px rgba(56, 189, 248, 0.7), 0 0 30px rgba(59, 130, 246, 0.6);
}

.btn-hotspot-node3:hover svg {
  transform: scale(1.1);
}

/* Tooltip hiển thị khi rê chuột vào */
.btn-hotspot-node3 .hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.btn-hotspot-node3 .hotspot-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.92) transparent transparent transparent;
}

.btn-hotspot-node3:hover .hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= POPUP MODAL ================= */
.hotspot-node3-modal-overlay {
  display: none;
  position: fixed;
  z-index: 999999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 16px;
  box-sizing: border-box;
}

.hotspot-node3-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.hotspot-node3-modal-content {
  position: relative;
  width: 90vw;
  max-width: 90vw;
  height: 90vh;
  height: 90dvh;
  max-height: 90vh;
  max-height: 90dvh;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(10, 15, 29, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 18px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.25);
  animation: modal-zoom-in-node3 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  color: #f1f5f9;
  overflow: hidden;
}

/* Nút tắt Popup X */
.hotspot-node3-modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #cbd5e1;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 10;
  user-select: none;
}

.hotspot-node3-modal-close:hover {
  background: rgba(239, 68, 68, 0.85);
  color: #ffffff;
  transform: rotate(90deg);
}

/* Tiêu đề Popup */
.hotspot-node3-title {
  color: #38bdf8;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.hotspot-node3-title svg {
  width: 22px;
  height: 22px;
  fill: #38bdf8;
}

/* Thân nội dung Popup */
.hotspot-node3-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  font-size: 15px;
  color: #cbd5e1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hotspot-node3-body::-webkit-scrollbar,
.hotspot-node3-modal-content::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/* Khung hiển thị Iframe / Video YouTube căn chỉnh 16:9 cực đại trong popup 90% */
.hotspot-node3-iframe-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc((90vh - 100px) * 16 / 9);
  max-height: calc(90vh - 100px);
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.35);
  margin: auto;
}

.hotspot-node3-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

@media screen and (max-width: 768px) {
  .hotspot-node3-modal-content {
    width: 80vw;
    max-width: 80vw;
    max-height: 80vh;
    max-height: 80dvh;
    padding: 16px 14px;
    border-radius: 16px;
  }
  .hotspot-node3-title {
    font-size: 15px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
  .hotspot-node3-modal-close {
    top: 10px;
    right: 12px;
    width: 30px;
    height: 30px;
    font-size: 20px;
  }
}
