/* PDF region snip — rubber-band, snip-mode cursor, and save dialog */

/* Snip mode: crosshair cursor + disable text selection while dragging */
.zotero-pdf-pages-container.pdf-snip-mode,
.zotero-pdf-pages-container.pdf-snip-mode * {
	cursor: crosshair !important;
	user-select: none !important;
}

.zotero-pdf-snip-btn.active {
	background: rgba(78, 201, 176, 0.25);
	color: #4ec9b0;
}

/* Rubber-band rectangle (appended to body, fixed to viewport coords) */
.pdf-snip-rubberband {
	position: fixed;
	z-index: 40000;
	border: 1.5px dashed #4ec9b0;
	background: rgba(78, 201, 176, 0.12);
	pointer-events: none;
	box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.08);
}

/* ── Save dialog ─────────────────────────────────────────────── */

.pdf-snip-overlay {
	position: fixed;
	inset: 0;
	z-index: 41000;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
}

.pdf-snip-card {
	width: min(460px, calc(100vw - 40px));
	max-height: calc(100vh - 60px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px;
	background: var(--theme-bg-secondary, #2d2d30);
	border: 1px solid var(--theme-border-primary, #3e3e42);
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
	color: var(--theme-text-primary, #e5e7eb);
	font-size: 13px;
}

.pdf-snip-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.pdf-snip-head h3 {
	margin: 0;
	font-size: 15px;
}
.pdf-snip-close {
	border: none;
	background: none;
	color: var(--theme-text-secondary, #9ca3af);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 8px;
	border-radius: 6px;
}
.pdf-snip-close:hover {
	color: var(--theme-text-primary, #e5e7eb);
	background: var(--theme-bg-hover, #3e3e42);
}

.pdf-snip-preview {
	display: flex;
	justify-content: center;
	padding: 8px;
	background: #f4f4f4;
	border-radius: 8px;
	border: 1px solid var(--theme-border-primary, #3e3e42);
	max-height: 220px;
	overflow: hidden;
}
.pdf-snip-preview-img {
	max-width: 100%;
	max-height: 200px;
	object-fit: contain;
}

.pdf-snip-source {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
}
.pdf-snip-source-label {
	color: var(--theme-text-secondary, #9ca3af);
}
.pdf-snip-source-key {
	font-family: 'SFMono-Regular', Consolas, monospace;
	font-size: 12px;
	color: #4ec9b0;
	padding: 1px 6px;
	border-radius: 4px;
	background: rgba(78, 201, 176, 0.12);
	border: 1px solid rgba(78, 201, 176, 0.22);
}

.pdf-snip-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.pdf-snip-field {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.pdf-snip-field-label {
	font-size: 11.5px;
	color: var(--theme-text-secondary, #9ca3af);
}
.pdf-snip-input {
	width: 100%;
	padding: 7px 9px;
	border: 1px solid var(--theme-border-primary, #3e3e42);
	border-radius: 7px;
	background: var(--theme-bg-primary, #1e1e1e);
	color: var(--theme-text-primary, #e5e7eb);
	font-size: 13px;
	outline: none;
	box-sizing: border-box;
}
.pdf-snip-input:focus {
	border-color: var(--theme-border-accent, rgba(79, 70, 229, 0.6));
}
.pdf-snip-textarea {
	resize: vertical;
	font-family: inherit;
	line-height: 1.4;
}

.pdf-snip-status {
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 12.5px;
	line-height: 1.4;
}
.pdf-snip-status.error {
	background: rgba(248, 113, 113, 0.12);
	border: 1px solid rgba(248, 113, 113, 0.4);
	color: #f87171;
}

.pdf-snip-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
	margin-top: 2px;
}
.pdf-snip-btn {
	padding: 8px 14px;
	border: 1px solid var(--theme-border-primary, #3e3e42);
	border-radius: 8px;
	background: var(--theme-bg-tertiary, #252526);
	color: var(--theme-text-primary, #e5e7eb);
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}
.pdf-snip-btn:hover:not(:disabled) {
	background: var(--theme-bg-hover, #3e3e42);
}
.pdf-snip-btn.primary {
	background: linear-gradient(135deg, #4f46e5 0%, #22d3ee 100%);
	border-color: transparent;
	color: #fff;
	font-weight: 600;
}
.pdf-snip-btn.primary:hover:not(:disabled) {
	filter: brightness(1.1);
}
.pdf-snip-btn:disabled {
	opacity: 0.55;
	cursor: default;
}
