/* Reset and base styles */
* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	background: #fff;
	min-height: 100vh;
	color: #000;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.container {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	margin: 0 auto;
	padding: 2rem;
	width: 100%;
	max-width: 1200px;
	text-align: center;
}

.main-content {
	display: flex;
	justify-content: center;
	align-items: flex-start;
	gap: 1rem;
}

.instructions-section {
	display: flex;
	flex: 0 0 auto;
	flex-direction: column;
	justify-content: center;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background: #fff;
	padding: 2rem;
	max-width: 350px;
	min-height: 400px;
	text-align: left;
}

.instructions-title {
	margin: 0 0 2rem 0;
	color: #000;
	font-weight: 600;
	font-size: 1.5rem;
	line-height: 1.3;
}

.instruction-steps {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
}

.instruction-step {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
}

.step-number {
	display: flex;
	flex-shrink: 0;
	justify-content: center;
	align-items: center;
	border-radius: 50%;
	background: #000;
	width: 32px;
	height: 32px;
	color: #fff;
	font-weight: 600;
	font-size: 0.875rem;
}

.step-text {
	margin: 0;
	padding-top: 0.25rem;
	color: #333;
	font-size: 0.9rem;
	line-height: 1.6;
}

h1 {
	margin-bottom: 0.5rem;
	color: #000;
	font-weight: 600;
	font-size: 2rem;
	letter-spacing: -0.025em;
}

p {
	margin-bottom: 2rem;
	color: #666;
	font-size: 1rem;
	line-height: 1.5;
}

.preview-section {
	position: relative;
	margin-bottom: 2rem;
	border: 1px solid #e5e5e5;
	border-radius: 12px;
	background: #fff;
	padding: 2rem;
}

.clear-icon-btn {
	display: flex;
	position: absolute;
	top: 20px;
	right: 20px;
	justify-content: center;
	align-items: center;
	z-index: 10;
	transition: all 0.2s ease;
	cursor: pointer;
	border: 2px solid #dc2626;
	border-radius: 50%;
	background: #fff;
	width: 40px;
	height: 40px;
	color: #dc2626;
}

.clear-icon-btn:hover:not(:disabled) {
	transform: scale(1.1);
	background: #dc2626;
	color: #fff;
}

.clear-icon-btn:disabled {
	display: none;
	opacity: 0.5;
	cursor: not-allowed;
}

.image-preview {
	display: flex;
	position: relative;
	justify-content: center;
	align-items: center;
	margin: 0 auto 1.5rem;
	border: 2px dashed #e5e5e5;
	border-radius: 50%;
	background: #fafafa;
	width: 400px;
	height: 400px;
	overflow: hidden;
}

.image-preview.clickable-upload {
	transition: all 0.2s ease;
	cursor: pointer;
}

.image-preview.clickable-upload:hover {
	transform: scale(1.02);
	border-color: #000;
	background: #f5f5f5;
}

.image-preview.clickable-upload:focus {
	outline: 2px solid #000;
	outline-offset: 2px;
}

.image-preview.drag-over {
	transform: scale(1.05);
	border-color: #000;
	background: #f0f9ff;
}

.upload-prompt {
	pointer-events: none;
	text-align: center;
}

.upload-icon {
	opacity: 0.7;
	margin-bottom: 1rem;
	font-size: 3rem;
}

.upload-hint {
	margin: 0.5rem 0 0 0;
	color: #999;
	font-weight: 400;
	font-size: 0.75rem;
}

.image-preview img {
	transition: opacity 0.5s ease-in-out;
	border-radius: 12px;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.image-preview img.fade-out {
	opacity: 0;
}

.image-preview img.fade-in {
	opacity: 1;
}

.processing-overlay {
	display: flex;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	opacity: 0;
	transition: opacity 0.2s ease-in-out;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
}

.processing-overlay.show {
	opacity: 1;
}

.spinner {
	animation: spin 1s linear infinite;
	margin-bottom: 0.75rem;
	border: 3px solid #e5e5e5;
	border-top: 3px solid #000;
	border-radius: 50%;
	width: 32px;
	height: 32px;
}

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

.processing-text {
	color: #000;
	font-weight: 500;
	font-size: 0.875rem;
}

.placeholder-text {
	margin: 0;
	color: #666;
	font-size: 0.875rem;
}

.button-group {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
}

.filter-btn {
	display: none;
}

.filter-btn,
.ribbon-btn,
.download-btn {
	transform: translateY(0);
	transition: all 0.2s ease;
	cursor: pointer;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	padding: 0.75rem 1.5rem;
	color: #000;
	font-weight: 500;
	font-size: 0.875rem;
}

.ribbon-btn {
	border-color: #000;
	background: #000;
	color: #fff;
}

.download-btn {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border-color: #e5e5e5;
	background: #fff;
	color: #000;
}

.filter-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	border-color: #d1d5db;
	background: #f5f5f5;
}

.ribbon-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	border-color: #333;
	background: #333;
}

.download-btn:hover:not(:disabled) {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	border-color: #d1d5db;
	background: #f5f5f5;
}

.filter-btn:disabled,
.ribbon-btn:disabled,
.download-btn:disabled {
	cursor: not-allowed;
	border-color: #e5e5e5;
	background: #f5f5f5;
	color: #999;
}

/* Image Controls Styles */
.image-controls {
	margin-top: 1.5rem;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	padding: 1.5rem;
}

.image-controls h3 {
	margin: 0 0 1rem 0;
	color: #000;
	font-weight: 500;
	font-size: 0.875rem;
	text-align: center;
}

.image-controls-content {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 1rem;
}

.image-slider {
	transition: background 0.2s ease;
	cursor: pointer;
	outline: none;
	border: none;
	border-radius: 3px;
	background: #e5e5e5;
	width: 120px;
	height: 6px;
}

.image-slider::-webkit-slider-thumb {
	appearance: none;
	transition: all 0.2s ease;
	cursor: pointer;
	border-radius: 50%;
	background: #000;
	width: 18px;
	height: 18px;
}

.image-slider::-webkit-slider-thumb:hover {
	transform: scale(1.1);
	background: #333;
}

.image-slider::-moz-range-thumb {
	transition: all 0.2s ease;
	cursor: pointer;
	border: none;
	border-radius: 50%;
	background: #000;
	width: 18px;
	height: 18px;
}

.image-slider::-moz-range-thumb:hover {
	transform: scale(1.1);
	background: #333;
}

.image-slider:hover {
	background: #d1d5db;
}

/* Ribbon Selector Styles */
.ribbon-selector {
	margin-top: 1.5rem;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	padding: 1.5rem;
}

.ribbon-selector h3 {
	margin: 0 0 1rem 0;
	color: #000;
	font-weight: 500;
	font-size: 0.875rem;
	text-align: center;
}

.ribbon-thumbnails {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	gap: 1rem;
	padding-bottom: 0.5rem;
	max-width: calc(6 * 64px + 5 * 1rem);
	overflow-x: auto;
	overflow-y: hidden;
	scroll-behavior: smooth;
}

.ribbon-thumbnails::-webkit-scrollbar {
	height: 6px;
}

.ribbon-thumbnails::-webkit-scrollbar-track {
	border-radius: 3px;
	background: #f5f5f5;
}

.ribbon-thumbnails::-webkit-scrollbar-thumb {
	border-radius: 3px;
	background: #d1d5db;
}

.ribbon-thumbnails::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

.ribbon-thumbnail {
	display: flex;
	flex-shrink: 0;
	justify-content: center;
	align-items: center;
	transform: translateY(0);
	transition: all 0.2s ease;
	cursor: pointer;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	background: #fff;
	width: 64px;
	height: 64px;
	overflow: hidden;
}

.ribbon-thumbnail:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
	border-color: #000;
}

.ribbon-thumbnail.active {
	border-color: #000;
	background: #fafafa;
}

.ribbon-thumbnail img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

/* Ribbon Controls Styles */
.ribbon-controls {
	display: flex;
	display: none;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 1rem;
	margin-top: 1.5rem;
	border-top: 1px solid #e5e5e5;
	padding-top: 1.5rem;
}

.slider-label {
	margin: 0;
	color: #000;
	font-weight: 500;
	font-size: 0.875rem;
}

.ribbon-slider {
	transition: background 0.2s ease;
	cursor: pointer;
	outline: none;
	border: none;
	border-radius: 3px;
	background: #e5e5e5;
	width: 120px;
	height: 6px;
}

.ribbon-slider::-webkit-slider-thumb {
	appearance: none;
	transition: all 0.2s ease;
	cursor: pointer;
	border-radius: 50%;
	background: #000;
	width: 18px;
	height: 18px;
}

.ribbon-slider::-webkit-slider-thumb:hover {
	transform: scale(1.1);
	background: #333;
}

.ribbon-slider::-moz-range-thumb {
	transition: all 0.2s ease;
	cursor: pointer;
	border: none;
	border-radius: 50%;
	background: #000;
	width: 18px;
	height: 18px;
}

.ribbon-slider::-moz-range-thumb:hover {
	transform: scale(1.1);
	background: #333;
}

.ribbon-slider:hover {
	background: #d1d5db;
}

.size-value {
	min-width: 40px;
	color: #666;
	font-weight: 500;
	font-size: 0.75rem;
	text-align: center;
}

/* Responsive design */
@media (max-width: 768px) {
	.container {
		padding: 1rem;
	}

	.main-content {
		flex-direction: column;
		align-items: center;
		gap: 2rem;
	}

	.instructions-section {
		padding: 1.5rem;
		width: 100%;
		max-width: 100%;
	}

	.instructions-title {
		margin-bottom: 1.5rem;
		font-size: 1.25rem;
	}

	.instruction-steps {
		gap: 1.25rem;
	}

	.step-number {
		width: 28px;
		height: 28px;
		font-size: 0.8125rem;
	}

	.step-text {
		font-size: 0.875rem;
	}

	h1 {
		font-size: 1.5rem;
	}

	.image-preview {
		width: 300px;
		height: 300px;
	}

	.clear-icon-btn {
		top: 15px;
		right: 15px;
		width: 36px;
		height: 36px;
	}

	.upload-label,
	.filter-btn,
	.ribbon-btn,
	.download-btn {
		padding: 0.625rem 1.25rem;
		font-size: 0.8125rem;
	}

	.button-group {
		gap: 0.5rem;
	}

	.ribbon-thumbnails {
		gap: 0.5rem;
	}

	.ribbon-thumbnail {
		width: 56px;
		height: 56px;
	}

	.image-controls-content {
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
	}

	.image-slider {
		width: 100px;
	}

	.ribbon-controls {
		flex-direction: column;
		align-items: center;
		gap: 0.5rem;
	}

	.ribbon-slider {
		width: 100px;
	}
}
