/* =================================================================
 * Fake Virus Scan
 * Two fullscreen skins driven by [data-skin] on .fvs-screen:
 *   defender — calm Windows-Security-style full scan (light)
 *   alert    — classic red "your computer is infected" scare (dark)
 * Phase is driven by [data-phase]: scanning → found.
 * Layers on top of prank-shared.css (one card + separator sections).
 * ================================================================= */

/* Declared on BOTH the page root and the overlay root on purpose. The shared
 * prank controller moves .fvs-overlay out to <body> on launch, so anything
 * scoped only to .fvs-page stops inheriting into the overlay the moment it is
 * portalled — var() then resolves to nothing and the property silently falls
 * back (a transparent progress bar, an uncoloured shield). */
.fvs-page,
.fvs-overlay {
	--fvs-red: #b91c1c;
	--fvs-blue: #0067c0;
}

/* ---------- Card preview (mini Defender-style scan) ---------- */
/* This page's settings panel is taller than a 16:10 preview. The shared
 * .prank-preview-frame stretches to the row height, and its aspect-ratio would
 * then derive a width from that height — overflowing the grid track and
 * painting over the settings panel. Clamping the width keeps it in its column
 * (the frame just runs slightly taller than 16:10). */
.fvs-preview-frame {
	background: #eef1f5;
	min-width: 0;
	max-width: 100%;
}

.fvs-preview {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	padding: 8% 9%;
	background: linear-gradient(180deg, #f7f9fc 0%, #e9edf3 100%);
	color: #1f2937;
	font-family: "Segoe UI", system-ui, sans-serif;
	text-align: left;
}

.fvs-preview-head {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: clamp(11px, 2.4vw, 15px);
	font-weight: 600;
}

.fvs-preview-shield {
	width: clamp(18px, 4vw, 28px);
	height: clamp(18px, 4vw, 28px);
	flex: none;
	color: var(--fvs-blue);
}

.fvs-preview-bar {
	height: 6px;
	border-radius: 4px;
	background: rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.fvs-preview-bar span {
	display: block;
	width: 62%;
	height: 100%;
	border-radius: 4px;
	background: var(--fvs-blue);
}

.fvs-preview-path {
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-size: clamp(8px, 1.8vw, 11px);
	color: #4b5563;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.fvs-preview-threats {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	padding: 3px 10px;
	border-radius: 20px;
	background: #fee2e2;
	color: #991b1b;
	font-size: clamp(9px, 1.9vw, 12px);
	font-weight: 700;
}

/* ---------- Settings controls ---------- */
.fvs-select {
	width: 100%;
	padding: 9px 12px;
	font-size: 1rem;
	font-weight: 600;
	font-family: inherit;
	color: #111827;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	cursor: pointer;
	outline: none;
	transition: border-color var(--effect, 0.2s ease), box-shadow var(--effect, 0.2s ease);
}

.fvs-select:hover { border-color: var(--flex-gray-30, #d1d5db); }

.fvs-select:focus-visible {
	border-color: var(--fvs-red);
	box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.16);
}

.fvs-check {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--headline-fcolor, #374151);
	cursor: pointer;
	user-select: none;
}

.fvs-check input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--fvs-red);
	cursor: pointer;
	flex: 0 0 18px;
}

.fvs-check input[type="checkbox"]:focus-visible {
	outline: 2px solid var(--fvs-red);
	outline-offset: 2px;
	border-radius: 4px;
}

.fvs-page .fvs-launch-btn {
	background: var(--fvs-red);
	border-color: var(--fvs-red);
}

.fvs-page .fvs-launch-btn:hover {
	background: #991b1b;
	border-color: #991b1b;
	box-shadow: 0 4px 12px rgba(185, 28, 28, 0.28);
}

.fvs-page .fvs-launch-btn:focus-visible,
.fvs-page .prank-fullscreen-btn:focus-visible {
	outline: 2px solid var(--fvs-red);
	outline-offset: 2px;
}

/* ---------- Safety note under the tool card ---------- */
.fvs-safety-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin: 24px 0 0;
	padding: 14px 16px;
	background: #f9fafb;
	border: 1px solid var(--prank-border);
	border-radius: 10px;
	font-size: 0.9rem;
	line-height: 1.6;
	color: var(--meta-fcolor, #4b5563);
}

.fvs-safety-note svg {
	width: 18px;
	height: 18px;
	flex: none;
	margin-top: 2px;
	color: var(--fvs-red);
}

/* =================================================================
 * Fullscreen overlay
 * ================================================================= */
.fvs-overlay {
	background: #000;
}

.fvs-screen {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 4vw;
	font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
	cursor: default;
}

.fvs-screen[data-skin="defender"] {
	background: linear-gradient(180deg, #f7f9fc 0%, #e6ebf2 100%);
	color: #1f2937;
}

.fvs-screen[data-skin="alert"] {
	background:
		radial-gradient(ellipse 70% 60% at 50% 40%, rgba(185, 28, 28, 0.32), transparent 72%),
		#08080b;
	color: #f9fafb;
}

.fvs-screen[data-skin="alert"][data-phase="found"] {
	animation: fvsAlertPulse 1.1s ease-in-out infinite;
}

@keyframes fvsAlertPulse {
	0%, 100% { box-shadow: inset 0 0 0 0 rgba(239, 68, 68, 0); }
	50%      { box-shadow: inset 0 0 0 12px rgba(239, 68, 68, 0.55); }
}

/* ---------- Scanner column ---------- */
.fvs-scanner {
	width: min(760px, 100%);
	max-height: 100%;
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.fvs-scan-head {
	display: flex;
	align-items: center;
	gap: 16px;
}

.fvs-shield {
	width: clamp(38px, 6vw, 56px);
	height: clamp(38px, 6vw, 56px);
	flex: none;
	color: var(--fvs-blue);
}

.fvs-screen[data-skin="alert"] .fvs-shield { color: #ef4444; }

.fvs-screen[data-phase="found"] .fvs-shield {
	color: #ef4444;
	animation: fvsShieldShake 0.9s ease-in-out infinite;
}

@keyframes fvsShieldShake {
	0%, 100% { transform: rotate(0deg); }
	25%      { transform: rotate(-6deg); }
	75%      { transform: rotate(6deg); }
}

.fvs-scan-title {
	font-size: clamp(1.15rem, 2.6vw, 1.8rem);
	font-weight: 700;
	line-height: 1.2;
}

.fvs-scan-sub {
	margin-top: 4px;
	font-size: clamp(0.82rem, 1.6vw, 1rem);
	opacity: 0.8;
}

.fvs-screen[data-phase="found"] .fvs-scan-title { color: #dc2626; }
.fvs-screen[data-skin="alert"][data-phase="found"] .fvs-scan-title { color: #f87171; }

/* ---------- Progress ---------- */
.fvs-progress {
	height: 8px;
	border-radius: 6px;
	background: rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.fvs-screen[data-skin="alert"] .fvs-progress { background: rgba(255, 255, 255, 0.14); }

/* No width transition — the fill is repainted every animation frame, so a
 * transition would only lag behind the real progress value. */
.fvs-progress-fill {
	width: 0;
	height: 100%;
	border-radius: 6px;
	background: var(--fvs-blue);
}

.fvs-screen[data-skin="alert"] .fvs-progress-fill { background: #ef4444; }
.fvs-screen[data-phase="found"] .fvs-progress-fill { background: #dc2626; }

.fvs-progress-meta {
	display: flex;
	justify-content: space-between;
	margin-top: -8px;
	font-size: clamp(0.78rem, 1.5vw, 0.95rem);
	font-variant-numeric: tabular-nums;
	opacity: 0.8;
}

/* ---------- Current file ---------- */
.fvs-current {
	font-size: clamp(0.78rem, 1.5vw, 0.95rem);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0.9;
}

.fvs-path {
	font-family: ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
}

/* Once the scan is done there is nothing being scanned — drop the line. */
.fvs-screen[data-phase="found"] .fvs-current { visibility: hidden; }

/* ---------- Stat pair ---------- */
.fvs-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.fvs-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 14px 18px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.72);
	border: 1px solid rgba(0, 0, 0, 0.07);
}

.fvs-screen[data-skin="alert"] .fvs-stat {
	background: rgba(255, 255, 255, 0.05);
	border-color: rgba(255, 255, 255, 0.12);
}

.fvs-stat-num {
	font-size: clamp(1.4rem, 3.4vw, 2.2rem);
	font-weight: 700;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.fvs-stat-label {
	font-size: clamp(0.72rem, 1.4vw, 0.88rem);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	opacity: 0.65;
}

.fvs-stat--danger .fvs-stat-num { color: #dc2626; }
.fvs-screen[data-skin="alert"] .fvs-stat--danger .fvs-stat-num { color: #f87171; }

/* ---------- Detected-threat list ---------- */
.fvs-threat-list {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: 26vh;
	overflow: hidden;
	font-family: ui-monospace, "SF Mono", Consolas, "Courier New", monospace;
	font-size: clamp(0.7rem, 1.35vw, 0.86rem);
}

.fvs-threat-list li {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 7px 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	animation: fvsThreatIn 0.22s ease-out both;
}

.fvs-screen[data-skin="alert"] .fvs-threat-list li {
	border-bottom-color: rgba(255, 255, 255, 0.1);
}

.fvs-threat-list li b {
	color: #dc2626;
	font-weight: 700;
	white-space: nowrap;
}

.fvs-screen[data-skin="alert"] .fvs-threat-list li b { color: #f87171; }

.fvs-threat-list li span {
	opacity: 0.72;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

@keyframes fvsThreatIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Result banner ---------- */
.fvs-banner {
	display: none;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-radius: 12px;
	background: #dc2626;
	color: #fff;
	font-size: clamp(0.85rem, 1.8vw, 1.1rem);
	font-weight: 700;
}

.fvs-screen[data-phase="found"] .fvs-banner { display: flex; }

.fvs-banner svg {
	width: clamp(20px, 3vw, 28px);
	height: clamp(20px, 3vw, 28px);
	flex: none;
}

/* =================================================================
 * Fake security-alert pop-ups
 * ================================================================= */
.fvs-popups {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.fvs-popup {
	position: absolute;
	width: min(340px, 76vw);
	background: #fff;
	color: #1f2937;
	border-radius: 8px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
	overflow: hidden;
	pointer-events: auto;
	animation: fvsPopIn 0.16s ease-out both;
	font-family: "Segoe UI", system-ui, sans-serif;
}

@keyframes fvsPopIn {
	from { opacity: 0; transform: scale(0.94); }
	to   { opacity: 1; transform: scale(1); }
}

.fvs-popup-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 12px;
	background: #b91c1c;
	color: #fff;
	font-size: 0.82rem;
	font-weight: 700;
}

.fvs-popup-x {
	width: 20px;
	height: 20px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 4px;
	color: #fff;
	font-size: 14px;
	line-height: 1;
	cursor: pointer;
	font-family: inherit;
}

.fvs-popup-x:hover { background: rgba(255, 255, 255, 0.22); }

.fvs-popup-body {
	display: flex;
	gap: 12px;
	padding: 16px 14px;
	font-size: 0.86rem;
	line-height: 1.5;
}

.fvs-popup-body svg {
	width: 26px;
	height: 26px;
	flex: none;
	color: #dc2626;
}

.fvs-popup-body code {
	display: block;
	margin-top: 6px;
	font-family: ui-monospace, "SF Mono", Consolas, monospace;
	font-size: 0.78rem;
	color: #6b7280;
	word-break: break-all;
	background: none;
	padding: 0;
}

.fvs-popup-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	padding: 0 14px 14px;
}

.fvs-popup-btn {
	padding: 7px 14px;
	font-size: 0.82rem;
	font-weight: 600;
	font-family: inherit;
	border-radius: 6px;
	border: 1px solid #d1d5db;
	background: #f3f4f6;
	color: #1f2937;
	cursor: pointer;
}

.fvs-popup-btn--primary {
	background: #b91c1c;
	border-color: #b91c1c;
	color: #fff;
}

.fvs-popup-btn:focus-visible {
	outline: 2px solid #1f2937;
	outline-offset: 2px;
}

/* ---------- Motion / small screens ---------- */
@media (prefers-reduced-motion: reduce) {
	.fvs-screen[data-skin="alert"][data-phase="found"],
	.fvs-screen[data-phase="found"] .fvs-shield {
		animation: none;
	}

	.fvs-threat-list li,
	.fvs-popup {
		animation-duration: 1ms;
	}
}

@media (max-width: 767px) {
	.fvs-scanner { gap: 14px; }
	.fvs-stats { grid-template-columns: 1fr; }
	.fvs-threat-list { max-height: 20vh; }
	.fvs-safety-note { font-size: 0.85rem; }
}
