/* Drag over overlay */
.container.dragover::after {
	content: '画像をドロップして切り替え';
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 210, 255, 0.2);
	backdrop-filter: blur(4px);
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 2rem;
	color: #ffffff;
	font-weight: bold;
	border-radius: 16px;
	border: 3px dashed #00d2ff;
	z-index: 20;
	pointer-events: none;
}

/* Upload Area */
.upload-area {
	border: 2px dashed rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 20px 40px;
	text-align: center;
	cursor: pointer;
	transition: 0.3s;
	position: relative;
	overflow: hidden;
	margin: 20px;
}

.upload-area:hover,
.upload-area.dragover {
	border-color: #00d2ff;
	background: rgba(0, 210, 255, 0.05);
}

.upload-text {
	font-size: 1.1rem;
	margin-bottom: 5px;
}

.upload-hint {
	font-size: 0.9rem;
	color: #aaa;
}

#fileInput {
	display: none;
}

/* Controls & Preview Section */
.controls-preview {
	/* display: none; */
	/* Hidden by default */
	margin-top: 30px;
	animation: slideUp 0.5s ease-out;
}

.settings-panel {
	background: rgba(0, 0, 0, 0.2);
	padding: 20px;
	border-radius: 16px;
	margin-bottom: 20px;
}

.control-group {
	margin-bottom: 15px;
}

.control-group label {
	display: block;
	margin-bottom: 8px;
	font-weight: 500;
}



.quality-value {
	float: right;
	color: #00d2ff;
	font-weight: bold;
}

/* Comparison View */
.comparison-container {
	margin: 30px 20px;
	border-radius: 16px;
	overflow: hidden;
	background: #000;
	position: relative;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.comparison-view {
	position: relative;
	width: 100%;
	height: 400px;
	display: flex;
	--split-pos: 50%;
	user-select: none;
}

.comparison-original {
	clip-path: inset(0 calc(100% - var(--split-pos)) 0 0);
	z-index: 1;
}

.comparison-after {
	z-index: 0;
}

.comparison-item {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

.comparison-item img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Draggable Slider */
.comparison-slider {
	position: absolute;
	top: 0;
	left: var(--split-pos);
	width: 4px;
	height: 100%;
	background: #00d2ff;
	z-index: 3;
	transform: translateX(-50%);
	cursor: pointer;
	box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
}

.slider-handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	background: #00d2ff;
	color: #fff;
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 4;
	font-weight: bold;
	box-shadow: 0 0 20px rgba(0, 210, 255, 0.6);
	cursor: pointer;
	border: 3px solid rgba(255, 255, 255, 0.3);
	font-size: 1.2rem;
}

.comparison-label {
	position: absolute;
	bottom: 20px;
	padding: 6px 15px;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(8px);
	border-radius: 50px;
	font-size: 0.85rem;
	font-weight: 700;
	color: #fff;
	z-index: 5;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-label.left {
	left: 20px;
	border-left: 3px solid #00d2ff;
}

.comparison-label.right {
	right: 20px;
	border-right: 3px solid #00d2ff;
}

.file-info {
	font-size: 0.9rem;
	color: #aaa;
}

.size-badge {
	display: inline-block;
	padding: 4px 8px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.1);
	font-weight: bold;
}

.size-badge.optimized {
	color: #00ff99;
	background: rgba(0, 255, 136, 0.1);
}



/* Loading Spinner */
.loading-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	justify-content: center;
	align-items: center;
	border-radius: 16px;
	z-index: 10;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s;
}

.loading-overlay.active {
	opacity: 1;
	pointer-events: all;
}

.spinner {
	width: 40px;
	height: 40px;
	border: 4px solid rgba(255, 255, 255, 0.3);
	border-top: 4px solid #00d2ff;
	border-radius: 50%;
	animation: spin 1s linear infinite;
}

@keyframes spin {
	0% {
		transform: rotate(0deg);
	}

	100% {
		transform: rotate(360deg);
	}
}

/* Download Buttons */
.download-toolbar {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 30px;
	margin-bottom: 25px;
	flex-wrap: wrap;
}

@media (max-width: 600px) {
	.download-toolbar {
		flex-direction: column;
		gap: 15px;
	}
}

.download-actions {
	display: flex;
	gap: 20px;
	justify-content: center;
	flex-wrap: wrap;
}

.download-btn {
	display: flex;
	align-items: center;
	padding: 12px 25px;
	min-width: 180px;
	justify-content: center;
	transition: opacity 0.3s, background 0.3s;
}

.download-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
	background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
	font-size: 1.2rem;
	margin-right: 10px;
}

.btn-text {
	display: flex;
	flex-direction: column;
	align-items: center;
	line-height: 1.2;
}

.btn-label {
	font-size: 1rem;
	font-weight: 700;
}

.btn-size {
	font-size: 0.85rem;
	opacity: 0.9;
	font-weight: 400;
}

/* File Size Info */
.file-size-info {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 500;
}

.size-arrow {
	color: #00d2ff;
	font-weight: 900;
	font-size: 1.2rem;
	opacity: 0.8;
}