/* Desvix Virtual Tour viewer */

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

html, body {
	width: 100%;
	height: 100%;
	overflow: hidden;
	background: #111;
	font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: #fff;
	overscroll-behavior: none;
}

#viewer {
	position: fixed;
	inset: 0;
}

#pano-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
	touch-action: none; /* we handle all gestures ourselves */
}

#pano-canvas.dragging {
	cursor: grabbing;
}

/* ---------------------------------------------------------------- hotspots */

#hotspot-layer {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none; /* only the pills themselves are clickable */
}

.hotspot {
	position: absolute;
	left: 0;
	top: 0;
	transform: translate(-50%, -50%);
	pointer-events: auto;
	cursor: pointer;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;

	display: flex;
	align-items: center;
	gap: 7px;
	padding: 5px 14px 5px 6px;
	border-radius: 999px;
	background: rgba(12, 12, 14, 0.88);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
	white-space: nowrap;
	transition: background 120ms ease;
}

.hotspot:hover {
	background: rgba(38, 38, 44, 0.95);
}

.hotspot:active {
	background: rgba(60, 60, 68, 0.95);
}

.hotspot .icon {
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
	border: 2px solid #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hotspot .icon svg {
	width: 13px;
	height: 13px;
	display: block;
}

.hotspot .label {
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	letter-spacing: 0.2px;
}

/* ----------------------------------------------------------------- UI bits */

#top-bar {
	position: absolute;
	top: 14px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	pointer-events: none;
	max-width: min(60vw, 640px);
}

.chip {
	background: rgba(12, 12, 14, 0.7);
	border-radius: 999px;
	padding: 6px 14px;
	font-size: 13px;
	backdrop-filter: blur(4px);
}

.chip:empty {
	display: none;
}

/* Title chips are plain white text over the panorama — no dark fill. */
#top-bar .chip {
	background: none;
	backdrop-filter: none;
	padding: 0;
	text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}

#tour-title {
	font-size: 14px;
}

#room-title {
	font-weight: 600;
	font-size: 15px;
}

#fade-overlay {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0;
	pointer-events: none;
	transition: opacity 250ms ease;
}

/* User toggle from the menu — overrides any inline visibility handling. */
#hotspot-layer.points-off {
	display: none !important;
}

/* ------------------------------------------------------------- UI buttons */

.ui-button {
	position: absolute;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background: none;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: background 120ms ease, transform 120ms ease;
	-webkit-tap-highlight-color: transparent;
}

.ui-button:hover {
	background: rgba(255, 255, 255, 0.15);
	transform: scale(1.06);
}

.ui-button svg {
	width: 22px;
	height: 22px;
	display: block;
	/* keeps the white icons readable over bright panoramas */
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}

.ui-button svg.hidden {
	display: none;
}

#menu-button {
	top: 14px;
	left: 14px;
}

#fullscreen-button {
	top: 14px;
	right: 14px;
}

/* ----------------------------------------------------------------- menu */

#menu-dropdown {
	position: absolute;
	top: 62px;
	left: 14px;
	min-width: 170px;
	background: rgba(12, 12, 14, 0.92);
	backdrop-filter: blur(6px);
	border-radius: 12px;
	padding: 6px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
	z-index: 5;
}

#menu-dropdown.hidden {
	display: none;
}

.menu-item {
	display: flex;
	align-items: center;
	gap: 10px;
	background: none;
	border: none;
	color: #fff;
	font: inherit;
	font-size: 14px;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
	text-align: left;
	-webkit-tap-highlight-color: transparent;
}

.menu-item:hover {
	background: rgba(255, 255, 255, 0.1);
}

.menu-check {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.menu-check svg {
	width: 14px;
	height: 14px;
	display: block;
}

.menu-item.unchecked .menu-check svg {
	display: none;
}

/* -------------------------------------------------------- bottom drawer */

#drawer-toggle {
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	transition: bottom 250ms ease, background 120ms ease;
	z-index: 6;
}

#drawer-toggle svg {
	transition: transform 250ms ease;
}

#viewer.drawer-open #drawer-toggle {
	bottom: calc(10vh + 14px);
}

#viewer.drawer-open #drawer-toggle svg {
	transform: rotate(180deg);
}

#drawer-panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 10vh;
	min-height: 72px;
	background: rgba(12, 12, 14, 0.85);
	backdrop-filter: blur(6px);
	display: flex;
	align-items: stretch;
	gap: 8px;
	padding: 8px;
	overflow-x: auto;
	overflow-y: hidden;
	transform: translateY(102%);
	transition: transform 250ms ease;
	z-index: 5;
	scrollbar-width: thin;
}

#viewer.drawer-open #drawer-panel {
	transform: translateY(0);
}

.drawer-item {
	position: relative;
	flex: 0 0 auto;
	height: 100%;
	aspect-ratio: 2 / 1;
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	background: #222;
	transition: border-color 120ms ease;
	-webkit-tap-highlight-color: transparent;
}

.drawer-item:hover {
	border-color: rgba(255, 255, 255, 0.5);
}

.drawer-item.current {
	border-color: #fff;
}

.drawer-item canvas {
	width: 100%;
	height: 100%;
	display: block;
	pointer-events: none;
}

.drawer-item .drawer-label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 6px 3px;
	font-size: 11px;
	text-align: center;
	color: #fff;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

/* ------------------------------------------------------------ full panels */

.center-panel {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	background: #17171a;
	z-index: 10;
	padding: 24px;
	text-align: center;
}

.center-panel.hidden {
	display: none;
}

.center-panel h1 {
	font-size: 22px;
	font-weight: 600;
}

.center-panel p {
	max-width: 560px;
	line-height: 1.5;
	color: #bbb;
}

#tour-list {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 10px;
	max-height: 60vh;
	overflow-y: auto;
	min-width: min(420px, 90vw);
}

#tour-list li {
	background: rgba(255, 255, 255, 0.07);
	border-radius: 12px;
	padding: 14px 18px;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	transition: background 120ms ease;
}

#tour-list li:hover {
	background: rgba(255, 255, 255, 0.14);
}

#tour-list .tour-name {
	font-weight: 500;
}

#tour-list .tour-meta {
	color: #999;
	font-size: 13px;
}

.spinner {
	width: 42px;
	height: 42px;
	border: 4px solid rgba(255, 255, 255, 0.15);
	border-top-color: #fff;
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}

@keyframes spin {
	to { transform: rotate(360deg); }
}

#loading-text {
	color: #bbb;
	font-size: 14px;
}
