body {
	margin: 0;
	padding: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	background-color: #f0f0f0;
	overflow: hidden;
}

#catalog-container {
	text-align: center;
	width: 100%;
	padding: 10px 0;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	overflow: hidden;
	max-height: 100vh;
	position: relative;
}

#flipbook {
	width: 100%;
	max-width: 100%;
	max-height: 80vh;
	aspect-ratio: 1787 / 2527;
	background-color: white;
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
	overflow: hidden;
	padding: 0;
	margin: 0 auto 10px auto;
	display: block;
}

#loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(255, 255, 255, 0.8);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 1000;
	visibility: visible;
	opacity: 1;
	transition: opacity 0.3s, visibility 0.3s;
}

#loading-overlay.hidden {
	visibility: hidden !important;
	opacity: 0 !important;
	display: none !important;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 5px solid #f3f3f3;
	border-top: 5px solid #007bff;
	border-radius: 50%;
	-webkit-animation: spin 1s linear infinite;
	animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

.loading-text {
	margin-top: 10px;
	font-size: 16px;
	color: #333;
	font-weight: bold;
}

#progress-bar-container {
	/* 追加：プログレスバー外枠 */
	width: 200px;
	height: 10px;
	background-color: #f3f3f3;
	border-radius: 5px;
	margin-top: 10px;
	overflow: hidden;
}

#progress-bar {
	/* 追加：プログレスバー内枠 */
	width: 0%;
	height: 100%;
	background-color: #007bff;
	transition: width 0.3s ease;
}

#progress-text {
	/* 追加：進捗テキスト */
	margin-top: 8px;
	font-size: 14px;
	color: #333;
	font-weight: bold;
}

#controls {
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
}

#controls-top {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin-bottom: 10px;
}

#controls-bottom {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 10px;
}

button {
	padding: 10px 20px;
	font-size: 16px;
	cursor: pointer;
	border: none;
	border-radius: 4px;
}

#prev-btn,
#next-btn {
	background-color: #6c757d;
	color: white;
}

#prev-btn:hover,
#next-btn:hover {
	background-color: #5a6268;
}

#page-number {
	font-size: 16px;
	color: #333;
}

#page-input {
	width: 80px;
	padding: 8px;
	font-size: 16px;
	text-align: center;
	border: 1px solid #ccc;
	border-radius: 4px;
}

#go-btn {
	padding: 10px 20px;
	font-size: 16px;
	background-color: #007bff;
	color: white;
	border: none;
	border-radius: 4px;
}

#go-btn:hover {
	background-color: #0056b3;
}

/* タブレット対応 (768px以下) */
@media screen and (max-width: 768px) {
	#catalog-container {
		padding: 5px 0;
	}

	#flipbook {
		max-height: 82vh;
		margin-bottom: 5px;
	}

	.spinner {
		width: 32px;
		height: 32px;
		border-width: 4px;
	}

	.loading-text {
		font-size: 14px;
		margin-top: 8px;
	}

	#progress-bar-container {
		width: 160px;
		height: 8px;
	}

	#progress-text {
		font-size: 12px;
		margin-top: 6px;
	}

	button {
		padding: 8px 16px;
		font-size: 14px;
	}

	#page-number {
		font-size: 14px;
	}

	#page-input {
		width: 60px;
		padding: 6px;
		font-size: 14px;
	}

	#go-btn {
		padding: 8px 16px;
		font-size: 14px;
	}

	#controls-top,
	#controls-bottom {
		gap: 8px;
		margin-bottom: 8px;
	}
}

/* スマートフォン対応 (480px以下) */
@media screen and (max-width: 480px) {
	#catalog-container {
		padding: 5px 0;
	}

	#flipbook {
		max-height: 80vh;
		margin-bottom: 5px;
	}

	.spinner {
		width: 24px;
		height: 24px;
		border-width: 3px;
	}

	.loading-text {
		font-size: 12px;
		margin-top: 6px;
	}

	#progress-bar-container {
		width: 120px;
		height: 6px;
	}

	#progress-text {
		font-size: 10px;
		margin-top: 4px;
	}

	button {
		padding: 6px 12px;
		font-size: 12px;
		min-width: 50px;
	}

	#page-number {
		font-size: 12px;
	}

	#page-input {
		width: 50px;
		padding: 4px;
		font-size: 12px;
	}

	#go-btn {
		padding: 6px 12px;
		font-size: 12px;
		min-width: 50px;
	}

	#controls-top,
	#controls-bottom {
		gap: 5px;
		margin-bottom: 5px;
	}
}
