import React, { useState, useEffect, useRef } from 'react';
import { Download, Wind, Sun, PenTool, Plus, Share2, Sparkles, Sprout, Image as ImageIcon } from 'lucide-react';
import { motion, AnimatePresence } from 'framer-motion';
// --- Constants & Data ---
const FLOWERS = [
{
id: 'sunflower',
name: 'Sunflower',
mood: 'Energetic',
meaning: 'Adoration, Loyalty, and Longevity',
quote: 'Keep your face to the sunshine and you cannot see the shadow.',
color: '#FBBF24',
bg: 'bg-yellow-50',
icon: '🌻',
illustration: 'https://images.unsplash.com/photo-1597848212624-a19eb35e2651?auto=format&fit=crop&q=80&w=400'
},
{
id: 'blue-salvia',
name: 'Blue Salvia',
mood: 'Peaceful',
meaning: 'I am thinking of you; Wisdom and Purity',
quote: 'Peace is the beauty of a soul at rest with itself.',
color: '#6366F1',
bg: 'bg-indigo-50',
icon: '🪻',
illustration: 'https://images.unsplash.com/photo-1508610048659-a06b669e3321?auto=format&fit=crop&q=80&w=400'
},
{
id: 'red-camellia',
name: 'Red Camellia',
mood: 'Resilient',
meaning: 'Unpretentious Excellence; Deep Passion',
quote: 'The flower that blooms in adversity is the most rare and beautiful of all.',
color: '#EF4444',
bg: 'bg-red-50',
icon: '🌺',
illustration: 'https://images.unsplash.com/photo-1518709268805-4e9042af9f23?auto=format&fit=crop&q=80&w=400'
},
{
id: 'white-lily',
name: 'White Lily',
mood: 'Reflective',
meaning: 'Purity, Rebirth, and Virtue',
quote: 'In the silence of the garden, the heart finds its own song.',
color: '#94a3b8',
bg: 'bg-slate-50',
icon: '🪷',
illustration: 'https://images.unsplash.com/photo-1508182314998-3bd49473002f?auto=format&fit=crop&q=80&w=400'
},
{
id: 'mimosa',
name: 'Mimosa',
mood: 'Playful',
meaning: 'Sensitivity, Secret Love, and Joy',
quote: 'Happiness is a butterfly which, when pursued, is always beyond our grasp.',
color: '#fbbf24',
bg: 'bg-orange-50',
icon: '🌼',
illustration: 'https://images.unsplash.com/photo-1554631221-f9603e6808be?auto=format&fit=crop&q=80&w=400'
}
];
const SEEDS = [
"Find a patch of sunlight and stand in it for 60 seconds.",
"Describe the texture of a nearby leaf in your mind.",
"Take three deep breaths, smelling the imaginary scent of rain.",
"Close your eyes and listen for the furthest sound you can hear.",
"Stretch your arms up like branches reaching for the sky."
];
// --- Sub-Components ---
const Petal = ({ color, rotation }) => (
);
const FlowerStalk = ({ log }) => {
return (
{/* The Stem */}
{/* Leaves on stem */}
{/* The Flower Head */}
{/* Petals only appear if entry exists */}
{[0, 60, 120, 180, 240, 300].map((deg) => (
))}
{/* Flower Center */}