/* === Shared CSS === */
/* Shared runtime styles used by skin-ui.js and hotspot renderers across themes.
   Theme CSS is appended after this file and may override these defaults. */

/* Shared AddToAny share menu */
.vr-share-menu {
  position: fixed;
  z-index: 9999;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  pointer-events: auto;
}

.vr-share-menu.hidden {
  display: none;
}

.vr-share-kit {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: max-content;
}

.vr-share-kit a {
  cursor: pointer;
}

.vr-share-copy-btn {
  width: var(--vr-share-icon-size, 40px);
  height: var(--vr-share-icon-size, 40px);
  border: 0;
  border-radius: 4px !important;
  background: #7f8a99;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  overflow: hidden;
  line-height: 1;
  vertical-align: middle;
  transition: width 0.18s ease, background 0.18s ease;
}

.vr-share-copy-btn svg {
  width: calc(var(--vr-share-icon-size, 40px) * 0.6);
  height: calc(var(--vr-share-icon-size, 40px) * 0.6);
  flex: 0 0 auto;
}

.vr-share-copy-btn span {
  display: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.vr-share-copy-btn.is-copied {
  width: calc(var(--vr-share-icon-size, 40px) + 66px);
  background: #16a34a;
}

.vr-share-copy-btn.is-copied span {
  display: inline;
}

/* Shared mascot base. Theme CSS may override spacing via CSS variables. */
.mascot-wrapper {
  position: fixed;
  right: var(--mascot-edge-x, 24px);
  bottom: var(--mascot-bottom, 24px);
  z-index: var(--mascot-zindex, 18);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.mascot-wrapper.pos-left,
.mascot-wrapper.pos-bottom-left,
.mascot-wrapper.pos-top-left {
  left: var(--mascot-edge-x, 24px);
  right: auto;
  align-items: flex-start;
}

.mascot-wrapper.pos-right,
.mascot-wrapper.pos-bottom-right,
.mascot-wrapper.pos-top-right {
  left: auto;
  right: var(--mascot-edge-x, 24px);
  align-items: flex-end;
}

.mascot-wrapper.pos-top-left,
.mascot-wrapper.pos-top-right {
  top: var(--mascot-top, 24px);
  bottom: auto;
}

.mascot-wrapper.pos-left,
.mascot-wrapper.pos-right,
.mascot-wrapper.pos-bottom-left,
.mascot-wrapper.pos-bottom-right {
  top: auto;
  bottom: var(--mascot-bottom, 24px);
}

#vr-mascot {
  width: var(--mascot-size, 80px);
  max-width: calc(100vw - (var(--mascot-edge-x, 24px) * 2));
  height: auto;
  cursor: pointer;
  pointer-events: auto;
  opacity: 1;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

#vr-mascot.hidden {
  display: none;
}

#vr-mascot img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (max-width: 900px) {
  .mascot-wrapper {
    right: var(--mascot-mobile-edge-x, 12px);
    bottom: var(--mascot-mobile-bottom, 74px);
    z-index: var(--mascot-zindex-mobile, var(--mascot-zindex, 18));
  }

  .mascot-wrapper.pos-left,
  .mascot-wrapper.pos-bottom-left,
  .mascot-wrapper.pos-top-left {
    left: var(--mascot-mobile-edge-x, 12px);
    right: auto;
  }

  .mascot-wrapper.pos-right,
  .mascot-wrapper.pos-bottom-right,
  .mascot-wrapper.pos-top-right {
    left: auto;
    right: var(--mascot-mobile-edge-x, 12px);
  }

  .mascot-wrapper.pos-top-left,
  .mascot-wrapper.pos-top-right {
    top: var(--mascot-mobile-top, 74px);
    bottom: auto;
  }

  .mascot-wrapper.pos-left,
  .mascot-wrapper.pos-right,
  .mascot-wrapper.pos-bottom-left,
  .mascot-wrapper.pos-bottom-right {
    top: auto;
    bottom: var(--mascot-mobile-bottom, 74px);
  }

  #vr-mascot {
    width: var(--mascot-mobile-size, var(--mascot-size, 80px));
    max-width: calc(100vw - (var(--mascot-mobile-edge-x, 12px) * 2));
  }
}

/* Hotspot base */
.vr-hotspot {
  position: absolute;
  cursor: pointer;
  transform-origin: center center;
}

.vr-hotspot-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}

.vr-hotspot-tooltip.visible {
  opacity: 1;
}

/* Hotspot: pulse */
.hs-pulse {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-pulse-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary, #1a73e8);
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
  transition: transform 0.15s;
}

.hs-pulse:hover .hs-pulse-dot {
  transform: scale(1.25);
}

.hs-pulse-ring {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--color-primary, #1a73e8);
  animation: vr-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

@keyframes vr-pulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Hotspot: callout */
.hs-callout {
  pointer-events: auto;
}

.hs-callout-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  background: var(--glass-bg, rgba(255, 255, 255, 0.6));
  backdrop-filter: var(--glass-blur, blur(12px));
  -webkit-backdrop-filter: var(--glass-blur, blur(12px));
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.35));
  border-radius: 4px;
  color: var(--color-text, #111827);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.15s, background 0.15s, color 0.15s;
}

.hs-callout:hover .hs-callout-label {
  background: rgba(0, 0, 0, 0.9);
  color: #fff;
  transform: scale(1.05);
}

.hs-callout-arrow {
  color: var(--color-primary, #1a73e8);
  flex-shrink: 0;
}

/* Hotspot: circle */
.hs-circle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hs-circle-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.hs-circle:hover .hs-circle-icon {
  transform: scale(1.12);
  border-color: var(--color-primary, #1a73e8);
  box-shadow: 0 0 12px rgba(26, 115, 232, 0.6);
}

.hs-circle-label {
  font-size: 11px;
  color: #fff;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Hotspot: default fallback */
.hs-default {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hs-default-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent, #facc15);
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Location labels (tab Nhan) */
.vr-custom-hs {
  pointer-events: auto;
}

.vr-label {
  position: absolute;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

.vr-label-flag {
  position: absolute;
  top: -51px;
  left: 29px;
  padding: 8px 16px;
  background: rgba(11, 168, 129, 0.95);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  letter-spacing: 0.01em;
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

.vr-label-flag:hover {
  transform: scale(1.05);
}

.vr-label-stem {
  position: absolute;
  width: 2px;
  height: 40px;
  top: -40px;
  left: -1px;
  background: rgba(255, 255, 255, 0.85);
  transform: rotate(35deg);
  transform-origin: bottom center;
  border-radius: 2px;
}

.vr-label-elbow {
  position: absolute;
  width: 2px;
  height: 36px;
  top: -51px;
  left: 22px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
}

.vr-label-icon {
  position: absolute;
  width: 24px;
  height: 24px;
  top: -12px;
  left: -12px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
}

.vr-label-badge {
  position: absolute;
  transform: translate(-50%, calc(-100% - 10px));
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 20px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  cursor: default;
  transition: transform 0.15s;
  letter-spacing: 0.01em;
}

.vr-label-badge:hover {
  transform: translate(-50%, calc(-100% - 10px)) scale(1.05);
}

.vr-label-badge--icon,
.vr-label-badge--custom-icon {
  padding: 4px;
  border-radius: 50%;
}

.vr-label-badge--preview-room {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.vr-label-preview-thumb {
  display: block;
  flex-shrink: 0;
}

.vr-label-badge--label,
.vr-label-badge--name {
  border-radius: 4px;
}

.vr-label-badge-text {
  line-height: 1.2;
}

.vr-label-badge-anchor {
  position: absolute;
  width: 14px;
  height: 14px;
  top: -7px;
  left: -7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

/* ── Shared hotspot PDF viewer ─────────────────────────────────────────── */
.vr-pdf-viewer {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  gap: 10px;
}

.vr-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 12px;
  color: var(--color-text, #0f172a);
  font-size: 13px;
}

.vr-pdf-toolbar span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vr-pdf-toolbar a {
  flex-shrink: 0;
  color: var(--color-primary, #2563eb);
  font-weight: 600;
  text-decoration: none;
}

.vr-pdf-viewer iframe {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius, 8px);
  background: #fff;
}


/* === Theme CSS === */
/* ============================================================
   theme-institutional — Right Sidebar + Bottom Timeline
   ============================================================ */

:root {
  --sidebar-width: 260px;
  --timeline-height: 96px;
  --topbar-height: 56px;
  --color-primary: #1565c0;
  --color-primary-dark: #0d47a1;
  --color-secondary: #1976d2;
  --color-accent: #e53935;
  --color-bg: #ffffff;
  --color-surface: rgba(255, 255, 255, 0.97);
  --color-text: #1a1f2e;
  --color-text-muted: #5f6b7c;
  --color-border: rgba(0, 0, 0, 0.10);
  --color-dot-active: var(--color-accent);
  --color-dot-default: var(--color-primary);
  --color-dot-hover: var(--color-primary);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.12);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.14);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.18);
  --radius: 8px;
  --anim: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --timeline-track-inset: 116px;
  --bottom-ui-offset: 110px;
}

/* ── Root skin wrapper ─────────────────────────────────────── */

#vr-skin {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  font-family: var(--brand-font, 'Segoe UI', system-ui, -apple-system, sans-serif);
  font-size: 14px;
  color: var(--color-text);
}

#vr-skin * {
  box-sizing: border-box;
  font-family: var(--brand-font, inherit);
}

#vr-skin .icon-slot i:is(.fa,.fas,.fa-solid),
#vr-skin i:is(.fa,.fas,.fa-solid) {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

#vr-skin .icon-slot i:is(.fab,.fa-brands),
#vr-skin i:is(.fab,.fa-brands) {
  font-family: "Font Awesome 6 Brands";
  font-weight: 400;
}

#vr-skin .interactive { pointer-events: auto; }

/* ── Logo ─────────────────────────────────────────────────── */

#vr-logo {
  position: absolute;
  top: calc(12px + var(--top-ui-offset, 0px));
  left: 12px;
  z-index: 100;
  pointer-events: auto;
  transition: top var(--anim);
}
#vr-logo img {
  width: var(--logo-desktop-width, auto);
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.3));
}

/* ── Infobar (top-center, scene title) ────────────────────── */

#vr-infobar {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
  width: max-content;
  max-width: min(560px, calc(100vw - 24px));
}
#vr-infobar .scene-title {
  background: var(--inst-scene-title-bg, rgba(0,0,0,0.55));
  color: var(--inst-scene-title-color, #fff);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 18px;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  max-width: 100%;
  line-height: 1.35;
}
#vr-infobar.anim-out .scene-title { opacity: 0; }

/* ── Parent category switcher (cấp 1, trên-trái, sát logo) ── */
/* Stack danh mục cấp 1 — khu đang chọn sáng + thanh accent vàng,
   các khu khác mờ. Click để chuyển khu vực. Nằm ngay dưới logo.
   Vị trí top được set động từ JS (_syncParentCatsPosition) theo chiều cao thực tế của logo. */

#vr-parent-cats {
  position: absolute;
  top: 68px; /* fallback, JS sẽ ghi đè theo logo thực tế */
  left: 16px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  /* Dùng transform thay vì left để tránh layout/reflow khi collapse */
  transform: translateX(0);
  transition: transform 0.3s ease, top var(--anim);
}

/* ── Toggle đóng/mở danh mục (tab dính bên phải panel, giống Glass sidebar toggle) ── */
.vr-parent-cats-toggle {
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: var(--inst-cat-bg, rgba(20, 24, 32, 0.45));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  color: var(--inst-cat-text, rgba(255, 255, 255, 0.55));
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--anim), color var(--anim), right 0.3s ease;
  z-index: 94;
}
.vr-parent-cats-toggle:hover {
  background: var(--inst-cat-bg-active, rgba(20, 24, 32, 0.72));
  color: var(--inst-cat-text-active, #fff);
}
.vr-parent-cats-toggle svg {
  transform: rotate(180deg); /* mặc định mở → mũi tên ← (collapse) */
  transition: transform 0.25s ease;
}

/* Khi collapsed: trượt sát lề trái, toggle chuyển sang trái, ẩn list */
#vr-parent-cats.collapsed {
  /* left: 16px giữ nguyên, dùng transform để trượt sát lề */
  transform: translateX(-16px);
  min-width: 22px;
  min-height: 44px;
}
#vr-parent-cats.collapsed .vr-parent-cats-toggle {
  right: auto;
  left: 2px;
  border-radius: 0 6px 6px 0; /* bo phía ngoài (hướng vào nội dung), sát lề trái không bo */
}
#vr-parent-cats.collapsed .vr-parent-cats-toggle svg {
  transform: rotate(0deg); /* đóng → mũi tên → (expand) */
}
#vr-parent-cats.collapsed .vr-parent-cats-list {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
}

.vr-parent-cats-list {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  max-width: 260px;
  opacity: 1;
  /* Chỉ transition opacity — max-width gây reflow/lag trên mobile */
  transition: opacity 0.25s ease;
}

.vr-parent-cat-item {
  position: relative;
  padding: 12px 20px 12px 16px;
  background: var(--inst-cat-bg, rgba(20, 24, 32, 0.45));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background var(--anim), border-color var(--anim);
}
.vr-parent-cat-item + .vr-parent-cat-item { border-top: 1px solid rgba(255,255,255,0.08); }

.vr-parent-cat-label {
  display: block;
  color: var(--inst-cat-text, rgba(255, 255, 255, 0.62));
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  transition: color var(--anim), font-weight var(--anim), font-size var(--anim);
}

.vr-parent-cat-item:hover .vr-parent-cat-label { color: var(--inst-cat-text-hover, rgba(255, 255, 255, 0.85)); }

.vr-parent-cat-item.active {
  background: var(--inst-cat-bg-active, rgba(20, 24, 32, 0.72));
  border-left-color: var(--color-accent);
}
.vr-parent-cat-item.active .vr-parent-cat-label {
  color: var(--inst-cat-text-active, #fff);
  font-size: 15px;
  font-weight: 700;
}

#vr-skin.inst-cat-blur-enabled .vr-parent-cat-item,
#vr-skin.inst-cat-blur-enabled .vr-parent-cats-toggle {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

@media (max-width: 600px) {
  .vr-parent-cat-label { max-width: 160px; font-size: 13px; }
  .vr-parent-cat-item.active .vr-parent-cat-label { font-size: 14px; }
  .vr-parent-cat-item { padding: 10px 16px 10px 14px; }
  .vr-parent-cat-item {
    background: var(--inst-cat-bg, rgba(20, 24, 32, 0.78));
  }
  .vr-parent-cat-item.active {
    background: var(--inst-cat-bg-active, rgba(20, 24, 32, 0.88));
  }
}

/* ── Contact popup (split layout: map iframe + info) ───────── */

#vr-contact-popup {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim);
}
#vr-contact-popup.hidden {
  opacity: 0;
  pointer-events: none;
}
#vr-contact-popup.hidden .vr-modal-box { transform: scale(0.96); }
#vr-contact-popup.hidden * { pointer-events: none !important; }

.vr-contact-box {
  max-width: 820px !important;
  min-height: 60vh;
}

.vr-contact-body {
  display: flex;
  flex-direction: row;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.vr-contact-map {
  flex: 1;
  min-width: 0;
  background: #e0e0e0;
}
.vr-contact-map iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.vr-contact-info {
  flex: 1;
  min-width: 0;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vr-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--color-text);
}
.vr-contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.vr-contact-icon svg { width: 16px; height: 16px; }
.vr-contact-text {
  word-break: break-word;
  color: var(--color-text-muted);
  text-decoration: none;
}
a.vr-contact-text:hover { color: var(--color-primary); }

@media (max-width: 600px) {
  .vr-contact-box {
    min-height: auto;
    height: 80vh;
  }
  .vr-contact-body {
    flex-direction: column;
  }
  .vr-contact-map {
    flex: 1;
    min-height: 0;
  }
  .vr-contact-info {
    flex: 1;
    min-height: 0;
    width: 100%;
  }
}

/* ── Top-right actions: "Địa điểm" + ≡ — ngang hàng ─────── */

#vr-topbar-actions {
  position: absolute;
  top: calc(8px + var(--top-ui-offset, 0px));
  right: 8px;
  z-index: 110;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  transition: top var(--anim);
}

.vr-topbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background var(--anim);
}
.vr-topbar-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.vr-topbar-btn:hover { background: var(--color-primary-dark); }

.vr-topbar-icon {
  width: 36px;
  height: 36px;
  background: #fff;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: background var(--anim), color var(--anim);
}
.vr-topbar-icon svg { width: 18px; height: 18px; }
.vr-topbar-icon:hover { background: #f8f8f8; }
.vr-topbar-icon.active {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}

/* ── Search box ───────────────────────────────────────────── */

#vr-search-box {
  position: absolute;
  top: calc(var(--topbar-height) + 4px);
  right: 8px;
  z-index: 110;
  display: flex;
  align-items: center;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 4px 8px;
  pointer-events: auto;
  gap: 6px;
  width: 280px;
}
#vr-search-box.hidden { display: none; }

#vr-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: var(--color-text);
}

#btn-search-clear {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 0 2px;
}

/* ── Right Sidebar (dropdown overlay below hamburger) ─────── */

#vr-sidebar {
  position: absolute;
  top: calc(52px + var(--top-ui-offset, 0px));
  right: 8px;
  width: var(--sidebar-width);
  max-height: calc(100vh - var(--topbar-height) - var(--timeline-height) - 20px);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 90;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Open/close animation */
  transform-origin: top right;
  transition: transform var(--anim), opacity var(--anim);
}

/* Sidebar closed: scale + fade out + block all child clicks */
#vr-skin:not(.sidebar-open) #vr-sidebar {
  transform: scale(0.92) translateY(-8px);
  opacity: 0;
  pointer-events: none;
}
#vr-skin:not(.sidebar-open) #vr-sidebar * {
  pointer-events: none !important;
}

.sidebar-header {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary);
  color: #fff;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.sidebar-project-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  display: block;
}

/* Nav links */
#vr-sidebar-nav {
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background var(--anim);
  color: var(--color-primary);
}
.sidebar-link:hover { background: rgba(21, 101, 192, 0.06); }
.sidebar-link-icon {
  width: 20px;
  height: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-link-icon svg { width: 18px; height: 18px; }
.sidebar-link-label {
  font-size: 13.5px;
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar-section-title {
  padding: 10px 16px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

/* Options section */
.sidebar-options {
  padding: 4px 0 8px;
  flex-shrink: 0;
}
.sidebar-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--anim);
  color: var(--color-primary);
  font-size: 13px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.sidebar-option:hover { background: rgba(21, 101, 192, 0.06); }
.sidebar-option .sidebar-link-icon { color: var(--color-primary); }
.sidebar-option .sidebar-link-label {
  color: var(--color-primary);
  font-size: 13.5px;
  font-weight: 500;
}

/* Language section */
.sidebar-lang-section {
  padding: 12px 16px;
  flex-shrink: 0;
  margin-top: auto;
  border-top: 1px solid var(--color-border);
}
#vr-lang-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vr-lang-item {
  padding: 5px 14px;
  border: 1.5px solid var(--color-border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--anim);
  background: transparent;
  color: var(--color-text-muted);
}
.vr-lang-item:hover { border-color: var(--color-primary); color: var(--color-primary); }
.vr-lang-item.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* Contact section */
.sidebar-contact {
  padding: 10px 16px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.sidebar-contact-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}
.sidebar-contact-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  transition: background var(--anim);
  color: var(--color-text-muted);
  text-decoration: none;
}
.sidebar-contact-item:hover {
  color: var(--color-primary);
  background: rgba(21, 101, 192, 0.04);
}
.sidebar-contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.sidebar-contact-icon svg {
  width: 16px;
  height: 16px;
}
.sidebar-contact-text {
  font-size: 12.5px;
  line-height: 1.4;
  word-break: break-word;
}

/* ── Timeline (bottom) ────────────────────────────────────── */

#vr-timeline {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--timeline-height);
  height: auto;
  background: transparent;
  z-index: 80;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  padding: 8px 24px 10px;
  overflow: visible;
}

.timeline-track {
  position: absolute;
  top: 30px;
  left: var(--timeline-track-inset);
  right: var(--timeline-track-inset);
  height: 2px;
  background: rgb(255 255 255 / 58%);
  transform: translateY(-50%);
  z-index: 0;
  pointer-events: none;
}

.timeline-items {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 12px;
  gap: 0;
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 0;
  justify-content: space-between;
}
.timeline-items::-webkit-scrollbar { display: none; }

.tl-dot-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 1 130px;
  min-width: 80px;
  padding: 6px 4px;
  position: relative;
  cursor: pointer;
  transition: opacity var(--anim);
}

.tl-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-dot-default);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform var(--anim), background var(--anim), box-shadow var(--anim);
  border: 0;
  flex-shrink: 0;
  cursor: pointer;
}
.tl-dot svg { width: 20px; height: 20px; }
.tl-dot-img { width: 65%; height: 65%; object-fit: contain; border-radius: 2px; }
.tl-dot-initials { font-size: 12px; font-weight: 700; line-height: 1; }

.tl-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.tl-dot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}
.tl-mobile-badge { display: none; }

.tl-dot-wrap.active .tl-dot {
  background: var(--color-accent);
  transform: scale(1.15);
  box-shadow: 0 4px 14px rgba(229, 57, 53, 0.4);
}
.tl-dot:hover:not(.tl-dot-wrap.active .tl-dot) {
  transform: scale(1.08);
  background: var(--color-dot-hover);
  box-shadow: var(--shadow-md);
}

.tl-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  line-height: 1.35;
  max-width: 130px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.tl-dot-wrap.active .tl-label {
  color: var(--color-accent);
  font-weight: 600;
}

.tl-scenes {
  display: none;
}

#btn-timeline-toggle {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 82;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-primary) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: rgba(255,255,255,0.75);
  box-shadow: none;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translateX(-50%);
  transition: transform var(--anim), background var(--anim), opacity var(--anim), color var(--anim);
}
#btn-timeline-toggle svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
#btn-timeline-toggle i {
  font-size: 18px;
  line-height: 1;
}
#btn-timeline-toggle .timeline-toggle-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}
#btn-timeline-toggle:hover {
  background: color-mix(in srgb, var(--color-primary) 70%, transparent);
  color: #fff;
}

#vr-skin.timeline-auto-collapse-enabled #vr-timeline {
  transition: transform var(--anim), opacity var(--anim);
}
#vr-skin.timeline-auto-collapse-enabled.timeline-collapsed #vr-timeline {
  transform: translateY(calc(100% + 18px));
  opacity: 0;
  pointer-events: none;
}
#vr-skin.timeline-auto-collapse-enabled.timeline-collapsed #btn-timeline-toggle {
  display: flex;
}

@media (min-width: 769px) {
  #btn-timeline-toggle.timeline-toggle-indicator {
    width: 132px;
    height: 28px;
    border-radius: 999px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #fff;
  }
  #btn-timeline-toggle.timeline-toggle-indicator:hover {
    background: transparent;
  }
  #btn-timeline-toggle.timeline-toggle-indicator .timeline-toggle-indicator-bar {
    width: 112px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
    display: block;
  }
  #btn-timeline-toggle.timeline-toggle-indicator:hover .timeline-toggle-indicator-bar {
    background: #fff;
  }
}

/* ── Category popup (scene list above dot) ────────────────── */

#vr-cat-popup {
  position: absolute;
  z-index: 200;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  min-width: 220px;
  max-width: 280px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
}
#vr-cat-popup.hidden { display: none; }

.cat-popup-title {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cat-popup-scenes {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--color-secondary) transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.cat-popup-scenes::-webkit-scrollbar { width: 4px; }
.cat-popup-scenes::-webkit-scrollbar-thumb { background: var(--color-secondary); border-radius: 2px; }

.cat-popup-scene {
  padding: 9px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background var(--anim);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  color: var(--color-text);
}
.cat-popup-scene:hover { background: rgba(21, 101, 192, 0.06); }
.cat-popup-scene.active {
  background: rgba(21, 101, 192, 0.10);
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Language switch popup (nút dưới nút âm thanh) ─────────── */
#vr-lang-popup {
  position: absolute;
  z-index: 200;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  min-width: 84px;
  padding: 6px;
}
#vr-lang-popup.hidden { display: none; }
.lang-popup-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.lang-popup-item {
  padding: 7px 14px;
  border-radius: calc(var(--radius) - 4px);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background var(--anim), color var(--anim);
}
.lang-popup-item:hover { background: rgba(21, 101, 192, 0.06); color: var(--color-primary); }
.lang-popup-item.active {
  background: var(--color-primary);
  color: #fff;
}

/* ── Info panel (modal) ───────────────────────────────────── */

#vr-info-panel {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim);
}
#vr-info-panel.hidden {
  opacity: 0;
  pointer-events: none;
}
#vr-info-panel.hidden .vr-modal-box { transform: scale(0.96); }
#vr-info-panel.hidden * { pointer-events: none !important; }

#vr-settings-panel {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim);
}
#vr-settings-panel.hidden {
  opacity: 0;
  pointer-events: none;
}
#vr-settings-panel.hidden .vr-modal-box { transform: scale(0.96); }
#vr-settings-panel.hidden * { pointer-events: none !important; }

.vr-settings-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 !important;
}
.vr-settings-body .vr-narration-settings {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--color-border);
}

.vr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}
.vr-modal-box {
  position: relative;
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  transition: transform var(--anim);
}
.vr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}
.vr-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: 2px 4px;
}
.vr-info-tabs {
  display: flex;
  gap: 0;
  padding: 4px 20px 0;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.vr-tab-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 8px 16px 6px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.vr-tab-btn:hover  { color: var(--color-text); }
.vr-tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.vr-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  touch-action: pan-y;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, black 20px, black calc(100% - 28px), transparent 100%);
}
.vr-modal-body::-webkit-scrollbar { width: 4px; }
.vr-modal-body::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

.vr-tab-pane        { display: none; }
.vr-tab-pane.active { display: block; }
.vr-info-section    { margin-bottom: 12px; }

#vr-info-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--color-text);
}
#vr-info-text p  { margin-bottom: 10px; }
#vr-info-text h2,
#vr-info-text h3 { margin-bottom: 6px; color: var(--color-primary); }

/* Gallery — hidden by default, grid when active */
.vr-gallery-grid        { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vr-gallery-grid.active { display: grid; }
.vr-gallery-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: zoom-in;
  transition: opacity var(--anim);
}
.vr-gallery-img:hover { opacity: 0.85; }

/* Video */
#vr-info-video iframe {
  display: block;
  width: 100%;
  height: 360px;
  border-radius: var(--radius);
  border: none;
}
.vr-video-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}
.vr-video-thumb {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  background: rgba(0,0,0,0.1);
}
.vr-video-thumb:hover, .vr-video-thumb.active { border-color: var(--color-primary); }
.vr-video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vr-video-play-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 8px rgba(0,0,0,0.6);
}
#vr-video-player-wrap iframe {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  border: none;
}
.vr-video-player {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius);
  background: #000;
}

/* ── Minimap — centered modal ────────────────────────────── */

#vr-minimap {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#vr-minimap.hidden { display: none; }

.vr-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.vr-map-inner {
  position: relative;
  z-index: 1;
  width: min(700px, calc(100vw - 40px));
  height: min(480px, calc(100vh - var(--timeline-height) - 60px));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
#vr-map-container { width: 100%; height: 100%; }

/* Reset Leaflet divIcon container to not interfere with our cluster style */
.leaflet-div-icon { background: transparent !important; border: none !important; }
.vr-map-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1000;
  display: flex;
  gap: 4px;
}
.vr-map-controls button {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}
.vr-map-controls button svg { width: 14px; height: 14px; }
.vr-map-controls button:hover { background: var(--color-primary); }
.vr-map-backdrop { display: none; }
/* Expanded: fullscreen modal */
#vr-skin.map-expanded-open #vr-minimap {
  padding: 0;
}
#vr-skin.map-expanded-open .vr-map-inner {
  width: calc(100vw - 40px);
  height: calc(100vh - var(--timeline-height) - 40px);
  max-width: 1200px;
}

/* Map markers — same as classic theme */
.vr-map-dot {
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid var(--color-primary);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.vr-map-dot:hover,
.vr-map-dot.active {
  background: var(--color-primary);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.4);
}
.vr-map-wrap { position: relative; }
.vr-map-wrap .vr-map-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.vr-map-wrap .vr-map-dot:hover,
.vr-map-wrap .vr-map-dot.active {
  transform: translate(-50%, -50%) scale(1.4);
}
.vr-map-radar {
  position: absolute;
  top: 50%; left: 50%;
  width: 60px; height: 60px;
  margin-left: -30px; margin-top: -30px;
  clip-path: polygon(50% 50%, 15% 0%, 85% 0%);
  background: var(--color-primary);
  opacity: 0.5;
  transform-origin: 50% 50%;
  display: none;
  pointer-events: none;
  z-index: 1;
}
.vr-map-radar.active { display: block; }

.vr-map-cluster {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.75);
  box-sizing: border-box;
  cursor: pointer;
}
.vr-map-cluster-sm { background: rgba(100, 200, 70, 0.9);  border-color: rgba(255,255,255,0.75); }
.vr-map-cluster-md { background: rgba(240, 185,  0, 0.9);  border-color: rgba(255,255,255,0.75); }
.vr-map-cluster-lg { background: rgba(220,  75, 55, 0.9);  border-color: rgba(255,255,255,0.75); }

.vr-map-pin { color: rgba(255,255,255,0.85); transition: color 0.15s, transform 0.15s; }
.vr-map-pin svg { width: 100%; height: 100%; display: block; }
.vr-map-pin:hover, .vr-map-pin.active { color: var(--color-primary); transform: scale(1.2) translateY(-2px); }

/* ── Intro screen ────────────────────────────────────────── */

#vr-intro {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Không có text nút "Bắt đầu" → cả màn hình đóng vai trò nút bắt đầu */
#vr-intro.vr-intro-clickable {
  cursor: pointer;
}
.vr-intro-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.vr-intro-dim {
  position: absolute;
  inset: 0;
}
.vr-intro-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  padding: 32px;
  max-width: 640px;
}
.vr-intro-logo { max-width: 200px; max-height: 100px; object-fit: contain; margin-bottom: 20px; }
.vr-intro-greeting { font-size: 20px; margin: 0 0 8px; opacity: 0.9; }
.vr-intro-title { font-size: 28px; font-weight: 700; margin: 0 0 24px; }
.vr-intro-cta {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 12px 32px;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
/* Vị trí nút CTA — mặc định nằm trong luồng nội dung; 3 vị trí dưới đây neo cố định theo đáy màn hình.
   Desktop/window và mobile (≤600px) dùng cách lề độc lập nhau. */
.vr-intro-cta.pos-bottom-left,
.vr-intro-cta.pos-bottom-center,
.vr-intro-cta.pos-bottom-right {
  position: fixed;
  bottom: var(--intro-cta-bottom, 10px);
  z-index: 2;
  width: auto;
  max-width: none;
}
.vr-intro-cta.pos-bottom-left   { left: var(--intro-cta-left, 10px); }
.vr-intro-cta.pos-bottom-right  { right: var(--intro-cta-right, 10px); }
.vr-intro-cta.pos-bottom-center { left: 0; right: 0; margin-left: auto; margin-right: auto; width: max-content; }
@media (max-width: 600px) {
  .vr-intro-cta.pos-bottom-left,
  .vr-intro-cta.pos-bottom-center,
  .vr-intro-cta.pos-bottom-right {
    bottom: var(--intro-cta-bottom-m, 10px);
  }
  .vr-intro-cta.pos-bottom-left  { left: var(--intro-cta-left-m, 10px); }
  .vr-intro-cta.pos-bottom-right { right: var(--intro-cta-right-m, 10px); }
}
.vr-intro-langs { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.vr-intro-lang-btn {
  padding: 6px 16px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  background: transparent;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.vr-intro-lang-btn.active { background: #fff; color: var(--color-primary); border-color: #fff; }
.vr-intro-exit { animation: vr-intro-fade-out 0.42s ease forwards; }
@keyframes vr-intro-fade-out { to { opacity: 0; transform: scale(1.02); } }

/* Hide all skin UI and hotspots under the intro until the visitor starts the tour. */
.vr-intro-hide-skin > * {
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Hotspot & Label styles (kept from classic) ──────────── */

.vr-custom-hs { pointer-events: auto; }
.vr-label { pointer-events: none; }
.vr-label-badge { pointer-events: auto; }

/* === Mascot Wrapper (bottom-right/left) === */
.mascot-wrapper {
  position: absolute;
  bottom: var(--bottom-ui-offset);
  right: 20px;
  z-index: var(--mascot-zindex, 18);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  transition: bottom var(--anim);
}

.mascot-wrapper.pos-left {
  left: 20px;
  right: auto;
}

/* === Mascot === */
#vr-mascot {
  width: var(--mascot-size);
  height: auto;
  pointer-events: auto;
  cursor: pointer;
  position: relative;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
  transition: transform var(--anim), opacity var(--anim);
  opacity: 1;
}

#vr-mascot.hidden {
  opacity: 0;
  pointer-events: none;
}

#vr-mascot:hover {
  transform: scale(1.05) translateY(-4px);
}

#vr-mascot img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Lightbox */
.vr-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.vr-lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  :root {
    --sidebar-width: 220px;
    --timeline-height: 84px;
    --timeline-track-inset: 113px;
  }
  .tl-dot { width: 38px; height: 38px; }
  .tl-label { font-size: 13px; max-width: 110px; }
  .tl-dot-wrap { flex-basis: 110px; min-width: 70px; }
}

@media (max-width: 600px) {
  #vr-cat-popup {
    min-width: 220px;
    max-width: min(280px, calc(100vw - 20px));
    max-height: min(320px, calc(100vh - 120px));
  }

  :root {
    --sidebar-width: 240px;
    --timeline-height: 44px;
    --timeline-track-inset: 18px;
  }

  #vr-logo {
    width: var(--logo-mobile-width, auto) !important;
    max-width: var(--logo-mobile-width, none) !important;
  }
  #vr-logo img {
    width: var(--logo-mobile-width, auto);
    max-width: var(--logo-mobile-width, none);
  }

  #vr-mascot {
    width: var(--mascot-mobile-size, var(--mascot-size));
  }

  #vr-timeline {
    bottom: 15px;
    align-items: flex-end;
    min-height: 0;
    padding: 0 2px max(6px, env(safe-area-inset-bottom, 0px));
  }
  .timeline-items { column-gap: 2px; row-gap: 18px; gap: 0; }
  .tl-dot-wrap {
    flex: 0 1 44px;
    min-width: 40px;
    padding: 0;
    position: relative;
  }
  .tl-dot { width: 34px; height: 34px; }
  .tl-dot svg { width: 16px; height: 16px; }
  .tl-label {
    display: none;
    position: absolute;
    bottom: calc(100% + 4px);
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(128px, calc(100vw - 12px));
    margin-top: 0;
    font-size: 13px;
    line-height: 1.35;
    overflow-wrap: anywhere;
    pointer-events: none;
  }
  .tl-dot-wrap:first-child .tl-label {
    left: 0;
    transform: none;
    text-align: left;
  }
  .tl-dot-wrap:last-child .tl-label {
    left: auto;
    right: 0;
    transform: none;
    text-align: right;
  }
  .tl-dot-wrap.active .tl-label {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #vr-skin.mobile-timeline-drawer-enabled #vr-timeline {
    left: 10px;
    right: auto;
    bottom: max(64px, calc(54px + env(safe-area-inset-bottom, 0px)));
    width: min(286px, calc(100vw - 20px));
    max-height: min(62vh, 420px);
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    align-items: stretch;
    transform-origin: bottom left;
    transition: transform var(--anim), opacity var(--anim);
  }
  #vr-skin.mobile-timeline-drawer-enabled .timeline-track {
    display: none !important;
  }
  #vr-skin.mobile-timeline-drawer-enabled .timeline-items {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
    width: 100%;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-wrap {
    flex: none;
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 6px 8px;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    border-radius: var(--radius);
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-wrap.active {
    background: rgba(21, 101, 192, 0.08);
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot {
    width: 34px;
    height: 34px;
    background: transparent;
    color: var(--color-primary);
    box-shadow: none;
    border: 0;
    font-size: 20px;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot i,
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-initials {
    font-size: 20px;
    line-height: 1;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-img {
    width: 20px;
    height: 20px;
    border-radius: 0;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-wrap.active .tl-dot {
    background: transparent;
    transform: none;
    box-shadow: none;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot:hover:not(.tl-dot-wrap.active .tl-dot) {
    transform: none;
    box-shadow: none;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-head .tl-label {
    flex: 1 1 auto;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-head .tl-dot-badge {
    display: none;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-head .tl-mobile-badge {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: 0;
    background: var(--color-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #fff;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-label,
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-wrap.active .tl-label {
    display: block;
    position: static;
    transform: none;
    width: auto;
    max-width: none;
    min-width: 0;
    margin: 0;
    color: var(--color-primary);
    text-align: left;
    text-shadow: none;
    white-space: normal;
  }

  /* Scene list inline trong drawer (thay vì popup) */
  #vr-skin.mobile-timeline-drawer-enabled .tl-dot-wrap {
    flex-wrap: wrap;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-scenes {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--color-border);
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-scenes.expanded {
    display: flex;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-scene-item {
    padding: 7px 6px;
    font-size: 12.5px;
    color: var(--color-text-muted);
    cursor: pointer;
    line-height: 1.35;
    word-break: break-word;
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-scene-item:active {
    color: var(--color-primary);
  }
  #vr-skin.mobile-timeline-drawer-enabled .tl-scene-item.active {
    color: var(--color-primary);
    font-weight: 600;
  }

  #vr-skin.mobile-timeline-drawer-enabled.timeline-collapsed #vr-timeline {
    transform: translateY(10px) scale(0.96);
    opacity: 0;
    pointer-events: none;
  }
  #vr-skin.mobile-timeline-drawer-enabled #btn-timeline-toggle {
    left: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius);
    transform: none;
    display: flex;
    background: var(--color-accent);
  }
  #vr-skin.mobile-timeline-drawer-enabled #btn-timeline-toggle span {
    display: none;
  }
  #vr-skin.mobile-timeline-drawer-enabled:not(.timeline-collapsed) #btn-timeline-toggle {
    background: var(--color-primary);
  }

  #btn-map span,
  #btn-discovery span { display: none; }

  #btn-map,
  #btn-discovery {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
}

/* ── Discovery popup (modal) ───────────────────────────────── */

#vr-discovery-popup {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim);
}
#vr-discovery-popup.hidden {
  opacity: 0;
  pointer-events: none;
}
#vr-discovery-popup.hidden .vr-modal-box { transform: scale(0.96); }
#vr-discovery-popup.hidden * { pointer-events: none !important; }

.vr-discovery-list {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.vr-discovery-list.active {
  display: grid;
}

.vr-discovery-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: var(--radius);
  background: var(--color-surface-alt, rgba(0,0,0,0.04));
  transition: background var(--anim);
}
.vr-discovery-item:hover {
  background: var(--color-surface-hover, rgba(0,0,0,0.08));
}

.vr-discovery-item-text {
  padding: 16px 12px;
  justify-content: center;
}

.vr-discovery-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius) - 2px);
  overflow: hidden;
  background: var(--color-surface);
}
.vr-discovery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vr-discovery-name {
  font-size: 13px;
  color: var(--color-text);
  text-align: center;
  line-height: 1.4;
  word-break: break-word;
}

.vr-discovery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* ── Discovery search bar ─────────────────────────────────── */

.vr-discovery-search-bar {
  display: flex;
  gap: 8px;
  padding: 0 0 12px 0;
  align-items: center;
}

.vr-discovery-search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.vr-discovery-search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: var(--color-text-muted);
  pointer-events: none;
  opacity: 0.6;
}

.vr-discovery-search-input {
  width: 100%;
  padding: 8px 12px 8px 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  transition: border-color var(--anim);
}
.vr-discovery-search-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}
.vr-discovery-search-input:focus {
  border-color: var(--color-primary);
}

.vr-discovery-filter-select {
  padding: 7px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
  cursor: pointer;
  min-width: 140px;
  transition: border-color var(--anim);
}
.vr-discovery-filter-select:focus {
  border-color: var(--color-primary);
}

@media (max-width: 600px) {
  .vr-discovery-search-bar {
    flex-direction: column;
  }
  .vr-discovery-filter-select {
    min-width: 100%;
  }
}

@media (max-width: 600px) {
  .vr-discovery-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .vr-discovery-name {
    font-size: 12px;
  }
}

/* ── Discovery detail view ─────────────────────────────────── */

#vr-discovery-detail {
  display: none;
}
#vr-discovery-detail.active {
  display: block;
}

#vr-discovery-popup .vr-modal-body {
  -webkit-mask-image: none;
  mask-image: none;
}

.vr-detail-back {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0 12px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.vr-detail-back:hover {
  opacity: 0.8;
}

.vr-detail-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 16px;
  line-height: 1.3;
}

.vr-detail-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}
.vr-detail-gallery-item {
  width: calc(50% - 5px);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface-alt, rgba(0,0,0,0.04));
}
.vr-detail-gallery-item img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: opacity var(--anim);
}
.vr-detail-gallery-item img:hover {
  opacity: 0.85;
}
@media (max-width: 600px) {
  .vr-detail-gallery-item {
    width: 100%;
  }
}

.vr-detail-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 16px;
}
.vr-detail-desc p { margin: 0.35em 0; }
.vr-detail-desc h2, .vr-detail-desc h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  margin: 0.6em 0 0.3em;
}

.vr-detail-video {
  margin-bottom: 16px;
}
.vr-detail-video iframe {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: var(--radius);
  border: none;
}

.vr-detail-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background var(--anim);
}
.vr-detail-cta:hover {
  background: var(--color-primary-dark);
}

/* ── Contact Form Button (dưới mascot, trong mascot wrapper) ── */

#vr-contact-form-btn {
  margin-top: 10px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform var(--anim), opacity var(--anim), background var(--anim);
  flex-shrink: 0;
}

/* Text-only */
#vr-contact-form-btn.cf-btn-text {
  padding: 8px 18px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
#vr-contact-form-btn.cf-btn-text:hover {
  background: var(--color-primary-dark);
  transform: scale(1.04);
}

/* Icon-only */
#vr-contact-form-btn.cf-btn-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(30, 30, 30, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
#vr-contact-form-btn.cf-btn-icon:hover {
  background: var(--color-primary);
  transform: scale(1.08);
}
#vr-contact-form-btn.cf-btn-icon .cf-btn-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#vr-contact-form-btn.cf-btn-icon .cf-btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Both icon + text */
#vr-contact-form-btn.cf-btn-both {
  padding: 8px 16px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
#vr-contact-form-btn.cf-btn-both:hover {
  background: var(--color-primary-dark);
  transform: scale(1.04);
}
#vr-contact-form-btn.cf-btn-both .cf-btn-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#vr-contact-form-btn.cf-btn-both .cf-btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Position: follow mascot position */
.mascot-wrapper.pos-left ~ #vr-contact-form-btn {
  right: auto;
  left: 20px;
}

/* ── Contact Form Modal ──────────────────────────────── */

#vr-contact-form-modal {
  position: absolute;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim);
}
#vr-contact-form-modal.hidden {
  opacity: 0;
  pointer-events: none;
}
#vr-contact-form-modal.hidden .vr-modal-box { transform: scale(0.96); }
#vr-contact-form-modal.hidden * { pointer-events: none !important; }

.cf-modal-box {
  width: 92%;
  max-width: 480px;
  max-height: 85vh;
}

.cf-modal-body {
  padding: 16px 24px !important;
  -webkit-mask-image: none !important;
  mask-image: none !important;
}

.cf-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.cf-required {
  color: var(--color-accent);
  margin-left: 2px;
}

.cf-input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: calc(var(--radius) - 2px);
  font-size: 13px;
  font-family: inherit;
  color: var(--color-text);
  background: var(--color-bg);
  outline: none;
  transition: border-color var(--anim);
  resize: vertical;
}
.cf-input:focus {
  border-color: var(--color-primary);
}
.cf-field.has-error .cf-input {
  border-color: var(--color-accent);
  background: rgba(229, 57, 53, 0.04);
}

.cf-modal-footer {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}

.cf-submit-btn {
  width: 100%;
  padding: 10px 24px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--anim);
}
.cf-submit-btn:hover { background: var(--color-primary-dark); }
.cf-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.cf-message {
  padding: 10px 14px;
  border-radius: calc(var(--radius) - 2px);
  font-size: 13px;
  font-weight: 500;
  margin-top: 12px;
  text-align: center;
}
.cf-message.hidden { display: none; }
.cf-message-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.cf-message-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ── Responsive: contact form button ────────────────── */

@media (max-width: 600px) {
  #vr-contact-form-btn.cf-btn-text {
    padding: 6px 14px;
    font-size: 12px;
  }
  #vr-contact-form-btn.cf-btn-icon {
    width: 36px;
    height: 36px;
  }
  #vr-contact-form-btn.cf-btn-both {
    padding: 6px 14px;
    font-size: 12px;
  }
  .cf-modal-box {
    max-height: 90vh;
    width: 94%;
  }
  .cf-modal-body {
    padding: 12px 16px !important;
  }
}

