/*
 * Community Chat Rooms UI — dark glass, mobile-first.
 * @package Noxora\Apps\Community
 */

.nx-chat-rooms {
	width: 100%;
	max-width: 1100px;
	margin: 0 auto;
	padding: clamp(1rem, 4vw, 2rem);
}

.nx-chat-rooms__head {
	text-align: center;
	padding: clamp(1.5rem, 5vw, 2.5rem);
	border-radius: 24px;
	margin-bottom: 1.5rem;
	border: 1px solid var(--nx-border, rgba(255,255,255,0.08));
	background: var(--nx-surface, rgba(18,18,18,0.72));
	backdrop-filter: blur(var(--nx-glass-blur, 18px));
	-webkit-backdrop-filter: blur(var(--nx-glass-blur, 18px));
}

.nx-chat-rooms__kicker {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--nx-accent, #8b5cf6);
	margin-bottom: 0.75rem;
}

.nx-chat-rooms__title {
	font-size: clamp(1.6rem, 5vw, 2.6rem);
	font-weight: 800;
	margin: 0 0 0.5rem;
	color: var(--nx-text, #f5f5f7);
}

.nx-chat-rooms__subtitle {
	font-size: 1rem;
	color: var(--nx-muted, #9a9a9a);
	margin: 0;
}

.nx-chat-rooms__shell {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 1rem;
	min-height: 60vh;
}

@media (max-width: 800px) {
	.nx-chat-rooms__shell {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
	}
}

.nx-chat-rooms__sidebar {
	border-radius: 20px;
	padding: 1rem;
	border: 1px solid var(--nx-border, rgba(255,255,255,0.08));
	background: var(--nx-surface, rgba(18,18,18,0.72));
	backdrop-filter: blur(var(--nx-glass-blur, 18px));
	-webkit-backdrop-filter: blur(var(--nx-glass-blur, 18px));
}

.nx-chat-rooms__list-head {
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--nx-muted, #9a9a9a);
	margin-bottom: 0.75rem;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--nx-border, rgba(255,255,255,0.08));
}

.nx-chat-rooms__tab {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.85rem 1rem;
	margin-bottom: 0.5rem;
	border-radius: 14px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--nx-text, #f5f5f7);
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s, transform 0.2s;
	text-align: left;
}

.nx-chat-rooms__tab:hover,
.nx-chat-rooms__tab:focus-visible,
.nx-chat-rooms__tab.is-active {
	background: rgba(255,255,255,0.06);
	border-color: var(--nx-accent, #8b5cf6);
	transform: translateX(4px);
}

.nx-chat-rooms__tab-title {
	font-weight: 600;
	font-size: 0.95rem;
}

.nx-chat-rooms__tab-badge {
	font-size: 0.65rem;
	font-weight: 700;
	padding: 0.2rem 0.5rem;
	border-radius: 999px;
	text-transform: uppercase;
	background: rgba(255,255,255,0.1);
	color: var(--nx-muted, #9a9a9a);
}

.nx-chat-rooms__tab-badge--vip {
	background: linear-gradient(135deg, rgba(225,6,0,0.25), rgba(255,200,0,0.2));
	color: #ffd700;
	border: 1px solid rgba(255,215,0,0.3);
}

.nx-chat-rooms__main {
	position: relative;
	border-radius: 20px;
	border: 1px solid var(--nx-border, rgba(255,255,255,0.08));
	background: var(--nx-surface, rgba(18,18,18,0.72));
	backdrop-filter: blur(var(--nx-glass-blur, 18px));
	-webkit-backdrop-filter: blur(var(--nx-glass-blur, 18px));
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.nx-chat-rooms__empty,
.nx-chat-room__login,
.nx-chat-room__paywall {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	padding: 2rem;
	text-align: center;
	color: var(--nx-muted, #9a9a9a);
	min-height: 300px;
}

.nx-chat-room__login-cta,
.nx-chat-room__paywall-cta {
	display: inline-flex;
	padding: 0.7rem 1.5rem;
	border-radius: 999px;
	font-weight: 700;
	color: #050505;
	background: linear-gradient(135deg, var(--nx-accent, #8b5cf6), #a78bfa);
	border: none;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.2s;
}

.nx-chat-room__login-cta:hover,
.nx-chat-room__paywall-cta:hover {
	filter: brightness(1.15);
}

.nx-chat-room {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.nx-chat-room__header {
	padding: 1rem 1.25rem;
	border-bottom: 1px solid var(--nx-border, rgba(255,255,255,0.08));
	background: rgba(0,0,0,0.15);
}

.nx-chat-room__title {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 0.25rem;
	color: var(--nx-text, #f5f5f7);
}

.nx-chat-room__meta {
	font-size: 0.8rem;
	color: var(--nx-accent, #8b5cf6);
}

.nx-chat-room__messages {
	flex: 1;
	overflow-y: auto;
	padding: 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	max-height: 60vh;
}

.nx-chat-room__no-msg,
.nx-chat-room__error {
	text-align: center;
	color: var(--nx-muted, #9a9a9a);
	margin: auto;
}

.nx-chat-room__error {
	color: #ff6b6b;
}

.nx-chat-msg {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	animation: nx-chat-msg-in 0.25s ease both;
}

@keyframes nx-chat-msg-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.nx-chat-msg__avatar {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	border-radius: 50%;
	overflow: hidden;
	background: var(--nx-surface, rgba(255,255,255,0.06));
	border: 2px solid transparent;
	box-shadow: 0 0 0 2px var(--nx-accent-soft, rgba(139,92,246,0.18));
}

.nx-chat-msg__avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nx-chat-msg__avatar-fallback {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	color: var(--nx-accent, #8b5cf6);
	font-size: 1rem;
}

.nx-chat-msg__body {
	flex: 1;
	min-width: 0;
	background: rgba(0,0,0,0.22);
	padding: 0.75rem 1rem;
	border-radius: 18px;
	border-top-left-radius: 4px;
}

.nx-chat-msg--gift .nx-chat-msg__body {
	border: 1px solid rgba(255,215,0,0.25);
	background: linear-gradient(135deg, rgba(255,215,0,0.08), rgba(0,0,0,0.22));
}

.nx-chat-msg__head {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.35rem;
	flex-wrap: wrap;
}

.nx-chat-msg__author {
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--nx-accent, #8b5cf6);
	text-decoration: none;
}

.nx-chat-msg__author:hover {
	text-decoration: underline;
}

.nx-chat-msg__time {
	font-size: 0.7rem;
	color: var(--nx-muted, #9a9a9a);
}

.nx-chat-msg__gift {
	font-size: 0.65rem;
	font-weight: 700;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: rgba(255,215,0,0.15);
	color: #ffd700;
	border: 1px solid rgba(255,215,0,0.3);
}

.nx-chat-msg__text {
	margin: 0;
	font-size: 0.95rem;
	line-height: 1.5;
	color: var(--nx-text, #f5f5f7);
	word-break: break-word;
}

.nx-chat-room__composer {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-top: 1px solid var(--nx-border, rgba(255,255,255,0.08));
}

.nx-chat-room__input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 999px;
	background: rgba(0,0,0,0.28);
	border: 1px solid var(--nx-border, rgba(255,255,255,0.08));
}

.nx-chat-room__emoji {
	width: 34px;
	height: 34px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: transparent;
	border: none;
	color: var(--nx-muted, #9a9a9a);
	cursor: pointer;
	font-size: 1.1rem;
	transition: background 0.2s, color 0.2s;
}

.nx-chat-room__emoji:hover {
	background: rgba(255,255,255,0.08);
	color: var(--nx-text, #f5f5f7);
}

.nx-chat-room__input {
	flex: 1;
	background: transparent;
	border: none;
	color: var(--nx-text, #f5f5f7);
	font-size: 0.95rem;
	outline: none;
}

.nx-chat-room__input::placeholder {
	color: var(--nx-muted, #9a9a9a);
}

.nx-chat-room__send {
	width: 42px;
	height: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: none;
	color: #050505;
	background: linear-gradient(135deg, var(--nx-accent, #8b5cf6), #a78bfa);
	cursor: pointer;
	transition: filter 0.2s, transform 0.2s;
}

.nx-chat-room__send:hover {
	filter: brightness(1.15);
	transform: scale(1.05);
}

.nx-chat-room__loading {
	display: flex;
	gap: 0.4rem;
	padding: 1rem;
	justify-content: center;
	align-items: center;
}

.nx-skeleton--dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--nx-muted, #9a9a9a);
	animation: nx-skeleton-pulse 1.2s infinite ease-in-out both;
}

.nx-skeleton--dot:nth-child(2) { animation-delay: 0.2s; }
.nx-skeleton--dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes nx-skeleton-pulse {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
	40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 800px) {
	.nx-chat-room__messages {
		max-height: 50vh;
	}
}

/* ── v5.3.45 Premium rooms UI refresh ── */
.nx-chat-rooms__head {
	position: relative;
	overflow: hidden;
	background: linear-gradient(135deg, rgba(18, 18, 26, 0.92) 0%, rgba(26, 22, 40, 0.85) 100%);
	border: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-chat-rooms__head::before {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: radial-gradient(circle at 85% 15%, rgba(212, 175, 55, 0.16) 0%, transparent 40%),
	            radial-gradient(circle at 15% 85%, rgba(138, 43, 226, 0.1) 0%, transparent 40%);
	opacity: 0.8;
}

.nx-chat-rooms__kicker {
	position: relative;
	color: var(--nx-gold, #d4af37);
	background: none;
	-webkit-text-fill-color: currentColor;
}

.nx-chat-rooms__title {
	position: relative;
	background: linear-gradient(90deg, #ffffff 0%, #f6e6b8 55%, #d4af37 100%);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
}

.nx-chat-rooms__subtitle {
	position: relative;
}

.nx-chat-rooms__tab {
	position: relative;
	transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nx-chat-rooms__tab:hover,
.nx-chat-rooms__tab:focus-visible,
.nx-chat-rooms__tab.is-active {
	background: rgba(255, 255, 255, 0.06);
	border-color: var(--nx-gold, #d4af37);
	box-shadow: 0 0 18px rgba(212, 175, 55, 0.12);
	transform: translateX(4px);
}

.nx-chat-rooms__tab-badge--vip {
	background: rgba(212, 175, 55, 0.14);
	color: var(--nx-gold, #f6e6b8);
	border: 1px solid rgba(212, 175, 55, 0.25);
}

.nx-chat-room__header {
	position: relative;
	background: rgba(18, 18, 26, 0.85);
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-chat-room__title {
	font-size: clamp(1.1rem, 3vw, 1.5rem);
	font-weight: 800;
	color: #f5f5f5;
}

.nx-chat-room__meta {
	color: var(--nx-gold, #d4af37);
	font-size: 0.8rem;
}

.nx-chat-room__messages {
	background: rgba(12, 12, 16, 0.4);
}

.nx-chat-room__composer {
	background: rgba(18, 18, 26, 0.85);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nx-chat-room__send {
	background: linear-gradient(135deg, #d4af37, #f8f6ef);
	color: #08080a;
}

.nx-chat-room__send:hover {
	filter: brightness(1.1);
	transform: scale(1.08);
}

.nx-chat-msg--gift .nx-chat-msg__text {
	color: var(--nx-gold, #f6e6b8);
}
