/* QR Code Scanner & Generator - Frontend Styles */

.bcsg-wrapper {
	--qrsg-primary: #2563eb;
	--qrsg-primary-hover: #1d4ed8;
	--qrsg-secondary: #64748b;
	--qrsg-success: #16a34a;
	--qrsg-whatsapp: #25d366;
	--qrsg-border: #e2e8f0;
	--qrsg-bg: #f8fafc;
	--qrsg-card: #ffffff;
	--qrsg-text: #1e293b;
	--qrsg-muted: #64748b;
	--qrsg-radius: 12px;
	--qrsg-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	color: var(--qrsg-text);
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

.bcsg-wrapper *,
.bcsg-wrapper *::before,
.bcsg-wrapper *::after {
	box-sizing: border-box;
}

/* Two Panel Layout */
.bcsg-panels {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
	align-items: start;
}

@media (max-width: 900px) {
	.bcsg-panels {
		grid-template-columns: 1fr;
	}
}

.bcsg-panel {
	background: var(--qrsg-card);
	border: 1px solid var(--qrsg-border);
	border-radius: var(--qrsg-radius);
	box-shadow: var(--qrsg-shadow);
	overflow: hidden;
}

.bcsg-panel-header {
	background: linear-gradient(135deg, #1EB07F 0%, #38d6a4 100%);
	color: #fff;
	padding: 16px 20px;
}

.bcsg-panel-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
	color: #fff;
}

.bcsg-icon {
	font-size: 1.4rem;
}

/* Tabs */
.bcsg-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	padding: 12px 12px 0;
	background: var(--qrsg-bg);
	border-bottom: 1px solid var(--qrsg-border);
}

.bcsg-tab {
	background: transparent;
	border: none;
	padding: 10px 14px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--qrsg-muted);
	cursor: pointer;
	border-radius: 8px 8px 0 0;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s ease;
	white-space: nowrap;
	height: 42px;
	outline: none;
	border: 1px solid #fff;
	border-bottom: none!important;
}
.bcsg-tab:hover,
.bcsg-tab:focus,
.bcsg-tab.active {
	color: var(--qrsg-primary)!important;
	background: rgba(37, 99, 235, 0.08)!important;
	outline:none!important;
	background: var(--qrsg-card);
	color: var(--qrsg-primary);
	box-shadow: 0 -1px 0 var(--qrsg-card);
	border: 1px solid var(--qrsg-border);
	border-bottom-color: var(--qrsg-card);
	border-bottom: none!important;
}

.bcsg-tab-icon {
	font-size: 1rem;
}

/* Tab Content */
.bcsg-tab-content {
	padding: 20px;
}

.bcsg-tab-pane {
	display: none;
}

.bcsg-tab-pane.active {
	display: block;
}

/* Reader / Camera */
.bcsg-reader {
	width: 100%;
	min-height: 260px;
	background: #000;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
}

.bcsg-reader video {
	width: 100% !important;
	border-radius: 8px;
}

.bcsg-camera-controls {
	display: flex;
	gap: 10px;
	margin-top: 14px;
	flex-wrap: wrap;
}

/* Upload Area */
.bcsg-upload-area {
	border: 2px dashed var(--qrsg-border);
	border-radius: 10px;
	padding: 32px 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background 0.2s;
	background: var(--qrsg-bg);
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.bcsg-upload-area:hover,
.bcsg-upload-area.dragover {
	border-color: var(--qrsg-primary);
	background: rgba(37, 99, 235, 0.04);
}

.bcsg-upload-icon {
	font-size: 2.5rem;
	display: block;
	margin-bottom: 8px;
}

.bcsg-upload-placeholder p {
	margin: 4px 0;
}

.bcsg-preview-img {
	max-width: 100%;
	max-height: 240px;
	border-radius: 8px;
	object-fit: contain;
}

/* Forms */
.bcsg-form-group {
	margin-bottom: 14px;
}

.bcsg-form-group label {
	display: block;
	font-size: 0.875rem;
	font-weight: 500;
	margin-bottom: 6px;
	color: var(--qrsg-text);
}

.bcsg-form-row {
	display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 500px) {
	.bcsg-form-row {
		grid-template-columns: 1fr;
	}
}

.bcsg-input,
.bcsg-textarea,
.bcsg-select {
	width: 100%;
	padding: 10px 12px;
	font-size: 0.95rem;
	border: 1px solid var(--qrsg-border);
	border-radius: 8px;
	background: #fff;
	color: var(--qrsg-text);
	transition: border-color 0.2s, box-shadow 0.2s;
}

.bcsg-input:focus,
.bcsg-textarea:focus,
.bcsg-select:focus {
	outline: none;
	border-color: var(--qrsg-primary);
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.bcsg-textarea {
	resize: vertical;
	min-height: 80px;
}

.bcsg-color {
	width: 100%;
	height: 42px;
	padding: 4px;
	border: 1px solid var(--qrsg-border);
	border-radius: 8px;
	cursor: pointer;
	background: #fff;
}

.bcsg-checkbox-group label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 400;
	cursor: pointer;
}

.bcsg-checkbox-group input[type="checkbox"] {
	width: 18px;
	height: 18px;
	accent-color: var(--qrsg-primary);
}

.bcsg-hint {
	font-size: 0.8rem;
	color: var(--qrsg-muted);
	margin: 8px 0 0;
	line-height: 1.4;
}

/* Generator Forms */
.bcsg-generator-forms {
	padding: 20px;
}

.bcsg-gen-form {
	display: none;
}

.bcsg-gen-form.active {
	display: block;
}

.bcsg-gen-options {
	padding: 0 20px 10px;
}

.bcsg-gen-actions {
	padding: 10px 20px 20px;
}

/* Buttons */
.bcsg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 18px;
	font-size: 0.9rem;
	font-weight: 500;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	text-decoration: none;
	line-height: 1.4;
}

.bcsg-btn:active {
	transform: scale(0.98);
}

.bcsg-btn-primary {
	background: var(--qrsg-primary);
	color: #fff;
}

.bcsg-btn-primary:hover {
	background: var(--qrsg-primary-hover);
	color: #fff;
}

.bcsg-btn-secondary {
	background: var(--qrsg-secondary);
	color: #fff;
}

.bcsg-btn-secondary:hover {
	background: #475569;
	color: #fff;
}

.bcsg-btn-outline {
	background: transparent;
	border: 1px solid var(--qrsg-border);
	color: var(--qrsg-text);
}

.bcsg-btn-outline:hover {
	background: var(--qrsg-bg);
}

.bcsg-btn-whatsapp {
	background: var(--qrsg-whatsapp);
	color: #fff;
}

.bcsg-btn-whatsapp:hover {
	background: #1da851;
	color: #fff;
}

.bcsg-btn-lg {
	width: 100%;
	padding: 14px 20px;
	font-size: 1rem;
}

.bcsg-btn-icon {
	background: transparent;
	border: none;
	cursor: pointer;
	font-size: 1.1rem;
	padding: 4px 8px;
	border-radius: 6px;
	line-height: 1;
}

.bcsg-btn-icon:hover {
	background: rgba(0, 0, 0, 0.06);
}

/* Result Box */
.bcsg-result-box {
	margin: 0 20px 20px;
	padding: 16px;
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
}

.bcsg-result-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	color: var(--qrsg-success);
}

.bcsg-result-content {
	background: #fff;
	padding: 12px;
	border-radius: 8px;
	font-size: 0.95rem;
	word-break: break-all;
	white-space: pre-wrap;
	border: 1px solid #dcfce7;
	max-height: 160px;
	overflow-y: auto;
}

.bcsg-result-actions {
	display: flex;
	gap: 10px;
	margin-top: 12px;
	flex-wrap: wrap;
}

/* QR Preview */
.bcsg-qr-preview {
	padding: 0 20px 24px;
	text-align: center;
}

.bcsg-qrcode {
	display: inline-block;
	padding: 16px;
	background: #fff;
	border: 1px solid var(--qrsg-border);
	border-radius: 12px;
	margin-bottom: 16px;
	line-height: 0;
}

.bcsg-qrcode img,
.bcsg-qrcode canvas {
	display: block;
	max-width: 100%;
	height: auto;
}

.bcsg-qr-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* Loading state */
.bcsg-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* html5-qrcode overrides */
#qrsg-reader__scan_region {
	min-height: 240px;
}

#qrsg-reader__dashboard_section_csr button,
#qrsg-reader__dashboard_section_fsr button {
	padding: 8px 14px !important;
	border-radius: 6px !important;
	font-size: 0.875rem !important;
}

#qrsg-reader__dashboard {
	padding-top: 10px;
}

/* Toast notification */
.bcsg-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: #1e293b;
	color: #fff;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 0.9rem;
	z-index: 99999;
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.bcsg-toast.show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

.bcsg-toast.success {
	background: var(--qrsg-success);
}

.bcsg-toast.error {
	background: #dc2626;
}

/* Forms */
.bcsg-generator-body {
	padding: 20px;
}

.bcsg-form-group {
	margin-bottom: 14px;
}
/* Share */
.bcsg-share-section {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid var(--bcsg-border);
}

.bcsg-share-label {
	font-size: 0.8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--bcsg-muted);
	margin: 0 0 12px;
}

.bcsg-share-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.bcsg-share-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	font-size: 0.8rem;
	font-weight: 500;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	color: #fff;
	transition: opacity 0.2s, transform 0.1s;
	line-height: 1.3;
}

.bcsg-share-btn:hover {
	opacity: 0.9;
}

.bcsg-share-btn:active {
	transform: scale(0.97);
}

.bcsg-share-icon {
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1;
	min-width: 1.1em;
	text-align: center;
}

.bcsg-share-facebook { background: #1877f2; }
.bcsg-share-twitter { background: #0f1419; }
.bcsg-share-linkedin { background: #0a66c2; }
.bcsg-share-pinterest { background: #e60023; }
.bcsg-share-telegram { background: #26a5e4; }
.bcsg-share-reddit { background: #ff4500; }
.bcsg-share-email { background: #6b7280; }
.bcsg-share-copy { background: #475569; }

@media (max-width: 480px) {
	.bcsg-share-text {
		display: none;
	}
	.bcsg-share-btn {
		padding: 10px 12px;
	}
}

/* Toast */
.bcsg-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: #1e293b;
	color: #fff;
	padding: 12px 24px;
	border-radius: 8px;
	font-size: 0.9rem;
	z-index: 99999;
	opacity: 0;
	transition: transform 0.3s ease, opacity 0.3s ease;
	box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.bcsg-toast.show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
}

.bcsg-toast.success {
	background: var(--bcsg-success);
}

.bcsg-toast.error {
	background: #dc2626;
}
