/**
 * Vist360 frontend viewer styles (matches the Stitch "Frontend Tour Viewer" design).
 */

.vist360-viewer {
	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: 8px;
	background: #101418;
	touch-action: none;
	user-select: none;

	&:fullscreen {
		border-radius: 0;
	}
}

.vist360-viewer__canvas {
	position: absolute;
	inset: 0;

	canvas {
		display: block;
		width: 100% !important;
		height: 100% !important;
		cursor: grab;

		&:active {
			cursor: grabbing;
		}
	}
}

.vist360-viewer__title {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 5px 12px;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-size: 12px;
	backdrop-filter: blur(4px);
	z-index: 2;
	pointer-events: none;
}

.vist360-viewer__hotspots {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.vist360-hotspot {
	position: absolute;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 4px;
	border: none;
	background: transparent;
	cursor: pointer;
	pointer-events: auto;
	color: #fff;

	&__dot {
		display: block;
		width: 18px;
		height: 18px;
		border-radius: 50%;
		background: rgba(255, 255, 255, 0.95);
		border: 2px solid rgba(0, 0, 0, 0.25);
		box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.25);
		animation: vist360-pulse 2s ease-out infinite;
	}

	&.is-navigation .vist360-hotspot__dot {
		background: #4da3ff;
	}

	&.is-link .vist360-hotspot__dot {
		background: #46c069;
	}

	&.is-media .vist360-hotspot__dot {
		background: #e9b213;
	}

	&__label {
		background: rgba(0, 0, 0, 0.65);
		padding: 3px 10px;
		border-radius: 999px;
		font-size: 12px;
		white-space: nowrap;
	}
}

@keyframes vist360-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.45);
	}

	100% {
		box-shadow: 0 0 0 12px rgba(255, 255, 255, 0);
	}
}

.vist360-viewer__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: #fff;
	background: rgba(16, 20, 24, 0.85);
	z-index: 3;

	p {
		margin: 0;
		font-size: 13px;
		opacity: 0.85;
	}
}

.vist360-viewer__spinner {
	width: 34px;
	height: 34px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #fff;
	border-radius: 50%;
	animation: vist360-spin 0.9s linear infinite;
}

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

.vist360-viewer__controls {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px;
	padding: 12px;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
	z-index: 2;
}

.vist360-viewer__scenes {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	padding-bottom: 2px;
}

.vist360-viewer__scene-thumb {
	flex: 0 0 auto;
	width: 64px;
	height: 40px;
	border-radius: 6px;
	border: 2px solid transparent;
	background: rgba(255, 255, 255, 0.15) center / cover no-repeat;
	cursor: pointer;
	transition: border-color 0.15s ease, transform 0.15s ease;

	&:hover {
		transform: translateY(-2px);
	}

	&.is-active {
		border-color: #fff;
	}

	@media (max-width: 600px) {
		width: 48px;
		height: 32px;
	}
}

.vist360-viewer__buttons {
	display: flex;
	gap: 8px;
}

.vist360-viewer__btn {
	width: 38px;
	height: 38px;
	display: grid;
	place-items: center;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 17px;
	cursor: pointer;
	backdrop-filter: blur(4px);
	transition: background 0.15s ease;

	&:hover,
	&.is-active {
		background: rgba(255, 255, 255, 0.25);
	}

	@media (max-width: 600px) {
		width: 44px;
		height: 44px;
	}
}

.vist360-viewer__popup {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, 0.6);
	z-index: 4;
	padding: 24px;
}

.vist360-viewer__popup-inner {
	position: relative;
	max-width: min(480px, 100%);
	max-height: 100%;
	overflow: auto;
	background: #fff;
	color: #1d2327;
	border-radius: 10px;
	padding: 20px 24px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);

	h4 {
		margin: 0 0 8px;
		font-size: 16px;
	}

	img {
		max-width: 100%;
		height: auto;
		border-radius: 6px;
	}
}

.vist360-viewer__popup-close {
	position: absolute;
	top: 8px;
	right: 10px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #646970;

	&:hover {
		color: #1d2327;
	}
}

.vist360-viewer__share {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;

	a,
	button {
		padding: 8px 14px;
		border: none;
		border-radius: 6px;
		background: #f0f0f1;
		text-decoration: none;
		color: #1d2327;
		font-size: 13px;
		cursor: pointer;

		&:hover {
			background: #2271b1;
			color: #fff;
		}
	}
}
