/* Noxora shared components — theme via CSS variables on [data-noxora-app] */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html.noxora-micro-root {
	-webkit-text-size-adjust: 100%;
}

body.noxora-micro-app {
	margin: 0;
	font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
	background: var(--nx-bg, #070707);
	color: var(--nx-text, #f5f5f5);
	line-height: 1.5;
	min-height: 100dvh;
}

.nx-glass {
	background: rgba(10, 10, 10, 0.6);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border: 1px solid rgba(255, 255, 255, 0.05);
}

.nx-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.65rem 1.1rem;
	border-radius: 10px;
	border: 1px solid transparent;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nx-btn--primary {
	background: var(--nx-accent, #e10600);
	color: #fff;
	box-shadow: 0 8px 24px var(--nx-accent-soft, rgba(225, 6, 0, 0.18));
}

.nx-btn--primary:hover {
	transform: translateY(-1px);
}

.nx-btn--ghost {
	background: transparent;
	border-color: var(--nx-border);
	color: var(--nx-text);
}

.nx-field {
	display: grid;
	gap: 0.35rem;
	margin-bottom: 0.85rem;
}

.nx-field span {
	font-size: 0.82rem;
	color: var(--nx-muted);
}

.nx-field input,
.nx-field textarea,
.nx-field select {
	width: 100%;
	padding: 0.65rem 0.75rem;
	border-radius: 8px;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.35);
	color: var(--nx-text);
	font: inherit;
}

/* Profile menu */
.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 var(--nx-border);
	background: rgba(0, 0, 0, 0.35);
	color: var(--nx-text);
	cursor: pointer;
	padding: 0;
	text-decoration: none;
}

.nx-shared-profile__avatar {
	border-radius: 50%;
	width: 36px;
	height: 36px;
}

.nx-shared-profile__guest {
	display: grid;
	place-items: center;
}

.nx-shared-profile__dot {
	position: absolute;
	right: 0;
	bottom: 0;
	width: 10px;
	height: 10px;
	padding: 0;
	border-radius: 50%;
}

.nx-profile-panel {
	position: absolute;
	top: calc(100% + 0.45rem);
	right: 0;
	width: min(280px, 92vw);
	padding: 0.85rem;
	border-radius: 14px;
	z-index: 120;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.nx-profile-panel[hidden] {
	display: none !important;
}

.nx-profile-panel__head {
	display: flex;
	gap: 0.65rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

.nx-profile-panel__avatar {
	border-radius: 50%;
}

.nx-profile-panel__head strong {
	display: block;
	font-size: 0.92rem;
}

.nx-profile-panel__wallet {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.35rem;
	margin-bottom: 0.75rem;
}

.nx-profile-panel__wallet div {
	padding: 0.45rem;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.03);
	text-align: center;
}

.nx-profile-panel__wallet span {
	display: block;
	font-size: 0.68rem;
	color: var(--nx-muted);
}

.nx-profile-panel__wallet strong {
	font-size: 0.82rem;
	color: var(--nx-accent);
}

.nx-profile-panel__nav {
	display: grid;
	gap: 0.25rem;
	margin-bottom: 0.65rem;
}

.nx-profile-panel__nav a {
	color: var(--nx-text);
	text-decoration: none;
	font-size: 0.85rem;
	padding: 0.35rem 0.25rem;
	border-radius: 6px;
}

.nx-profile-panel__nav a:hover {
	background: rgba(255, 255, 255, 0.04);
	color: var(--nx-accent);
}

.nx-profile-panel__logout {
	display: block;
	font-size: 0.78rem;
	color: var(--nx-muted);
	text-decoration: none;
}

.nx-tier {
	display: inline-flex;
	align-items: center;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	border: 1px solid var(--nx-border);
	background: rgba(255, 255, 255, 0.06);
}

.nx-tier--lg {
	font-size: 0.75rem;
	padding: 0.2rem 0.65rem;
}

.nx-tier--bronze {
	border-color: rgba(205, 127, 50, 0.5);
	color: #cd7f32;
	background: rgba(205, 127, 50, 0.12);
}

.nx-tier--silver {
	border-color: rgba(192, 192, 192, 0.5);
	color: #c0c0c0;
	background: rgba(192, 192, 192, 0.1);
}

.nx-tier--gold {
	border-color: rgba(255, 215, 0, 0.45);
	color: #ffd700;
	background: rgba(255, 215, 0, 0.1);
}

.nx-tier--vip {
	border-color: rgba(225, 6, 0, 0.55);
	color: var(--nx-accent);
	background: var(--nx-accent-soft);
}

/* Ad slots */
.nx-ad-slot {
	display: block;
	width: 100%;
	border-radius: 12px;
	overflow: hidden;
	margin: 0.75rem 0;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.25);
}

.nx-ad-slot__link {
	display: block;
	text-decoration: none;
}

.nx-ad-slot__frame {
	width: 100%;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.35);
}

.nx-ad-slot__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nx-ad-slot--global-footer {
	margin: 0 0 0.75rem;
}

.nx-ad-slot--global-footer .nx-ad-slot__frame {
	max-height: 120px;
}

/* Support modal */
.nx-support[hidden] {
	display: none !important;
}

.nx-support {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.nx-support__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.nx-support__dialog {
	position: relative;
	width: min(480px, 100%);
	max-height: 90dvh;
	overflow: auto;
	border-radius: 16px;
	padding: 1.1rem;
}

.nx-support__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 0.75rem;
}

.nx-support__head h2 {
	margin: 0;
	font-size: 1.1rem;
}

.nx-support__close {
	border: 0;
	background: transparent;
	color: var(--nx-text);
	font-size: 1.5rem;
	cursor: pointer;
	line-height: 1;
}

.nx-support__tabs {
	display: flex;
	gap: 0.5rem;
	margin-bottom: 0.85rem;
}

.nx-support__tab {
	flex: 1;
	padding: 0.5rem;
	border-radius: 8px;
	border: 1px solid var(--nx-border);
	background: transparent;
	color: var(--nx-muted);
	cursor: pointer;
	font: inherit;
}

.nx-support__tab.is-active {
	border-color: var(--nx-accent);
	color: var(--nx-accent);
	background: var(--nx-accent-soft);
}

.nx-support__panel[hidden] {
	display: none;
}

.nx-support__hint {
	font-size: 0.85rem;
	color: var(--nx-muted);
	margin: 0 0 0.75rem;
}

.nx-support__foot {
	display: flex;
	justify-content: flex-end;
	gap: 0.5rem;
	margin-top: 0.5rem;
}

.nx-support__status {
	font-size: 0.85rem;
	margin: 0.5rem 0 0;
}

.nx-support__status.is-error {
	color: #ff6b6b;
}

.nx-support__status.is-success {
	color: #5ee08d;
}

/* App chrome helpers */
.nx-app-topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	position: sticky;
	top: 0;
	z-index: 50;
}

.nx-app-topbar__brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--nx-text);
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.nx-app-topbar__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.nx-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.3);
	color: var(--nx-text);
	cursor: pointer;
	padding: 0;
}

.nx-empty {
	padding: 2rem;
	border-radius: 14px;
	text-align: center;
	color: var(--nx-muted);
}

/* Interactions bar */
.nx-interactions {
	margin: 1.25rem 0;
	padding: 1rem;
	border-radius: 14px;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.35);
}

.nx-interactions--fixed {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60;
	margin: 0;
	border-radius: 0;
	border-left: 0;
	border-right: 0;
	border-bottom: 0;
	padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
	background: rgba(8, 8, 8, 0.92);
	backdrop-filter: blur(16px);
}

.nx-interactions__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
}

.nx-interactions__btn,
.nx-interactions__rx {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 0.7rem;
	border-radius: 999px;
	border: 1px solid var(--nx-border);
	background: rgba(255, 255, 255, 0.04);
	color: var(--nx-text);
	cursor: pointer;
	font: inherit;
	font-size: 0.85rem;
}

.nx-interactions__btn.is-active,
.nx-interactions__rx.is-active {
	border-color: var(--nx-accent);
	background: var(--nx-accent-soft);
	color: var(--nx-accent);
}

.nx-interactions__reactions {
	display: inline-flex;
	gap: 0.25rem;
}

.nx-interactions__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.nx-interactions__tag {
	font-size: 0.78rem;
	color: var(--nx-muted);
}

.nx-interactions__comments {
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--nx-border);
}

.nx-interactions__comment-list {
	margin: 0 0 0.75rem;
	padding: 0;
	list-style: none;
}

.nx-interactions__comment-list li {
	margin-bottom: 0.65rem;
	font-size: 0.88rem;
}

.nx-interactions__comment-form {
	display: grid;
	gap: 0.5rem;
}

/* AI widget */
.nx-ai-root {
	position: fixed;
	right: 1rem;
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	z-index: 320;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.65rem;
	pointer-events: none;
}

.nx-ai-root > * {
	pointer-events: auto;
}

.nx-ai__launcher {
	position: relative;
	right: auto;
	bottom: auto;
	z-index: 1;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 1px solid var(--nx-border);
	background: linear-gradient(145deg, rgba(225, 6, 0, 0.9), rgba(120, 0, 0, 0.95));
	color: #fff;
	cursor: pointer;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.nx-ai[hidden] {
	display: none !important;
}

.nx-ai {
	position: relative;
	right: auto;
	bottom: auto;
	z-index: 2;
	width: min(360px, calc(100vw - 2rem));
}

.nx-ai__panel {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
}

.nx-ai__head {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--nx-border);
}

.nx-ai__head h2 {
	margin: 0;
	font-size: 0.95rem;
}

.nx-ai__sub {
	margin: 0.2rem 0 0;
	font-size: 0.78rem;
	color: var(--nx-muted);
}

.nx-ai__close {
	border: 0;
	background: transparent;
	color: var(--nx-text);
	font-size: 1.4rem;
	cursor: pointer;
}

.nx-ai__messages {
	max-height: 240px;
	overflow: auto;
	padding: 0.75rem 1rem;
	display: grid;
	gap: 0.5rem;
}

.nx-ai__bubble {
	padding: 0.55rem 0.75rem;
	border-radius: 12px;
	font-size: 0.86rem;
	line-height: 1.45;
	max-width: 92%;
}

.nx-ai__bubble--user {
	justify-self: end;
	background: var(--nx-accent-soft);
	border: 1px solid rgba(225, 6, 0, 0.35);
}

.nx-ai__bubble--bot {
	justify-self: start;
	background: rgba(255, 255, 255, 0.05);
	border: 1px solid var(--nx-border);
}

.nx-ai__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.45rem;
}

.nx-ai__link {
	display: inline-flex;
	padding: 0.25rem 0.55rem;
	border-radius: 999px;
	border: 1px solid var(--nx-border);
	font-size: 0.72rem;
	color: var(--nx-accent);
	text-decoration: none;
}

.nx-ai-status {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin-top: 0.35rem;
	font-size: 0.72rem;
	color: var(--nx-muted);
}

.nx-ai-status__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #3dd68c;
	box-shadow: 0 0 8px rgba(61, 214, 140, 0.6);
}

.nx-ai-list {
	margin: 0.35rem 0 0;
	padding-left: 1rem;
	font-size: 0.82rem;
}

.nx-ai-list a {
	color: var(--nx-accent);
}

.nx-ai__form {
	display: flex;
	gap: 0.4rem;
	padding: 0.75rem;
	border-top: 1px solid var(--nx-border);
}

.nx-ai__form input {
	flex: 1;
	padding: 0.55rem 0.7rem;
	border-radius: 10px;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.35);
	color: var(--nx-text);
	font: inherit;
}

/* Points reward toast */
.nx-points-toast {
	position: fixed;
	left: 50%;
	bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
	transform: translate(-50%, 16px);
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.7rem 1.15rem;
	border-radius: 999px;
	background: rgba(12, 10, 14, 0.94);
	border: 1px solid rgba(225, 6, 0, 0.45);
	color: var(--nx-text);
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
	z-index: 310;
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}

.nx-points-toast.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

.nx-points-toast__icon {
	color: #ffd700;
	font-size: 1.1rem;
}

/* Comment modal */
.nx-comment-modal[hidden] {
	display: none !important;
}

.nx-comment-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: grid;
	place-items: end center;
	padding: 1rem;
}

@media (min-width: 640px) {
	.nx-comment-modal {
		place-items: center;
	}
}

.nx-comment-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
}

.nx-comment-modal__dialog {
	position: relative;
	width: min(480px, 100%);
	max-height: min(80dvh, 560px);
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
}

.nx-comment-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid var(--nx-border);
}

.nx-comment-modal__head h2 {
	margin: 0;
	font-size: 1rem;
}

.nx-comment-modal__close {
	border: 0;
	background: transparent;
	color: var(--nx-text);
	font-size: 1.5rem;
	cursor: pointer;
}

.nx-comment-modal__list {
	flex: 1;
	overflow: auto;
	margin: 0;
	padding: 0.75rem 1rem;
	list-style: none;
	display: grid;
	gap: 0.65rem;
}

.nx-comment-modal__list li {
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid var(--nx-border);
}

.nx-comment-modal__list p {
	margin: 0.25rem 0 0;
	font-size: 0.86rem;
	color: var(--nx-muted);
}

.nx-comment-modal__form {
	display: grid;
	gap: 0.5rem;
	padding: 0.75rem 1rem 1rem;
	border-top: 1px solid var(--nx-border);
}

.nx-comment-modal__form textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border-radius: 10px;
	border: 1px solid var(--nx-border);
	background: rgba(0, 0, 0, 0.35);
	color: var(--nx-text);
	font: inherit;
	resize: vertical;
}

/* AI premium polish */
.nx-ai__launcher-pulse {
	position: absolute;
	inset: -6px;
	border-radius: 50%;
	border: 2px solid rgba(230, 0, 0, 0.45);
	animation: nxAiPulse 2.4s ease-out infinite;
	pointer-events: none;
}

@keyframes nxAiPulse {
	0% { transform: scale(0.85); opacity: 0.9; }
	100% { transform: scale(1.35); opacity: 0; }
}

.nx-ai__brand {
	display: flex;
	align-items: center;
	gap: 0.65rem;
}

.nx-ai__orb {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--nx-accent);
	box-shadow: 0 0 12px rgba(230, 0, 0, 0.8);
}

.nx-ai__panel {
	background: rgba(8, 8, 8, 0.88);
	backdrop-filter: blur(16px);
}

.nx-ai__prompts {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	padding: 0.65rem 0.85rem 0;
}

.nx-ai__prompt {
	border: 1px solid rgba(230, 0, 0, 0.25);
	background: rgba(230, 0, 0, 0.08);
	color: var(--nx-text);
	border-radius: 999px;
	padding: 0.35rem 0.7rem;
	font-size: 0.72rem;
	cursor: pointer;
}

.nx-ai__prompt:hover {
	background: rgba(230, 0, 0, 0.18);
}

.nx-ai__bubble {
	border-radius: 12px;
	padding: 0.55rem 0.75rem;
	line-height: 1.45;
}

.nx-ai__bubble--user {
	background: rgba(230, 0, 0, 0.18);
	border: 1px solid rgba(230, 0, 0, 0.25);
}

.nx-ai__bubble--bot {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid var(--nx-border);
}
