/* ========================================================================
== TỆP: CSS/HOTSPOT_NODE4.CSS
== CHỨC NĂNG: Giao diện Nút 3D Hotspot & Popup Video tại Node 4 (Xanh Dương)
======================================================================== */

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

@keyframes pulse-wave-node4 {
  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-node4 {
  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 (NODE 4) ================= */
.btn-hotspot-node4 {
  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-node4 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 */
.btn-hotspot-node4::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-node4 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-node4 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-node4: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-node4:hover svg {
  transform: scale(1.1);
}

/* Tooltip hiển thị khi rê chuột vào */
.btn-hotspot-node4 .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-node4 .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-node4:hover .hotspot-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================= POPUP MODAL (NODE 4) ================= */
.hotspot-node4-modal-overlay {
  display: none;
  position: fixed;
  z-index: 2147483647 !important; /* Luôn nổi cao nhất trên mọi nút điều hướng, logo và menu */
  left: 0;
  top: 0;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  background-color: rgba(3, 7, 18, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: env(safe-area-inset-top, 16px) env(safe-area-inset-right, 16px) env(safe-area-inset-bottom, 16px) env(safe-area-inset-left, 16px);
  box-sizing: border-box;
}

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

.hotspot-node4-modal-content {
  position: relative;
  width: min(92vw, 960px);
  max-width: 960px;
  height: auto;
  max-height: 90vh;
  max-height: 90dvh;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(7, 12, 24, 0.99));
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 20px;
  padding: 16px 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.25);
  animation: modal-zoom-in-node4 0.3s 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-node4-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #e2e8f0;
  font-size: 22px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hotspot-node4-modal-close:hover,
.hotspot-node4-modal-close:active {
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  border-color: #ef4444;
  transform: scale(1.08);
}

/* Tiêu đề Popup */
.hotspot-node4-title {
  color: #38bdf8;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
  padding-bottom: 10px;
  padding-right: 46px; /* Dành khoảng trống bên phải cho nút X không bị đè vào chữ */
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hotspot-node4-title svg {
  width: 20px;
  height: 20px;
  fill: #38bdf8;
  flex-shrink: 0;
}

/* Thân nội dung Popup */
.hotspot-node4-body {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

/* Khung hiển thị Iframe / Video YouTube chuẩn tỉ lệ 16:9 thích ứng màn hình */
.hotspot-node4-iframe-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(88vh - 85px);
  max-height: calc(88dvh - 85px);
  border-radius: 12px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.3);
  margin: auto;
}

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

/* ================= ĐIỀU CHỈNH TRÊN ĐIỆN THOẠI (MOBILE RESPONSIVE) ================= */
@media screen and (max-width: 768px) {
  .hotspot-node4-modal-overlay {
    padding: 12px;
  }
  .hotspot-node4-modal-content {
    width: 94vw;
    max-width: 460px;
    height: auto;
    max-height: 85vh;
    max-height: 85dvh;
    padding: 12px 14px;
    border-radius: 16px;
  }
  .hotspot-node4-title {
    font-size: 13px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    padding-right: 40px;
  }
  .hotspot-node4-title svg {
    width: 16px;
    height: 16px;
  }
  .hotspot-node4-modal-close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    font-size: 19px;
  }
  .hotspot-node4-iframe-wrapper {
    max-height: calc(85vh - 65px);
    max-height: calc(85dvh - 65px);
    border-radius: 10px;
  }
}

/* Xoay ngang điện thoại (Mobile Landscape) */
@media screen and (max-width: 920px) and (orientation: landscape) and (max-height: 550px) {
  .hotspot-node4-modal-overlay {
    padding: 8px;
  }
  .hotspot-node4-modal-content {
    width: auto;
    max-width: 94vw;
    max-height: 94vh;
    max-height: 94dvh;
    padding: 8px 12px;
  }
  .hotspot-node4-title {
    font-size: 12px;
    margin-bottom: 6px;
    padding-bottom: 6px;
    padding-right: 34px;
  }
  .hotspot-node4-modal-close {
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  .hotspot-node4-iframe-wrapper {
    height: calc(94vh - 48px);
    height: calc(94dvh - 48px);
    max-height: calc(94vh - 48px);
    max-height: calc(94dvh - 48px);
    width: auto;
    aspect-ratio: 16 / 9;
  }
}

/* TỰ ĐỘNG ẨN TẤT CẢ NÚT ĐIỀU HƯỚNG, LOGO VÀ WIDGET ĐỂ KHÔNG ĐÈ LÊN POPUP */
body:has(.hotspot-node4-modal-overlay.active) .top-center-logo,
body:has(.hotspot-node4-modal-overlay.active) .menu-trai-trigger-btn,
body:has(.hotspot-node4-modal-overlay.active) .menu-trai-wrapper,
body:has(.hotspot-node4-modal-overlay.active) #menu-trai-container,
body:has(.hotspot-node4-modal-overlay.active) .menu-top-right,
body:has(.hotspot-node4-modal-overlay.active) #menu-phai-container,
body:has(.hotspot-node4-modal-overlay.active) .bancovan-widget-container,
body:has(.hotspot-node4-modal-overlay.active) .bancovan-card,
body:has(.hotspot-node4-modal-overlay.active) .translate-pill-btn,
body:has(.hotspot-node4-modal-overlay.active) .translate-floating-btn,
body:has(.hotspot-node4-modal-overlay.active) #audio-player-container,
body:has(.hotspot-node4-modal-overlay.active) #counter-container,
body:has(.hotspot-node4-modal-overlay.active) #google_translate_element,
body.hotspot-modal-open .top-center-logo,
body.hotspot-modal-open .menu-trai-trigger-btn,
body.hotspot-modal-open .menu-trai-wrapper,
body.hotspot-modal-open #menu-trai-container,
body.hotspot-modal-open .menu-top-right,
body.hotspot-modal-open #menu-phai-container,
body.hotspot-modal-open .bancovan-widget-container,
body.hotspot-modal-open .bancovan-card,
body.hotspot-modal-open .translate-pill-btn,
body.hotspot-modal-open .translate-floating-btn,
body.hotspot-modal-open #audio-player-container,
body.hotspot-modal-open #counter-container,
body.hotspot-modal-open #google_translate_element {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
