/*
 * Palm Network Visualizer -- Front-end hero styles.
 * Loaded only on pages containing the [pnv_visualizer] shortcode.
 */

/* Suppress duplicate page titles rendered by the active theme. */
body.pnv-has-hero .wp-block-post-title,
body.pnv-has-hero .wp-block-template-part .wp-block-post-title,
body.pnv-has-hero .entry-header,
body.pnv-has-hero .entry-title,
body.pnv-has-hero .page .entry-title,
body.pnv-has-hero header.entry-header,
body.pnv-has-hero .page-title,
body.pnv-has-hero h1.entry-title {
	display: none !important;
}

/* Optional: tighten the gap so the hero sits flush below the site header. */
body.pnv-has-hero .wp-site-blocks,
body.pnv-has-hero main,
body.pnv-has-hero .site-main {
	padding-top: 0 !important;
}

/* The hero breaks out of any constrained content column. */
.pnv-hero {
	position: relative;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	min-height: 78vh;
	background: #06040F;
	color: #E6F1FF;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	overflow: hidden;
	box-shadow: inset 0 0 200px rgba(138, 43, 226, 0.18);
}

/* The SVG scene fills the hero. */
.pnv-hero__scene {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.pnv-hero__scene svg {
	width: 100%;
	height: 100%;
	display: block;
}

/* Top-left branding strip. */
.pnv-hero__brand {
	position: absolute;
	top: 24px;
	left: 32px;
	z-index: 2;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	letter-spacing: 4px;
	color: #9FB3C8;
	opacity: 0.75;
}

.pnv-hero__brand::after {
	content: "";
	display: block;
	width: 220px;
	height: 1px;
	background: #00E5FF;
	opacity: 0.5;
	margin-top: 6px;
}

.pnv-hero__brand-sub {
	display: block;
	font-size: 11px;
	letter-spacing: 2px;
	color: #9FB3C8;
	opacity: 0.6;
	margin-top: 8px;
}

/* Top-right live status. */
.pnv-hero__status {
	position: absolute;
	top: 24px;
	right: 32px;
	z-index: 2;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 13px;
	letter-spacing: 3px;
	color: #39FF14;
	text-align: right;
}

.pnv-hero__status-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	background: #39FF14;
	border-radius: 50%;
	margin-right: 8px;
	vertical-align: 1px;
	animation: pnv-pulse-dot 1.6s ease-in-out infinite;
}

.pnv-hero__status-sub {
	display: block;
	font-size: 11px;
	letter-spacing: 1px;
	color: #9FB3C8;
	opacity: 0.7;
	margin-top: 4px;
}

/* Holographic HUD panels. */
.pnv-hud {
	position: absolute;
	z-index: 2;
	background: rgba(10, 8, 32, 0.88);
	border: 1px solid #00E5FF;
	border-radius: 6px;
	padding: 18px 22px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	color: #E6F1FF;
	min-width: 220px;
	box-shadow: 0 0 24px rgba(0, 229, 255, 0.28);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	animation: pnv-hud-pulse 4s ease-in-out infinite;
}

.pnv-hud--left {
	top: 28%;
	left: 3%;
}

.pnv-hud--right {
	top: 28%;
	right: 3%;
	border-color: #FF2E9A;
	box-shadow: 0 0 24px rgba(255, 46, 154, 0.28);
	animation-delay: -2s;
}

.pnv-hud__label {
	font-size: 11px;
	letter-spacing: 3px;
	color: #00E5FF;
	margin-bottom: 6px;
}

.pnv-hud--right .pnv-hud__label {
	color: #FF2E9A;
}

.pnv-hud__value {
	font-size: 38px;
	font-weight: 700;
	color: #FFFFFF;
	line-height: 1;
	letter-spacing: 1px;
}

.pnv-hud__value-unit {
	font-size: 16px;
	color: #9FB3C8;
	font-weight: 400;
	margin-left: 4px;
}

.pnv-hud__divider {
	height: 1px;
	background: #00E5FF;
	opacity: 0.4;
	margin: 14px 0 12px;
}

.pnv-hud--right .pnv-hud__divider {
	background: #FF2E9A;
}

.pnv-hud__value--md {
	font-size: 26px;
}

.pnv-hud__row {
	display: flex;
	gap: 24px;
}

.pnv-hud__col {
	flex: 1;
}

/* Bottom: legend / phase note. */
.pnv-hero__footer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 28px;
	z-index: 2;
	text-align: center;
	padding: 0 24px;
}

.pnv-hero__legend {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 18px 28px;
	justify-content: center;
	align-items: center;
	background: rgba(10, 8, 32, 0.88);
	border: 1px solid #8A2BE2;
	border-radius: 6px;
	padding: 14px 26px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	color: #E6F1FF;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.pnv-hero__legend-title {
	font-size: 12px;
	letter-spacing: 4px;
	color: #FF2E9A;
	font-weight: 700;
	width: 100%;
	text-align: center;
	margin-bottom: 4px;
}

.pnv-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: help;
	transition: transform 0.12s ease, filter 0.12s ease;
	outline: none;
}
.pnv-legend-item:hover,
.pnv-legend-item:focus {
	transform: translateY(-1px);
	filter: brightness(1.4) drop-shadow(0 0 6px currentColor);
}

.pnv-legend-swatch {
	display: inline-block;
	width: 22px;
	height: 8px;
	border: 1px solid currentColor;
}

/* ----- Legend hover tooltip (added in 1.5.2.1) -----
 * Single shared element positioned above whichever legend item is
 * currently hovered, focused, or tapped. Pointer-events stay off so
 * it can never block the legend underneath.
 */
.pnv-legend-tooltip {
	position: absolute;
	left: 0;
	top: 0;
	max-width: 360px;
	min-width: 280px;
	padding: 14px 18px;
	background: rgba(8, 6, 26, 0.96);
	border: 1px solid #FF2E9A;
	border-radius: 8px;
	box-shadow: 0 0 24px rgba(255, 46, 154, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5);
	color: #E6F1FF;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 12px;
	line-height: 1.5;
	text-align: left;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s linear;
	z-index: 10;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}
.pnv-legend-tooltip[data-pnv-active] {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	pointer-events: auto;
}
.pnv-legend-tooltip__title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	color: #FFD700;
	margin-bottom: 6px;
}
.pnv-legend-tooltip__desc {
	color: #C8D4E8;
	margin-bottom: 8px;
}
.pnv-legend-tooltip__band {
	color: #9FB3C8;
	font-size: 11px;
	margin-bottom: 8px;
	padding: 4px 8px;
	background: rgba(255, 46, 154, 0.08);
	border-left: 2px solid #FF2E9A;
	border-radius: 2px;
}
.pnv-legend-tooltip__band strong {
	color: #FF2E9A;
	font-weight: 600;
}
.pnv-legend-tooltip__body {
	color: #B8C4D8;
	font-size: 11px;
	line-height: 1.55;
	margin-bottom: 4px;
	padding: 6px 8px;
	background: rgba(255, 255, 255, 0.03);
	border-left: 2px solid rgba(255, 46, 154, 0.4);
	border-radius: 2px;
}
.pnv-legend-tooltip__list {
	margin: 0;
	padding: 0 0 0 16px;
	color: #B8C4D8;
	font-size: 11px;
}
.pnv-legend-tooltip__list li {
	margin: 2px 0;
}

/* ----- HUD label help markers (added in 1.5.2.2) -----
 * Small "?" badge next to each HUD metric label. Hovering the label
 * (cursor: help) reveals the explanation tooltip. The marker itself
 * brightens when the label is hovered/focused to confirm interactivity.
 */
.pnv-hud__label[data-pnv-help] {
	cursor: help;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	outline: none;
	transition: color 0.12s ease;
}
.pnv-hud__label[data-pnv-help]:hover,
.pnv-hud__label[data-pnv-help]:focus {
	color: #FF2E9A;
}
.pnv-hud__help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	font-size: 10px;
	font-weight: 700;
	color: #9FB3C8;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid rgba(159, 179, 200, 0.4);
	border-radius: 50%;
	transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.pnv-hud__label[data-pnv-help]:hover .pnv-hud__help,
.pnv-hud__label[data-pnv-help]:focus .pnv-hud__help {
	color: #0A0820;
	background: #FF2E9A;
	border-color: #FF2E9A;
	box-shadow: 0 0 8px rgba(255, 46, 154, 0.6);
}

.pnv-hero__phase-note {
	display: block;
	margin-top: 14px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 11px;
	letter-spacing: 2px;
	color: #9FB3C8;
	opacity: 0.7;
}

/* SVG-driven animations. */
.pnv-lane {
	animation: pnv-lane-flow 1.4s linear infinite;
}

.pnv-lane--center {
	animation-duration: 1.1s;
}

.pnv-sign {
	animation: pnv-sign-flicker 7s ease-in-out infinite;
}

.pnv-police-light--magenta {
	animation: pnv-police-magenta 0.9s steps(2, end) infinite;
}

.pnv-police-light--cyan {
	animation: pnv-police-cyan 0.9s steps(2, end) infinite;
}

.pnv-windows--cyan,
.pnv-windows--magenta {
	animation: pnv-windows-twinkle 6s ease-in-out infinite;
}

.pnv-windows--magenta {
	animation-delay: -3s;
}

@keyframes pnv-lane-flow {
	from { stroke-dashoffset: 0; }
	to { stroke-dashoffset: -80; }
}

@keyframes pnv-hud-pulse {
	0%, 100% { box-shadow: 0 0 24px rgba(0, 229, 255, 0.28); }
	50% { box-shadow: 0 0 44px rgba(0, 229, 255, 0.55); }
}

.pnv-hud--right {
	animation-name: pnv-hud-pulse-magenta;
}

@keyframes pnv-hud-pulse-magenta {
	0%, 100% { box-shadow: 0 0 24px rgba(255, 46, 154, 0.28); }
	50% { box-shadow: 0 0 44px rgba(255, 46, 154, 0.55); }
}

@keyframes pnv-pulse-dot {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes pnv-sign-flicker {
	0%, 95%, 100% { opacity: 1; }
	96% { opacity: 0.55; }
	97% { opacity: 0.85; }
	98% { opacity: 0.4; }
	99% { opacity: 0.95; }
}

@keyframes pnv-police-magenta {
	0%, 49% { opacity: 1; }
	50%, 100% { opacity: 0.15; }
}

@keyframes pnv-police-cyan {
	0%, 49% { opacity: 0.15; }
	50%, 100% { opacity: 1; }
}

@keyframes pnv-windows-twinkle {
	0%, 100% { opacity: 0.7; }
	50% { opacity: 0.95; }
}

/* Respect reduced motion. */
@media (prefers-reduced-motion: reduce) {
	.pnv-lane,
	.pnv-sign,
	.pnv-police-light--magenta,
	.pnv-police-light--cyan,
	.pnv-windows--cyan,
	.pnv-windows--magenta,
	.pnv-hero__status-dot,
	.pnv-hud {
		animation: none !important;
	}
}

/* Responsive. */
@media (max-width: 900px) {
	.pnv-hero {
		min-height: 64vh;
	}
	.pnv-hud {
		padding: 12px 16px;
		min-width: 160px;
	}
	.pnv-hud__value {
		font-size: 28px;
	}
	.pnv-hero__brand,
	.pnv-hero__status {
		font-size: 11px;
		letter-spacing: 2px;
	}
}

@media (max-width: 640px) {
	.pnv-hero {
		min-height: 56vh;
	}
	.pnv-hud--left {
		top: auto;
		bottom: 32%;
		left: 4%;
		right: 4%;
		min-width: 0;
	}
	.pnv-hud--right {
		display: none;
	}
	.pnv-hero__legend {
		font-size: 10px;
		padding: 10px 14px;
		gap: 8px 14px;
	}
	.pnv-hero__legend-title {
		font-size: 10px;
		letter-spacing: 3px;
	}
}

/* Fullscreen template body. */
body.pnv-fullscreen-template {
	margin: 0;
	background: #06040F;
	color: #E6F1FF;
}

body.pnv-fullscreen-template .pnv-hero {
	margin: 0;
	width: 100%;
	min-height: 100vh;
}
