/**
 * LPTENT Panorama — styles de la visionneuse 360°.
 * Autonome : utilisable sans le reste du plugin.
 */

.lptent-pano {
	position: relative;
	width: 100%;
	height: var(--lptent-pano-h, 520px);
	overflow: hidden;
	background: #10151b;
	border-radius: var(--lptent-radius, 4px);
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
	color: #fff;
}

.lptent-pano__canvas {
	display: block;
	width: 100%;
	height: 100%;
	cursor: grab;
	outline: none;
}

.lptent-pano__canvas:active {
	cursor: grabbing;
}

.lptent-pano__canvas:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -2px;
}

/* --- Mode iframe (export Marzipano) --------------------------------------- */

.lptent-pano--iframe {
	touch-action: auto;
	border: 1px solid var(--lptent-border, #dcdfe4);
	background: var(--lptent-bg-alt, #f6f7f9);
}

.lptent-pano__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

/* --- Chargement / erreur -------------------------------------------------- */

.lptent-pano__status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	text-align: center;
	font-size: 0.9rem;
	background: #10151b;
}

.lptent-pano__status[hidden] {
	display: none;
}

.lptent-pano__status::before {
	content: '';
	width: 1em;
	height: 1em;
	margin-right: 0.6em;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lptent-pano-spin 0.8s linear infinite;
}

.lptent-pano.is-error .lptent-pano__status::before {
	display: none;
}

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

@media (prefers-reduced-motion: reduce) {
	.lptent-pano__status::before {
		animation-duration: 3s;
	}
}

/* --- Indication d'usage --------------------------------------------------- */

.lptent-pano__hint {
	position: absolute;
	left: 50%;
	bottom: 1rem;
	transform: translateX(-50%);
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	background: rgba(16, 21, 27, 0.72);
	backdrop-filter: blur(4px);
	font-size: 0.8rem;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.4s ease;
}

.lptent-pano.is-ready .lptent-pano__hint {
	opacity: 1;
}

.lptent-pano .lptent-pano__hint.is-hidden {
	opacity: 0;
}

/* --- Boutons -------------------------------------------------------------- */

.lptent-pano__controls {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.lptent-pano.is-ready .lptent-pano__controls {
	opacity: 1;
}

.lptent-pano__btn {
	width: 38px;
	height: 38px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: var(--lptent-radius, 4px);
	background: rgba(16, 21, 27, 0.65);
	color: #fff;
	cursor: pointer;
	line-height: 1;
	transition: background 0.15s ease;
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.lptent-pano__btn:hover,
.lptent-pano__btn:focus-visible {
	background: rgba(31, 77, 122, 0.9);
}

/* Icônes dessinées en CSS : aucune police ni SVG externe à charger. */
.lptent-pano__btn::before,
.lptent-pano__btn::after {
	content: '';
	position: absolute;
	background: currentColor;
}

.lptent-pano__btn {
	position: relative;
}

.lptent-pano__btn--zoom-in::before,
.lptent-pano__btn--zoom-out::before {
	width: 14px;
	height: 2px;
}

.lptent-pano__btn--zoom-in::after {
	width: 2px;
	height: 14px;
}

.lptent-pano__btn--reset::before {
	width: 13px;
	height: 13px;
	border: 2px solid currentColor;
	border-radius: 50%;
	background: none;
}

.lptent-pano__btn--reset::after {
	width: 4px;
	height: 4px;
	border-radius: 50%;
}

.lptent-pano__btn--play::before {
	width: 0;
	height: 0;
	border-left: 9px solid currentColor;
	border-top: 6px solid transparent;
	border-bottom: 6px solid transparent;
	background: none;
	margin-left: 3px;
	display: none;
}

.lptent-pano__btn--play::after {
	width: 10px;
	height: 12px;
	border-left: 3px solid currentColor;
	border-right: 3px solid currentColor;
	background: none;
}

.lptent-pano__btn--play.is-paused::before {
	display: block;
}

.lptent-pano__btn--play.is-paused::after {
	display: none;
}

.lptent-pano__btn--fullscreen::before {
	width: 15px;
	height: 12px;
	border: 2px solid currentColor;
	background: none;
}

.lptent-pano__btn--fullscreen::after {
	display: none;
}

.lptent-pano__btn--fullscreen.is-active::before {
	width: 9px;
	height: 8px;
}

/* --- Plein écran ---------------------------------------------------------- */

.lptent-pano:fullscreen {
	height: 100%;
	border-radius: 0;
}

.lptent-pano:-webkit-full-screen {
	height: 100%;
	border-radius: 0;
}

/* --- Repli sans WebGL ----------------------------------------------------- */

.lptent-pano.is-flat {
	height: auto;
	min-height: 0;
	background: none;
}

.lptent-pano__flat {
	overflow-x: auto;
}

.lptent-pano__flat img {
	display: block;
	max-width: none;
	width: auto;
	height: var(--lptent-pano-h, 520px);
}

@media (max-width: 782px) {
	.lptent-pano {
		height: var(--lptent-pano-h-mobile, 320px);
	}

	.lptent-pano__flat img {
		height: var(--lptent-pano-h-mobile, 320px);
	}

	.lptent-pano__hint {
		font-size: 0.75rem;
	}
}
