/*
 * Shared header fixes - profile panel and search overlay.
 * Loaded after the shared component and header system layers.
 */

/* Header profile trigger: no label text, keep icon only */
.nx-shared-profile {
	position: relative;
}

.nx-shared-profile__trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.35);
	color: var(--nx-text, #f4f4f8);
	cursor: pointer;
	padding: 0;
	transition: background 0.2s ease, transform 0.15s ease;
}

.nx-shared-profile__trigger:hover {
	background: rgba(255, 255, 255, 0.08);
	transform: scale(1.05);
}

.nx-shared-profile__trigger .nx-eco-icon {
	width: 20px;
	height: 20px;
}

/* Profile dropdown: elegant glass panel anchored to the trigger */
.nx-profile-panel {
	position: absolute;
	top: calc(100% + 12px);
	right: 0;
	width: min(92vw, 300px);
	padding: 1rem;
	border-radius: 18px;
	background: rgba(18, 18, 26, 0.92);
	backdrop-filter: blur(24px) saturate(180%);
	-webkit-backdrop-filter: blur(24px) saturate(180%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
	z-index: 10000;
}

.nx-profile-panel[hidden] {
	display: none !important;
}

/* Search overlay: fixed viewport, centered content */
.nx-global-search {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.9);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.nx-global-search[hidden] {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

.nx-global-search__panel {
	position: relative;
	width: min(92vw, 560px);
	margin: auto;
	border-radius: 24px;
	background: rgba(12, 12, 18, 0.82);
	backdrop-filter: blur(20px) saturate(150%);
	-webkit-backdrop-filter: blur(20px) saturate(150%);
	border: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
	overflow: hidden;
}

.nx-global-search__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.nx-global-search__input-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.65rem;
	margin: 0 1rem 0.75rem;
	padding: 0 0.85rem;
	border-radius: 14px;
	border: 1px solid rgba(255, 255, 255, 0.08);
	background: rgba(0, 0, 0, 0.35);
}

.nx-global-search__input {
	flex: 1;
	min-height: 48px;
	border: none;
	background: transparent;
	color: var(--nx-text, #f4f4f8);
	font: inherit;
	outline: none;
}

.nx-global-search__input::placeholder {
	color: rgba(255, 255, 255, 0.35);
}

.nx-global-search__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.15rem 0.5rem;
}

.nx-global-search__title {
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
}

.nx-global-search__close {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.05);
	color: inherit;
	cursor: pointer;
}

.nx-global-search__input-wrap:focus-within {
	border-color: rgba(0, 240, 255, 0.4);
	box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.nx-global-search__kbd {
	font-size: 0.68rem;
	padding: 0.2rem 0.45rem;
	border-radius: 6px;
	background: rgba(255, 255, 255, 0.06);
	color: var(--nx-muted, #6b6b7b);
}

.nx-global-search__body {
	max-height: min(50vh, 380px);
	overflow-y: auto;
	padding: 0 1rem 1rem;
}

.nx-global-search__section {
	margin-top: 0.75rem;
}

.nx-global-search__section-title {
	margin: 0 0 0.5rem;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--nx-muted, #6b6b7b);
}

.nx-global-search__modules {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.35rem;
}

.nx-global-search__module {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 0.75rem;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	transition: background 0.2s ease;
}

.nx-global-search__module:hover,
.nx-global-search__module:focus-visible {
	background: rgba(255, 255, 255, 0.05);
}

.nx-global-search__module-icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	color: var(--nx-accent, #e10600);
	flex: 0 0 36px;
}

.nx-global-search__module-icon .nx-eco-icon {
	width: 18px;
	height: 18px;
}

.nx-global-search__module-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.nx-global-search__module-text strong {
	font-size: 0.9rem;
}

.nx-global-search__module-text span {
	font-size: 0.78rem;
	color: var(--nx-muted, #6b6b7b);
}

.nx-global-search__empty,
.nx-global-search__recent {
	font-size: 0.82rem;
	color: var(--nx-muted, #6b6b7b);
	padding: 0.5rem 0;
}

/* Premium compact profile dropdown (overrides header-system layer) */
.nx-ecosystem-header__profile .nx-profile-panel {
	width: min(92vw, 280px);
	padding: 0.85rem;
	border-radius: 16px;
	background: rgba(14, 14, 20, 0.96);
	box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-ecosystem-header__profile .nx-profile-panel__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.65rem;
}

.nx-ecosystem-header__profile .nx-profile-panel__head .nx-afe,
.nx-ecosystem-header__profile .nx-profile-panel__head .nx-avatar-frame {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
}

.nx-ecosystem-header__profile .nx-profile-panel__meta {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.nx-ecosystem-header__profile .nx-profile-panel__meta strong {
	font-size: 0.92rem;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nx-ecosystem-header__profile .nx-profile-panel__meta .nx-tier {
	align-self: flex-start;
	font-size: 0.65rem;
	padding: 0.15rem 0.45rem;
}

.nx-ecosystem-header__profile .nx-profile-panel__wallet {
	display: flex;
	justify-content: space-between;
	gap: 0.4rem;
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	margin-bottom: 0.65rem;
}

.nx-ecosystem-header__profile .nx-profile-panel__wallet div {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.1rem;
	font-size: 0.65rem;
	color: var(--nx-muted);
}

.nx-ecosystem-header__profile .nx-profile-panel__wallet strong {
	font-size: 0.85rem;
	color: var(--nx-accent);
}

.nx-ecosystem-header__profile .nx-profile-panel__rank {
	margin-bottom: 0.5rem;
}

.nx-ecosystem-header__profile .nx-profile-panel__rate {
	margin: -0.25rem 0 0.55rem;
	font-size: 0.65rem;
	color: var(--nx-muted);
	text-align: center;
}

.nx-ecosystem-header__profile .nx-profile-panel__nav {
	display: grid;
	gap: 0.15rem;
	margin-bottom: 0.5rem;
}

.nx-ecosystem-header__profile .nx-profile-panel__nav-link,
.nx-ecosystem-header__profile .nx-profile-panel__logout {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.45rem 0.55rem;
	border-radius: 8px;
	font-size: 0.82rem;
	color: var(--nx-text);
	background: transparent;
	border: none;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.nx-ecosystem-header__profile .nx-profile-panel__nav-link:hover,
.nx-ecosystem-header__profile .nx-profile-panel__logout:hover {
	background: rgba(255, 255, 255, 0.06);
	color: var(--nx-accent);
}

.nx-ecosystem-header__profile .nx-profile-panel__logout {
	margin-top: 0.25rem;
	color: var(--nx-muted);
}

.nx-ecosystem-header__profile .nx-profile-panel__nav-link .nx-eco-icon,
.nx-ecosystem-header__profile .nx-profile-panel__logout .nx-eco-icon {
	width: 16px;
	height: 16px;
	flex: 0 0 16px;
	color: currentColor;
}
