/*
 * Palm Network Visualizer — Client portal layout.
 * Applied whenever a page contains [pnv_visualizer], [pnv_dashboard],
 * [pnv_site_manager], or [pnv_settings] (configurable in Settings).
 */

html, body.pnv-client-portal {
	margin: 0;
	padding: 0;
	background: #06040F !important;
	color: #E6F1FF;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	overflow-x: hidden;
	min-height: 100vh;
}

body.pnv-client-portal {
	display: flex;
	flex-direction: column;
}

/* The portal nav. */
.pnv-portal-nav {
	position: sticky;
	top: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	gap: 32px;
	padding: 14px 32px;
	background: rgba(10, 8, 32, 0.92);
	border-bottom: 1px solid rgba(0, 229, 255, 0.22);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	flex-shrink: 0;
}

.pnv-portal-nav__brand {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: inherit;
	min-width: 0;
}

.pnv-portal-nav__logo {
	width: 32px;
	height: 32px;
	object-fit: contain;
}

.pnv-portal-nav__brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	min-width: 0;
}

.pnv-portal-nav__brand-company {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 10px;
	letter-spacing: 3px;
	color: #00E5FF;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pnv-portal-nav__brand-product {
	font-size: 14px;
	font-weight: 700;
	color: #FFFFFF;
	letter-spacing: 0.2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pnv-portal-nav__links {
	display: flex;
	gap: 4px;
	flex: 1;
	margin-left: 24px;
}

.pnv-portal-nav__link {
	color: #9FB3C8;
	text-decoration: none;
	font-size: 13px;
	letter-spacing: 1.5px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	text-transform: uppercase;
	padding: 8px 14px;
	border-radius: 4px;
	transition: color 0.2s ease, background 0.2s ease;
	position: relative;
}

.pnv-portal-nav__link:hover {
	color: #FFFFFF;
	background: rgba(0, 229, 255, 0.06);
}

.pnv-portal-nav__link.is-active {
	color: #00E5FF;
	background: rgba(0, 229, 255, 0.08);
}

.pnv-portal-nav__link.is-active::after {
	content: "";
	position: absolute;
	bottom: -15px;
	left: 14px;
	right: 14px;
	height: 2px;
	background: #00E5FF;
	box-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

.pnv-portal-nav__account {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.pnv-portal-nav__username {
	color: #9FB3C8;
	font-size: 12px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	letter-spacing: 0.5px;
}

.pnv-portal-nav__signout,
.pnv-portal-nav__signin {
	color: #FF2E9A;
	text-decoration: none;
	font-size: 11px;
	letter-spacing: 2px;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	text-transform: uppercase;
	padding: 7px 14px;
	border: 1px solid rgba(255, 46, 154, 0.4);
	border-radius: 4px;
	transition: all 0.2s ease;
	font-weight: 700;
}

.pnv-portal-nav__signout:hover,
.pnv-portal-nav__signin:hover {
	background: rgba(255, 46, 154, 0.12);
	border-color: #FF2E9A;
	color: #FFFFFF;
	box-shadow: 0 0 12px rgba(255, 46, 154, 0.3);
}

/* Main content slot. */
.pnv-portal-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.pnv-portal-main > * {
	flex-shrink: 0;
}

/* Override hero and dashboard break-out tricks -- inside the portal, the
 * body has no parent constraints, so we don't need the negative-margin viewport
 * escape. We re-anchor them to fill 100% width and the remaining viewport
 * height (minus the nav). */
body.pnv-client-portal .pnv-hero {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
	min-height: calc(100vh - 64px);
}

body.pnv-client-portal .pnv-fe-dashboard {
	margin-left: 0;
	margin-right: 0;
	width: 100%;
	min-height: calc(100vh - 64px);
	padding-top: 48px;
}

/* Suppress any WordPress comment forms / post nav that may leak through
 * the_content(). */
body.pnv-client-portal .comments-area,
body.pnv-client-portal .post-navigation,
body.pnv-client-portal .wp-block-post-comments-form {
	display: none !important;
}

/* The portal is opinionated -- it shows the visualizer or dashboard and
 * nothing else. Any stray paragraphs, headings, or block content inside
 * pnv-portal-main (leftover from older page content, theme injections, or
 * plugins like related-posts) is hidden so the immersive layout stays
 * clean. Recognized Palm NV sections render normally. */
body.pnv-client-portal .pnv-portal-main > *:not(.pnv-hero):not(.pnv-fe-dashboard):not(.pnv-card) {
	display: none !important;
}

/* When the_content() wraps the shortcode output in <p> tags (some themes
 * still apply wpautop to block content), unwrap by making the wrapper
 * transparent and flat. */
body.pnv-client-portal .pnv-portal-main > p {
	display: none !important;
}

/* Responsive collapse. */
@media (max-width: 900px) {
	.pnv-portal-nav {
		flex-wrap: wrap;
		gap: 12px;
		padding: 12px 16px;
	}
	.pnv-portal-nav__links {
		order: 3;
		flex-basis: 100%;
		margin-left: 0;
		gap: 0;
		justify-content: space-between;
		overflow-x: auto;
	}
	.pnv-portal-nav__link {
		padding: 6px 10px;
		font-size: 11px;
		letter-spacing: 1px;
	}
	.pnv-portal-nav__brand-product {
		font-size: 13px;
	}
	.pnv-portal-nav__username {
		display: none;
	}
}

@media (max-width: 480px) {
	.pnv-portal-nav__link {
		font-size: 10px;
		padding: 6px 8px;
	}
}
