/**
 * Fullscreen PDF menu modal — layout only.
 * Visual tokens come from Core Framework with fallbacks.
 */

.maxs-pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	background: #111;
	color: #fff;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.maxs-pdf-modal[hidden] {
	display: none;
}

.maxs-pdf-modal.is-open {
	opacity: 1;
}

.maxs-pdf-modal__toolbar {
	position: relative;
	z-index: 11;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--space-s, 0.75rem);
	padding: clamp(0.75rem, 2.5vw, 1.5rem);
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
}

.maxs-pdf-modal__back.btn {
	flex-shrink: 0;
	min-width: 0;
	gap: var(--space-s, 0.5rem);
}

.maxs-pdf-modal__back-arrow {
	font-size: 1.1em;
	line-height: 1;
}

.maxs-pdf-modal__title {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	font-size: var(--text-lg, 1.125rem);
	line-height: 1.2;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.maxs-pdf-modal__controls {
	display: flex;
	flex-shrink: 0;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0.35rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.maxs-pdf-modal__controls::-webkit-scrollbar {
	display: none;
}

.maxs-pdf-modal__control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: var(--radius-s, 8px);
	background: rgba(0, 0, 0, 0.45);
	color: inherit;
	font: inherit;
	font-size: var(--text-s, 0.9375rem);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.maxs-pdf-modal__control:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.maxs-pdf-modal__control:not(:disabled):hover,
.maxs-pdf-modal__control:not(:disabled):focus-visible {
	border-color: rgba(255, 255, 255, 0.55);
	background: rgba(255, 255, 255, 0.08);
}

.maxs-pdf-modal__page {
	min-width: 4.5rem;
	text-align: center;
	font-size: var(--text-s, 0.9375rem);
	font-variant-numeric: tabular-nums;
}

.maxs-pdf-modal__divider {
	flex-shrink: 0;
	width: 1px;
	height: 1.5rem;
	margin: 0 0.15rem;
	background: rgba(255, 255, 255, 0.2);
}

.maxs-pdf-modal__stage {
	position: relative;
	flex: 1;
	min-height: 0;
	overflow: hidden;
	touch-action: none;
}

.maxs-pdf-modal__viewport {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow: hidden;
	will-change: transform;
}

.maxs-pdf-modal__canvas {
	display: block;
	max-width: none;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.maxs-pdf-modal__status {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: var(--space-s, 0.75rem);
	padding: var(--space-m, 1.5rem);
	text-align: center;
}

.maxs-pdf-modal__status[hidden] {
	display: none;
}

.maxs-pdf-modal__status--error p {
	margin: 0;
	max-width: 28rem;
	line-height: 1.5;
}

.maxs-pdf-modal__spinner {
	width: 2rem;
	height: 2rem;
	border: 2px solid rgba(255, 255, 255, 0.2);
	border-top-color: #fff;
	border-radius: 50%;
	animation: maxs-pdf-spin 0.8s linear infinite;
}

@keyframes maxs-pdf-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (max-width: 640px) {
	.maxs-pdf-modal__title {
		display: none;
	}

	.maxs-pdf-modal__back-label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}

	.maxs-pdf-modal__control {
		min-width: 2.25rem;
		min-height: 2.25rem;
		padding: 0.25rem 0.45rem;
	}

	.maxs-pdf-modal__page {
		min-width: 3.5rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.maxs-pdf-modal,
	.maxs-pdf-modal__spinner {
		transition: none;
		animation: none;
	}
}
