/* Add-ons for the Marzipano tour: branding colours, dock (logo, music, gyro),
   welcome screen, floor plan minimap, and the editor panel (edit mode only). */

/* ---------- Brand colours (set by branding.js from data.js) ---------- */
#titleBar .sceneName,
#sceneList .scenes,
.link-hotspot-tooltip,
.info-hotspot .info-hotspot-title-wrapper,
.info-hotspot .info-hotspot-text,
.info-hotspot-modal .info-hotspot-text { background-color: var(--tour-dark, rgba(58,68,84,0.8)); }

#fullscreenToggle, #autorotateToggle, #sceneListToggle,
.no-touch #sceneList .scene:hover, #sceneList .scene.current,
.info-hotspot .info-hotspot-header, .info-hotspot-modal .info-hotspot-header,
.viewControlButton { background-color: var(--tour-light, rgba(103,115,131,0.8)); }

.info-hotspot .info-hotspot-close-wrapper,
.info-hotspot-modal .info-hotspot-close-wrapper { background-color: var(--tour-dark, rgba(78,88,104,0.8)); }

/* ---------- Floating round buttons at the bottom (no bar) ---------- */
/* --bar-h is the space the buttons take at the bottom; the logo and map sit above it. */
:root { --bar-glass: rgba(0, 0, 0, 0.32); --bar-glass-hover: rgba(255, 255, 255, 0.22); --bar-h: 54px; }
#titleBar { display: none; }
#sceneListToggle, #autorotateToggle, #fullscreenToggle,
.mobile #sceneListToggle, .mobile #autorotateToggle, .mobile #fullscreenToggle {
  top: auto; bottom: 12px; width: 42px; height: 42px; padding: 0; border-radius: 50%;
  background-color: var(--bar-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
#sceneListToggle .icon, #autorotateToggle .icon, #fullscreenToggle .icon,
.mobile #sceneListToggle .icon, .mobile #autorotateToggle .icon, .mobile #fullscreenToggle .icon { top: 9px; right: 9px; width: 24px; height: 24px; }
#sceneListToggle { left: 12px; }
#fullscreenToggle { right: 12px; }
#autorotateToggle, .mobile #autorotateToggle { right: 12px; }
body.fullscreen-enabled #autorotateToggle, body.fullscreen-enabled.mobile #autorotateToggle { right: 62px; }
.no-touch #sceneListToggle:hover, .no-touch #autorotateToggle:hover, .no-touch #fullscreenToggle:hover { background-color: var(--bar-glass-hover); }
/* Room menu: a see-through panel that opens above the menu button */
#sceneList .scenes { background-color: var(--bar-glass); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-radius: 10px; overflow: hidden; }
#sceneList .scene .text { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.no-touch #sceneList .scene:hover { background-color: var(--bar-glass-hover); }
#sceneList .scene.current { background-color: var(--bar-glass-hover); box-shadow: inset 3px 0 0 var(--tour-accent, #fff); }
#sceneList, .mobile #sceneList { top: auto; bottom: var(--bar-h); height: auto; padding-top: 0; max-height: calc(100% - var(--bar-h) - 12px); overflow-y: auto; }
#sceneList.enabled { margin-left: 232px; }
.mobile #sceneList { width: calc(100% - 24px); left: calc(-100% + 24px); }
.mobile #sceneList.enabled { margin-left: calc(100% - 12px); }
.mobile #sceneList .scenes { height: auto; }
.viewControlButton { bottom: var(--bar-h); }

/* ---------- Floor cursor and room links (rings lying on the floor) ---------- */
.floor-cursor svg, .tour-link svg { display: block; width: 100%; height: 100%; overflow: visible; }
.ring-fill { fill: #fff; fill-opacity: .18; }
.ring-outer { fill: none; stroke: #fff; stroke-width: 9; }
.ring-inner { fill: none; stroke: #000; stroke-opacity: .3; stroke-width: 4; }
.floor-cursor { pointer-events: none; opacity: 0; transition: opacity .15s; }
.floor-cursor.show { opacity: .95; }
.tour-link { cursor: pointer; outline: none; }
.tour-link .ring-fill { fill: var(--tour-accent, #0e6a7d); fill-opacity: .4; transition: fill-opacity .15s; }
.tour-link:hover .ring-fill, .tour-link:focus-visible .ring-fill { fill-opacity: .75; }
.tour-link .ring-outer { stroke-width: 10; }
.tour-link .ring-inner { display: none; }
.tour-link svg { animation: ring-pulse 2.6s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes ring-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .tour-link svg { animation: none; } }
.tour-link.upright { width: var(--link-size, 34px); height: var(--link-size, 34px); margin: calc(var(--link-size, 34px) / -2) 0 0 calc(var(--link-size, 34px) / -2); filter: drop-shadow(0 1px 4px rgba(0,0,0,.45)); }
.tour-link-label { pointer-events: none; }
/* (Marzipano sets display on the hotspot itself every frame, so hide the text inside it.) */
body.ui-no-linklabels:not(.tour-editing) .tour-link-label span { display: none !important; }
.tour-link-label span { position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - var(--link-size, 34px) / 2 - 8px)); white-space: nowrap;
  font: 600 13px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; color: #fff; padding: 7px 12px; border-radius: 999px;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s; }
.tour-link-label.show span, .touch .tour-link-label span { opacity: 1; }

/* ---------- Info points: pin on a thin line ---------- */
.tour-info { position: relative; width: 0; height: 0; }
.tour-info.open { z-index: 5; }
.tour-info::after { content: ""; position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 3px rgba(0,0,0,.6); }
.tour-info .ti-line { position: absolute; left: -1px; bottom: 0; width: 2px; height: 44px; background: rgba(255,255,255,.9); box-shadow: 0 0 2px rgba(0,0,0,.45); pointer-events: none; }
.tour-info .ti-pin { position: absolute; left: 0; top: -44px; width: 24px; height: 24px; transform: translate(-50%, -50%); border: 0; padding: 0; border-radius: 50%;
  cursor: pointer; background: var(--tour-accent, #0e6a7d); box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .15s; }
.tour-info .ti-pin::after { content: ""; position: absolute; inset: 5px; border: 2.5px solid #fff; border-radius: 50%; }
.tour-info .ti-pin:hover, .tour-info .ti-pin:focus-visible { transform: translate(-50%, -50%) scale(1.15); outline: none; }
.tour-info .ti-card { display: none; position: absolute; left: 20px; top: -44px; transform: translateY(-50%); width: 250px; max-width: 70vw;
  padding: 12px 34px 12px 14px; border-radius: 10px; color: #fff; font: 14px/1.45 "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: rgba(0,0,0,.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.tour-info .ti-title { display: block; font-size: 15px; margin-bottom: 4px; }
.tour-info .ti-body { color: rgba(255,255,255,.85); }
.tour-info .ti-body a { color: #fff; }
.tour-info .ti-close { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; background: none; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; opacity: .7; }
.tour-info .ti-close:hover { opacity: 1; }
.tour-info.open .ti-card, .no-touch .tour-info .ti-pin:hover + .ti-card { display: block; }

/* ---------- Client choices (settings.ui): hide features, button style ---------- */
body.ui-no-roommenu #sceneListToggle, body.ui-no-roommenu #sceneList { display: none !important; }
body.ui-no-autorotate #autorotateToggle { display: none !important; }
body.ui-no-minimap #minimap { display: none !important; }
body.ui-no-cursor .floor-cursor { display: none !important; }
/* "brand": solid brand colour buttons */
body.btn-brand #sceneListToggle, body.btn-brand #autorotateToggle, body.btn-brand #fullscreenToggle,
body.btn-brand .td-btn, body.btn-brand #minimap .mm-toggle { background-color: var(--tour-accent, #3a4454); -webkit-backdrop-filter: none; backdrop-filter: none; }
body.btn-brand #sceneList .scenes { background-color: var(--tour-dark, rgba(58,68,84,.9)); }
/* "light": white buttons with dark icons */
body.btn-light #sceneListToggle, body.btn-light #autorotateToggle, body.btn-light #fullscreenToggle,
body.btn-light .td-btn, body.btn-light #minimap .mm-toggle { background-color: rgba(255,255,255,.9); color: #1d2228; }
body.btn-light #sceneListToggle .icon, body.btn-light #autorotateToggle .icon, body.btn-light #fullscreenToggle .icon { filter: invert(1); }
body.btn-light .td-btn.on { background: var(--tour-accent, #3a4454); color: #fff; }
body.btn-light #sceneList .scenes { background-color: rgba(255,255,255,.88); }
body.btn-light #sceneList .scene .text { color: #1d2228; text-shadow: none; }
body.btn-light.no-touch #sceneList .scene:hover, body.btn-light #sceneList .scene.current { background-color: rgba(0,0,0,.08); }

/* ---------- Dock: logo + round buttons, bottom left ---------- */
#tourDock { position: absolute; left: 12px; bottom: calc(var(--bar-h) + 12px); z-index: 20; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; pointer-events: none; }
#tourDock > * { pointer-events: auto; }
#tourDock .td-logo { max-width: 150px; max-height: 56px; display: block; filter: drop-shadow(0 1px 4px rgba(0,0,0,.5)); }
#tourDock .td-btns { display: flex; gap: 8px; }
.td-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: #fff;
  background: var(--tour-light, rgba(103,115,131,0.85)); box-shadow: 0 2px 8px rgba(0,0,0,.35); padding: 0; }
.td-btn svg { width: 22px; height: 22px; }
.td-btn.on { background: #fff; color: var(--tour-accent, #3a4454); }
.td-btn[hidden], #tourDock .td-logo[hidden] { display: none; }
#tourDock { transition: opacity .3s; }
#sceneList.enabled ~ #tourDock { opacity: 0; pointer-events: none; }
#sceneList.enabled ~ #tourDock > * { pointer-events: none; }
.view-control-buttons #tourDock { bottom: calc(var(--bar-h) * 2 + 12px); }

/* ---------- Welcome screen ---------- */
#tourIntro { position: absolute; inset: 0; z-index: 12000; display: grid; place-items: center; padding: 16px;
  background: rgba(10,12,16,.55); backdrop-filter: blur(3px); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
#tourIntro[hidden] { display: none; }
#tourIntro .ti-card { width: min(420px, 100%); background: rgba(20,24,30,.88); color: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
#tourIntro .ti-logo { max-width: 180px; max-height: 70px; margin: 0 auto 14px; display: block; }
#tourIntro .ti-logo[hidden] { display: none; }
#tourIntro h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px; line-height: 1.2; }
#tourIntro p { font-size: 15px; line-height: 1.5; color: rgba(255,255,255,.82); margin: 0 0 20px; white-space: pre-line; }
#tourIntro .ti-start { border: 0; border-radius: 999px; padding: 13px 26px; font-size: 16px; font-weight: 600; cursor: pointer; color: #fff;
  background: var(--tour-accent, #677383); }
#tourIntro .ti-start:hover { filter: brightness(1.1); }
#tourIntro .ti-hint { font-size: 12px; color: rgba(255,255,255,.6); margin: 16px 0 0; }

/* ---------- Intro video (plays before the tour, then fades out) ---------- */
#tourVideo { position: absolute; inset: 0; z-index: 12500; background: #000; transition: opacity .6s ease; }
#tourVideo[hidden] { display: none; }
#tourVideo.is-done { opacity: 0; pointer-events: none; }
#tourVideo video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
#tourVideo .tv-bar { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 8px; }
#tourVideo .tv-bar button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px;
  background: rgba(0,0,0,.45); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; cursor: pointer;
  font: 600 14px/1 "Helvetica Neue", Helvetica, Arial, sans-serif; }
#tourVideo .tv-bar .tv-sound { width: 40px; padding: 0; justify-content: center; }
#tourVideo .tv-bar svg { width: 18px; height: 18px; }
#tourVideo .tv-bar button:hover { background: rgba(0,0,0,.7); border-color: rgba(255,255,255,.6); }
#tourVideo .tv-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #111; cursor: pointer; display: grid; place-items: center; }
#tourVideo .tv-play[hidden] { display: none; }
#tourVideo .tv-play svg { width: 30px; height: 30px; margin-left: 4px; }
#tourVideo button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Floor plan minimap, bottom right ---------- */
#minimap { position: absolute; right: 12px; bottom: calc(var(--bar-h) + 12px); z-index: 20; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
#minimap[hidden] { display: none; }
#minimap .mm-toggle { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; display: grid; place-items: center;
  background: var(--tour-light, rgba(103,115,131,0.85)); box-shadow: 0 2px 8px rgba(0,0,0,.35); padding: 0; }
#minimap .mm-toggle svg { width: 24px; height: 24px; }
#minimap .mm-panel { display: none; width: 260px; background: rgba(255,255,255,.94); border-radius: 12px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
#minimap.open .mm-panel { display: block; }
#minimap.open .mm-toggle { display: none; }
.mobile #minimap .mm-panel { width: 190px; }
#minimap .mm-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 6px 6px 12px; font-size: 13px; font-weight: 600; color: #fff;
  background: var(--tour-dark, rgba(58,68,84,0.9)); }
#minimap .mm-close { border: 0; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; width: 28px; height: 28px; }
#minimap .mm-plan { position: relative; }
#minimap .mm-plan img { display: block; width: 100%; height: auto; }
#minimap .mm-plan img[hidden] { display: none; }
#minimap .mm-empty { padding: 28px 14px; font-size: 13px; color: #555; text-align: center; }
#minimap .mm-empty[hidden] { display: none; }
#minimap .mm-plan.picking { cursor: crosshair; outline: 3px dashed #f5a623; outline-offset: -3px; }
.mm-dot { position: absolute; width: 0; height: 0; padding: 0; border: 0; background: none; cursor: pointer; }
.mm-dot .mm-pin { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 3px solid var(--tour-accent, #3a4454); box-sizing: border-box; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.mm-dot:hover .mm-pin { transform: scale(1.2); }
.mm-dot.current .mm-pin { background: var(--tour-accent, #3a4454); border-color: #fff; }
.mm-dot .mm-cone { position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; display: none; pointer-events: none; }
.mm-dot .mm-cone path { fill: var(--tour-accent, #3a4454); fill-opacity: .35; }
.mm-dot.current .mm-cone { display: block; }
.mm-dot .mm-label { position: absolute; left: 12px; top: -10px; white-space: nowrap; font-size: 11px; font-weight: 600; color: #fff; padding: 2px 6px; border-radius: 4px;
  background: var(--tour-dark, rgba(58,68,84,0.9)); opacity: 0; transition: opacity .15s; pointer-events: none; }
.mm-dot:hover .mm-label, .mm-dot.current .mm-label { opacity: 1; }
.mm-dot.mm-flip .mm-label { left: auto; right: 12px; }

/* ---------- Editor (only with ?edit / #edit) ---------- */
body.tour-editing { width: calc(100% - 340px); position: relative; }
#tourEditor { position: fixed; top: 0; right: 0; bottom: 0; width: 340px; z-index: 13000; overflow-y: auto;
  background: #16191e; color: #e9ecf0; font: 13px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif; border-left: 1px solid #2b3038; }
#tourEditor * { box-sizing: border-box; }
#tourEditor header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: #1d2127; border-bottom: 1px solid #2b3038; }
#tourEditor header strong { font-size: 14px; flex: 1; }
#tourEditor .te-dirty { color: #f5b942; font-size: 12px; }
#tourEditor details { border-bottom: 1px solid #2b3038; padding: 4px 14px 12px; }
#tourEditor summary { cursor: pointer; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #9aa4b2; padding: 8px 0; }
#tourEditor label { display: block; margin: 8px 0; color: #c6ccd5; }
#tourEditor label.te-check { display: flex; gap: 8px; align-items: flex-start; }
#tourEditor input[type=text], #tourEditor input:not([type]), #tourEditor textarea, #tourEditor select {
  display: block; width: 100%; margin-top: 4px; padding: 7px 8px; border-radius: 6px; border: 1px solid #353b45; background: #0f1215; color: #fff; font: inherit; }
#tourEditor textarea { resize: vertical; }
#tourEditor input[type=range] { width: 100%; }
#tourEditor input[type=color] { display: block; margin-top: 4px; width: 60px; height: 32px; border: 1px solid #353b45; border-radius: 6px; background: none; padding: 2px; }
#tourEditor input[type=file] { display: block; margin-top: 4px; font-size: 12px; color: #c6ccd5; max-width: 100%; }
#tourEditor button { font: inherit; color: #e9ecf0; background: #2a2f37; border: 1px solid #3a404b; border-radius: 6px; padding: 6px 10px; cursor: pointer; }
#tourEditor button:hover { border-color: #6aa9ff; }
#tourEditor button.on { background: #6aa9ff; color: #08111f; border-color: #6aa9ff; }
#tourEditor button.te-primary { background: #3d8bfd; border-color: #3d8bfd; color: #fff; font-weight: 600; }
#tourEditor button.te-danger { color: #ff8a80; }
#tourEditor .te-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#tourEditor .te-hint { color: #8b95a3; font-size: 12px; margin: 6px 0; }
#tourEditor .te-status { color: #f5b942; }
#tourEditor .te-read { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: #8b95a3; }
#tourEditor .te-banner { margin: 10px 14px 0; padding: 10px; border-radius: 8px; background: #3a2f12; color: #ffe2a8; }
#tourEditor .te-banner[hidden], #tourEditor [hidden] { display: none; }
#tourEditor ul { list-style: none; margin: 6px 0; padding: 0; }
#tourEditor li { padding: 6px 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
#tourEditor li:hover { background: #222730; }
#tourEditor li.sel { background: #23344f; }
#tourEditor li .te-ico { width: 18px; text-align: center; color: #6aa9ff; }
#tourEditor .te-sel { margin-top: 8px; padding: 10px; border-radius: 8px; background: #1e232a; }
#tourEditor.te-min { width: 160px; bottom: auto; }
#tourEditor.te-min .te-body { display: none; }
body.tour-editing .hotspot { touch-action: none; }
body.tour-editing .tour-link, body.tour-editing .tour-info .ti-pin { cursor: grab; }
body.tour-editing.te-placing #pano { cursor: crosshair; }
.tour-selected.tour-link .ring-outer { stroke: #ffd54a; }
.tour-selected .ti-pin { outline: 3px solid #ffd54a; outline-offset: 3px; }
