/* Upload antivirus verdict indicator.
 *
 * Loaded on the desk AND on the website, because the upload that most needs it
 * is a job applicant attaching a resume to the public careers form - a page
 * that does not load solnrus_shell.css. Every token therefore carries a literal
 * fallback rather than assuming the SOLNRUS design system is present.
 */

.solnrus-scan-toasts {
	position: fixed;
	z-index: 2000;          /* above a Bootstrap modal (1050): the upload dialog
	                           is often still open when the verdict arrives */
	right: 16px;
	bottom: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(380px, calc(100vw - 32px));
	pointer-events: none;   /* the stack is a spacer; the cards take the clicks */
}

.solnrus-scan-toast {
	pointer-events: auto;
	display: grid;
	grid-template-columns: 22px 1fr 20px;
	gap: 10px;
	align-items: start;
	padding: 12px 12px 12px 14px;
	border-radius: 10px;
	border: 1px solid var(--sln-border, #e2e5e9);
	border-left: 3px solid var(--sln-tone, #6b7280);
	background: var(--sln-surface, #ffffff);
	color: var(--sln-text, #1f2933);
	box-shadow: 0 6px 22px rgba(16, 24, 40, 0.14);
	font-size: 13px;
	line-height: 1.45;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.solnrus-scan-toast.is-in {
	opacity: 1;
	transform: translateY(0);
}

.solnrus-scan-toast[data-state="scanning"] { --sln-tone: #2f6fed; }
.solnrus-scan-toast[data-state="clean"]    { --sln-tone: #128a5c; }
.solnrus-scan-toast[data-state="infected"] { --sln-tone: #c02b2b; }
.solnrus-scan-toast[data-state="pending"]  { --sln-tone: #b26a00; }

.solnrus-scan-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 20px;
	color: var(--sln-tone, #6b7280);
}

.solnrus-scan-icon svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.solnrus-scan-spinner {
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2px solid currentColor;
	border-right-color: transparent;
	opacity: 0.85;
	animation: solnrus-scan-spin 0.75s linear infinite;
}

@keyframes solnrus-scan-spin {
	to { transform: rotate(360deg); }
}

.solnrus-scan-title {
	font-weight: 600;
	color: var(--sln-text, #1f2933);
}

.solnrus-scan-note {
	margin-top: 2px;
	color: var(--sln-text-muted, #5b6572);
}

/* The person's own file name, echoed back. Never a stored path, never anything
 * the scanner saw inside the file. */
.solnrus-scan-file {
	margin-top: 4px;
	font-size: 12px;
	color: var(--sln-text-muted, #79838f);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.solnrus-scan-file:empty { display: none; }

.solnrus-scan-close {
	appearance: none;
	border: 0;
	background: transparent;
	color: var(--sln-text-muted, #79838f);
	font-size: 19px;
	line-height: 1;
	padding: 0;
	cursor: pointer;
	border-radius: 4px;
}

.solnrus-scan-close:hover { color: var(--sln-text, #1f2933); }

.solnrus-scan-close:focus-visible {
	outline: 2px solid var(--sln-tone, #2f6fed);
	outline-offset: 2px;
}

/* Phone: full width along the bottom, where a thumb can reach the dismiss. */
@media (max-width: 540px) {
	.solnrus-scan-toasts {
		right: 8px;
		left: 8px;
		bottom: 8px;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.solnrus-scan-toast { transition: none; }
	.solnrus-scan-spinner { animation-duration: 2.4s; }
}

/* Frappe stamps data-theme on <html>; the website has no switcher, so the
 * media query covers a visitor whose OS is dark. */
[data-theme="dark"] .solnrus-scan-toast {
	--sln-surface: #1c2127;
	--sln-border: #2f3742;
	--sln-text: #e6eaef;
	--sln-text-muted: #a4aeb9;
	box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .solnrus-scan-toast {
		--sln-surface: #1c2127;
		--sln-border: #2f3742;
		--sln-text: #e6eaef;
		--sln-text-muted: #a4aeb9;
		box-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
	}
}
