@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Poppins:wght@400;600;800&family=Pacifico&display=swap');

.cds-app {
	--cds-accent: #ffd700;
	--cds-radius: 14px;
	max-width: 920px;
	margin: 0 auto;
	padding: 24px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #232323;
	box-sizing: border-box;
}
.cds-app *, .cds-app *::before, .cds-app *::after { box-sizing: border-box; }

/* Step indicator */
.cds-steps {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-bottom: 28px;
}
.cds-step {
	display: flex;
	align-items: center;
	gap: 8px;
	opacity: 0.4;
	transition: opacity .25s ease;
}
.cds-step.is-active,
.cds-step.is-done {
	opacity: 1;
}
.cds-step-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #eee;
	color: #555;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
}
.cds-step.is-active .cds-step-num {
	background: linear-gradient(135deg, #ffd700, #ff8c00);
	color: #1a1a1a;
}
.cds-step.is-done .cds-step-num {
	background: #2ecc71;
	color: #fff;
}
.cds-step-label { font-size: 13px; font-weight: 600; }
.cds-steps::after { content: ""; }
.cds-step:not(:last-child)::after {
	content: "";
	width: 32px;
	height: 2px;
	background: #ddd;
	margin-left: 8px;
}

/* Panels */
.cds-panel { display: none; animation: cdsFadeIn .35s ease; }
.cds-panel.is-active { display: block; }
@keyframes cdsFadeIn {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}
.cds-panel-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.cds-panel-sub { color: #666; margin: 0 0 20px; font-size: 14px; }

/* Upload */
.cds-upload-grid {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 16px;
	align-items: center;
	margin-bottom: 24px;
}
.cds-upload-connector {
	font-size: 22px;
	font-weight: 800;
	color: #bbb;
}
.cds-upload-box {
	position: relative;
	border: 2px dashed #cfcfcf;
	border-radius: var(--cds-radius);
	min-height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	background: #fafafa;
	transition: border-color .2s ease, background .2s ease;
	overflow: hidden;
	padding: 12px;
}
.cds-upload-box:hover,
.cds-upload-box.is-dragover {
	border-color: var(--cds-accent);
	background: #fffdf5;
}
.cds-file-input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
	width: 100%;
	height: 100%;
}
.cds-upload-empty { text-align: center; color: #888; pointer-events: none; }
.cds-upload-icon { font-size: 32px; margin-bottom: 6px; }
.cds-upload-preview {
	position: relative;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cds-upload-preview img {
	max-width: 100%;
	max-height: 150px;
	object-fit: contain;
	border-radius: 8px;
}
.cds-remove-btn {
	position: absolute;
	top: 4px;
	right: 4px;
	background: rgba(0,0,0,.65);
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 4px 8px;
	font-size: 11px;
	cursor: pointer;
	z-index: 2;
}

/* Fields */
.cds-field-group { margin-bottom: 16px; }
.cds-field-group label {
	display: block;
	font-weight: 700;
	font-size: 13px;
	margin-bottom: 6px;
	color: #333;
}
.cds-field-group input[type="text"],
.cds-field-group select {
	width: 100%;
	padding: 11px 13px;
	border: 1.5px solid #ddd;
	border-radius: 10px;
	font-size: 14px;
	font-family: inherit;
}
.cds-field-group input[type="text"]:focus,
.cds-field-group select:focus {
	outline: none;
	border-color: var(--cds-accent);
}

/* Buttons */
.cds-actions { display: flex; justify-content: center; margin-top: 20px; gap: 12px; }
.cds-actions-split { justify-content: space-between; }
.cds-btn {
	border: none;
	border-radius: 10px;
	padding: 13px 22px;
	font-size: 14.5px;
	font-weight: 700;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
	font-family: inherit;
}
.cds-btn:active { transform: scale(0.97); }
.cds-btn-primary {
	background: linear-gradient(135deg, #ffd700, #ff8c00);
	color: #1a1a1a;
	box-shadow: 0 4px 14px rgba(255, 140, 0, .35);
}
.cds-btn-primary:hover { box-shadow: 0 6px 18px rgba(255, 140, 0, .45); }
.cds-btn-primary:disabled {
	opacity: .45;
	cursor: not-allowed;
	box-shadow: none;
}
.cds-btn-secondary {
	background: #f0f0f0;
	color: #333;
}
.cds-btn-secondary:hover { background: #e4e4e4; }
.cds-btn-ghost {
	background: transparent;
	color: #888;
	text-decoration: underline;
}

/* Style grid */
.cds-style-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 20px;
}
.cds-style-grid-compact { grid-template-columns: repeat(3, 1fr); margin-top: 20px; }
.cds-style-card {
	border: 2.5px solid transparent;
	background: #f7f7f7;
	border-radius: 12px;
	padding: 12px;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	transition: border-color .2s ease, transform .15s ease;
}
.cds-style-card:hover { transform: translateY(-2px); }
.cds-style-card.is-selected { border-color: var(--cds-accent); background: #fffdf2; }
.cds-style-swatch {
	width: 100%;
	height: 44px;
	border-radius: 8px;
	display: block;
}
.cds-style-name { font-size: 12.5px; font-weight: 700; text-align: center; }

.cds-swatch-golden { background: linear-gradient(135deg, #1a1a2e, #16213e 60%, #ffd700); }
.cds-swatch-rose { background: linear-gradient(135deg, #3d0c1f, #7a1f3d 60%, #ffc1cc); }
.cds-swatch-electric { background: linear-gradient(135deg, #050505, #101010 60%, #39ff14); }
.cds-swatch-royal { background: linear-gradient(135deg, #0b1d4d, #1c3a8a 60%, #c0c0c0); }
.cds-swatch-sunset { background: linear-gradient(135deg, #ff512f, #f09819 60%, #ffe259); }
.cds-swatch-custom { background: repeating-linear-gradient(45deg, #ddd, #ddd 6px, #eee 6px, #eee 12px); position: relative; }
.cds-swatch-custom::after {
	content: "🎨";
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

/* Custom controls */
.cds-custom-controls {
	background: #fafafa;
	border-radius: 12px;
	padding: 16px;
	margin-bottom: 20px;
	border: 1px solid #eee;
}
.cds-custom-controls h3 { margin: 0 0 12px; font-size: 15px; }
.cds-custom-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	margin-bottom: 12px;
}
.cds-color-field { display: flex; flex-direction: column; gap: 4px; }
.cds-color-field label { font-size: 11.5px; font-weight: 700; color: #555; }
.cds-color-field input[type="color"] {
	width: 100%;
	height: 36px;
	border: 1.5px solid #ddd;
	border-radius: 8px;
	padding: 2px;
	cursor: pointer;
	background: #fff;
}

/* Canvas */
.cds-live-preview-wrap,
.cds-result-wrap {
	display: flex;
	justify-content: center;
	margin-bottom: 8px;
	background: #f0f0f0;
	border-radius: var(--cds-radius);
	padding: 14px;
	position: relative;
	overflow: hidden;
}
#cds-canvas, #cds-canvas-final {
	width: 100%;
	max-width: 640px;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(0,0,0,.15);
	display: block;
}
.cds-confetti-overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

@media (max-width: 640px) {
	.cds-upload-grid { grid-template-columns: 1fr; }
	.cds-upload-connector { justify-self: center; transform: rotate(90deg); }
	.cds-style-grid, .cds-style-grid-compact { grid-template-columns: repeat(2, 1fr); }
	.cds-custom-grid { grid-template-columns: repeat(2, 1fr); }
}
