.wpb-upload-page {
	max-width: 900px;
	margin: 40px auto;
	padding: 20px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wpb-header {
	text-align: center;
	margin-bottom: 30px;
}

.wpb-header h1 {
	margin: 0 0 10px;
	color: #333;
}

.wpb-header p {
	margin: 0;
	color: #666;
	font-size: 14px;
}

.wpb-status {
	background: #f9f9f9;
	padding: 20px;
	border-radius: 6px;
	margin-bottom: 30px;
}

.wpb-status p {
	margin: 10px 0;
	color: #333;
	font-size: 14px;
}

.wpb-status strong {
	font-weight: 600;
}

.wpb-progress {
	margin-top: 15px;
	height: 24px;
	background: #e0e0e0;
	border-radius: 4px;
	overflow: hidden;
}

.wpb-progress-bar {
	height: 100%;
	background: linear-gradient(90deg, #4CAF50, #45a049);
	width: 0%;
	transition: width 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	color: white;
	font-size: 12px;
	font-weight: 600;
}

.wpb-upload-area {
	border: 2px dashed #ccc;
	border-radius: 6px;
	padding: 40px;
	text-align: center;
	cursor: pointer;
	transition: all 0.3s ease;
	background: #fafafa;
	margin-bottom: 30px;
}

.wpb-upload-area:hover {
	border-color: #4CAF50;
	background: #f0f8f0;
}

.wpb-upload-area.dragover {
	border-color: #4CAF50;
	background: #e8f5e9;
}

.wpb-upload-area p {
	margin: 0;
	color: #666;
	font-size: 16px;
}

.wpb-images-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 15px;
	margin-bottom: 30px;
}

.wpb-image-item {
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: 6px;
	border: 2px solid #e0e0e0;
	background: #f5f5f5;
	cursor: pointer;
	transition: all 0.3s ease;
}

.wpb-image-item:hover {
	border-color: #4CAF50;
	box-shadow: 0 2px 8px rgba(76, 175, 80, 0.2);
}

.wpb-image-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wpb-actions {
	text-align: center;
}

.wpb-actions .button {
	padding: 12px 30px;
	font-size: 16px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s ease;
}

.wpb-actions .button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Crop Modal */
.wpb-crop-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 9999;
}

.wpb-crop-modal-content {
	background: white;
	border-radius: 8px;
	max-width: 600px;
	width: 90%;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	max-height: 90vh;
}

.wpb-crop-header {
	padding: 20px;
	border-bottom: 1px solid #e0e0e0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.wpb-crop-header h2 {
	margin: 0;
	font-size: 18px;
	color: #333;
}

.wpb-crop-header .close {
	background: none;
	border: none;
	font-size: 28px;
	cursor: pointer;
	color: #999;
	padding: 0;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wpb-crop-header .close:hover {
	color: #333;
}

.wpb-crop-body {
	padding: 20px;
	overflow: auto;
	flex: 1;
}

.wpb-crop-body img {
	max-width: 100%;
	height: auto;
	display: block;
}

.wpb-crop-footer {
	padding: 20px;
	border-top: 1px solid #e0e0e0;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	background: #f9f9f9;
}

.wpb-crop-footer .button {
	padding: 10px 20px;
	border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
	.wpb-upload-page {
		margin: 20px 10px;
		padding: 15px;
	}

	.wpb-images-grid {
		grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	}

	.wpb-crop-modal-content {
		max-width: 95%;
		max-height: 95vh;
	}
}

/* A4 Preview Scaling */
.wpb-preview-container {
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-x: auto;
	background: #f0f0f0;
	padding: 20px;
	border-radius: 8px;
}

.wpb-preview-page {
	transform-origin: top center;
	max-width: 100% !important;
	height: auto !important;
	margin-bottom: 20px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

@media (max-width: 210mm) {
	.wpb-preview-page {
		width: 100% !important;
		padding: 5% !important;
	}
	.wpb-preview-page > div {
		grid-template-columns: repeat(2, 45%) !important;
		gap: 5% !important;
		width: 100% !important;
		margin: 5% auto !important;
	}
	.wpb-preview-page .image {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 1/1 !important;
	}
}

/* Loading Spinner */
.wpb-loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(255,255,255,0.7);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	border-radius: inherit;
}

.wpb-spinner {
	width: 30px;
	height: 30px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid #4CAF50;
	border-radius: 50%;
	animation: wpb-spin 1s linear infinite;
}

@keyframes wpb-spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* Image Thumb Indicators */
.wpb-image-thumb {
	position: relative;
}

.wpb-image-thumb::after {
	content: '✎';
	position: absolute;
	bottom: 5px;
	left: 5px;
	background: rgba(0,0,0,0.5);
	color: white;
	width: 20px;
	height: 20px;
	border-radius: 3px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	opacity: 0;
	transition: opacity 0.3s;
}

.wpb-image-thumb:hover::after {
	opacity: 1;
}

.wpb-image-thumb.is-loading .wpb-loading-overlay {
	display: flex;
}
