/* ==========================================================
   Barcode Scanner page — additions on top of the existing
   .analyzer-shell / .camera-zone / .result-card design system
   in styles.css. Kept in its own file so it only loads on the
   /barcode-scanner/ template instead of bloating every page.
   ========================================================== */

/* Scanning frame overlay drawn over the camera video while live */
.bcs-scan-frame {
	position: absolute;
	top: 50%; left: 50%;
	transform: translate(-50%, -50%);
	width: 78%;
	height: 110px;
	border: 3px solid var(--green-600);
	border-radius: 14px;
	box-shadow: 0 0 0 2000px rgba(0, 0, 0, 0.35);
	pointer-events: none;
	z-index: 5;
}
.bcs-scan-frame::before,
.bcs-scan-frame::after {
	content: '';
	position: absolute;
	left: 0; right: 0;
	height: 2px;
	background: #7fe0a5;
	animation: bcs-scan-line 1.6s ease-in-out infinite;
}
.bcs-scan-frame::after { animation-delay: -0.8s; }
@keyframes bcs-scan-line {
	0%   { top: 6%; opacity: 0; }
	15%  { opacity: 1; }
	50%  { top: 92%; opacity: 1; }
	65%  { opacity: 0; }
	100% { top: 92%; opacity: 0; }
}

/* html5-qrcode injects its own <video>/<canvas> into #bcs-camera-zone —
   make sure it fills the same footprint as the existing .camera-zone
   video rule, since the library doesn't know about our classes. */
#bcs-camera-zone video {
	width: 100% !important;
	height: 340px !important;
	object-fit: cover;
}
#bcs-camera-zone > div { width: 100%; }

.bcs-status {
	font-size: 12.5px;
	color: var(--text-400);
	text-align: center;
	margin: 12px 0 0;
	min-height: 16px;
}
.bcs-status.bcs-status--active { color: var(--green-700); font-weight: 600; }
.bcs-status.bcs-status--error  { color: #b23a3a; font-weight: 600; }

/* Once a scan succeeds, the input card hides and the result card takes
   the full width instead of leaving an empty grid column behind it. */
#bcs-shell.bcs-shell--result-only {
	grid-template-columns: 1fr;
	max-width: 640px;
	margin: 0 auto;
}

.bcs-field-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--text-600);
	margin-bottom: 8px;
}
.bcs-manual-input {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 11px;
	padding: 13px 16px;
	font-size: 15px;
	font-family: inherit;
	color: var(--text-900);
	letter-spacing: 0.04em;
}
.bcs-manual-input::placeholder { color: var(--text-400); letter-spacing: normal; }

.bcs-save-note {
	font-size: 12px;
	color: var(--text-400);
	text-align: center;
	margin: 10px 0 0;
}

/* Per-macro mini rows inside .result-macro-mini (mirrors how the
   analyzer's own JS renders these — kept here since the barcode
   scanner builds this markup independently in JS) */
.bcs-macro-row {
	display: flex;
	justify-content: space-between;
	font-size: 13px;
	color: var(--text-600);
}
.bcs-macro-row strong { color: var(--text-900); font-weight: 700; }

.bcs-insight-item {
	font-size: 13px;
	color: var(--text-600);
	padding: 8px 0;
	border-bottom: 1px solid var(--border);
	display: flex;
	gap: 8px;
}
.bcs-insight-item:last-child { border-bottom: none; }

@media (max-width: 640px) {
	.bcs-scan-frame { height: 90px; }
	#bcs-camera-zone video { height: 260px !important; }
}

/* Full-tool login gate — matches the pattern used by NC Meal Planner /
   NC Progress Photos / NC Water Tracker's own login gates, recreated
   here with theme classes since this page lives in the theme, not a
   plugin with its own --vars. */
.bcs-login-gate {
	max-width: 460px; margin: 0 auto; text-align: center;
	border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 32px;
}
.bcs-login-gate-icon { font-size: 40px; margin-bottom: 14px; }
.bcs-login-gate h3 { font-size: 19px; font-weight: 800; margin: 0 0 10px; }
.bcs-login-gate p { font-size: 14px; color: var(--text-600); line-height: 1.6; margin: 0 0 24px; }
.bcs-login-gate-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
