
* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	min-height: 100%;
	font-family: Arial, sans-serif;
	background: #222;
}

body {
	color: white;
}

/* =========================
   HEADER
========================= */

.header {
	width: 100%;
	padding: 15px;
	text-align: center;
	background: #181818;
}

.header h1 {
	margin: 0;
	font-size: 20px;
	font-weight: normal;
}

/* =========================
   VIEWER
========================= */

.viewer {
	width: 100%;
	min-height: calc(100vh - 140px);
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 20px;
}

.page-container {
	position: relative;
	background: white;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
	max-width: 100%;
}

#pdfCanvas {
	display: block;
	max-width: 100%;
	height: auto;
}

/* =========================
   LOADING
========================= */

#loading {
	position: fixed;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	background: #222;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 100;
}

.loading-box {
	text-align: center;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid #555;
	border-top-color: white;
	border-radius: 50%;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

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

/* =========================
   ERROR
========================= */

#error {
	display: none;
	max-width: 700px;
	margin: 30px auto;
	padding: 20px;
	background: #8b0000;
	border-radius: 8px;
	text-align: center;
	line-height: 1.6;
}

/* =========================
   CONTROLS
========================= */

.controls {
	position: fixed;
	left: 0;
	bottom: 0;
	width: 100%;
	min-height: 70px;
	background: rgba(20, 20, 20, 0.97);
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	padding: 10px;
	z-index: 50;
}

button {
	border: none;
	background: white;
	color: #222;
	border-radius: 5px;
	padding: 10px 15px;
	font-size: 15px;
	cursor: pointer;
}

button:hover {
	background: #ddd;
}

button:disabled {
	opacity: 0.35;
	cursor: default;
}

#pageInfo {
	min-width: 110px;
	text-align: center;
	font-size: 14px;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {

	.viewer {
		padding: 10px;
		align-items: flex-start;
		padding-top: 15px;
		padding-bottom: 90px;
	}

	.controls {
		flex-wrap: wrap;
		min-height: 80px;
	}

	button {
		padding: 8px 11px;
		font-size: 13px;
	}

	#pageInfo {
		min-width: 90px;
	}

	.header h1 {
		font-size: 17px;
	}
}
