/*
 * Palm Network Visualizer -- WebGL canvas, click-to-inspect popup, and the
 * pause / reset-camera control rail. Loaded alongside visualizer.js whenever
 * the hero is present on the page.
 */

/* Canvas slot ------------------------------------------------------------ */

.pnv-hero__scene.pnv-vis-active {
	cursor: grab;
}

.pnv-vis-canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	z-index: 0;
}

/* Click-to-inspect popup ------------------------------------------------- */

.pnv-vis-popup {
	position: absolute;
	z-index: 10;
	min-width: 240px;
	max-width: 320px;
	background: rgba( 10, 8, 32, 0.94 );
	border: 1px solid #00E5FF;
	border-radius: 6px;
	padding: 14px 18px 16px;
	color: #E6F1FF;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	box-shadow: 0 0 26px rgba( 0, 229, 255, 0.32 );
	pointer-events: none;
	backdrop-filter: blur( 8px );
	-webkit-backdrop-filter: blur( 8px );
	animation: pnv-vis-popup-in 0.18s ease-out;
}

@keyframes pnv-vis-popup-in {
	from { opacity: 0; transform: translateY( 6px ); }
	to   { opacity: 1; transform: translateY( 0 ); }
}

.pnv-vis-popup__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	padding-bottom: 8px;
	border-bottom: 1px solid rgba( 0, 229, 255, 0.18 );
}

.pnv-vis-popup__proto {
	font-weight: 700;
	letter-spacing: 2px;
	color: #00E5FF;
	font-size: 13px;
}

.pnv-vis-popup__pill {
	display: inline-block;
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 2px;
	padding: 3px 8px;
	border-radius: 3px;
	background: #FF2E9A;
	color: #FFFFFF;
	box-shadow: 0 0 10px rgba( 255, 46, 154, 0.55 );
	animation: pnv-vis-pill-pulse 1.2s ease-in-out infinite;
}

@keyframes pnv-vis-pill-pulse {
	0%, 100% { box-shadow: 0 0 10px rgba( 255, 46, 154, 0.55 ); }
	50%      { box-shadow: 0 0 18px rgba( 255, 46, 154, 0.85 ); }
}

/* Device identity block (added 1.5.3). Sits between the header
 * and the SOURCE row when the joined client record has resolved
 * a name/manufacturer/OS. Visually distinct from the data rows
 * below so it reads as "who is this" rather than "what numbers". */
.pnv-vis-popup__device {
	margin: -4px 0 10px 0;
	padding: 8px 10px;
	background: rgba( 0, 229, 255, 0.06 );
	border-left: 2px solid #00E5FF;
	border-radius: 2px;
}
.pnv-vis-popup__device-name {
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.5px;
	word-break: break-word;
}
.pnv-vis-popup__device-sub {
	color: #9FB3C8;
	font-size: 11px;
	margin-top: 2px;
	letter-spacing: 0.3px;
}

.pnv-vis-popup__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin: 5px 0;
	line-height: 1.4;
}

.pnv-vis-popup__label {
	color: #9FB3C8;
	font-size: 10px;
	letter-spacing: 1.5px;
	flex-shrink: 0;
}

.pnv-vis-popup__value {
	color: #FFFFFF;
	font-size: 12px;
	text-align: right;
	word-break: break-all;
}

/* Control rail ---------------------------------------------------------- */

.pnv-vis-controls {
	position: absolute;
	top: 50%;
	left: 24px;
	transform: translateY( -50% );
	z-index: 5;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pnv-vis-controls__btn {
	width: 40px;
	height: 40px;
	background: rgba( 10, 8, 32, 0.85 );
	border: 1px solid rgba( 0, 229, 255, 0.35 );
	color: #00E5FF;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
	backdrop-filter: blur( 6px );
	-webkit-backdrop-filter: blur( 6px );
}

.pnv-vis-controls__btn:hover {
	background: rgba( 0, 229, 255, 0.14 );
	border-color: #00E5FF;
	box-shadow: 0 0 14px rgba( 0, 229, 255, 0.4 );
}

.pnv-vis-controls__btn:active {
	background: rgba( 0, 229, 255, 0.22 );
}

.pnv-vis-controls__btn:focus-visible {
	outline: 2px solid #FF2E9A;
	outline-offset: 2px;
}

/* Tighter spacing on mobile so the rail doesn't crowd the road. */
@media ( max-width: 768px ) {
	.pnv-vis-controls {
		left: 12px;
	}
	.pnv-vis-controls__btn {
		width: 34px;
		height: 34px;
		font-size: 14px;
	}
	.pnv-vis-popup {
		min-width: 200px;
		font-size: 12px;
		padding: 12px 14px;
	}
}
