/* ══════════════════════════════════════════════
   KeyNova Social Proof Notifications
   Modern Glass Design — Dark & Light Mode
   ══════════════════════════════════════════════ */

/* ─── CSS Variables for theme adaptation ─── */
:root {
	--sp-bg: rgba(12, 14, 20, 0.92);
	--sp-border: rgba(255, 255, 255, 0.08);
	--sp-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.25);
	--sp-text: #f0f2f5;
	--sp-text-sec: rgba(255, 255, 255, 0.65);
	--sp-text-muted: rgba(255, 255, 255, 0.38);
	--sp-accent: #00E676;
	--sp-accent-bg: rgba(0, 230, 118, 0.12);
	--sp-close-bg: rgba(255, 255, 255, 0.06);
	--sp-close-hover: rgba(255, 255, 255, 0.12);
	--sp-close-color: rgba(255, 255, 255, 0.5);
	--sp-icon-bg: linear-gradient(135deg, rgba(0, 230, 118, 0.15), rgba(0, 176, 255, 0.12));
	--sp-icon-color: #7cf0be;
	--sp-bar-gradient: linear-gradient(180deg, #00e676, #00b0ff);
}

html.light {
	--sp-bg: rgba(255, 255, 255, 0.95);
	--sp-border: rgba(0, 0, 0, 0.06);
	--sp-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
	--sp-text: #1a1a2e;
	--sp-text-sec: rgba(0, 0, 0, 0.6);
	--sp-text-muted: rgba(0, 0, 0, 0.35);
	--sp-accent: #00C853;
	--sp-accent-bg: rgba(0, 200, 83, 0.1);
	--sp-close-bg: rgba(0, 0, 0, 0.04);
	--sp-close-hover: rgba(0, 0, 0, 0.08);
	--sp-close-color: rgba(0, 0, 0, 0.4);
	--sp-icon-bg: linear-gradient(135deg, rgba(0, 200, 83, 0.12), rgba(0, 150, 255, 0.08));
	--sp-icon-color: #00a854;
	--sp-bar-gradient: linear-gradient(180deg, #00C853, #0091EA);
}

/* ─── Container ─── */
.sp-notification-container {
	position: fixed;
	display: flex;
	flex-direction: column;
	gap: 12px;
	width: min(380px, calc(100vw - 32px));
	z-index: 10040;
	pointer-events: none;
}

.sp-notification-container.bottom-left {
	left: 20px;
	bottom: 20px;
	align-items: flex-start;
}

.sp-notification-container.bottom-right {
	right: 20px;
	bottom: 20px;
	align-items: flex-end;
}

.sp-notification-container.top-left {
	left: 20px;
	top: calc(var(--header-h, 88px) + 20px);
	align-items: flex-start;
}

.sp-notification-container.top-right {
	right: 20px;
	top: calc(var(--header-h, 88px) + 20px);
	align-items: flex-end;
}

/* ─── Notification Card ─── */
.sp-notification {
	position: relative;
	pointer-events: auto;
	width: 100%;
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 16px;
	border-radius: 16px;
	border: 1px solid var(--sp-border);
	background: var(--sp-bg);
	box-shadow: var(--sp-shadow);
	backdrop-filter: blur(20px);
	-webkit-backdrop-filter: blur(20px);
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sp-notification:hover {
	transform: translateY(-2px);
	box-shadow: var(--sp-shadow), 0 0 0 1px var(--sp-accent-bg);
}

/* Accent bar left */
.sp-notification::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--sp-bar-gradient);
	border-radius: 3px;
}

/* Subtle shimmer effect */
.sp-notification::after {
	content: '';
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
	animation: spShimmer 3s ease-in-out infinite;
	pointer-events: none;
}

@keyframes spShimmer {
	0%, 100% { left: -100%; }
	50% { left: 100%; }
}

/* ─── Product Image / Icon ─── */
.sp-notification-product-image,
.sp-notification-icon {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	flex-shrink: 0;
	overflow: hidden;
	border: 1px solid var(--sp-border);
}

.sp-notification-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.sp-notification-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--sp-icon-bg);
	color: var(--sp-icon-color);
	font-size: 1rem;
}

/* ─── Content ─── */
.sp-notification-content {
	flex: 1;
	min-width: 0;
}

.sp-notification-name {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 3px;
	color: var(--sp-text);
	font-size: 0.85rem;
	font-weight: 700;
	line-height: 1.3;
}

.sp-notification-verified {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--sp-accent-bg);
	color: var(--sp-accent);
	font-size: 0.55rem;
	flex-shrink: 0;
}

.sp-notification-message {
	color: var(--sp-text-sec);
	font-size: 0.78rem;
	line-height: 1.4;
	margin-bottom: 4px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sp-notification-time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--sp-text-muted);
	font-size: 0.68rem;
	font-weight: 500;
}

.sp-notification-time i {
	font-size: 0.62rem;
}

/* ─── Close Button ─── */
.sp-notification-close {
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	background: var(--sp-close-bg);
	color: var(--sp-close-color);
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
	font-size: 0.7rem;
	flex-shrink: 0;
	margin-top: 2px;
}

.sp-notification-close:hover {
	background: var(--sp-close-hover);
	color: var(--sp-text);
	transform: scale(1.08);
}

/* ─── Animations ─── */
.slide-in-left {
	animation: spSlideInLeft 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-in-right {
	animation: spSlideInRight 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.slide-out-left {
	animation: spSlideOutLeft 0.3s ease both;
}

.slide-out-right {
	animation: spSlideOutRight 0.3s ease both;
}

.fade-in {
	animation: spFadeIn 0.35s ease both;
}

@keyframes spSlideInLeft {
	from {
		opacity: 0;
		transform: translate3d(-24px, 12px, 0) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
}

@keyframes spSlideInRight {
	from {
		opacity: 0;
		transform: translate3d(24px, 12px, 0) scale(0.95);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
}

@keyframes spSlideOutLeft {
	from {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
	to {
		opacity: 0;
		transform: translate3d(-20px, 8px, 0) scale(0.97);
	}
}

@keyframes spSlideOutRight {
	from {
		opacity: 1;
		transform: translate3d(0, 0, 0) scale(1);
	}
	to {
		opacity: 0;
		transform: translate3d(20px, 8px, 0) scale(0.97);
	}
}

@keyframes spFadeIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── Mobile Responsive ─── */
@media (max-width: 640px) {
	.sp-notification-container {
		width: calc(100vw - 24px);
	}

	.sp-notification-container.bottom-left,
	.sp-notification-container.bottom-right {
		left: 12px;
		right: 12px;
		bottom: 12px;
		align-items: stretch;
	}

	.sp-notification-container.top-left,
	.sp-notification-container.top-right {
		left: 12px;
		right: 12px;
		top: calc(var(--header-h, 88px) + 12px);
		align-items: stretch;
	}

	.sp-notification {
		gap: 10px;
		padding: 12px 14px;
		border-radius: 14px;
	}

	.sp-notification-product-image,
	.sp-notification-icon {
		width: 42px;
		height: 42px;
		border-radius: 10px;
	}

	.sp-notification-close {
		width: 26px;
		height: 26px;
	}

	.sp-notification-name {
		font-size: 0.82rem;
	}

	.sp-notification-message {
		font-size: 0.75rem;
	}
}
