/* ==========================================================
   Secure PDF Flipbook — Light Minimal theme
   ========================================================== */

.spdfb-wrap {
	--spdfb-accent: #2b6cb0;
	--spdfb-bg: #f7f8fa;
	--spdfb-border: #e2e8f0;
	--spdfb-text: #2d3748;
	--spdfb-radius: 10px;
	position: relative;
	max-width: 100%;
	margin: 1.5em auto;
	font-family: inherit;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.spdfb-wrap,
.spdfb-wrap * {
	box-sizing: border-box;
}

.spdfb-protected-notice {
	padding: 2em;
	text-align: center;
	background: #f7f8fa;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	color: #4a5568;
}

/* Loading */
.spdfb-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 320px;
	color: #718096;
	background: var(--spdfb-bg);
	border: 1px solid var(--spdfb-border);
	border-radius: var(--spdfb-radius);
}
.spdfb-spinner {
	width: 34px;
	height: 34px;
	border: 3px solid #cbd5e0;
	border-top-color: var(--spdfb-accent);
	border-radius: 50%;
	animation: spdfb-spin 0.9s linear infinite;
}
@keyframes spdfb-spin { to { transform: rotate(360deg); } }

/* Shell layout */
.spdfb-shell {
	position: relative;
	background: linear-gradient(180deg, #ffffff, var(--spdfb-bg));
	border: 1px solid var(--spdfb-border);
	border-radius: var(--spdfb-radius);
	padding: 16px 12px 10px;
	box-shadow: 0 6px 24px rgba(45, 55, 72, 0.06);
}
.spdfb-shell.is-fullscreen {
	border-radius: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 100vh;
	width: 100%;
}

/* Stage */
.spdfb-stage {
	position: relative;
	overflow: hidden;
	border-radius: 6px;
	min-height: 200px;
}
.spdfb-stage.is-hidden .spdfb-book,
.spdfb-stage.is-hidden .spdfb-zoom-pane {
	visibility: hidden;
	filter: blur(24px);
}

.spdfb-book {
	margin: 0 auto;
	position: relative;
	outline: none;
}

/* StPageFlip page shadows etc. inherit engine styles (injected by its JS) */

/* Protect overlay */
.spdfb-protect-overlay {
	position: absolute;
	inset: 0;
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(247, 248, 250, 0.96);
	backdrop-filter: blur(3px);
}
.spdfb-protect-overlay[hidden],
.spdfb-zoom-pane[hidden] {
	display: none;
}
.spdfb-protect-msg {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 22px;
	background: #fff;
	border: 1px solid var(--spdfb-border);
	border-radius: 999px;
	color: var(--spdfb-text);
	font-size: 15px;
	box-shadow: 0 4px 14px rgba(45, 55, 72, 0.08);
}
.spdfb-protect-icon { font-size: 18px; }

/* Zoom pane */
.spdfb-zoom-pane {
	position: absolute;
	inset: 0;
	z-index: 20;
	overflow: auto;
	background: rgba(250, 251, 253, 0.98);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 18px;
	touch-action: pan-x pan-y;
}
.spdfb-zoom-pane.is-dragging { cursor: grabbing; }
.spdfb-zoom-pane img {
	max-width: 100%;
	height: auto;
	border-radius: 4px;
	box-shadow: 0 10px 30px rgba(45, 55, 72, 0.18);
	transform-origin: center top;
	transition: transform 0.15s ease;
	pointer-events: none;
}

/* Toolbar */
.spdfb-toolbar {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 10px;
}
.spdfb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid var(--spdfb-border);
	border-radius: 9px;
	background: #fff;
	color: var(--spdfb-text);
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.spdfb-btn:hover,
.spdfb-btn:focus-visible {
	background: var(--spdfb-accent);
	border-color: var(--spdfb-accent);
	color: #fff;
	outline: none;
}
.spdfb-btn.is-active {
	background: var(--spdfb-accent);
	border-color: var(--spdfb-accent);
	color: #fff;
}

/* Page number */
.spdfb-page-no {
	text-align: center;
	color: #718096;
	font-size: 13px;
	letter-spacing: 0.04em;
	margin-top: 8px;
}

/* Images inside the book */
.spdfb-wrap img {
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: auto;
}

/* ---------- print protection (server-side pages anyway) ---------- */
@media print {
	.spdfb-wrap,
	.spdfb-wrap * {
		display: none !important;
	}
	body > *:not(.spdfb-protected-notice) {
		visibility: hidden;
	}
}

/* ---------- responsive ---------- */
@media (max-width: 640px) {
	.spdfb-shell { padding: 10px 6px 8px; }
	.spdfb-btn { width: 34px; height: 34px; font-size: 15px; }
	.spdfb-page-no { font-size: 12px; }
	.spdfb-protect-msg { font-size: 13px; padding: 10px 16px; }
}
