/* Easy PDF: scoped viewer + modal (resists template overrides) */

.jx-epdf,
.jx-epdf-modal {
	--jx-epdf-accent: var(--color-primary, var(--primary, var(--bs-primary, #2563eb)));
	--jx-epdf-accent-contrast: #fff;
	--jx-epdf-radius: 12px;
	--jx-epdf-ink: #0f172a;
	--jx-epdf-muted: #64748b;
	--jx-epdf-line: rgba(15, 23, 42, 0.12);
	--jx-epdf-surface: #ffffff;
	--jx-epdf-soft: #f8fafc;
	--jx-epdf-header-bg: #111827;
	--jx-epdf-header-fg: #f8fafc;
	--jx-epdf-header-muted: #cbd5e1;
	--jx-epdf-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
	box-sizing: border-box;
	margin: 1.25rem 0;
	color: var(--jx-epdf-ink);
	font-family: inherit;
	line-height: 1.4;
}

.jx-epdf *,
.jx-epdf-modal *,
.jx-epdf *::before,
.jx-epdf *::after,
.jx-epdf-modal *::before,
.jx-epdf-modal *::after {
	box-sizing: border-box;
}

.jx-epdf__sr {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.jx-epdf__btn {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.7rem 1.15rem !important;
	border: 0 !important;
	border-radius: var(--jx-epdf-radius) !important;
	background: var(--jx-epdf-accent) !important;
	color: var(--jx-epdf-accent-contrast) !important;
	font: inherit !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	cursor: pointer;
	box-shadow: 0 10px 24px color-mix(in srgb, var(--jx-epdf-accent) 28%, transparent);
	transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.jx-epdf__btn:hover,
.jx-epdf__btn:focus-visible {
	filter: brightness(1.06);
	color: var(--jx-epdf-accent-contrast) !important;
	text-decoration: none !important;
	transform: translateY(-1px);
}

.jx-epdf__btn .fas,
.jx-epdf__btn .fa {
	font-size: 0.95em;
	line-height: 1;
}

.jx-epdf__btn--login,
.jx-epdf__btn--register {
	box-shadow: none;
}

.jx-epdf__btn--login {
	background: var(--jx-epdf-ink) !important;
}

.jx-epdf__btn--register {
	background: transparent !important;
	color: var(--jx-epdf-ink) !important;
	box-shadow: inset 0 0 0 2px var(--jx-epdf-ink) !important;
}

.jx-epdf__btn--register:hover,
.jx-epdf__btn--register:focus-visible {
	color: var(--jx-epdf-ink) !important;
	background: color-mix(in srgb, var(--jx-epdf-ink) 6%, transparent) !important;
}

.jx-epdf__meta {
	opacity: 0.8;
	font-weight: 500 !important;
	font-size: 0.85em !important;
	color: inherit !important;
}

.jx-epdf__thumb-btn {
	display: block;
	width: var(--jx-epdf-thumb-w, 220px);
	max-width: 100%;
	height: var(--jx-epdf-thumb-h, auto);
	margin: 0 auto 0.55rem;
	overflow: hidden;
	border-radius: calc(var(--jx-epdf-radius) - 2px);
	background: #0b1220;
	box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
	aspect-ratio: auto;
}

.jx-epdf__btn--thumb {
	flex-direction: column !important;
	align-items: stretch !important;
	gap: 0.65rem !important;
	padding: 0.55rem !important;
	width: fit-content;
	max-width: 100%;
	text-align: center;
	background: var(--jx-epdf-surface) !important;
	color: var(--jx-epdf-ink) !important;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
	border: 1px solid var(--jx-epdf-line) !important;
}

.jx-epdf__btn--thumb:hover,
.jx-epdf__btn--thumb:focus-visible {
	color: var(--jx-epdf-ink) !important;
	filter: none;
	border-color: color-mix(in srgb, var(--jx-epdf-accent) 45%, var(--jx-epdf-line)) !important;
	box-shadow: 0 16px 36px color-mix(in srgb, var(--jx-epdf-accent) 18%, transparent) !important;
}

.jx-epdf__btn--thumb .jx-epdf__thumb-btn {
	margin-bottom: 0;
}

.jx-epdf__btn--thumb .jx-epdf__text {
	display: block;
	padding: 0 0.35rem 0.2rem;
	font-weight: 600 !important;
	color: inherit !important;
}

.jx-epdf__btn--thumb .jx-epdf__meta {
	display: block;
	padding: 0 0.35rem 0.35rem;
}

.jx-epdf__thumb-btn img,
.jx-epdf__thumb img,
.jx-epdf__thumb-canvas {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}

.jx-epdf__thumb-btn:not([style*="--jx-epdf-thumb-h:auto"]) img,
.jx-epdf__thumb-btn:not([style*="--jx-epdf-thumb-h:auto"]) .jx-epdf__thumb-canvas {
	height: 100%;
	object-fit: cover;
}

.jx-epdf__thumb-btn:not([style*="--jx-epdf-thumb-h:auto"]) {
	height: var(--jx-epdf-thumb-h);
}

.jx-epdf__thumb-btn--auto {
	position: relative;
	min-height: 140px;
}

.jx-epdf__thumb-skeleton {
	display: block;
	width: 100%;
	min-height: 160px;
	background:
		linear-gradient(90deg, rgba(148, 163, 184, 0.18), rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0.18));
	background-size: 200% 100%;
	animation: jx-epdf-shimmer 1.2s ease-in-out infinite;
}

.jx-epdf__thumb-skeleton[hidden],
.jx-epdf__thumb-canvas[hidden] {
	display: none !important;
}

.jx-epdf__thumb-btn--auto.is-failed {
	display: grid;
	place-items: center;
	min-height: 120px;
	background: #1e293b;
}

.jx-epdf__thumb-btn--auto.is-failed::after {
	content: 'PDF';
	color: #94a3b8;
	font-weight: 700;
	letter-spacing: 0.04em;
}

@keyframes jx-epdf-shimmer {
	0% { background-position: 100% 0; }
	100% { background-position: -100% 0; }
}

.jx-epdf__thumb img {
	display: block;
	width: 100%;
	height: auto;
}

.jx-epdf--gate {
	padding: 1.25rem 1.35rem;
	border-radius: var(--jx-epdf-radius);
	background: var(--jx-epdf-soft);
	border: 1px solid var(--jx-epdf-line);
}

.jx-epdf__gate-msg {
	margin: 0 0 0.85rem !important;
	color: var(--jx-epdf-ink) !important;
}

.jx-epdf__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
}

.jx-epdf--embed {
	overflow: hidden;
	margin: 1.25rem 0;
	border: 1px solid var(--jx-epdf-line);
	border-radius: var(--jx-epdf-radius);
	background: var(--jx-epdf-surface);
}

.jx-epdf--embed.jx-epdf--bare {
	border: 0;
	background: transparent;
	border-radius: 0;
}

.jx-epdf--embed.jx-epdf--bare .jx-epdf__frame-wrap {
	border-radius: var(--jx-epdf-radius);
	overflow: hidden;
	border: 1px solid var(--jx-epdf-line);
}

.jx-epdf__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	padding: 0.8rem 1rem;
	border-bottom: 1px solid var(--jx-epdf-line);
	background: var(--jx-epdf-soft);
}

.jx-epdf__title {
	flex: 1 1 auto;
	margin: 0 !important;
	font-weight: 600 !important;
	color: var(--jx-epdf-ink) !important;
}

.jx-epdf__toolbar {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: center;
}

.jx-epdf__tool {
	appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2.15rem;
	height: 2.15rem;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--jx-epdf-accent) !important;
	font: inherit !important;
	line-height: 1 !important;
	text-decoration: none !important;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.jx-epdf__tool:hover,
.jx-epdf__tool:focus-visible {
	background: color-mix(in srgb, var(--jx-epdf-accent) 12%, transparent) !important;
	color: var(--jx-epdf-accent) !important;
	text-decoration: none !important;
}

.jx-epdf__frame-wrap {
	position: relative;
	width: 100%;
	min-height: 280px;
	background: #0b1220;
}

.jx-epdf-modal .jx-epdf__frame-wrap {
	height: 100% !important;
	min-height: 0;
}

.jx-epdf__stage {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	min-height: inherit;
	background: #0b1220;
	color: #e2e8f0;
}

.jx-epdf__vbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.2rem;
	flex: 0 0 auto;
	padding: 0.4rem 0.55rem;
	border-bottom: 1px solid rgba(148, 163, 184, 0.22);
	background: #111827;
}

.jx-epdf__vbtn {
	appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: transparent !important;
	color: #cbd5e1 !important;
	cursor: pointer;
	line-height: 1 !important;
}

.jx-epdf__vbtn:hover,
.jx-epdf__vbtn:focus-visible {
	background: rgba(148, 163, 184, 0.16) !important;
	color: #f8fafc !important;
}

.jx-epdf__vbtn:disabled {
	opacity: 0.35;
	cursor: default;
}

.jx-epdf__vpage {
	min-width: 4.5rem;
	padding: 0 0.35rem;
	font-size: 0.85rem;
	font-variant-numeric: tabular-nums;
	text-align: center;
	color: #e2e8f0;
}

.jx-epdf__vsep {
	width: 1px;
	height: 1.1rem;
	margin: 0 0.35rem;
	background: rgba(148, 163, 184, 0.28);
}

.jx-epdf__vscroll {
	flex: 1 1 auto;
	overflow: auto;
	min-height: 0;
	padding: 0.75rem;
	background: #0b1220;
}

.jx-epdf__vpagewrap {
	display: flex;
	justify-content: center;
	min-height: 100%;
}

.jx-epdf__canvas {
	display: block;
	max-width: 100%;
	height: auto;
	background: #fff;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.jx-epdf__vstatus {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	padding: 0.65rem 1rem;
	border-radius: 8px;
	background: rgba(15, 23, 42, 0.88);
	color: #f8fafc;
	font-size: 0.9rem;
	pointer-events: none;
	z-index: 2;
}

.jx-epdf__vstatus[hidden] {
	display: none !important;
}

.jx-epdf__vstatus.is-error {
	background: rgba(127, 29, 29, 0.92);
}

.jx-epdf__frame {
	display: block;
	width: 100%;
	height: 100%;
	min-height: inherit;
	border: 0 !important;
	background: #fff;
}

.jx-epdf__fallback {
	position: absolute;
	inset: 0;
	display: grid;
	place-content: center;
	gap: 0.75rem;
	padding: 1.5rem;
	text-align: center;
	background: var(--jx-epdf-soft);
	color: var(--jx-epdf-ink) !important;
}

.jx-epdf__fallback[hidden] {
	display: none !important;
}

/* Modal shell */
.jx-epdf-modal.modal {
	--jx-epdf-header-bg: #111827;
	--jx-epdf-header-fg: #f8fafc;
	--jx-epdf-header-muted: #cbd5e1;
}

.jx-epdf-modal.jx-epdf-modal--light {
	--jx-epdf-header-bg: #ffffff;
	--jx-epdf-header-fg: #0f172a;
	--jx-epdf-header-muted: #475569;
}

.jx-epdf-modal .jx-epdf-modal__dialog {
	width: min(1080px, 94vw) !important;
	max-width: 94vw !important;
	margin: 1.25rem auto !important;
}

.jx-epdf-modal .jx-epdf-modal__content {
	border: 0 !important;
	border-radius: 16px !important;
	overflow: hidden;
	background: #0b1220 !important;
	box-shadow: var(--jx-epdf-shadow) !important;
}

.jx-epdf-modal.jx-epdf-modal--light .jx-epdf-modal__content {
	background: #f8fafc !important;
}

.jx-epdf-modal .jx-epdf-modal__header {
	display: flex !important;
	align-items: center !important;
	gap: 0.75rem !important;
	padding: 0.85rem 1rem !important;
	border: 0 !important;
	border-bottom: 1px solid color-mix(in srgb, var(--jx-epdf-header-fg) 12%, transparent) !important;
	background: var(--jx-epdf-header-bg) !important;
	color: var(--jx-epdf-header-fg) !important;
}

.jx-epdf-modal .jx-epdf-modal__title,
.jx-epdf-modal .modal-title.jx-epdf-modal__title,
.jx-epdf-modal h3.jx-epdf-modal__title {
	flex: 1 1 auto !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: transparent !important;
	color: var(--jx-epdf-header-fg) !important;
	font-size: 1rem !important;
	font-weight: 600 !important;
	line-height: 1.35 !important;
	letter-spacing: 0 !important;
	text-transform: none !important;
	opacity: 1 !important;
	visibility: visible !important;
}

.jx-epdf-modal .jx-epdf-modal__header .jx-epdf__tool {
	color: var(--jx-epdf-header-muted) !important;
}

.jx-epdf-modal .jx-epdf-modal__header .jx-epdf__tool:hover,
.jx-epdf-modal .jx-epdf-modal__header .jx-epdf__tool:focus-visible {
	background: color-mix(in srgb, var(--jx-epdf-header-fg) 10%, transparent) !important;
	color: var(--jx-epdf-header-fg) !important;
}

.jx-epdf-modal .jx-epdf__close {
	appearance: none;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 2.15rem;
	height: 2.15rem;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: transparent !important;
	color: var(--jx-epdf-header-muted) !important;
	cursor: pointer;
	opacity: 1 !important;
}

.jx-epdf-modal .jx-epdf__close:hover,
.jx-epdf-modal .jx-epdf__close:focus-visible {
	background: color-mix(in srgb, var(--jx-epdf-header-fg) 10%, transparent) !important;
	color: var(--jx-epdf-header-fg) !important;
}

.jx-epdf-modal .jx-epdf-modal__body {
	position: relative;
	height: min(var(--jx-epdf-height, 80vh), 88vh);
	padding: 0 !important;
	background: #0b1220 !important;
}

.jx-epdf-modal.jx-epdf-modal--light .jx-epdf-modal__body {
	background: #e2e8f0 !important;
}

@media (max-width: 767.98px) {
	.jx-epdf-modal .jx-epdf-modal__dialog {
		width: 100vw !important;
		max-width: 100vw !important;
		margin: 0 !important;
		min-height: 100%;
	}

	.jx-epdf-modal .jx-epdf-modal__content {
		min-height: 100vh;
		border-radius: 0 !important;
	}

	.jx-epdf-modal .jx-epdf-modal__body {
		height: calc(100vh - 3.75rem);
	}

	.jx-epdf__header {
		flex-direction: column;
		align-items: flex-start;
	}
}
