/**
 * BrandBees QR Code Generator — front-end styles.
 *
 * @package BrandBees_QR
 */

/* ── Container ──────────────────────────────────────────────────── */

.bbqr-container {
	max-width: 720px;
	margin: 0 auto 40px;
	padding: 28px 24px;
	background: #fff;
	border: 1px solid #e2e4e7;
	border-radius: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	color: #1e1e1e;
	box-sizing: border-box;
}

.bbqr-container *,
.bbqr-container *::before,
.bbqr-container *::after {
	box-sizing: inherit;
}

/* ── Fields ─────────────────────────────────────────────────────── */

.bbqr-field {
	margin-bottom: 16px;
}

.bbqr-field label {
	display: block;
	margin-bottom: 4px;
	font-size: 14px;
	font-weight: 600;
	color: #1e1e1e;
}

.bbqr-field input[type="text"],
.bbqr-field input[type="email"],
.bbqr-field input[type="url"],
.bbqr-field input[type="tel"],
.bbqr-field input[type="number"],
.bbqr-field textarea,
.bbqr-field select {
	width: 100%;
	padding: 9px 12px;
	font-size: 14px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	background: #fff;
	color: #1e1e1e;
	transition: border-color 0.15s;
}

.bbqr-field input:focus,
.bbqr-field textarea:focus,
.bbqr-field select:focus {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
	outline: none;
}

.bbqr-field textarea {
	resize: vertical;
	min-height: 70px;
}

.bbqr-field input[type="range"] {
	width: calc(100% - 50px);
	vertical-align: middle;
}

.bbqr-field input[type="checkbox"] {
	width: auto;
	margin-right: 6px;
	vertical-align: middle;
}

.bbqr-field input[type="checkbox"] + label,
.bbqr-field label input[type="checkbox"] {
	font-weight: 400;
}

/* Two-column rows */
.bbqr-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.bbqr-half {
	flex: 1 1 calc(50% - 6px);
	min-width: 200px;
}

.bbqr-field-full {
	width: 100%;
}

/* ── Fieldsets (vCard groups) ───────────────────────────────────── */

.bbqr-fieldset {
	border: 1px solid #e2e4e7;
	border-radius: 6px;
	padding: 16px 16px 4px;
	margin-bottom: 16px;
}

.bbqr-fieldset legend {
	font-size: 14px;
	font-weight: 600;
	color: #2271b1;
	padding: 0 6px;
}

/* ── Buttons ────────────────────────────────────────────────────── */

.bbqr-btn {
	display: inline-block;
	padding: 10px 22px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 4px;
	border: none;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background-color 0.15s, box-shadow 0.15s;
}

.bbqr-btn-primary {
	background: #2271b1;
	color: #fff;
	width: 100%;
	max-width: 320px;
	margin-top: 8px;
}

.bbqr-btn-primary:hover {
	background: #135e96;
}

.bbqr-btn-primary:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.bbqr-btn-secondary {
	background: #f0f0f1;
	color: #1e1e1e;
	border: 1px solid #c3c4c7;
}

.bbqr-btn-secondary:hover {
	background: #e2e4e7;
	color: #1e1e1e;
}

.bbqr-link-btn {
	background: none;
	border: none;
	color: #b32d2e;
	cursor: pointer;
	font-size: 13px;
	text-decoration: underline;
	padding: 4px 0;
}

/* ── Advanced panel ─────────────────────────────────────────────── */

.bbqr-advanced {
	margin: 20px 0;
	padding: 16px;
	background: #f6f7f7;
	border: 1px solid #e2e4e7;
	border-radius: 6px;
}

.bbqr-advanced summary {
	cursor: pointer;
	font-weight: 600;
	font-size: 14px;
	color: #2271b1;
	user-select: none;
	outline: none;
}

.bbqr-advanced summary:hover {
	text-decoration: underline;
}

.bbqr-advanced[open] summary {
	margin-bottom: 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid #dcdcde;
}

.bbqr-adv-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.bbqr-adv-grid > .bbqr-field {
	flex: 1 1 180px;
}

/* ── Spinner ────────────────────────────────────────────────────── */

.bbqr-spinner {
	text-align: center;
	padding: 20px;
}

.bbqr-spinner span {
	display: inline-block;
	width: 36px;
	height: 36px;
	border: 4px solid #e2e4e7;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: bbqr-spin 0.7s linear infinite;
}

@keyframes bbqr-spin {
	to { transform: rotate(360deg); }
}

/* ── Error ──────────────────────────────────────────────────────── */

.bbqr-error {
	padding: 12px 16px;
	background: #fcf0f1;
	border-left: 4px solid #d63638;
	color: #8a1215;
	border-radius: 4px;
	margin: 16px 0;
	font-size: 14px;
}

/* ── Notice (info / warning) ────────────────────────────────────── */

.bbqr-notice {
	padding: 10px 14px;
	background: #fcf9e8;
	border-left: 4px solid #dba617;
	color: #6e4e00;
	border-radius: 4px;
	margin: 12px 0;
	font-size: 13px;
}

/* ── Result area ────────────────────────────────────────────────── */

.bbqr-result {
	margin-top: 24px;
	padding: 24px;
	background: #f0f6fc;
	border: 1px solid #c3d5e6;
	border-radius: 8px;
	text-align: center;
}

.bbqr-preview {
	margin-bottom: 20px;
}

.bbqr-preview img {
	max-width: 350px;
	width: 100%;
	height: auto;
	border: 3px solid #fff;
	border-radius: 6px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.bbqr-downloads {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ── Logo upload dropzone ───────────────────────────────────────── */

.bbqr-logo-dropzone {
	position: relative;
	border: 2px dashed #c3c4c7;
	border-radius: 8px;
	padding: 20px;
	text-align: center;
	cursor: pointer;
	transition: border-color 0.2s, background-color 0.2s;
	background: #fafafa;
}

.bbqr-logo-dropzone:hover,
.bbqr-logo-dropzone-active {
	border-color: #2271b1;
	background: #f0f6fc;
}

.bbqr-logo-file-input {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.bbqr-logo-dropzone-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	pointer-events: none;
}

.bbqr-logo-dropzone-icon {
	font-size: 28px;
	line-height: 1;
	margin-bottom: 4px;
}

.bbqr-logo-dropzone-label span {
	font-size: 14px;
	color: #50575e;
}

.bbqr-logo-dropzone-label small {
	font-size: 12px;
	color: #8c8f94;
}

/* ── Logo uploading state ──────────────────────────────────────── */

.bbqr-logo-uploading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	font-size: 14px;
	color: #50575e;
}

.bbqr-spinner-inline {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid #e2e4e7;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: bbqr-spin 0.7s linear infinite;
}

/* ── Logo preview ───────────────────────────────────────────────── */

.bbqr-logo-preview-wrap {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 0;
	flex-wrap: wrap;
}

.bbqr-logo-thumb {
	display: inline-block;
	max-width: 60px;
	max-height: 60px;
	vertical-align: middle;
	border: 1px solid #dcdcde;
	border-radius: 4px;
}

#bbqr-logo-filename {
	font-size: 13px;
	color: #50575e;
	word-break: break-all;
}

/* ── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.bbqr-container {
		padding: 16px 12px;
		margin: 0 8px 24px;
	}

	.bbqr-half {
		flex-basis: 100%;
	}

	.bbqr-btn-primary {
		max-width: 100%;
	}

	.bbqr-preview img {
		max-width: 100%;
	}

	.bbqr-downloads {
		flex-direction: column;
		align-items: center;
	}

	.bbqr-adv-grid > .bbqr-field {
		flex-basis: 100%;
	}
}
