/* ==========================================================================
   TBS Check-In Scanner Styles
   Mobile-first CSS for the volunteer scanner page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.tbs-scanner {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
		Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	-webkit-font-smoothing: antialiased;
	position: relative;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.tbs-scanner__header {
	color: #ffffff;
	padding: 1rem 1.25rem;
	text-align: center;
	position: relative;
	z-index: 10;
}

.tbs-scanner__title {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: 0.01em;
}

/* --------------------------------------------------------------------------
   Scanner Body
   -------------------------------------------------------------------------- */

.tbs-scanner__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	padding: 1.5rem 1rem 5rem;
	position: relative;
}

/* --------------------------------------------------------------------------
   QR Reader Area
   -------------------------------------------------------------------------- */

.tbs-scanner__reader {
	width: 100%;
	max-width: 400px;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
	background: #ffffff;
}

/* Override html5-qrcode internal styles for cleaner look */
#tbs-scanner-reader {
	border: none !important;
}

#tbs-scanner-reader img[alt="Info icon"] {
	display: none !important;
}

#tbs-scanner-reader video {
	border-radius: 8px;
}

#tbs-scanner-reader__scan_region {
	min-height: 280px;
}

#tbs-scanner-reader__dashboard_section button {
	background: #2d5016 !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 8px !important;
	padding: 0.6rem 1.2rem !important;
	font-size: 0.95rem !important;
	cursor: pointer !important;
	margin: 0.25rem !important;
}

#tbs-scanner-reader__dashboard_section select {
	border: 2px solid #2d5016 !important;
	border-radius: 6px !important;
	padding: 0.4rem 0.6rem !important;
	font-size: 0.9rem !important;
}

#tbs-scanner-reader__dashboard_section_csr {
	padding: 0.4rem 0.6rem;
	text-align: center;
}

/* Error message when scanner fails */
.tbs-scanner__error {
	text-align: center;
	padding: 2rem 1rem;
	color: #b91c1c;
	font-size: 1rem;
	line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Result Banner
   -------------------------------------------------------------------------- */

.tbs-scanner__result {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 2rem 1.5rem 3rem;
	text-align: center;
	color: #ffffff;
	z-index: 100;
	animation: tbs-slide-up 0.3s ease-out;
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25);
}

.tbs-scanner__result--valid {
	background: #22c55e;
}

.tbs-scanner__result--expired {
	background: #ef4444;
}

.tbs-scanner__result--invalid {
	background: #f59e0b;
	color: #1a1a1a;
}

.tbs-scanner__result--error {
	background: #ea580c;
}

.tbs-scanner__result-icon {
	font-size: 2.5rem;
	margin-bottom: 0.25rem;
	line-height: 1;
}

.tbs-scanner__result-status {
	font-size: 1.1rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	margin-bottom: 0.5rem;
}

.tbs-scanner__result-name {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.15;
	margin-bottom: 0.25rem;
	word-break: break-word;
}

.tbs-scanner__result-level {
	font-size: 1.1rem;
	font-weight: 500;
	opacity: 0.9;
	margin-bottom: 0.15rem;
}

.tbs-scanner__result-date {
	font-size: 0.95rem;
	opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Check-In Counter
   -------------------------------------------------------------------------- */

.tbs-scanner__counter {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(45, 80, 22, 0.92);
	color: #ffffff;
	text-align: center;
	padding: 0.6rem 1rem;
	font-size: 0.95rem;
	font-weight: 500;
	z-index: 50;
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.tbs-scanner__counter #tbs-scanner-count {
	font-weight: 700;
	font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes tbs-slide-up {
	from {
		transform: translateY(100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* --------------------------------------------------------------------------
   QR Badge Styles (for [tbs_my_qr] shortcode)
   -------------------------------------------------------------------------- */

.tbs-qr-badge {
	display: flex;
	justify-content: center;
	padding: 2rem 1rem;
}

.tbs-qr-badge__card {
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
	padding: 2rem 1.5rem;
	text-align: center;
	max-width: 380px;
	width: 100%;
}

.tbs-qr-badge__header {
	margin-bottom: 1.5rem;
}

.tbs-qr-badge__org {
	font-size: 1.2rem;
	font-weight: 700;
	color: #2d5016;
	margin: 0;
}

.tbs-qr-badge__qr {
	margin-bottom: 1.5rem;
}

.tbs-qr-badge__image {
	width: 250px;
	height: 250px;
	display: block;
	margin: 0 auto;
	border-radius: 8px;
}

.tbs-qr-badge__details {
	margin-bottom: 1.5rem;
}

.tbs-qr-badge__name {
	font-size: 1.5rem;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 0.25rem;
}

.tbs-qr-badge__level {
	font-size: 1.1rem;
	color: #2d5016;
	font-weight: 600;
	margin: 0 0 0.25rem;
}

.tbs-qr-badge__expiry {
	font-size: 0.95rem;
	color: #666666;
	margin: 0;
}

.tbs-qr-badge__print-btn {
	background: #2d5016;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 0.75rem 2rem;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease;
}

.tbs-qr-badge__print-btn:hover {
	background: #1e3a0e;
}

.tbs-qr-badge__message {
	text-align: center;
	padding: 2rem 1rem;
	font-size: 1.05rem;
	color: #333333;
}

.tbs-qr-badge__message a {
	color: #2d5016;
	font-weight: 600;
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Responsive - Larger screens
   -------------------------------------------------------------------------- */

@media (min-width: 480px) {
	.tbs-scanner__result-name {
		font-size: 2.5rem;
	}

	.tbs-scanner__title {
		font-size: 1.5rem;
	}
}

/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
	.tbs-scanner,
	.tbs-scanner__header,
	.tbs-scanner__body,
	.tbs-scanner__reader,
	.tbs-scanner__result,
	.tbs-scanner__counter {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
   iOS Safari safe area support
   -------------------------------------------------------------------------- */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
	.tbs-scanner__counter {
		padding-bottom: calc(0.6rem + env(safe-area-inset-bottom));
	}

	.tbs-scanner__result {
		padding-bottom: calc(3rem + env(safe-area-inset-bottom));
	}
}
