/*!
 * SCL Beta Feedback (BETA 1) — floating button + feedback dialog.
 * Train: SCL_BETA_FEEDBACK_BUG_REPORT_AND_PRIVATE_SCREENSHOT_V1 (LOCAL only).
 * Scoped under .scl-bf-* to avoid collisions with the host page.
 */

/* ── Floating action button ─────────────────────────────────────────────── */
.scl-bf-fab {
	position: fixed;
	z-index: 2147483000; /* above portal shell + supportframe, below native dialogs */
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px; /* touch target */
	padding: 10px 12px 10px 14px;
	border: none;
	border-radius: 10px 0 0 10px;
	background: #7c3aed;
	color: #fff;
	font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	letter-spacing: .02em;
	cursor: pointer;
	box-shadow: -2px 2px 10px rgba(0, 0, 0, .25);
	writing-mode: vertical-rl;
	text-orientation: mixed;
	transition: background .15s ease, box-shadow .15s ease;
}
.scl-bf-fab__icon { writing-mode: horizontal-tb; font-size: 15px; }
.scl-bf-fab__text { writing-mode: horizontal-tb; }
.scl-bf-fab:hover { background: #6d28d9; }
.scl-bf-fab:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.scl-bf-fab[aria-busy="true"] { opacity: .7; cursor: progress; }
.scl-bf-fab[disabled] { cursor: default; }

/* Mobile: lower-right, horizontal, safe-area aware, doesn't block content */
@media (max-width: 767px) {
	.scl-bf-fab {
		top: auto;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		right: calc(12px + env(safe-area-inset-right, 0px));
		transform: none;
		border-radius: 999px;
		writing-mode: horizontal-tb;
		padding: 12px 16px;
		box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
	}
	.scl-bf-fab__icon, .scl-bf-fab__text { writing-mode: horizontal-tb; }
}

/* ── Overlay + dialog ───────────────────────────────────────────────────── */
.scl-bf-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	background: rgba(17, 17, 24, .55);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 24px 16px;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.scl-bf-dialog {
	width: 100%;
	max-width: 460px;
	margin: auto;
	background: #ffffff;
	color: #1a1a1a;
	border-radius: 14px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	animation: scl-bf-in .18s ease;
}
@keyframes scl-bf-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.scl-bf-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid #ececf0;
}
.scl-bf-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #111827; }
.scl-bf-x {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #9ca3af;
	cursor: pointer;
	width: 36px;
	height: 36px;
	border-radius: 8px;
}
.scl-bf-x:hover { color: #374151; background: #f3f4f6; }
.scl-bf-x:focus-visible { outline: 2px solid #7c3aed; outline-offset: 1px; }

.scl-bf-body { padding: 16px 18px; }
.scl-bf-intro { font-size: .88rem; color: #4b5563; margin: 0 0 12px; line-height: 1.55; }
.scl-bf-label { display: block; font-size: .8rem; font-weight: 600; color: #374151; margin: 0 0 5px; }
.scl-bf-textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 84px;
	padding: 10px 12px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font: inherit;
	font-size: 16px; /* prevent iOS zoom on focus */
	line-height: 1.5;
	resize: vertical;
	color: #1f2937;
	background: #fff;
}
.scl-bf-textarea:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .15); }

.scl-bf-shot { margin: 14px 0 0; }
.scl-bf-toggle { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #374151; cursor: pointer; margin-bottom: 8px; }
.scl-bf-toggle input { width: 16px; height: 16px; }
.scl-bf-preview {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #f6f7f9;
	max-height: 200px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.scl-bf-preview-img { display: block; max-width: 100%; max-height: 200px; width: auto; height: auto; }
.scl-bf-nocap { font-size: .82rem; color: #6b7280; padding: 18px; text-align: center; margin: 0; }

/* V2: "capturing" placeholder + spinner */
.scl-bf-preparing {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 22px 18px;
	font-size: .84rem;
	color: #6b7280;
}
.scl-bf-spinner {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	border: 2px solid #ddd6fe;
	border-top-color: #7c3aed;
	border-radius: 50%;
	animation: scl-bf-spin .7s linear infinite;
}
@keyframes scl-bf-spin { to { transform: rotate(360deg); } }

/* V2: file input hidden (triggered by the "Datei auswählen" link) + hide utility */
.scl-bf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.scl-bf-hide { display: none !important; }
.scl-bf-shot-actions { margin-top: 8px; display: flex; gap: 14px; }
.scl-bf-link {
	background: none;
	border: none;
	padding: 0;
	color: #7c3aed;
	font: inherit;
	font-size: .82rem;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}
.scl-bf-link:hover { color: #6d28d9; }
.scl-bf-link:focus-visible { outline: 2px solid #7c3aed; outline-offset: 2px; border-radius: 3px; }

.scl-bf-privacy {
	margin: 14px 0 0;
	padding: 10px 12px;
	background: #f3f0ff;
	border: 1px solid #ddd6fe;
	border-radius: 8px;
	font-size: .8rem;
	color: #5b21b6;
	line-height: 1.5;
}
.scl-bf-status { margin-top: 10px; font-size: .82rem; color: #6b7280; min-height: 1.2em; }
.scl-bf-ref { font-size: .95rem; font-weight: 600; color: #111827; margin: 0 0 10px; }

.scl-bf-foot {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	padding: 14px 18px;
	border-top: 1px solid #ececf0;
	background: #fafafb;
}
/* V3 informational dialog (anonymous / non-beta): multiple actions, left-aligned + wrapping */
.scl-bf-foot--info { flex-wrap: wrap; justify-content: flex-start; }
.scl-bf-foot--info .scl-bf-btn { flex: 0 1 auto; }
.scl-bf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 9px 18px;
	border-radius: 8px;
	font: 600 .88rem/1 inherit;
	cursor: pointer;
	border: 1px solid transparent;
	text-decoration: none;
}
.scl-bf-btn--primary { background: #7c3aed; color: #fff; }
.scl-bf-btn--primary:hover { background: #6d28d9; }
.scl-bf-btn--ghost { background: #fff; color: #374151; border-color: #d1d5db; }
.scl-bf-btn--ghost:hover { background: #f3f4f6; }
.scl-bf-btn:focus-visible { outline: 3px solid #c4b5fd; outline-offset: 2px; }
.scl-bf-btn[disabled] { opacity: .6; cursor: progress; }

/* ── Thread-view protected screenshot card (owner/admin only, JS-injected) ── */
.scl-bf-shotcard {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0 24px 18px;
	padding: 10px 14px;
	background: #f3f0ff;
	border: 1px solid #ddd6fe;
	border-radius: 8px;
	font-size: .85rem;
	color: #5b21b6;
}
.scl-bf-shotcard__label { font-weight: 600; }
.scl-bf-shotcard__open {
	color: #6d28d9;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ── Reduced motion ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	.scl-bf-fab, .scl-bf-btn, .scl-bf-x { transition: none; }
	.scl-bf-dialog { animation: none; }
	.scl-bf-spinner { animation: none; border-top-color: #ddd6fe; }
}
