/**
 * Noxora Notifications v2 - BEM CSS
 *
 * Server-driven notification styling with BEM naming convention.
 * Replaces legacy .nx-notify-* classes.
 *
 * @package Noxora_Core
 * @version 4.14.0
 */

/* ============================================
   NOTIFICATION TRIGGER (Header Icon)
   ============================================ */

.nx-notify {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.nx-notify__trigger {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	background: transparent;
	color: inherit;
	cursor: pointer;
	border-radius: 8px;
	transition: background-color 0.2s ease;
}

.nx-notify__trigger:hover {
	background-color: rgba(255, 255, 255, 0.1);
}

.nx-notify__badge {
	position: absolute;
	top: 4px;
	right: 4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background-color: #ef4444;
	border-radius: 9px;
	border: 2px solid var(--nx-bg-primary, #1a1a2e);
}

.nx-notify__badge[hidden] {
	display: none;
}

/* ============================================
   NOTIFICATION PANEL (Dropdown)
   ============================================ */

.nx-notify__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	width: 360px;
	max-width: calc(100vw - 32px);
	max-height: 520px;
	display: flex;
	flex-direction: column;
	background: var(--nx-bg-secondary, #16162a);
	border: 1px solid var(--nx-border, rgba(255, 255, 255, 0.1));
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
	overflow: hidden;
	z-index: 1000;
}

.nx-notify__panel[hidden] {
	display: none;
}

/* ============================================
   NOTIFICATION HEADER
   ============================================ */

.nx-notify__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nx-notify__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--nx-text-primary, #fff);
}

.nx-notify__read-all {
	padding: 0.5rem 0.75rem;
	border: none;
	background: transparent;
	color: var(--nx-accent, #8b5cf6);
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	border-radius: 6px;
	transition: background-color 0.2s ease;
}

.nx-notify__read-all:hover {
	background: rgba(139, 92, 246, 0.1);
}

/* ============================================
   NOTIFICATION LIST
   ============================================ */

.nx-notify__list {
	display: flex;
	flex-direction: column;
	max-height: 400px;
	overflow-y: auto;
}

.nx-notify__list::-webkit-scrollbar {
	width: 6px;
}

.nx-notify__list::-webkit-scrollbar-track {
	background: transparent;
}

.nx-notify__list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 3px;
}

.nx-notify__list::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   NOTIFICATION ITEM
   ============================================ */

.nx-notify__item {
	display: grid;
	grid-template-columns: 40px 1fr auto;
	gap: 0.75rem;
	align-items: flex-start;
	padding: 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.05);
	transition: background-color 0.2s ease;
	cursor: pointer;
}

.nx-notify__item:hover {
	background: rgba(255, 255, 255, 0.03);
}

.nx-notify__item--unread {
	background: rgba(139, 92, 246, 0.05);
}

.nx-notify__item--unread:hover {
	background: rgba(139, 92, 246, 0.08);
}

.nx-notify__item-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	color: var(--nx-text-primary, #fff);
}

.nx-notify__item-icon--announcement {
	background: rgba(96, 165, 250, 0.14);
	color: #93c5fd;
}

.nx-notify__item-icon--store {
	background: rgba(212, 175, 55, 0.14);
	color: #d4af37;
}

.nx-notify__item-icon--payment {
	background: rgba(74, 222, 128, 0.14);
	color: #86efac;
}

.nx-notify__item-icon--tube {
	background: rgba(248, 113, 113, 0.14);
	color: #fca5a5;
}

.nx-notify__item-icon--live {
	background: rgba(192, 132, 252, 0.14);
	color: #d8b4fe;
}

.nx-notify__item-icon--social {
	background: rgba(251, 191, 36, 0.14);
	color: #fcd34d;
}

.nx-notify__item-icon--default {
	background: rgba(255, 255, 255, 0.1);
	color: var(--nx-muted, rgba(255, 255, 255, 0.6));
}

.nx-notify__item-body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	min-width: 0;
}

.nx-notify__item-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--nx-text-primary, #fff);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nx-notify__item-message {
	font-size: 12px;
	color: var(--nx-muted, rgba(255, 255, 255, 0.6));
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nx-notify__item-time {
	font-size: 11px;
	color: var(--nx-muted, rgba(255, 255, 255, 0.4));
}

.nx-notify__item-dot {
	width: 8px;
	height: 8px;
	background: var(--nx-accent, #8b5cf6);
	border-radius: 50%;
	margin-top: 4px;
	flex-shrink: 0;
}

/* ============================================
   NOTIFICATION STATES
   ============================================ */

.nx-notify__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
	gap: 1rem;
}

.nx-notify__spinner {
	width: 32px;
	height: 32px;
	border: 3px solid rgba(255, 255, 255, 0.1);
	border-top-color: var(--nx-accent, #8b5cf6);
	border-radius: 50%;
	animation: nx-notify-spin 0.8s linear infinite;
}

@keyframes nx-notify-spin {
	to {
		transform: rotate(360deg);
	}
}

.nx-notify__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
	gap: 1rem;
	text-align: center;
}

.nx-notify__empty-icon {
	width: 48px;
	height: 48px;
	color: var(--nx-muted, rgba(255, 255, 255, 0.4));
}

.nx-notify__empty span {
	font-size: 14px;
	color: var(--nx-muted, rgba(255, 255, 255, 0.6));
}

.nx-notify__error {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 3rem 1rem;
}

.nx-notify__error span {
	font-size: 14px;
	color: var(--nx-muted, rgba(255, 255, 255, 0.6));
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 480px) {
	.nx-notify__panel {
		width: calc(100vw - 32px);
		right: -8px;
	}

	.nx-notify__item {
		grid-template-columns: 36px 1fr auto;
		gap: 0.5rem;
		padding: 0.75rem;
	}

	.nx-notify__item-icon {
		width: 36px;
		height: 36px;
	}
}
