/* 360Viewer — top-right dock: "Now playing" pill + settings panel.
   Adapted from the user's own depth-timeline-audio-player snippet
   (OSMO Glass-Effect layers). Scoped to the 360 viewer. */

/* ---- Self-hosted PP Neue fonts ---- */
@font-face {
	font-family: "PP Neue Corp Tight V360";
	src: url("lib/fonts/PPNeueCorp-TightUltrabold.woff2") format("woff2");
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: "PP Neue Montreal V360";
	src: url("lib/fonts/PPNeueMontreal-Regular.woff2") format("woff2");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: "PP Neue Montreal V360";
	src: url("lib/fonts/PPNeueMontreal-Medium.woff2") format("woff2");
	font-weight: 500;
	font-display: swap;
}

/* ---- Glass-effect layers ---- */
.v360-viewer .glass-effect {
	-webkit-backdrop-filter: saturate(120%) blur(0.75em);
	backdrop-filter: saturate(120%) blur(0.75em);
	pointer-events: none;
	isolation: isolate;
	border-radius: inherit;
	position: absolute;
	inset: 0;
	overflow: hidden;
}
.v360-viewer .glass-effect__fill { border-radius: inherit; background-color: rgba(28, 30, 36, 0.34); position: absolute; inset: 0; }
.v360-viewer .glass-effect__fill-burn { opacity: 0.05; mix-blend-mode: color-burn; border-radius: inherit; background-color: currentColor; position: absolute; inset: 0; }
.v360-viewer .glass-effect__highlight-soft { mix-blend-mode: overlay; border-radius: inherit; position: absolute; inset: 0; box-shadow: inset -0.28em -0.28em 0.09em -0.33em rgba(255, 255, 255, 0.5); }
.v360-viewer .glass-effect__highlight-strong { border-radius: inherit; position: absolute; inset: 0; box-shadow: inset 0.28em 0.28em 0.09em -0.33em rgba(255, 255, 255, 0.8); }
.v360-viewer .glass-effect__edge-light { border-radius: inherit; mix-blend-mode: plus-lighter; position: absolute; inset: 0; box-shadow: inset 0.19em 0.28em 0.09em -0.19em rgba(179, 179, 179, 0.5); }
.v360-viewer .glass-effect__edge-dark { mix-blend-mode: overlay; border-radius: inherit; position: absolute; inset: 0; box-shadow: inset -0.19em -0.28em 0.09em -0.19em rgba(179, 179, 179, 0.3); }
.v360-viewer .glass-effect__inner-glow { mix-blend-mode: darken; border-radius: inherit; position: absolute; inset: 0; box-shadow: inset 0 0 1.75em rgba(242, 242, 242, 0.3); }

/* ---- Dock (top-right) ---- */
.v360-dock {
	--v360-ease: cubic-bezier(0.625, 0.05, 0, 1);
	--v360-accent: #ff6a3d;
	position: absolute;
	top: clamp(14px, 3vh, 22px);
	right: clamp(14px, 3vw, 24px);
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 0.65em;
	font-family: "PP Neue Montreal V360", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 1rem;
}
.v360-dock :where(button) { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.v360-dock :where(*, *::before, *::after) { box-sizing: border-box; }

/* Now-playing pill */
.v360-np {
	color: #f4f3f1;
	display: flex;
	align-items: center;
	gap: 0.6em;
	max-width: min(26em, 52vw);
	padding: 0.6em 1.1em;
	border-radius: 100em;
	position: relative;
	box-shadow: 0 0.5em 1em -0.75em rgba(0, 0, 0, 0.5);
	transition: transform 0.4s var(--v360-ease);
}
.v360-np:hover { transform: scale(1.03); }
.v360-np[hidden] { display: none; }
/* Track cover thumbnail inside the pill */
.v360-np__cover {
	flex: none;
	width: 1.9em;
	height: 1.9em;
	border-radius: 0.55em;
	object-fit: cover;
	display: block;
	position: relative;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Play/pause button inside the pill */
.v360-np__pp {
	flex: none;
	width: 1.5em;
	height: 1.5em;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #f4f3f1;
	position: relative;
}
.v360-np__pp svg { width: 1.15em; height: 1.15em; display: block; }
.v360-np__pp .v360-icon-pause { display: none; }
.v360-np[data-live] .v360-np__pp .v360-icon-play { display: none; }
.v360-np[data-live] .v360-np__pp .v360-icon-pause { display: block; }

.v360-np__label {
	flex: none;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.6875em;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.7);
	position: relative;
}
/* "Now playing:" only makes sense while actually playing. */
.v360-np:not([data-live]) .v360-np__label { display: none; }
.v360-np__title {
	min-width: 0;
	max-width: 12em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	text-transform: uppercase;
	font-family: "PP Neue Corp Tight V360", "Inter Tight V360", Arial, sans-serif;
	font-size: 1.25em;
	font-weight: 700;
	letter-spacing: 0.01em;
	position: relative;
}
/* Autoplay was refused by the browser — invite the visitor to start it.
   The pill breathes gently until the first click/tap anywhere on the page. */
.v360-np__hint { display: none; }
.v360-np[data-blocked] .v360-np__hint {
	display: block;
	flex: none;
	position: relative;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-size: 0.6875em;
	font-weight: 500;
	white-space: nowrap;
	color: rgba(255, 255, 255, 0.72);
}
.v360-np[data-blocked] { animation: v360-np-invite 2.6s ease-in-out infinite; }
@keyframes v360-np-invite {
	0%, 100% { box-shadow: 0 0.5em 1em -0.75em rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(255, 106, 61, 0.4); }
	50% { box-shadow: 0 0.5em 1em -0.75em rgba(0, 0, 0, 0.5), 0 0 0 0.55em rgba(255, 106, 61, 0); }
}

.v360-np__bars { flex: none; height: 0.9em; display: flex; align-items: center; gap: 0.14em; position: relative; }
.v360-np__bars span {
	flex: none;
	width: 0.15em;
	height: 100%;
	border-radius: 100em;
	background-color: var(--v360-accent);
	transform: scaleY(0.25);
	transform-origin: center;
	transition: transform 0.06s linear;
}
/* Idle CSS equalizer when playing but no analyser data yet. */
.v360-np[data-live] .v360-np__bars span { animation: v360-eq 0.9s ease-in-out infinite; }
.v360-np[data-live] .v360-np__bars span:nth-child(2) { animation-delay: 0.15s; }
.v360-np[data-live] .v360-np__bars span:nth-child(3) { animation-delay: 0.3s; }
.v360-np[data-live] .v360-np__bars span:nth-child(4) { animation-delay: 0.1s; }
.v360-np[data-live] .v360-np__bars span:nth-child(5) { animation-delay: 0.22s; }
.v360-np[data-analyser] .v360-np__bars span { animation: none; }
@keyframes v360-eq { 0%, 100% { transform: scaleY(0.25); } 50% { transform: scaleY(1); } }

/* Settings gear */
.v360-gear {
	flex: none;
	width: 2.5em;
	height: 2.5em;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 100em;
	color: rgba(255, 255, 255, 0.82);
	position: relative;
	box-shadow: 0 0.5em 1em -0.75em rgba(0, 0, 0, 0.5);
	transition: color 0.2s, transform 0.4s var(--v360-ease);
}
.v360-gear:hover { color: #fff; transform: scale(1.08); }
.v360-gear svg { width: 1.05em; height: 1.05em; position: relative; }

/* Settings panel (dropdown under the dock) */
.v360-set {
	--v360-ease: cubic-bezier(0.625, 0.05, 0, 1);
	position: absolute;
	top: clamp(58px, 8vh, 74px);
	right: clamp(14px, 3vw, 24px);
	z-index: 30;
	width: min(21em, 88vw);
	padding: 1em 1.25em;
	border-radius: 1.25em;
	color: #17181c;
	font-family: "PP Neue Montreal V360", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
	font-size: 1rem;
	display: flex;
	flex-direction: column;
	opacity: 0;
	transform: translateY(-0.6em) scale(0.98);
	transform-origin: top right;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.45s var(--v360-ease), opacity 0.3s, visibility 0s 0.45s;
	box-shadow: 0 1.5em 3em -1.5em rgba(0, 0, 0, 0.55);
}
.v360-set[data-open] {
	opacity: 1;
	transform: none;
	visibility: visible;
	pointer-events: auto;
	transition: transform 0.45s var(--v360-ease), opacity 0.3s, visibility 0s;
}
.v360-set :where(button) { appearance: none; -webkit-appearance: none; font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.v360-set :where(*, *::before, *::after) { box-sizing: border-box; }
/* A near-solid light panel so the dark text stays readable over any panorama. */
.v360-set .glass-effect {
	-webkit-backdrop-filter: saturate(115%) brightness(1.15) blur(1em);
	backdrop-filter: saturate(115%) brightness(1.15) blur(1em);
}
.v360-set .glass-effect__fill { background-color: rgba(244, 244, 246, 0.82); }
.v360-set__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4em; position: relative; }
.v360-set__title {
	margin: 0;
	text-transform: uppercase;
	font-family: "PP Neue Corp Tight V360", "Inter Tight V360", Arial, sans-serif;
	font-size: 1.5em;
	font-weight: 700;
	line-height: 0.85;
	text-shadow: 0 0 0.45em rgba(255, 255, 255, 0.5);
}
.v360-set__close { width: 1.9em; height: 1.9em; display: flex; align-items: center; justify-content: center; border-radius: 100em; color: rgba(23, 24, 28, 0.55); position: relative; transition: color 0.2s, background-color 0.2s; }
.v360-set__close:hover { color: #17181c; background-color: rgba(23, 24, 28, 0.08); }
.v360-set__close svg { width: 0.85em; height: 0.85em; }
.v360-set__row { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: 0.55em 0; cursor: pointer; position: relative; }
.v360-set__row + .v360-set__row { border-top: 1px solid rgba(23, 24, 28, 0.14); }
.v360-set__label { display: flex; flex-direction: column; gap: 0.15em; font-size: 0.9375em; font-weight: 500; text-shadow: 0 0 0.45em rgba(255, 255, 255, 0.4); }
.v360-set__note { color: rgba(23, 24, 28, 0.72); font-size: 0.8em; font-weight: 400; }
.v360-set__input { position: absolute; opacity: 0; pointer-events: none; }
.v360-switch { flex: none; width: 2.6em; height: 1.4em; border-radius: 100em; background-color: rgba(23, 24, 28, 0.2); transition: background-color 0.3s var(--v360-ease); position: relative; }
.v360-switch::after { content: ""; position: absolute; top: 0.175em; left: 0.175em; width: 1.05em; height: 1.05em; border-radius: 100em; background-color: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.3s var(--v360-ease); }
.v360-set__input:checked ~ .v360-switch { background-color: var(--v360-accent, #ff6a3d); }
.v360-set__input:checked ~ .v360-switch::after { transform: translateX(1.2em); }

/* ---- Runtime interface toggles ---- */
.v360-viewer__stage.v360-hide-title .v360-title,
.v360-viewer__stage.v360-hide-controls .pnlm-controls-container,
.v360-viewer__stage.v360-hide-compass .pnlm-compass,
.v360-viewer__stage.v360-hide-story .v360-storybtn,
.v360-viewer__stage.v360-hide-arrows .v360-dpad {
	opacity: 0 !important;
	pointer-events: none !important;
	transition: opacity 0.45s ease !important;
}
/* Hotspots carry .v360-hotspot; this Pannellum build labels custom-class
   hotspots .pnlm-hotspot-base (NOT .pnlm-hotspot), so we target our own class.
   No opacity transition here: Pannellum rewrites each hotspot's inline style
   every animation frame, which perpetually re-triggers a fade and leaves it
   stuck near opacity 1 — so snap it hidden instead. */
.v360-viewer__stage.v360-hide-hotspots .v360-hotspot {
	opacity: 0 !important;
	pointer-events: none !important;
	transition: none !important;
}
/* Hide the now-playing player (menu toggle / backend default). display:none so
   no invisible pill is left behind; wins over setAudio's pill.hidden = false. */
.v360-viewer__stage.v360-hide-player .v360-np {
	display: none !important;
}
/* Disable the sliding vinyl record when the effect is turned off. */
.v360-viewer__stage.v360-no-vinyl .v360-vinyl__record {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.v360-np, .v360-gear, .v360-set { transition: none; }
	.v360-np__dot, .v360-np__bars span, .v360-np[data-blocked] { animation: none; }
}
