/**
 * Noxora v4.27 — additive premium stabilization layer.
 * Preserves legacy class names; only enhances spacing, motion, and overflow safety.
 */

:root {
	--nx-v427-space-1: 4px;
	--nx-v427-space-2: 8px;
	--nx-v427-space-3: 12px;
	--nx-v427-space-4: 16px;
	--nx-v427-space-5: 24px;
	--nx-v427-space-6: 32px;
	--nx-v427-header-h: 64px;
	--nx-v427-radius: 14px;
	--nx-v427-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

/* Header alignment & sticky polish */
.nx-ecosystem-header,
.nx-main-header,
[data-ns-site-header] {
	min-height: var(--nx-v427-header-h);
	align-items: center;
	gap: var(--nx-v427-space-3);
}

.nx-ecosystem-header.is-scrolled,
.nx-main-header.is-scrolled {
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
	backdrop-filter: blur(16px) saturate(140%);
}

.nx-main-header__actions,
.ns-pro-header__actions,
.ns-story-header__actions,
.ns-tube-header__actions {
	display: flex;
	align-items: center;
	gap: var(--nx-v427-space-2);
	flex-shrink: 0;
}

/* Keşfet mega — canonical rules live in nx-header-system.css */

/* Profile dropdown */
.nx-shared-profile {
	position: relative;
	z-index: 120;
}

.nx-profile-panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	min-width: min(92vw, 320px);
	z-index: var(--nx-z-dropdown, 10050);
	box-shadow: var(--nx-v427-shadow);
	border-radius: var(--nx-v427-radius);
	overflow: hidden;
}

/* Global search overlay */
.nx-global-search {
	z-index: 100000;
}

.nx-global-search__panel {
	border-radius: calc(var(--nx-v427-radius) + 2px);
	box-shadow: var(--nx-v427-shadow);
}

.nx-global-search__content-item {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 10px 12px;
	border-radius: 10px;
	transition: background 0.15s ease;
}

.nx-global-search__content-item:hover {
	background: rgba(255, 255, 255, 0.06);
}

/* Notifications */
.nx-notify {
	position: relative;
	z-index: 115;
}

.nx-notify__panel {
	box-shadow: var(--nx-v427-shadow);
	border-radius: var(--nx-v427-radius);
}

.nx-notify__badge[hidden] {
	display: none !important;
}

/* Landing today sections */
.nx-landing-cards--compact {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
	gap: var(--nx-v427-space-4);
}

.nx-landing-card--compact {
	display: flex;
	flex-direction: column;
	gap: var(--nx-v427-space-2);
	padding: var(--nx-v427-space-4);
	min-height: 180px;
	overflow: hidden;
}

.nx-landing-card--compact .nx-landing-card__thumb {
	display: block;
	width: 100%;
	height: 96px;
	border-radius: 10px;
	background-size: cover;
	background-position: center;
	margin-bottom: var(--nx-v427-space-2);
}

/* Community widget marquee safety */
.nx-comm-widget__track {
	display: flex;
	gap: var(--nx-v427-space-3);
	min-width: 0;
}

.nx-comm-widget-card {
	min-width: min(280px, 78vw);
	max-width: 320px;
	flex: 0 0 auto;
}

/* Responsive overflow guards */
@media (max-width: 1024px) {
	.nx-disc-nav__panel-grid,
	[data-nx-discover-mega-content] {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.nx-main-header__nav,
	.ns-pro-header__nav {
		display: none;
	}

	.nx-disc-nav__panel {
		position: fixed;
		left: var(--nx-v427-space-3);
		right: var(--nx-v427-space-3);
		top: calc(var(--nx-v427-header-h) + var(--nx-ticker-height, 36px) + 8px);
		width: auto;
		max-width: none;
	}

	.nx-site-chrome-stack:not(:has(.nx-announcement-ticker)) .nx-disc-nav__panel {
		top: calc(var(--nx-v427-header-h) + 8px);
	}

	.nx-disc-nav__panel-grid,
	[data-nx-discover-mega-content] {
		grid-template-columns: 1fr;
	}

	.nx-profile-panel {
		position: fixed;
		left: var(--nx-v427-space-3);
		right: var(--nx-v427-space-3);
		top: auto;
		bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}
}

@media (max-width: 390px) {
	.nx-main-header__actions .nx-icon-btn,
	.ns-pro-icon-btn {
		width: 36px;
		height: 36px;
	}
}

/* Story infinite scroll sentinel */
.ns-story-infinite-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: var(--nx-v427-space-4) var(--nx-v427-space-3);
	color: var(--nx-text-muted, rgba(255, 255, 255, 0.55));
	font-size: 0.875rem;
	letter-spacing: 0.02em;
}

.ns-story-infinite-sentinel[hidden] {
	display: none;
}

/* Shared ecosystem footer — Story & Tube */
.nx-ecosystem-footer {
	margin-top: var(--nx-v427-space-6);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.nx-ecosystem-footer__grid {
	display: grid;
	grid-template-columns: minmax(200px, 1.2fr) repeat(auto-fit, minmax(140px, 1fr));
	gap: var(--nx-v427-space-5) var(--nx-v427-space-4);
	padding: var(--nx-v427-space-6) var(--nx-v427-space-4);
}

.nx-ecosystem-footer__brand .ns-story-footer__logo,
.nx-ecosystem-footer__brand .ns-tube-footer__logo,
.nx-ecosystem-footer__brand .nx-ecosystem-footer-module__logo {
	font-size: 1.25rem;
	font-weight: 700;
	text-decoration: none;
}

.nx-ecosystem-footer-module__logo {
	color: var(--nx-text, #f5f5f5);
}

.nx-ecosystem-footer__tagline {
	margin: var(--nx-v427-space-2) 0 0;
	max-width: 28ch;
	color: var(--nx-text-muted, rgba(255, 255, 255, 0.6));
	font-size: 0.875rem;
	line-height: 1.5;
}

.nx-ecosystem-footer__col h4 {
	margin: 0 0 var(--nx-v427-space-3);
	font-size: 0.8125rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--nx-text-muted, rgba(255, 255, 255, 0.55));
}

.nx-ecosystem-footer__col ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: var(--nx-v427-space-2);
}

.nx-ecosystem-footer__col a,
.nx-ecosystem-footer__col button {
	color: inherit;
	text-decoration: none;
	font-size: 0.9375rem;
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.15s ease;
}

.nx-ecosystem-footer__col a:hover,
.nx-ecosystem-footer__col button:hover {
	opacity: 1;
}

.nx-ecosystem-footer__cats {
	display: flex;
	flex-wrap: wrap;
	gap: var(--nx-v427-space-2) var(--nx-v427-space-3);
	padding: 0 var(--nx-v427-space-4) var(--nx-v427-space-4);
}

.nx-ecosystem-footer__cats a {
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
	font-size: 0.8125rem;
	text-decoration: none;
	color: inherit;
	opacity: 0.9;
}

.nx-ecosystem-footer__bottom {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--nx-v427-space-3);
	padding: var(--nx-v427-space-4);
	border-top: 1px solid rgba(255, 255, 255, 0.06);
	text-align: center;
}

@media (max-width: 768px) {
	.nx-ecosystem-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.nx-ecosystem-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 480px) {
	.nx-ecosystem-footer__grid {
		grid-template-columns: 1fr;
	}
}

/* Tube infinite scroll sentinel */
.ns-tube-infinite-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: var(--nx-v427-space-4) var(--nx-v427-space-3);
	color: var(--nx-text-muted, rgba(255, 255, 255, 0.55));
	font-size: 0.875rem;
}

.ns-tube-infinite-sentinel[hidden] {
	display: none;
}

/* Pro live virtual grid sentinel */
.ns-pro-live-infinite-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 56px;
	padding: var(--nx-v427-space-4) var(--nx-v427-space-3);
	color: var(--nx-text-muted, rgba(255, 255, 255, 0.55));
	font-size: 0.875rem;
}

.ns-pro-live-infinite-sentinel[hidden] {
	display: none;
}

/* Marketplace featured slider */
.ns-pro-marketplace-hub__slider {
	padding-bottom: var(--nx-v427-space-5);
}

.ns-pro-marketplace-hub__slider .swiper-slide {
	height: auto;
}

/* Discover premium hero + infinite scroll */
.nx-disc-hero--premium {
	border: 1px solid rgba(255, 255, 255, 0.06);
}

.nx-disc-infinite-sentinel {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
}
