import { useState, useEffect } from "react"; // ─── Design Tokens ─────────────────────────────────────────────────────────── // Palette: near-black base, warm parchment text, gold accent (vinyl warmth), // with a deep green Spotify nod used sparingly const T = { bg: "#0A0A0A", surface: "#141414", surfaceHover: "#1C1C1C", border: "#242424", borderActive: "#C8A951", accent: "#C8A951", accentDim: "#8A7234", accentGlow: "rgba(200,169,81,0.15)", spotifyGreen: "#1DB954", textPrimary: "#F0EDE6", textMuted: "#666", textDim: "#444", error: "#E05252", success: "#4DAF7C", }; const STEPS = [ { id: 1, label: "Track", icon: "♬" }, { id: 2, label: "Sound", icon: "◈" }, { id: 3, label: "Playlists", icon: "☰" }, { id: 4, label: "Pitch", icon: "✎" }, { id: 5, label: "Submit", icon: "✦" }, ]; const GENRES = ["Hip-Hop","R&B","Afrobeats","Pop","Electronic","Indie","Soul","Reggae","Gospel","Jazz","Lo-Fi","Dancehall","Amapiano","Drill","Alternative"]; const MOODS = ["Energetic","Chill","Emotional","Hype","Late Night","Focus","Romantic","Melancholic","Uplifting","Dark","Party","Spiritual"]; const PLAYLISTS = [ { id: 1, curator: "Fresh Vibes Daily", genre: "Afrobeats · R&B", followers: "48.2K", slots: 3, img: "🎵" }, { id: 2, curator: "Night Drive Collective", genre: "Lo-Fi · Electronic", followers: "122K", slots: 2, img: "🌙" }, { id: 3, curator: "The Heat Check", genre: "Hip-Hop · Drill", followers: "89.4K", slots: 5, img: "🔥" }, { id: 4, curator: "Soul Kitchen", genre: "Soul · R&B · Jazz", followers: "34.7K", slots: 4, img: "🎷" }, { id: 5, curator: "Gospel Waves", genre: "Gospel · Worship", followers: "61K", slots: 2, img: "🙌" }, { id: 6, curator: "Amapiano District", genre: "Amapiano · House", followers: "97.8K", slots: 6, img: "💿" }, ]; // ─── Helpers ───────────────────────────────────────────────────────────────── function isValidSpotifyUrl(url) { return /open\.spotify\.com\/(track|embed\/track)\/[A-Za-z0-9]+/.test(url); } // ─── Sub-components ────────────────────────────────────────────────────────── function ProgressBar({ step }) { return (
{STEPS.map((s, i) => (
s.id ? T.accent : step === s.id ? T.accentGlow : "transparent", border: `2px solid ${step >= s.id ? T.accent : T.border}`, display: "flex", alignItems: "center", justifyContent: "center", fontSize: step > s.id ? 14 : 16, color: step > s.id ? "#000" : step === s.id ? T.accent : T.textDim, fontWeight: 700, transition: "all 0.3s ease", boxShadow: step === s.id ? `0 0 16px ${T.accentGlow}` : "none", }}> {step > s.id ? "✓" : s.icon}
= s.id ? T.accent : T.textDim, fontFamily: "monospace", fontWeight: step === s.id ? 700 : 400, }}>{s.label}
{i < STEPS.length - 1 && (
s.id ? `linear-gradient(90deg, ${T.accent}, ${T.accentDim})` : T.border, transition: "background 0.4s ease", }} /> )}
))}
); } function StepLabel({ number, title, subtitle }) { return (
STEP {number} / {STEPS.length}

{title}

{subtitle &&

{subtitle}

}
); } function Input({ label, placeholder, value, onChange, type = "text", error }) { const [focused, setFocused] = useState(false); return (
onChange(e.target.value)} placeholder={placeholder} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)} style={{ width: "100%", padding: "13px 16px", boxSizing: "border-box", background: T.surface, border: `1px solid ${error ? T.error : focused ? T.accent : T.border}`, borderRadius: 8, color: T.textPrimary, fontSize: 15, outline: "none", fontFamily: "inherit", boxShadow: focused ? `0 0 0 3px ${T.accentGlow}` : "none", transition: "all 0.2s ease", }} /> {error &&

{error}

}
); } function Textarea({ label, placeholder, value, onChange, maxLength = 500 }) { const [focused, setFocused] = useState(false); return (