/**
 * ProofNexus front-end popup styles.
 *
 * Colors/radius are driven by CSS custom properties injected inline by
 * PHP (see ProofNexus::enqueue_front_assets) so this file never needs to be
 * regenerated when an admin changes design settings. --proofnexus-text is
 * kept for backward compatibility (some site owners have customized it),
 * but the two text rows below default to their own fixed, high-contrast
 * colors per the modern popup design and only fall back to
 * --proofnexus-text if a child theme/CSS override removes them.
 */

 /* Settings Container CSS Clean-up */

:root {
	--proofnexus-bg: #ffffff;
	--proofnexus-text: #111827;
	--proofnexus-radius: 14px;
	--proofnexus-img-radius: 50%;
	--proofnexus-action-color: #6b7280;
	--proofnexus-title-color: #111827;
	--proofnexus-time-color: #9ca3af;
	--proofnexus-accent: #7c3aed;
}

.proofnexus-container {
	position: fixed;
	z-index: 999999;
	max-width: 360px;
	width: calc(100% - 32px);
	pointer-events: none;
}

/*
 * Position variants — each one is applied exclusively (see
 * assets/js/proofnexus-front.js, which sets the container's className
 * once from the `position` setting), but every rule still explicitly
 * resets the *other* axis' property to `auto` and uses !important on all
 * four. This is deliberate defensive scoping, not redundancy: without it,
 * switching an existing site's position setting from e.g. bottom-left to
 * bottom-right can appear to silently fail — a `left` value set by an
 * older cached copy of this file (browser cache, a page cache, or a CDN
 * edge that hasn't picked up the new file yet) would otherwise still win
 * over a `right` value from a newer one at equal specificity, since nothing
 * here ever told the browser to drop the old property. Chaining
 * `.proofnexus-container` onto the position class also raises specificity
 * above a bare `.proofnexus-pos-*` override some other stylesheet might
 * define. See proofnexus_asset_version() in proofnexus.php for the actual
 * fix for stale cached CSS being served in the first place — these
 * !important resets are the belt-and-suspenders layer under it.
 */
.proofnexus-container.proofnexus-pos-bottom-left {
	left: 16px !important;
	right: auto !important;
	bottom: 16px !important;
	top: auto !important;
}

.proofnexus-container.proofnexus-pos-bottom-right {
	right: 16px !important;
	left: auto !important;
	bottom: 16px !important;
	top: auto !important;
}

.proofnexus-container.proofnexus-pos-top-left {
	left: 16px !important;
	right: auto !important;
	top: 16px !important;
	bottom: auto !important;
}

.proofnexus-container.proofnexus-pos-top-right {
	right: 16px !important;
	left: auto !important;
	top: 16px !important;
	bottom: auto !important;
}

.proofnexus-popup {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	background: var(--proofnexus-bg);
	color: var(--proofnexus-text);
	border-radius: var(--proofnexus-radius);
	/* Crisp, soft, layered shadow — matches the modern card look instead
	   of the old single flat drop-shadow. */
	box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
	border: 1px solid rgba(17, 24, 39, 0.06);
	padding: 14px 34px 14px 14px;
	pointer-events: auto;
	position: relative;
	opacity: 0;
	transform: translateY(16px) scale(0.98);
	transition: opacity 0.35s ease, transform 0.35s ease;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.proofnexus-pos-top-left .proofnexus-popup,
.proofnexus-pos-top-right .proofnexus-popup {
	transform: translateY(-16px) scale(0.98);
}

.proofnexus-popup.proofnexus-visible {
	opacity: 1;
	transform: translateY(0) scale(1);
}

.proofnexus-popup.proofnexus-leaving {
	opacity: 0;
	transform: translateY(8px) scale(0.98);
}

.proofnexus-popup.proofnexus-clickable {
	cursor: pointer;
}

.proofnexus-popup.proofnexus-clickable:hover {
	box-shadow: 0 14px 30px -6px rgba(0, 0, 0, 0.14), 0 10px 14px -6px rgba(0, 0, 0, 0.06);
}

/* ---------- Avatar / product image ---------- */

.proofnexus-popup-img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: var(--proofnexus-img-radius);
	flex: 0 0 auto;
	background: #f3f4f6;
	border: 1px solid rgba(17, 24, 39, 0.06);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

@media (min-width: 360px) {
	.proofnexus-popup-img {
		width: 64px;
		height: 64px;
	}
}

.proofnexus-popup-body {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 1px;
}

/* ---------- Text rows ---------- */

/* Buyer Action Line (top) — muted, subtle, small. */
.proofnexus-popup-action {
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.35;
	color: var(--proofnexus-action-color);
	word-wrap: break-word;
}

/* Product / Subject Title (middle) — bold, high-contrast, larger. */
.proofnexus-popup-title {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--proofnexus-title-color);
	word-wrap: break-word;
	letter-spacing: -0.01em;
}

@media (min-width: 360px) {
	.proofnexus-popup-title {
		font-size: 15px;
	}
}

.proofnexus-popup-action + .proofnexus-popup-title {
	margin-top: 2px;
}

/* Legacy single-line fallback for modules/items that supply only
   `message` and no `title` — rendered with the bold/title treatment
   since it's the primary (and only) piece of content. */
.proofnexus-popup-message {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--proofnexus-title-color);
	word-wrap: break-word;
	letter-spacing: -0.01em;
}

/* ---------- Footer: time-ago ---------- */

.proofnexus-popup-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 7px;
}

.proofnexus-popup-time {
	margin: 0;
	font-size: 11.5px;
	line-height: 1.4;
	font-weight: 500;
	color: var(--proofnexus-time-color);
	text-align: left;
}

/* ---------- Close (X) button ---------- */

.proofnexus-popup-close {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	background: transparent;
	border: none;
	border-radius: 50%;
	color: #9ca3af;
	opacity: 1;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.proofnexus-popup-close:hover {
	background: #f3f4f6;
	color: #4b5563;
}

@media (max-width: 480px) {
	.proofnexus-container {
		max-width: none;
		width: calc(100% - 20px);
	}

	.proofnexus-container.proofnexus-pos-bottom-left,
	.proofnexus-container.proofnexus-pos-bottom-right {
		left: 10px !important;
		right: 10px !important;
		bottom: 10px !important;
		top: auto !important;
	}

	.proofnexus-container.proofnexus-pos-top-left,
	.proofnexus-container.proofnexus-pos-top-right {
		left: 10px !important;
		right: 10px !important;
		top: 10px !important;
		bottom: auto !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.proofnexus-popup {
		transition: opacity 0.2s linear;
		transform: none !important;
	}
}
