/**
 * PropertyConnector — Aerial 360°
 * Front-end viewer styling. Colours pull from PropertyConnector's brand CSS
 * variables when present, with safe fallbacks.
 */

.pca360-section {
	--pca360-primary: var( --pc-primary, #1e3a5f );
	--pca360-accent: var( --pc-a-primary, #0170b9 );
	margin: 28px 0;
	font-family: inherit;
}

/* ---- Header ---------------------------------------------------------- */
.pca360-head {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 12px;
}

.pca360-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 24px;
	padding: 0 9px;
	border-radius: 999px;
	background: var( --pca360-accent );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.3px;
	line-height: 1;
}

.pca360-title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 600;
	color: var( --pca360-primary );
}

/* ---- Stage ----------------------------------------------------------- */
.pca360-stage {
	position: relative;
	height: var( --pca360-h, 460px );
	border-radius: 14px;
	overflow: hidden;
	background:
		radial-gradient( 120% 120% at 50% 0%, rgba( 255, 255, 255, 0.06 ) 0%, transparent 60% ),
		linear-gradient( 160deg, #243b55 0%, #141e2c 100% );
	box-shadow: 0 10px 30px rgba( 16, 27, 43, 0.18 );
	isolation: isolate;
}

.pca360-viewer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* In-viewer "360°" indicator (top-right; Pannellum's controls are top-left). */
.pca360-corner-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 4;
	padding: 4px 10px;
	border-radius: 999px;
	background: rgba( 16, 24, 38, 0.6 );
	-webkit-backdrop-filter: blur( 6px );
	backdrop-filter: blur( 6px );
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.3px;
	line-height: 1;
	pointer-events: none;
}

/* ---- Loading state --------------------------------------------------- */
.pca360-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	opacity: 1;
	transition: opacity 0.45s ease;
	pointer-events: none;
}

.pca360-loader.is-gone {
	opacity: 0;
}

.pca360-spinner {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 3px solid rgba( 255, 255, 255, 0.25 );
	border-top-color: #fff;
	animation: pca360-spin 0.8s linear infinite;
}

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

.pca360-stage--error::after {
	content: "360\00b0 photo unavailable";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba( 255, 255, 255, 0.8 );
	font-size: 14px;
	z-index: 3;
}

/* ---- "Drag to look around" hint -------------------------------------- */
.pca360-hint {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translate( -50%, 8px );
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 999px;
	background: rgba( 16, 24, 38, 0.62 );
	-webkit-backdrop-filter: blur( 6px );
	backdrop-filter: blur( 6px );
	color: #fff;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s;
	pointer-events: none;
	z-index: 4;
}

.pca360-hint.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate( -50%, 0 );
}

.pca360-hint svg {
	flex: 0 0 auto;
}

/* ---- Caption --------------------------------------------------------- */
.pca360-caption {
	margin: 10px 2px 0;
	font-size: 0.9rem;
	color: #5b6675;
}

/* ---- Property marker (Pannellum hotspot) ----------------------------- */
.pca360-pin,
.pca360-anno {
	position: absolute;
	width: 0;
	height: 0;
}

.pca360-pin-dot {
	position: absolute;
	left: 0;
	top: 0;
	width: 18px;
	height: 18px;
	margin: -9px 0 0 -9px;
	border-radius: 50%;
	background: var( --pca360-accent, #0170b9 );
	border: 2px solid #fff;
	box-shadow: 0 0 0 0 rgba( 1, 112, 185, 0.55 );
	animation: pca360-pulse 2s infinite;
}

@keyframes pca360-pulse {
	0% {
		box-shadow: 0 0 0 0 rgba( 1, 112, 185, 0.55 );
	}
	70% {
		box-shadow: 0 0 0 16px rgba( 1, 112, 185, 0 );
	}
	100% {
		box-shadow: 0 0 0 0 rgba( 1, 112, 185, 0 );
	}
}

.pca360-pin-label {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX( -50% );
	padding: 4px 10px;
	border-radius: 6px;
	background: var( --pca360-primary, #1e3a5f );
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.35 );
}

.pca360-pin-label::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	transform: translateX( -50% );
	border: 5px solid transparent;
	border-top-color: var( --pca360-primary, #1e3a5f );
}

@media ( prefers-reduced-motion: reduce ) {
	.pca360-pin-dot {
		animation: none;
	}
}

/* ---- Annotation pins (map points) ------------------------------------ */
.pca360-anno-dot {
	position: absolute;
	left: 0;
	top: 0;
	width: 14px;
	height: 14px;
	margin: -7px 0 0 -7px;
	border-radius: 50%;
	background: #0170b9;
	border: 2px solid #fff;
	box-shadow: 0 1px 5px rgba( 0, 0, 0, 0.45 );
}

.pca360-anno-label {
	position: absolute;
	left: 50%;
	bottom: 12px;
	transform: translateX( -50% );
	padding: 3px 9px;
	border-radius: 5px;
	background: rgba( 16, 24, 38, 0.82 );
	-webkit-backdrop-filter: blur( 4px );
	backdrop-filter: blur( 4px );
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	box-shadow: 0 1px 5px rgba( 0, 0, 0, 0.3 );
}

/* ---- Pannellum control restyle --------------------------------------- */
.pca360-viewer .pnlm-controls {
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.3 );
}

.pca360-viewer .pnlm-control:hover {
	background-color: var( --pca360-accent, #0170b9 );
}

.pca360-viewer .pnlm-load-box {
	display: none;
}

/* ---- Responsive ------------------------------------------------------ */
@media ( max-width: 600px ) {
	.pca360-stage {
		height: min( var( --pca360-h, 460px ), 320px );
	}

	.pca360-title {
		font-size: 1.05rem;
	}
}
