// Decorative SVGs: hero illustration, wave separators, sun, etc.

const HeroIllustration = () => (
  <svg viewBox="0 0 520 520" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden>
    {/* sky gradient circle (sun) */}
    <defs>
      <linearGradient id="sunG" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#ffd977"/>
        <stop offset="1" stopColor="#ffa85c"/>
      </linearGradient>
      <linearGradient id="seaG" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#7cc0dd"/>
        <stop offset="1" stopColor="#2a6e97"/>
      </linearGradient>
      <linearGradient id="sandG" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0" stopColor="#f7e6c4"/>
        <stop offset="1" stopColor="#e8cf9a"/>
      </linearGradient>
      <radialGradient id="ballG" cx="0.3" cy="0.3" r="0.9">
        <stop offset="0" stopColor="#fff"/>
        <stop offset="1" stopColor="#e94e3a"/>
      </radialGradient>
    </defs>

    {/* Sun */}
    <circle cx="370" cy="150" r="74" fill="url(#sunG)"/>
    {/* Sun rays */}
    {[0,1,2,3,4,5,6,7].map(i => {
      const a = (i * 45) * Math.PI / 180;
      const x1 = 370 + Math.cos(a)*92, y1 = 150 + Math.sin(a)*92;
      const x2 = 370 + Math.cos(a)*118, y2 = 150 + Math.sin(a)*118;
      return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke="#ffa85c" strokeWidth="6" strokeLinecap="round" opacity="0.7"/>;
    })}

    {/* Clouds */}
    <g fill="#fff" opacity="0.9">
      <ellipse cx="130" cy="110" rx="42" ry="14"/>
      <ellipse cx="155" cy="100" rx="30" ry="12"/>
      <ellipse cx="110" cy="100" rx="22" ry="9"/>
    </g>

    {/* Sea (wavy) */}
    <path d="M0 280 C 60 260, 120 300, 180 285 S 300 260, 360 280 S 480 300, 540 285 L 540 400 L 0 400 Z" fill="url(#seaG)"/>
    <path d="M0 300 C 60 290, 130 315, 200 305 S 320 290, 380 305 S 480 315, 540 305 L 540 360 L 0 360 Z" fill="#fff" opacity="0.18"/>
    <path d="M0 320 C 80 315, 160 330, 240 322 S 380 315, 540 322 L 540 345 L 0 345 Z" fill="#fff" opacity="0.15"/>

    {/* Sand */}
    <path d="M0 380 C 100 360, 200 400, 300 380 S 460 380, 540 390 L 540 520 L 0 520 Z" fill="url(#sandG)"/>

    {/* Beach umbrella */}
    <g>
      <rect x="118" y="290" width="4" height="110" fill="#8a3d2a"/>
      <path d="M60 290 A 60 60 0 0 1 180 290 Z" fill="#e94e3a"/>
      <path d="M60 290 A 60 60 0 0 1 90 238 L 90 290 Z" fill="#fff"/>
      <path d="M150 238 A 60 60 0 0 1 180 290 L 150 290 Z" fill="#fff"/>
    </g>

    {/* Beach ball */}
    <g transform="translate(245,370)">
      <circle r="28" fill="url(#ballG)"/>
      <path d="M-28 0 A 28 28 0 0 1 28 0" fill="#fff" opacity="0.85"/>
      <path d="M-26 -6 A 28 28 0 0 1 26 -6" fill="#ffd977"/>
      <path d="M-22 -16 A 28 28 0 0 1 22 -16" fill="#2a6e97"/>
    </g>

    {/* Palm tree */}
    <g transform="translate(420,270)">
      <path d="M8 0 Q 12 60 6 130" stroke="#8a5a2e" strokeWidth="10" fill="none" strokeLinecap="round"/>
      <g fill="#3e8d53">
        <path d="M8 0 Q -40 -20 -60 10 Q -20 -6 8 0 Z"/>
        <path d="M8 0 Q 60 -22 80 8 Q 40 -8 8 0 Z"/>
        <path d="M8 0 Q -20 -50 10 -70 Q 14 -40 8 0 Z"/>
        <path d="M8 0 Q 36 -50 60 -36 Q 30 -24 8 0 Z"/>
        <path d="M8 0 Q -30 -36 -54 -30 Q -18 -20 8 0 Z"/>
      </g>
    </g>

    {/* Bucket & shovel */}
    <g transform="translate(320,400)">
      <path d="M0 0 L 52 0 L 46 36 L 6 36 Z" fill="#ffd977"/>
      <path d="M0 0 Q 26 -10 52 0" stroke="#e8b449" strokeWidth="3" fill="none"/>
      <rect x="18" y="6" width="16" height="16" fill="#fff" opacity="0.5"/>
    </g>

    {/* Kids (abstracted) */}
    <g transform="translate(180,330)">
      {/* kid 1 */}
      <circle cx="0" cy="0" r="14" fill="#f7c9a0"/>
      <path d="M-14 8 Q 0 30 14 8 L 18 40 L -18 40 Z" fill="#e94e3a"/>
      <rect x="-18" y="40" width="14" height="22" fill="#2a6e97"/>
      <rect x="4" y="40" width="14" height="22" fill="#2a6e97"/>
      <path d="M-16 -6 Q 0 -22 16 -6 L 14 -14 L -14 -14 Z" fill="#3a2a1a"/>
    </g>
    <g transform="translate(90,345)">
      <circle cx="0" cy="0" r="13" fill="#eab086"/>
      <path d="M-13 6 Q 0 26 13 6 L 17 36 L -17 36 Z" fill="#ffd977"/>
      <rect x="-16" y="36" width="13" height="20" fill="#3e8d53"/>
      <rect x="3" y="36" width="13" height="20" fill="#3e8d53"/>
      <path d="M-14 -4 Q 0 -20 14 -4 Q 10 -12 -10 -12 Z" fill="#5c3a1a"/>
      <circle cx="-14" cy="-10" r="6" fill="#5c3a1a"/>
      <circle cx="14" cy="-10" r="6" fill="#5c3a1a"/>
    </g>

    {/* Seagulls */}
    <g stroke="#2a3a50" strokeWidth="3" fill="none" strokeLinecap="round">
      <path d="M210 130 q 10 -12 22 0 q 10 -12 22 0"/>
      <path d="M260 170 q 8 -10 18 0 q 8 -10 18 0"/>
    </g>
  </svg>
);

const WaveDivider = ({color = "#ffffff", flip = false}) => (
  <svg className="wave-sep" viewBox="0 0 1440 80" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" style={{transform: flip ? 'scaleY(-1)' : 'none'}}>
    <path d="M0 40 C 240 10, 480 70, 720 40 S 1200 10, 1440 40 L 1440 80 L 0 80 Z" fill={color}/>
  </svg>
);

const SmallSun = ({size = 28}) => (
  <svg width={size} height={size} viewBox="0 0 28 28" aria-hidden>
    <circle cx="14" cy="14" r="6" fill="#ffb84d"/>
    {[0,1,2,3,4,5,6,7].map(i => {
      const a = (i * 45) * Math.PI / 180;
      const x1 = 14 + Math.cos(a)*9, y1 = 14 + Math.sin(a)*9;
      const x2 = 14 + Math.cos(a)*13, y2 = 14 + Math.sin(a)*13;
      return <line key={i} x1={x1} y1={y1} x2={x2} y2={y2} stroke="#ffb84d" strokeWidth="2" strokeLinecap="round"/>;
    })}
  </svg>
);

// Simple sparkle / decoration cluster
const Sparkles = ({className}) => (
  <svg className={className} width="120" height="80" viewBox="0 0 120 80" aria-hidden>
    <g fill="currentColor" opacity="0.8">
      <path d="M20 40 L 22 30 L 24 40 L 34 42 L 24 44 L 22 54 L 20 44 L 10 42 Z"/>
      <path d="M90 20 L 92 14 L 94 20 L 100 22 L 94 24 L 92 30 L 90 24 L 84 22 Z"/>
      <circle cx="70" cy="60" r="3"/>
    </g>
  </svg>
);

Object.assign(window, { HeroIllustration, WaveDivider, SmallSun, Sparkles });
