/* === VR360 Theme: Glass (ColorOS Light Field Design) === */
:root {
  /* Sizing — match classic navbar height */
  --navbar-height:      64px;
  --list-scenes-height:  140px;
  --sidebar-width:       285px;
  --mascot-size:         80px;

  /* Light Field: Glassmorphism — increased opacity */
  --glass-bg:     rgba(255, 255, 255, 0.60);
  --glass-border: rgba(0, 0, 0, 0.12);
  --glass-blur:   blur(15px);
  --glass-blur-webkit: blur(15px);

  /* Light Field: Halo Glow colors */
  --halo-primary: rgba(74, 158, 187, 0.25);
  --halo-soft:    rgba(74, 158, 187, 0.10);

  /* Animations — spring feel */
  --anim-panel:  0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-strip:  0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
  --anim-fade:   0.20s cubic-bezier(0.4, 0, 0.2, 1);
  --anim-scale:  0.25s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Brand Colors — teal accent, dark text */
  --color-primary:   #4a9ebb;
  --color-secondary: #5bb89a;
  --color-accent:    #7ab5d4;

  --color-text:       #1a1f2e;
  --color-text-muted: rgba(26, 31, 46, 0.65);

  /* Radius */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-pill: 9999px;
}

/* === Reset & Base === */
:where(#vr-skin *) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Roboto', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

#vr-skin {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

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

/* === Logo === */
#vr-logo {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  z-index: 20;
  background: none;
  width: max-content;
  max-width: calc(100vw - 48px);
}

#vr-logo img {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

#vr-logo .logo-text {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* === InfoBar (top center) === */
#vr-infobar {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  -webkit-font-smoothing: subpixel-antialiased;
  border: 1px solid var(--glass-border);
  color: var(--color-text);
  padding: 6px;
  border-radius: var(--radius-md);
  min-width: 200px;
  max-width: 450px;
  text-align: center;
  pointer-events: none;
  z-index: 20;
  transition: opacity var(--anim-fade), transform var(--anim-fade);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#vr-infobar.anim-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-10px);
}

#vr-infobar .breadcrumb-tag {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#vr-infobar .infobar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
  flex-shrink: 0;
}

#vr-infobar .scene-title {
  font-size: 12px;
  font-weight: 400;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* === Nav-bar (bottom center) === */
#vr-navbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  padding: 10px 16px;
  pointer-events: auto;
  z-index: 20;
  height: var(--navbar-height);
  white-space: nowrap;
}

.vr-btn {
  height: 48px;
  min-width: 48px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 12px;
  transition: all var(--anim-fade);
}

.vr-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  transform: translateY(-2px);
}

.vr-btn.active {
  color: var(--color-primary);
  background: rgba(255,255,255,0.1);
}

.vr-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  overflow: visible;
}

.vr-btn .btn-label {
  font-size: 10px;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.vr-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.15);
  margin: 0 4px;
}

/* === Controls cluster (top-right, vertical, icon-only) === */
#vr-controls {
  position: absolute;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
  pointer-events: auto;
  z-index: 20;
}

#vr-controls #btn-controls-toggle { margin-bottom: 5px; }

.vr-controls-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow: hidden;
  max-height: 500px;
  opacity: 1;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

#vr-controls.collapsed .vr-controls-group {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.vr-ctrl-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--anim-fade), color var(--anim-fade), border-color var(--anim-fade);
  flex-shrink: 0;
}

.vr-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.vr-ctrl-btn.active { color: var(--color-primary); }

.vr-ctrl-btn svg {
  width: 20px;
  height: 20px;
  overflow: visible;
}

#vr-navbar.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(120px); /* push fully below viewport */
  visibility: hidden; /* ensure no click-through at all */
}

/* Override .interactive on navbar children when hidden */
#vr-navbar.hidden .interactive,
#vr-navbar.hidden .vr-btn {
  pointer-events: none;
}

/* === List Scenes (full-width, bottom edge) === */
#vr-list-scenes {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--list-scenes-height);
  background: linear-gradient(to top, rgba(245, 245, 245, 0.98) 0%, rgba(255, 255, 255, 0.7) 70%, transparent 100%);
  display: flex;
  align-items: stretch; /* Stretch inner content */
  pointer-events: auto;
  z-index: 16;
  transform: translateY(0);
  transition: transform var(--anim-strip);
  overflow: visible;
}

/* Scene list inner wrapper */
#vr-list-scenes > div {
  pointer-events: auto;
}

.vr-list-scroll {
  position: relative;
  z-index: 2;
  touch-action: pan-x; /* Critical for mobile touch scrolling */
  pointer-events: auto;
}

.vr-list-arrow,
.vr-list-close-btn {
  pointer-events: auto;
}

#vr-list-scenes.hidden {
  transform: translateY(100%);
  pointer-events: none;
}

#vr-list-scenes.hidden .vr-list-close-btn {
  opacity: 0;
  pointer-events: none;
}

.vr-list-close-btn {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 40px;
  height: 24px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: 1px solid transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--anim-fade);
  z-index: 20;
}

.vr-list-close-btn:hover {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-color: var(--glass-border);
}

.vr-list-close-btn svg {
  width: 20px;
  height: 20px;
}

.vr-list-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  /* scroll-snap-type: x mandatory;  -- Gây kẹt khi dùng JS drag */
  flex: 1;
  min-width: 0; /* Prevents flexbox from expanding beyond screen */
  align-items: flex-end; /* Cards stay at bottom */
  height: 100%;
  padding: 15px 20px 10px; /* 15px top space for card 'pop up' */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.5) rgba(0,0,0,0.05);
  cursor: grab;
  -webkit-overflow-scrolling: touch; /* iOS momentum for native touch */
}

.vr-list-scroll.grabbing {
  cursor: grabbing;
}

.vr-list-scroll::-webkit-scrollbar {
  height: 6px;
  display: block !important;
}

.vr-list-scroll::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
}

.vr-list-scroll::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.5);
  border-radius: 10px;
}

.scene-card {
  position: relative;
  width: 130px;
  height: 110px; /* Fixed height to allow room for pop-up */
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  /* scroll-snap-align: start; */
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--anim-fade);
  background: #222;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.scene-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene-card .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
  color: rgba(255,255,255,0.2);
  font-size: 24px;
  font-weight: bold;
}

.scene-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 20%, rgba(10, 12, 20, 0.92) 100%);
  pointer-events: none;
}

.scene-card-num {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

.scene-card-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  padding: 6px 8px 8px;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  line-height: 1.25;
  max-height: calc(4 * 1.25em + 14px);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-card:hover {
  transform: scale(1.02);
}

.scene-card.active {
  border-color: var(--color-secondary);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transform: translateY(-8px);
  z-index: 2;
}

.vr-list-scroll.grabbing .scene-card {
  transition: none;
}

.vr-list-scroll.grabbing .scene-card:hover {
  transform: none;
}

.scene-card.active .scene-card-num {
  background: var(--color-secondary);
  color: #fff;
}

/* List arrows (Desktop) */
.vr-list-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: opacity var(--anim-fade);
}

.vr-list-arrow:hover { background: rgba(0,0,0,0.8); }
.vr-list-arrow.hidden { opacity: 0; pointer-events: none; }
.vr-list-prev { left: 8px; }
.vr-list-next { right: 8px; }
.vr-list-arrow svg { width: 16px; height: 16px; fill: currentColor; }

/* === Category Sidebar (floating, left side) === */
#vr-category {
  position: absolute;
  left: 12px;
  top: 180px;    /* dưới logo: 24px top + ~130px logo + 26px gap */
  bottom: auto;
  width: var(--sidebar-width);
  height: auto;
  max-height: calc(100vh - 180px - 12px);   /* bottom margin = left margin */
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: visible; /* changed from hidden to allow toggle button to overflow */
  pointer-events: auto;
  z-index: 15;
  transform: translateX(0);
  transition: transform var(--anim-panel);
}

#vr-category.hidden {
  transform: translateX(calc(-100% - 12px));   /* slide off including left offset */
  pointer-events: none;
}

.vr-panel-header {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: bold;
  color: var(--color-text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
  line-height: 1.3;
}

.vr-panel-header .proj-name {
  font-size: 16px;
  color: var(--color-secondary);
  text-transform: none;
  margin-top: 2px;
}

.vr-panel-close {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  position: absolute;
  right: 12px;
  top: 12px;
}

.vr-panel-close:hover {
  color: var(--color-text);
  background: rgba(255,255,255,0.1);
}

#vr-category-items {
  overflow-y: auto;
  flex: 0 1 auto;
  padding: 8px 12px 16px;
  margin-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#vr-category-items::-webkit-scrollbar { width: 4px; }
#vr-category-items::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 2px; }
#vr-category-items::-webkit-scrollbar-track { background: transparent; }

.vr-category-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
  background: transparent;
  transition: all 0.2s ease-in-out;
}

.vr-category-item:last-child {
}

.vr-category-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.vr-category-item.active {
  background: linear-gradient(135deg, var(--color-primary) 0%, #4285f4 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}

/* Inner Layout: Left Section */
.vr-category-left-section {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-grow: 1;
  min-width: 0; /* allows child text-overflow to work */
}

/* Icon Slot */
.icon-slot {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vr-category-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.icon-slot i {
  font-size: 18px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.vr-category-left-section.no-icon {
  gap: 0;
}

/* Text Label */
.vr-category-label {
  font-weight: 500;
  font-size: 15px;
  flex-grow: 1;
  text-align: left;
  white-space: normal;
  word-break: break-word;
  color: inherit;
  line-height: 1.4;
}

/* Right Section: Badge */
.vr-category-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-left: 12px;
}

.vr-category-item.active .vr-category-badge {
  color: var(--color-accent);
}

/* === Sidebar Toggle Tab (tab dính vào phải sidebar) === */
#btn-sidebar-toggle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: -25px; /* Offset by 1px to clear the container border */
  width: 24px;
  height: 48px;
  border-radius: 0 8px 8px 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-left: none;
  color: rgba(255,255,255,0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  pointer-events: auto;
  z-index: 16;
  box-shadow: 4px 0 16px rgba(0,0,0,0.3);
  transition: background 0.2s, color 0.2s;
}

#btn-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.85);
  color: #333; /* Darken text when background is bright white */
}

/* === List Scenes Toggle Button (moved to nav-bar, this floats only in mobile maybe? Actually removed entirely from float) === */
#btn-list-toggle.strip-open {
  /* handled by JS/Nav bar */
}

/* === Mascot Wrapper (bottom-right/left, chỉ chứa mascot) === */
.mascot-wrapper {
  position: absolute;
  bottom: 24px;
  right: 24px;
  z-index: 18;
  transition: bottom var(--anim-strip);
}

/* Move mascot up when scene list is open */
#vr-skin:has(#vr-list-scenes:not(.hidden)) .mascot-wrapper {
  bottom: calc(var(--list-scenes-height) + 3px);
}

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

/* === Mascot === */
#vr-mascot {
  width: var(--mascot-size);
  height: auto;
  pointer-events: auto;
  cursor: pointer;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
  transition: transform var(--anim-fade), opacity var(--anim-fade);
  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;
}

/* === Other Panels (Map, Info, Narration) === */
.vr-panel {
  position: absolute;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  pointer-events: auto;
  transition: opacity var(--anim-panel), transform var(--anim-panel);
  overflow: hidden;
  z-index: 15;
  display: flex;
  flex-direction: column;
}

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

.vr-panel.hidden * {
  pointer-events: none !important;
}

/* Minimap */
#vr-minimap {
  right: 20px;
  bottom: 20px;
  width: 320px;
  height: 280px;
  z-index: 20;
  transform: translateX(0);
}

#vr-minimap.hidden { transform: translateX(calc(100% + 40px)); }

#vr-map-container {
  width: 100%;
  height: 100%;
}

/* Map overlay structure */
.vr-map-backdrop {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
  z-index: 0;
}

.vr-map-inner {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  border-radius: inherit;
}

.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); }

/* Map cluster icon */
.vr-map-cluster {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 24px;
  text-align: center;
  transition: background 0.25s, border-color 0.25s;
  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); }

/* Map expanded state: full map background */
#vr-skin.map-expanded-open #vr-minimap {
  inset: 0;
  width: 100%;
  height: 100%;
  right: auto;
  bottom: auto;
  border-radius: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none;
}

#vr-skin.map-expanded-open .vr-map-backdrop {
  display: none;
}

#vr-skin.map-expanded-open .vr-map-inner {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}

#vr-skin.map-expanded-open #vr-map-container,
#vr-skin.map-expanded-open .leaflet-container {
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0;
}

#vr-skin.map-expanded-open #vr-navbar,
#vr-skin.map-expanded-open #vr-controls,
#vr-skin.map-expanded-open #vr-category,
#vr-skin.map-expanded-open #btn-sidebar-toggle,
#vr-skin.map-expanded-open #vr-list-scenes,
#vr-skin.map-expanded-open #vr-school-rail,
#vr-skin.map-expanded-open #vr-school-mobile-nav,
#vr-skin.map-expanded-open #vr-school-campus,
#vr-skin.map-expanded-open #vr-school-playback {
  z-index: 60;
  pointer-events: auto;
}

#vr-skin.map-expanded-open #vr-logo,
#vr-skin.map-expanded-open #vr-infobar,
#vr-skin.map-expanded-open .mascot-wrapper {
  display: none !important;
  pointer-events: none !important;
}

.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);
}

/* Wrapper for dot + radar */
.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);
}

/* Radar / heading cone */
.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; }

/* Vietnamese sovereignty labels */
.vr-map-vn-label {
  background: rgba(201, 33, 39, 0.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.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);
}

.vr-map-img { transition: transform 0.15s, filter 0.15s; }
.vr-map-img:hover,
.vr-map-img.active {
  transform: scale(1.2) translateY(-2px);
  filter: drop-shadow(0 0 4px var(--color-primary));
}

/* Info Modal — full-screen overlay */
#vr-info-panel {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity var(--anim-panel);
}
#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-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.vr-modal-box {
  position: relative;
  width: 92%;
  max-width: 680px;
  max-height: 80vh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--anim-panel);
}

.vr-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 2px;
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.vr-info-tabs {
  display: flex;
  gap: 0;
  padding: 4px 20px 0;
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.vr-tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.vr-tab-btn:hover  { color: rgba(255, 255, 255, 0.85); }
.vr-tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.vr-modal-body {
  flex: 1;
  overflow-y: auto;
  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.15); border-radius: 2px; }
.vr-modal-body::-webkit-scrollbar-track { background: transparent; }

.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); }

.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-sm);
  cursor: zoom-in;
  transition: opacity var(--anim-fade);
}
.vr-gallery-img:hover { opacity: 0.85; }

#vr-info-video iframe {
  display: block;
  width: 100%;
  height: 360px;
  border-radius: var(--radius-sm);
  border: none;
}

/* Multi-video gallery (13.3) */
.vr-video-gallery {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
  scrollbar-width: thin;
}
.vr-video-gallery::-webkit-scrollbar { height: 4px; }
.vr-video-gallery::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 2px; }
.vr-video-gallery::-webkit-scrollbar-track { background: transparent; }

.vr-video-thumb {
  position: relative;
  flex-shrink: 0;
  width: 140px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
  background: rgba(0,0,0,0.4);
}
.vr-video-thumb:hover { border-color: var(--color-primary); }
.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);
  transition: color 0.15s;
}
.vr-video-thumb:hover .vr-video-play-icon { color: #fff; }
.vr-video-thumb.active .vr-video-play-icon { color: var(--color-primary); }

#vr-video-player-wrap iframe {
  display: block;
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  border: none;
}

/* Uploaded video player (13.3) */
.vr-video-player {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius-sm);
  background: #000;
}

/* Hide all UI when info modal is open */
#vr-skin.info-modal-open #vr-navbar,
#vr-skin.info-modal-open #vr-controls,
#vr-skin.info-modal-open #vr-infobar,
#vr-skin.info-modal-open #vr-category,
#vr-skin.info-modal-open #btn-sidebar-toggle,
#vr-skin.info-modal-open #vr-list-scenes,
#vr-skin.info-modal-open .mascot-wrapper,
#vr-skin.info-modal-open #vr-logo {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Narration Panel */
#vr-narration {
  right: 16px;
  top: 50%;
  transform: translateY(-50%) translateX(0);
  width: 300px;
  max-height: 70vh;
}
#vr-narration.hidden { transform: translateY(-50%) translateX(20px); }

#vr-narration-items {
  overflow-y: auto;
  flex: 1;
  padding-bottom: 16px;
}

#vr-narration-items::-webkit-scrollbar { width: 4px; }
#vr-narration-items::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 2px; }
#vr-narration-items::-webkit-scrollbar-track { background: transparent; }

.vr-narration-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background var(--anim-fade);
}
.vr-narration-row:hover { background: rgba(255,255,255,0.1); }
.vr-narration-row.playing { background: rgba(26,115,232,0.14); }

.vr-narration-title {
  flex: 1;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vr-narration-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  flex-shrink: 0;
  transition: background var(--anim-fade), border-color var(--anim-fade);
}
.vr-narration-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--color-primary);
}
.vr-narration-btn svg { width: 12px; height: 12px; fill: currentColor; }

.vr-narration-settings {
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.vr-narration-settings label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--color-text-muted);
  cursor: pointer;
}
.vr-narration-settings input[type="checkbox"] { cursor: pointer; }
.vr-narration-settings .radio-group { display: flex; gap: 12px; }
.vr-narration-settings input[type="file"] { display: none; }
.vr-upload-btn {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: background var(--anim-fade);
}
.vr-upload-btn:hover { background: rgba(255,255,255,0.2); }


/* === 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: var(--radius-sm);
}

/* === 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);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 100;
}
.vr-hotspot-tooltip.visible { opacity: 1; }

/* Hotspot: Pulse (hs_location) */
.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);
  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);
  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 (ht_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);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  color: var(--color-text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.15s, background 0.15s;
}
.hs-callout:hover .hs-callout-label {
  background: rgba(0,0,0,0.9);
  transform: scale(1.05);
}
.hs-callout-arrow { color: var(--color-primary); flex-shrink: 0; }

/* Hotspot: Circle (ht_node) */
.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;
}

/* === Intro Screen === */
#vr-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}
#vr-intro.vr-intro-exit {
  opacity: 0;
  pointer-events: none;
}

.vr-intro-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--color-primary, #1a73e8) 0%, #000 100%);
  background-size: cover;
  background-position: center;
}
.vr-intro-dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45); /* overridden by JS via introCfg.background.overlayOpacity */
}

.vr-intro-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 48px;
  max-width: min(720px, 92vw);
  text-align: center;
  color: #fff;
}

.vr-intro-logo {
  max-width: 140px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.vr-intro-greeting {
  font-size: 22px;
  font-weight: 500;
  opacity: 0.9;
  margin: 0;
  -webkit-font-smoothing: subpixel-antialiased;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.vr-intro-title {
  font-size: clamp(28px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
  -webkit-font-smoothing: subpixel-antialiased;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.vr-intro-cta-text {
  display: inline-block;
  /* JS apply background-clip: text khi textColor là gradient */
}

.vr-intro-cta {
  margin-top: 8px;
  padding: 16px 40px;
  border-radius: var(--radius-pill, 9999px);
  background: var(--color-primary, #1a73e8); /* overridden by JS via ctaButton.background */
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 52px;
}
.vr-intro-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.vr-intro-cta:active {
  transform: translateY(0);
}

.vr-intro-langs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.vr-intro-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-pill, 9999px);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.vr-intro-lang-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}
.vr-intro-lang-btn.active {
  background: var(--color-primary, #1a73e8);
  border-color: transparent;
}
.vr-intro-lang-flag {
  font-size: 18px;
  line-height: 1;
}

/* Tablet */
@media (max-width: 1024px) {
  .vr-intro-content { gap: 20px; padding: 32px 24px; }
  .vr-intro-logo    { max-width: 110px; max-height: 110px; }
  .vr-intro-greeting{ font-size: 18px; }
  .vr-intro-cta     { padding: 14px 36px; font-size: 17px; }
}

/* Mobile portrait */
@media (max-width: 600px) {
  .vr-intro-content  { gap: 16px; padding: 24px 16px; }
  .vr-intro-logo     { max-width: 88px; max-height: 88px; }
  .vr-intro-greeting { font-size: 16px; }
  .vr-intro-title    { font-size: clamp(22px, 7vw, 36px); }
  .vr-intro-cta      { padding: 14px 32px; font-size: 16px; width: 100%; max-width: 320px; }
  .vr-intro-lang-btn { padding: 6px 12px; font-size: 13px; }
}

/* Mobile landscape — compact để tránh overflow */
@media (max-height: 480px) and (orientation: landscape) {
  .vr-intro-content  { gap: 8px; padding: 12px 20px; }
  .vr-intro-logo     { max-width: 56px; max-height: 56px; }
  .vr-intro-greeting { font-size: 14px; }
  .vr-intro-title    { font-size: clamp(18px, 4vw, 28px); }
  .vr-intro-cta      { padding: 10px 28px; font-size: 15px; min-height: 44px; }
}

/* Khi intro đang hiển thị → ẩn skin UI + hotspots bên dưới (giữ canvas pano2vr).
   Class được toggle trên player.divSkin (parent của #vr-skin và hotspot DOM elements). */
.vr-intro-hide-skin > * {
  visibility: hidden !important;
  pointer-events: none !important;
}
.hs-circle:hover .hs-circle-icon {
  transform: scale(1.12);
  border-color: var(--color-primary);
  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);
  border: 1px solid rgba(255,255,255,0.5);
}


/* Tablet (< 1200px): move map up to avoid covering navbar, disable showInitially */
@media (max-width: 1199px) {
  #vr-minimap {
    bottom: 90px;
  }
}

/* Mobile (< 600px) */
@media (max-width: 600px) {
  :root {
    --list-scenes-height: 140px;
    --mascot-size:        64px;
  }

  /* Logo & category nằm dưới infobar để tránh đè chồng — JS tính chính xác */
  #vr-logo { top: 80px; left: 12px; padding: 6px 12px; transform: scale(0.85); transform-origin: left top; }
  #vr-logo .logo-text { font-size: 15px; }

  #vr-infobar {
    top: 8px;
    left: 50%;
    transform: translateX(-50%) !important;
    transform-origin: top center;
    -webkit-font-smoothing: subpixel-antialiased;
    min-width: 0;
    width: calc(100vw - 100px);
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    padding: 4px;
  }
  #vr-infobar .scene-title { font-size: 10px; }
  #vr-infobar .infobar-dot { display: none; }
  #vr-infobar .breadcrumb-tag { font-size: 14px; }

  /* Navbar: scale 0.8 như classic, giữ tỉ lệ gọn trên mobile */
  #vr-navbar {
    bottom: 12px;
    padding: 8px 12px;
    gap: 0;
    transform: translateX(-50%) scale(0.8);
    transform-origin: bottom center;
  }

  /* Category Sidebar: scale 0.8 như classic — JS tính chính xác */
  #vr-category {
    top: 160px;
    left: 10px;
    border-radius: var(--radius-md);
    max-height: calc(100vh - 160px - 88px);
    transform: scale(0.8);
    transform-origin: left center;
  }

  #vr-controls { top: 8px; right: 10px; transform: scale(0.85); transform-origin: right top; }

  .mascot-wrapper { bottom: 74px; right: 10px; }
  .mascot-wrapper.pos-left { left: 10px; right: auto; }
  #vr-mascot { width: 64px; }

  /* List Scenes */
  .scene-card { width: 90px; }
  .vr-list-scroll { height: 100%; }
  .vr-list-arrow { display: none; }
  #btn-list-toggle { right: 10px; }

  /* Other panels */
  #vr-minimap, #vr-narration {
    width: calc(100vw - 32px);
    max-height: 55vh;
    top: auto;
    bottom: 80px;
    transform: translateY(0) translateX(0);
  }
  #vr-narration.hidden {
    transform: translateY(20px) translateX(0);
  }
  #vr-minimap.hidden {
    transform: translateY(calc(100% + 100px)) translateX(0);
  }

  #vr-skin.map-expanded-open #vr-minimap {
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    bottom: auto;
    transform: none;
  }

  #vr-skin.map-expanded-open .vr-map-inner {
    width: 100vw;
    height: 100vh;
  }

  #vr-skin.map-expanded-open #vr-map-container,
  #vr-skin.map-expanded-open .leaflet-container {
    width: 100vw !important;
    height: 100vh !important;
  }

}

/* Scene list dọc khi portrait + > 6 cảnh (many-scenes) — aspect-ratio driven */
#vr-skin.many-scenes #vr-list-scenes {
  top: 90px;
  bottom: 100px;
  height: auto;
  flex-direction: column;
  padding: 12px 8px 8px;
  overflow: hidden;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
}
#vr-skin.many-scenes #vr-list-scenes.hidden {
  transform: translateY(calc(100% + 100px));
}
#vr-skin.many-scenes #vr-list-scenes > div {
  flex: 1 1 0;
  min-height: 0;
  order: 0;
}
#vr-skin.many-scenes .vr-list-close-btn {
  position: static;
  order: 1;
  margin-top: 12px;
  transform: none;
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: transparent;
  border-color: transparent;
}
#vr-skin.many-scenes .vr-list-scroll {
  display: grid;
  grid-template-columns: repeat(auto-fill, 130px);
  justify-content: center;
  align-content: flex-start;
  gap: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0;
  height: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--color-secondary) transparent;
}
#vr-skin.many-scenes .vr-list-scroll::-webkit-scrollbar {
  width: 3px;
}
#vr-skin.many-scenes .vr-list-scroll::-webkit-scrollbar-track {
  background: transparent;
}
#vr-skin.many-scenes .vr-list-scroll::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: 2px;
}
#vr-skin.many-scenes .scene-card {
  width: 130px;
  height: 110px;
}
#vr-skin.many-scenes .vr-list-arrow {
  display: none;
}
#vr-skin.many-scenes:has(#vr-list-scenes:not(.hidden)) .mascot-wrapper {
  bottom: 74px;
}
/* Ẩn category, controls, mascot, logo khi scene list dọc mở */
#vr-skin.many-scenes:has(#vr-list-scenes:not(.hidden)) #vr-category,
#vr-skin.many-scenes:has(#vr-list-scenes:not(.hidden)) #vr-controls,
#vr-skin.many-scenes:has(#vr-list-scenes:not(.hidden)) .mascot-wrapper,
#vr-skin.many-scenes:has(#vr-list-scenes:not(.hidden)) #vr-logo {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Language Dropdown */
#vr-language-dropdown {
  position: absolute;
  bottom: calc(var(--navbar-height) + 36px);
  transform: translateX(-50%) translateZ(0);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  z-index: 21;
  transition: opacity var(--anim-fade), transform var(--anim-fade);
}

#vr-language-dropdown.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
}

#vr-language-dropdown.hidden .interactive,
#vr-language-dropdown.hidden .vr-lang-item {
  pointer-events: none;
}

.vr-lang-item {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vr-lang-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.vr-lang-item.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ======== GLASS THEME OVERRIDES ======== */

/* Force dark text for all skin elements */
#vr-skin {
  color: var(--color-text);
}

/* Keep white for specific elements that look better on glass */
#vr-skin .scene-card-title,
#vr-skin .scene-card-num,
#vr-skin .breadcrumb-tag,
#vr-skin .vr-narration-title,
#vr-skin .hs-circle-label,
#vr-skin .vr-info-section,
#vr-skin .vr-panel-header,
#vr-skin .vr-intro-content,
#vr-skin .vr-intro-greeting,
#vr-skin .vr-intro-title,
#vr-skin .vr-intro-cta-text,
#vr-skin .vr-map-vn-label,
#vr-skin .vr-hotspot-tooltip,
#vr-skin .vr-list-arrow,
#vr-skin .hs-callout-label,
#vr-skin .vr-map-dot,
#vr-skin .vr-map-cluster,
#vr-skin .vr-modal-header {
  color: #ffffff !important;
}

/* Light Field: Halo Glow ambient layers */
body::before,
body::after {
  content: '';
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}

body::before {
  top: -20%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--halo-primary) 0%, transparent 70%);
  animation: halo-pulse 8s ease-in-out infinite;
}

body::after {
  bottom: 10%;
  left: 5%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--halo-soft) 0%, transparent 70%);
  animation: halo-pulse 10s ease-in-out infinite reverse;
}

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

/* Navbar — Light Field glass, match classic height */
#vr-navbar {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur-webkit);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  height: var(--navbar-height);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.50);
  color: var(--color-text);
}

/* Nav buttons — larger icons, spring interaction */
.vr-btn {
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  transition:
    background var(--anim-fade),
    transform var(--anim-scale),
    box-shadow var(--anim-fade),
    color var(--anim-fade);
}

.vr-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  transform: translateY(-1px);
}

.vr-btn:active {
  transform: translateY(1px) scale(0.98);
}

.vr-btn.active {
  background: rgba(74, 158, 187, 0.25);
  border-color: var(--color-primary);
  color: var(--color-text);
  box-shadow:
    0 0 20px rgba(74, 158, 187, 0.35),
    0 2px 8px rgba(0, 0, 0, 0.10);
}

.vr-btn svg,
.vr-btn i,
.vr-btn [class*="icon"] {
  color: var(--color-text);
}

.vr-btn .btn-label {
  color: var(--color-text);
  font-size: 11px;
  font-weight: 600;
}

.vr-divider {
  background: rgba(0, 0, 0, 0.15);
  height: 28px;
  margin: 0 8px;
}

/* Controls — Light Field */
.vr-controls-group {
  background: transparent;
  border: none;
  gap: 8px;
}

.vr-ctrl-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.50);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--color-text);
  transition:
    background var(--anim-fade),
    transform var(--anim-scale),
    box-shadow var(--anim-fade),
    color var(--anim-fade);
}

.vr-ctrl-btn svg {
  color: var(--color-text);
}

.vr-ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.70);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.vr-ctrl-btn:active {
  transform: translateY(0) scale(0.95);
}

.vr-ctrl-btn.active {
  background: rgba(74, 158, 187, 0.30);
  border-color: var(--color-primary);
  box-shadow:
    0 0 24px rgba(74, 158, 187, 0.40),
    0 4px 12px rgba(0, 0, 0, 0.10);
}

/* Scene list */
#vr-list-scenes {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.50) 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
  border-top: none;
}

/* Scene cards */
.scene-card {
  width: 120px;
  height: 95px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(0, 0, 0, 0.10);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition:
    transform var(--anim-scale),
    box-shadow var(--anim-fade),
    border-color var(--anim-fade);
}

.scene-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  border-color: rgba(0, 0, 0, 0.15);
}

.scene-card.active {
  border-color: var(--color-primary);
  transform: translateY(-8px) scale(1.02);
  box-shadow:
    0 0 30px rgba(74, 158, 187, 0.35),
    0 12px 32px rgba(0, 0, 0, 0.18);
}

.scene-card-overlay {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.50) 0%, transparent 60%);
  border-radius: inherit;
}

/* Sidebar — Light Field glass */
#vr-category {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur-webkit);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

.vr-category-item {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  transition:
    background var(--anim-fade),
    transform var(--anim-scale);
}

.vr-category-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

.vr-category-item.active {
  background: rgba(74, 158, 187, 0.20);
  border-left: 3px solid var(--color-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.30);
}

/* Infobar */
#vr-infobar {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur-webkit);
  -webkit-font-smoothing: subpixel-antialiased;
  transform: translateX(-50%) translateZ(0);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  font-size: 14px;
}

#vr-infobar * {
  color: var(--color-text);
}

/* Category text */
#vr-category {
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur-webkit);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
  color: var(--color-text);
}

#vr-category * {
  color: var(--color-text);
}

.vr-category-item {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  transition:
    background var(--anim-fade),
    transform var(--anim-scale);
}

/* Scene card text */
.scene-card-title {
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
}

.scene-card-desc {
  color: var(--color-text-muted);
  font-size: 11px;
}

/* Modal text */
.vr-modal-box {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-md);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.60);
  color: var(--color-text);
}

.vr-modal-box * {
  color: var(--color-text);
}

/* Map */
#vr-minimap {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

/* Close button */
.vr-list-close-btn {
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(0, 0, 0, 0.10);
  color: var(--color-text);
  transition:
    background var(--anim-fade),
    transform var(--anim-scale),
    color var(--anim-fade);
}

.vr-list-close-btn:hover {
  background: rgba(255, 255, 255, 0.80);
  color: var(--color-text);
}

.vr-list-close-btn svg {
  color: var(--color-text);
}

/* Toggle tab */
#btn-sidebar-toggle {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
}

#btn-sidebar-toggle svg {
  color: var(--color-text);
}

/* ─── Location Labels (nhãn vị trí) ─────────────────────────────────────── */
.vr-label {
  position: absolute;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

/* Flag — nằm NGANG với elbow (cùng top) */
.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);
}

/* Stem — line chéo rotate(35°), đỉnh tại ≈ (23px, -33px) */
.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;
}

/* Elbow — centered tại junction (±18px) */
.vr-label-elbow {
  position: absolute;
  width: 2px;
  height: 36px;
  top: -51px;
  left: 22px;
  background: rgba(255,255,255,0.85);
  border-radius: 2px;
}

/* Icon — wrapper dùng lại hs-pulse-ring + hs-pulse-dot */
.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;
}

/* ── Badge labels (non-callout types) ─────────────────────────────────── */
.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%;
}

/* preview-room: iframe 360° box */
.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);
}
