/**
 * Noxora Core v4.24.0 Enterprise — Global UI/UX layer
 * Consolidates v4.23 global layer + enterprise design system utilities.
 */

/* ── Critical layout guard (zero horizontal CLS) ── */
html.noxora-html,
html.nx-landing-html,
html.nx-comm-html,
html.ns-pro-html,
html.ns-story-html,
html.ns-tube-html,
body.noxora-body,
body.nx-landing-body,
body.nx-comm-body,
body.ns-pro-body {
	overflow-x: clip;
	max-width: 100vw;
}

/* ── Enterprise focus ring (accessibility) ── */
:focus-visible {
	outline: 2px solid var(--nx-e-cyan, #00f0ff);
	outline-offset: 2px;
}

.nx-e-btn:focus:not(:focus-visible),
.nx-e-input:focus:not(:focus-visible) {
	outline: none;
}

/* ── Header micro-interactions (Main / ecosystem) ── */
.nx-main-header__link,
.ns-story-header__link,
.ns-tube-site-header__link,
.ns-pro-site-header__link,
.nx-comm-nav-link {
	transition: color var(--nx-duration-normal) ease, background var(--nx-duration-normal) ease,
		box-shadow var(--nx-duration-normal) ease, transform var(--nx-duration-normal) ease;
}

.nx-main-header__link:hover,
.nx-main-header__link:focus-visible,
.ns-story-header__link:hover,
.ns-tube-site-header__link:hover,
.ns-pro-site-header__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(0, 240, 255, 0.08);
}

.nx-main-header__link svg,
.nx-icon-btn svg,
.ns-story-icon-btn svg,
.ns-tube-icon-btn svg,
.ns-pro-icon-btn svg {
	stroke-width: 1.5;
}

/* Community nav — no "Canlı" chip clutter */
.nx-comm-nav-link__live {
	display: none !important;
}

.nx-comm-nav-link__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--nx-e-cyan, #00f0ff);
	box-shadow: 0 0 8px rgba(0, 240, 255, 0.65);
	animation: nxE424PulseDot 2s ease-in-out infinite;
}

@keyframes nxE424PulseDot {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: 0.55; transform: scale(0.85); }
}

/* ── Profile dropdown premium ── */
.nx-shared-profile__panel {
	border-radius: var(--nx-radius-lg, 18px);
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.08));
	background: rgba(10, 10, 14, 0.94);
	backdrop-filter: blur(var(--nx-glass-blur, 20px));
	-webkit-backdrop-filter: blur(var(--nx-glass-blur, 20px));
	box-shadow: var(--nx-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.55)), var(--nx-shadow-inset);
	transition: opacity 0.24s ease, transform 0.24s var(--nx-ease-out, cubic-bezier(0.22, 1, 0.36, 1));
	transform-origin: top right;
}

.nx-shared-profile.is-open .nx-shared-profile__panel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.nx-shared-profile__panel[hidden] {
	display: block;
	opacity: 0;
	transform: translateY(-6px) scale(0.98);
	pointer-events: none;
}

/* ── Landing hero explore link ── */
.nx-landing-hero__explore {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-top: 0.85rem;
	color: rgba(255, 255, 255, 0.72);
	text-decoration: none;
	font-size: var(--nx-text-fluid-sm, 0.88rem);
	font-weight: var(--nx-weight-semibold, 600);
	letter-spacing: 0.02em;
	transition: color var(--nx-duration-normal) ease, text-shadow var(--nx-duration-normal) ease;
}

.nx-landing-hero__explore:hover,
.nx-landing-hero__explore:focus-visible {
	color: var(--nx-e-cyan, #00f0ff);
	text-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
	text-decoration: none;
}

.nx-landing-hero__explore svg {
	transition: transform var(--nx-duration-normal) ease;
}

.nx-landing-hero__explore:hover svg {
	transform: translateY(3px);
}

/* ── Partners +15% + grayscale hover ── */
.nx-partners-strip__logo img {
	filter: grayscale(1) opacity(0.72);
	transition: filter 0.35s ease, transform 0.35s ease;
	transform: scale(1.15);
}

.nx-partners-strip__logo:hover img,
.nx-partners-strip__logo:focus-visible img {
	filter: grayscale(0) opacity(1);
	transform: scale(1.2);
}

.nx-partners-strip__logos {
	gap: clamp(1rem, 3vw, 1.75rem);
}

/* ── Live engagement counters ── */
[data-nx-live-stat] {
	display: inline-block;
	font-variant-numeric: tabular-nums;
	transition: color 0.3s ease;
}

[data-nx-live-stat].is-ticking {
	color: var(--nx-e-cyan, #00f0ff);
	animation: nxE424StatTick 0.45s ease;
}

@keyframes nxE424StatTick {
	0% { transform: scale(1); }
	40% { transform: scale(1.08); }
	100% { transform: scale(1); }
}

/* ── Tube watch cinematic + skeleton ── */
.ns-tube-watch__stage {
	position: relative;
}

.ns-tube-watch__stage.is-loading::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, rgba(255,255,255,0.04) 8%, rgba(255,255,255,0.1) 18%, rgba(255,255,255,0.04) 33%);
	background-size: 200% 100%;
	animation: nxE424Shimmer 1.2s linear infinite;
	border-radius: inherit;
	pointer-events: none;
}

@keyframes nxE424Shimmer {
	to { background-position-x: -200%; }
}

.ns-tube-watch--cinematic {
	box-shadow: 0 0 80px rgba(255, 0, 128, 0.12), 0 0 120px rgba(0, 240, 255, 0.06);
}

.ns-tube-watch--cinematic .ns-tube-watch__stage {
	border-radius: var(--nx-radius-md, 16px);
	overflow: hidden;
}

/* ── Story reader typography polish ── */
.ns-story-reader .ns-story-reader__content,
.ns-story-read-body {
	line-height: 1.75;
	font-weight: var(--nx-weight-normal, 400);
	letter-spacing: 0.01em;
	max-width: 68ch;
}

/* ── Profile account centered ── */
.nx-dashboard-tabs__pane[data-nx-profile-pane="account"] .nx-dashboard-account {
	max-width: 520px;
	margin-inline: auto;
}

.nx-dashboard-account__form input,
.nx-dashboard-account__form textarea {
	width: 100%;
	min-height: 48px;
	border-radius: var(--nx-radius-sm, 12px);
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.08));
	background: rgba(0, 0, 0, 0.35);
	padding: 0.65rem 0.85rem;
	transition: border-color var(--nx-duration-normal) ease, box-shadow var(--nx-duration-normal) ease;
}

.nx-dashboard-account__form input:focus,
.nx-dashboard-account__form textarea:focus {
	outline: none;
	border-color: rgba(0, 240, 255, 0.45);
	box-shadow: 0 0 0 3px var(--nx-e-cyan-soft, rgba(0, 240, 255, 0.12));
}

/* ── XP level bar (separate from coin tier) ── */
.nx-dashboard-hero__level-head strong.nx-xp-level {
	color: var(--nx-e-cyan, #00f0ff);
	font-size: 1.1rem;
}

/* ── Premium toast (v424 + v423 compat class) ── */
.nx-enterprise-toast,
.nx-v423-toast {
	position: fixed;
	bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
	left: 50%;
	transform: translateX(-50%) translateY(120%);
	z-index: var(--nx-z-toast, 9999);
	min-width: min(92vw, 380px);
	padding: 0.85rem 1.1rem;
	border-radius: var(--nx-radius-md, 14px);
	background: rgba(12, 12, 16, 0.94);
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.08));
	box-shadow: var(--nx-shadow-md, 0 16px 48px rgba(0, 0, 0, 0.5));
	color: var(--nx-text, #f5f5f7);
	font-size: var(--nx-text-sm, 0.88rem);
	transition: transform 0.35s var(--nx-ease-out, cubic-bezier(0.22, 1, 0.36, 1)), opacity 0.35s ease;
	opacity: 0;
	pointer-events: none;
}

.nx-enterprise-toast.is-visible,
.nx-v423-toast.is-visible {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

.nx-enterprise-toast.is-error,
.nx-v423-toast.is-error {
	border-color: rgba(255, 80, 80, 0.35);
}

.nx-enterprise-toast.is-success,
.nx-v423-toast.is-success {
	border-color: rgba(0, 240, 255, 0.25);
}

/* ── Issue report premium ── */
.nx-issue-report__dialog {
	border-radius: var(--nx-radius-xl, 20px);
	max-width: min(92vw, 440px);
}

.nx-issue-report__form input,
.nx-issue-report__form select,
.nx-issue-report__form textarea {
	border-radius: var(--nx-radius-sm, 12px);
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.08));
	background: rgba(0, 0, 0, 0.3);
	min-height: 44px;
}

/* ── Ad grid stability ── */
.nx-ad-slot,
.nx-ad-grid__cell {
	max-width: 100%;
	min-width: 0;
	overflow: hidden;
}

.nx-ad-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
	gap: var(--nx-space-4, 1rem);
	width: 100%;
}

/* ── Admin CC notification badge ── */
.nx-cc-admin-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: var(--nx-radius-full, 999px);
	background: var(--nx-danger, #ff5050);
	color: #fff;
	font-size: 0.7rem;
	font-weight: var(--nx-weight-bold, 700);
	margin-inline-start: 0.35rem;
}

.nx-landing-btn--primary {
	background: linear-gradient(145deg, var(--nx-e-cyan, #00f0ff), #0099cc);
	color: #060608;
	font-weight: var(--nx-weight-bold, 700);
	box-shadow: 0 8px 28px rgba(0, 240, 255, 0.25);
}

.nx-landing-btn--primary:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 32px rgba(0, 240, 255, 0.35);
}

.nx-shared-profile .nx-profile-panel,
.nx-profile-panel.nx-glass {
	border-radius: var(--nx-radius-lg, 18px);
	box-shadow: var(--nx-shadow-lg, 0 24px 64px rgba(0, 0, 0, 0.55));
}

.nx-dashboard-mission__reward--xp {
	color: var(--nx-e-cyan, #00f0ff);
	margin-inline-start: 0.35rem;
}

.nx-dashboard-hero__level-note--tier {
	opacity: 0.72;
	font-size: 0.82rem;
	margin-top: 0.35rem;
}

/* ── Enterprise skeleton loader ── */
.nx-e-skeleton {
	position: relative;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.04);
	border-radius: var(--nx-radius-sm, 10px);
}

.nx-e-skeleton::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.08) 37%, transparent 63%);
	background-size: 200% 100%;
	animation: nxE424Shimmer 1.4s linear infinite;
}

/* ── Enterprise empty state ── */
.nx-e-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--nx-space-3, 0.75rem);
	padding: var(--nx-space-10, 2.5rem) var(--nx-space-4, 1rem);
	text-align: center;
	color: var(--nx-text-secondary, #a8a8b8);
}

.nx-e-empty__title {
	font-size: var(--nx-text-fluid-lg, 1.125rem);
	font-weight: var(--nx-weight-semibold, 600);
	color: var(--nx-text, #f4f4f8);
	margin: 0;
}

.nx-e-empty__desc {
	font-size: var(--nx-text-fluid-sm, 0.875rem);
	max-width: 42ch;
	margin: 0;
	line-height: var(--nx-leading-normal, 1.5);
}

/* ── Enterprise premium button base ── */
.nx-e-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--nx-space-2, 0.5rem);
	min-height: 44px;
	padding-inline: var(--nx-space-5, 1.25rem);
	border-radius: var(--nx-radius-sm, 10px);
	border: 1px solid transparent;
	font-size: var(--nx-text-sm, 0.875rem);
	font-weight: var(--nx-weight-semibold, 600);
	cursor: pointer;
	transition: transform var(--nx-duration-normal) ease, box-shadow var(--nx-duration-normal) ease,
		background var(--nx-duration-normal) ease, border-color var(--nx-duration-normal) ease;
}

.nx-e-btn--primary {
	background: linear-gradient(145deg, var(--nx-e-cyan, #00f0ff), #0099cc);
	color: #060608;
	box-shadow: 0 6px 20px rgba(0, 240, 255, 0.2);
}

.nx-e-btn--primary:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 28px rgba(0, 240, 255, 0.3);
}

.nx-e-btn--ghost {
	background: transparent;
	border-color: var(--nx-border, rgba(255, 255, 255, 0.08));
	color: var(--nx-text, #f4f4f8);
}

.nx-e-btn--ghost:hover {
	background: var(--nx-surface-hover, rgba(28, 28, 40, 0.85));
}

/* ── Lazy image fade-in ── */
img[data-nx-lazy].is-loaded {
	opacity: 1;
	transition: opacity 0.35s ease;
}

img[data-nx-lazy]:not(.is-loaded) {
	opacity: 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Profile panel enterprise nav (global) */
.nx-profile-panel__nav-link {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.55rem 0.65rem;
	border-radius: 10px;
	text-decoration: none;
	color: inherit;
	font-size: 0.88rem;
	transition: background var(--nx-duration-normal) ease;
	border: none;
	background: transparent;
	width: 100%;
	text-align: start;
	cursor: pointer;
	font: inherit;
}

.nx-profile-panel__nav-link:hover,
.nx-profile-panel__nav-link:focus-visible {
	background: rgba(255, 255, 255, 0.05);
}

.nx-profile-panel__logout {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.nx-profile-panel__wallet--premium {
	grid-template-columns: repeat(3, 1fr);
}

/* Global search */
.nx-global-search {
	position: fixed;
	inset: 0;
	z-index: 500;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: clamp(1rem, 8vh, 4rem) 1rem;
}

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

.nx-global-search__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	cursor: pointer;
}

.nx-global-search__recent {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.nx-global-search__recent-btn {
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.08));
	background: rgba(255, 255, 255, 0.04);
	color: inherit;
	border-radius: 999px;
	padding: 0.35rem 0.75rem;
	font-size: 0.78rem;
	cursor: pointer;
	transition: border-color 0.2s ease, background 0.2s ease;
}

.nx-global-search__recent-btn:hover {
	border-color: rgba(0, 240, 255, 0.35);
	background: rgba(0, 240, 255, 0.06);
}

@media (max-width: 768px) {
	.nx-main-header__nav { display: none; }
}
