/*
 * Gradient Wallpaper Maker ([gradient_wallpaper]). Loaded after tools.css,
 * which supplies the type scale, inputs, sliders and button icons. Radius
 * scale as everywhere: 28px stages, 24px cards, 14px swatches, pills.
 */

.wp-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(300px, 1fr); gap: 20px; align-items: start; margin-bottom: 28px; }

/* Preview */
.wp-stage {
	position: sticky; top: 96px;
	display: flex; flex-direction: column; align-items: center;
	padding: 28px 20px 18px; border-radius: 28px;
	background: repeating-conic-gradient(#F2F2F6 0% 25%, #fff 0% 50%) 0 0 / 20px 20px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05);
}
.wp-frame { line-height: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px -20px rgba(20, 10, 60, .45), 0 0 0 1px rgba(0, 0, 0, .08); }
.wp-frame.is-tall { border-radius: 30px; box-shadow: 0 0 0 7px #111, 0 24px 50px -18px rgba(20, 10, 60, .5); margin: 7px; }
.wp-frame canvas { display: block; }
.wp-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 16px 0 0 !important; font-size: 13px; color: #55555F; }
.wp-meta #wp-name { font-weight: 600; color: #111; }

/* Controls */
.wp-side { display: grid; gap: 14px; }
.wp-card { background: #fff; border: 1px solid #F0F0F0; border-radius: 24px; padding: 18px 20px; box-shadow: 0 1px 3px rgba(0, 0, 0, .04); }
.wp-card-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #6E6E78; margin-bottom: 12px; }
.wp-card .tg-grain { border: 0; background: none; padding: 0; }

.wp-stops { display: grid; gap: 8px; margin-bottom: 12px; }
.wp-stop { display: flex; align-items: center; gap: 8px; }
.wp-stop input[type="color"] {
	width: 40px !important; height: 40px !important; padding: 0 !important; border: 0 !important; border-radius: 12px !important;
	background: none !important; cursor: pointer; flex-shrink: 0;
}
.wp-stop input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.wp-stop input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.wp-stop input[type="text"] { flex: 1; min-width: 0; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; text-transform: uppercase; }
.wp-stop input.bad { border-color: #B42318 !important; }
.wp-remove {
	width: 30px; height: 30px; padding: 0 !important; border-radius: 50% !important; border: 1px solid #ECECF1 !important;
	background: #FAFAFA !important; color: #55555F !important; font-size: 16px; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.wp-remove:hover { background: #111 !important; color: #fff !important; border-color: #111 !important; }

.wp-row { display: flex; flex-wrap: wrap; gap: 8px; }

.wp-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 999px; background: #F4F4F7; margin-bottom: 14px; }
.wp-style {
	padding: 8px 4px !important; border: 0 !important; border-radius: 999px !important; background: transparent !important;
	font-size: 13px !important; font-weight: 600 !important; color: #45454F !important; cursor: pointer; box-shadow: none !important;
}
.wp-style[aria-pressed="true"] { background: #fff !important; color: #111 !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .1) !important; }

.wp-angle-row { display: flex; align-items: center; gap: 12px; }
.wp-angle-row label { font-size: 13px; font-weight: 600; color: #333; }
.wp-angle-row input { flex: 1; }
.wp-angle-row span { min-width: 40px; text-align: right; font-family: 'SF Mono', 'Fira Code', ui-monospace, monospace; font-size: 13px; color: #55555F; }

.wp-size-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.wp-size-group > span { width: 100%; font-size: 12px; font-weight: 600; color: #6E6E78; }
.wp-size, .wp-loop-btn {
	padding: 6px 12px !important; border: 1px solid #E8E8EE !important; border-radius: 999px !important; background: #fff !important;
	font-size: 12.5px !important; font-weight: 600 !important; color: #333 !important; cursor: pointer; box-shadow: none !important;
}
.wp-size:hover, .wp-loop-btn:hover { border-color: #C9C9D3 !important; }
.wp-size[aria-pressed="true"], .wp-loop-btn[aria-pressed="true"] { background: #111 !important; border-color: #111 !important; color: #fff !important; }
.wp-custom { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 13px; color: #55555F; }
.wp-custom label { font-weight: 600; color: #333; }
.wp-custom input { width: 90px !important; }

/* Buttons */
.wp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 11px 20px; border-radius: 999px !important; font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, transform .15s; }
.wp-btn-primary { background: #111 !important; color: #fff !important; }
.wp-btn-primary:hover { background: #333 !important; transform: translateY(-1px); }
.wp-btn-primary:disabled { opacity: .7; cursor: progress; transform: none; }
.wp-btn-ghost { background: #fff !important; border-color: #E2E2E8 !important; color: #222 !important; }
.wp-btn-ghost:hover { border-color: #111 !important; }
.wp-btn-sm { padding: 7px 14px; font-size: 13px; }
.wp-btn-sm .tg-i { width: 15px; height: 15px; }
.wp-download { width: 100%; padding: 15px 20px; font-size: 15px; }

/* Gallery */
.wp-gallery-sec h2 { font-size: 20px !important; margin: 8px 0 14px !important; letter-spacing: -.02em; }
.wp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-bottom: 40px; }
.wp-tile {
	position: relative; aspect-ratio: 9 / 19.5; padding: 0 !important; border: 0 !important; border-radius: 22px !important;
	cursor: pointer; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .06), 0 6px 18px -10px rgba(0, 0, 0, .35) !important;
	transition: transform .18s;
}
.wp-tile:hover { transform: translateY(-3px); }
.wp-tile span {
	position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 5px 8px; border-radius: 999px;
	background: rgba(255, 255, 255, .88); color: #111; font-size: 11px; font-weight: 600; line-height: 1.2;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Motion */
.wp-new { margin-left: 6px; padding: 2px 7px; border-radius: 999px; background: #F0EEFF; color: #5B4FCF; font-size: 10px; letter-spacing: .06em; }
.wp-switch { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: #222; cursor: pointer; }
.wp-switch input { position: absolute; opacity: 0; pointer-events: none; }
.wp-switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: #D9D9DF; flex-shrink: 0; transition: background .15s; }
.wp-switch-track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s; }
.wp-switch input:checked + .wp-switch-track { background: #111; }
.wp-switch input:checked + .wp-switch-track::after { transform: translateX(16px); }
.wp-switch input:focus-visible + .wp-switch-track { outline: 2px solid #5B4FCF; outline-offset: 2px; }
.wp-motion-opts { margin-top: 14px; }
.wp-motion-opts[hidden], #wp-video[hidden], .wp-progress[hidden], #wp-download[hidden] { display: none !important; }
.wp-loop { align-items: center; }
.wp-loop > span { font-size: 13px; font-weight: 600; color: #333; margin-right: 4px; }
.wp-motion-note { margin: 12px 0 0 !important; font-size: 12.5px; line-height: 1.55; color: #6E6E78; }
.wp-progress { height: 6px; border-radius: 999px; background: #ECECF1; overflow: hidden; }
.wp-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5B6CFF, #FF6FB5); transition: width .2s linear; }

@media (max-width: 860px) {
	.wp-layout { grid-template-columns: 1fr; }
	.wp-stage { position: static; }
}
