/* Reusable SVG motifs distilled from the BSH logo.
   Geometric/abstract — silhouettes that echo the world. */

const Mountains = ({ className = "", color = "currentColor", snow = "rgba(255,255,255,0.9)" }) => (
  <svg className={className} viewBox="0 0 800 240" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M0 240 L80 160 L140 200 L220 90 L290 170 L360 40 L430 180 L500 110 L580 170 L650 70 L720 200 L800 130 L800 240 Z" fill={color} />
    <path d="M340 70 L360 40 L385 75 L370 75 L360 60 L350 80 Z" fill={snow} opacity="0.9" />
    <path d="M205 110 L220 90 L240 120 L228 120 L220 105 L213 125 Z" fill={snow} opacity="0.9" />
    <path d="M635 95 L650 70 L675 110 L660 110 L650 88 L645 115 Z" fill={snow} opacity="0.9" />
  </svg>
);

const Wave = ({ className = "", color = "currentColor" }) => (
  <svg className={className} viewBox="0 0 800 200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M0 120 Q 100 40 200 100 T 400 100 T 600 100 T 800 100 L 800 200 L 0 200 Z" fill={color} opacity="0.85"/>
    <path d="M0 150 Q 100 90 200 140 T 400 140 T 600 140 T 800 140 L 800 200 L 0 200 Z" fill={color}/>
    <path d="M40 100 Q 80 70 120 90 T 200 90" stroke={color} strokeWidth="1.5" fill="none" opacity="0.5"/>
    <path d="M240 110 Q 280 80 320 100 T 400 100" stroke={color} strokeWidth="1.5" fill="none" opacity="0.5"/>
    <path d="M440 110 Q 480 80 520 100 T 600 100" stroke={color} strokeWidth="1.5" fill="none" opacity="0.5"/>
  </svg>
);

const CurlWave = ({ className = "", color = "currentColor", foam = "#F4EFE6" }) => (
  // Big curling wave like the logo's — nautilus spiral with foam crest
  <svg className={className} viewBox="0 0 400 320" xmlns="http://www.w3.org/2000/svg">
    <defs>
      <linearGradient id="curlBody" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0%" stopColor={color} stopOpacity="0.55"/>
        <stop offset="100%" stopColor={color} stopOpacity="1"/>
      </linearGradient>
      <linearGradient id="curlFoam" x1="0" y1="0" x2="1" y2="0">
        <stop offset="0%" stopColor={foam} stopOpacity="1"/>
        <stop offset="100%" stopColor={foam} stopOpacity="0.6"/>
      </linearGradient>
    </defs>
    {/* outer wave body */}
    <path d="M10 310 Q 10 90 200 90 Q 360 90 360 230 Q 360 290 295 295 Q 245 296 245 245 Q 245 200 200 200 Q 150 200 145 260 Q 140 310 80 310 Z" fill="url(#curlBody)"/>
    {/* foam crest layers */}
    <path d="M50 280 Q 70 130 200 120 Q 320 115 340 220" stroke="url(#curlFoam)" strokeWidth="6" fill="none" opacity="0.9"/>
    <path d="M70 270 Q 90 160 210 150 Q 310 150 325 215" stroke={foam} strokeWidth="2" fill="none" opacity="0.55"/>
    {/* inner curl barrel */}
    <path d="M155 250 Q 155 215 195 215 Q 235 215 235 250" stroke={foam} strokeWidth="2.5" fill="none" opacity="0.7"/>
    {/* spray dots */}
    <circle cx="200" cy="170" r="2.5" fill={foam} opacity="0.85"/>
    <circle cx="240" cy="190" r="2" fill={foam} opacity="0.7"/>
    <circle cx="170" cy="195" r="1.8" fill={foam} opacity="0.7"/>
    <circle cx="120" cy="220" r="2.2" fill={foam} opacity="0.6"/>
    <circle cx="280" cy="155" r="1.6" fill={foam} opacity="0.6"/>
    <circle cx="90" cy="240" r="1.4" fill={foam} opacity="0.5"/>
    <circle cx="305" cy="180" r="1.2" fill={foam} opacity="0.5"/>
  </svg>
);

const Zeppelin = ({ className = "", color = "currentColor", accent = "rgba(255,255,255,0.25)" }) => (
  <svg className={className} viewBox="0 0 220 90" xmlns="http://www.w3.org/2000/svg">
    {/* main envelope */}
    <ellipse cx="100" cy="40" rx="86" ry="24" fill={color}/>
    {/* highlight band */}
    <ellipse cx="100" cy="34" rx="80" ry="18" fill="none" stroke={accent} strokeWidth="0.6"/>
    <line x1="20" y1="40" x2="186" y2="40" stroke={accent} strokeWidth="0.6"/>
    {/* nose detail */}
    <ellipse cx="14" cy="40" rx="6" ry="6" fill={color}/>
    {/* tail fins */}
    <path d="M186 40 L210 30 L210 50 Z" fill={color}/>
    <path d="M186 40 L200 22 L196 40 Z" fill={color}/>
    <path d="M186 40 L200 58 L196 40 Z" fill={color}/>
    {/* gondola */}
    <rect x="84" y="62" width="32" height="9" rx="2" fill={color}/>
    <line x1="90" y1="62" x2="90" y2="56" stroke={color} strokeWidth="1.2"/>
    <line x1="110" y1="62" x2="110" y2="56" stroke={color} strokeWidth="1.2"/>
    {/* gondola windows */}
    <circle cx="92" cy="66" r="1" fill={accent}/>
    <circle cx="100" cy="66" r="1" fill={accent}/>
    <circle cx="108" cy="66" r="1" fill={accent}/>
  </svg>
);

const Sun = ({ className = "", color = "currentColor" }) => (
  <svg className={className} viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    <defs>
      <radialGradient id="sunGrad" cx="0.5" cy="0.5" r="0.5">
        <stop offset="0%" stopColor={color} stopOpacity="1"/>
        <stop offset="60%" stopColor={color} stopOpacity="0.6"/>
        <stop offset="100%" stopColor={color} stopOpacity="0"/>
      </radialGradient>
    </defs>
    <circle cx="100" cy="100" r="100" fill="url(#sunGrad)"/>
    <circle cx="100" cy="100" r="45" fill={color}/>
  </svg>
);

const Pines = ({ className = "", color = "currentColor" }) => (
  <svg className={className} viewBox="0 0 600 100" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg">
    {[20, 70, 130, 195, 260, 320, 385, 450, 510, 565].map((x, i) => {
      const h = 60 + ((i * 17) % 30);
      const w = 22;
      return (
        <path key={i} d={`M${x} 100 L${x - w/2} ${100 - h*0.7} L${x - 3} ${100 - h*0.55} L${x - w/2 + 4} ${100 - h*0.4} L${x - 2} ${100 - h*0.25} L${x} ${100 - h} L${x + 2} ${100 - h*0.25} L${x + w/2 - 4} ${100 - h*0.4} L${x + 3} ${100 - h*0.55} L${x + w/2} ${100 - h*0.7} Z`} fill={color}/>
      );
    })}
  </svg>
);

const Compass = ({ className = "", color = "currentColor" }) => (
  <svg className={className} viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
    <circle cx="50" cy="50" r="48" fill="none" stroke={color} strokeWidth="1"/>
    <circle cx="50" cy="50" r="36" fill="none" stroke={color} strokeWidth="0.5" opacity="0.5"/>
    {[0, 45, 90, 135, 180, 225, 270, 315].map(a => {
      const rad = (a * Math.PI) / 180;
      const x1 = 50 + Math.cos(rad) * 40;
      const y1 = 50 + Math.sin(rad) * 40;
      const x2 = 50 + Math.cos(rad) * 47;
      const y2 = 50 + Math.sin(rad) * 47;
      return <line key={a} x1={x1} y1={y1} x2={x2} y2={y2} stroke={color} strokeWidth={a % 90 === 0 ? 1.5 : 0.5}/>;
    })}
    <path d="M50 18 L54 50 L50 82 L46 50 Z" fill={color} opacity="0.85"/>
    <path d="M50 18 L54 50 L50 50 Z" fill={color}/>
    <circle cx="50" cy="50" r="2.5" fill={color}/>
  </svg>
);

const Cloud = ({ className = "", color = "currentColor", opacity = 1 }) => (
  <svg className={className} viewBox="0 0 200 80" xmlns="http://www.w3.org/2000/svg">
    <path d="M30 60 Q 10 60 10 45 Q 10 28 30 30 Q 35 12 60 14 Q 85 8 95 30 Q 120 22 130 40 Q 155 38 160 55 Q 175 55 175 65 L 30 65 Z" fill={color} opacity={opacity}/>
  </svg>
);

const Surfboard = ({ className = "", color = "currentColor", stripe = "#F4EFE6" }) => (
  // a longboard, side-on, with a center stripe and fin
  <svg className={className} viewBox="0 0 320 80" xmlns="http://www.w3.org/2000/svg">
    <path d="M10 40 Q 60 18 160 18 Q 270 18 308 38 Q 312 40 308 42 Q 270 62 160 62 Q 60 62 10 42 Q 6 40 10 40 Z" fill={color}/>
    <path d="M30 40 Q 80 30 160 30 Q 250 30 295 40 Q 250 50 160 50 Q 80 50 30 40 Z" fill={stripe} opacity="0.5"/>
    <path d="M210 62 L 224 78 L 200 70 Z" fill={color}/>
    <circle cx="78" cy="40" r="2" fill={stripe} opacity="0.7"/>
    <circle cx="240" cy="40" r="2" fill={stripe} opacity="0.7"/>
  </svg>
);

const Surfer = ({ className = "", color = "currentColor", board = "#F4EFE6" }) => (
  // stylized surfer + board, in profile, riding
  <svg className={className} viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg">
    {/* board */}
    <ellipse cx="100" cy="160" rx="78" ry="9" fill={board}/>
    <ellipse cx="100" cy="160" rx="78" ry="9" fill="none" stroke={color} strokeWidth="1" opacity="0.4"/>
    <path d="M168 160 L 184 174 L 160 168 Z" fill={color} opacity="0.6"/>
    {/* surfer body — crouched */}
    <path d="M85 155 Q 88 130 100 110 Q 110 100 115 110 L 118 130 Q 122 145 118 158 Z" fill={color}/>
    {/* head */}
    <circle cx="108" cy="98" r="10" fill={color}/>
    {/* arms outstretched */}
    <path d="M88 130 Q 70 128 62 138" stroke={color} strokeWidth="5" fill="none" strokeLinecap="round"/>
    <path d="M118 122 Q 138 116 150 124" stroke={color} strokeWidth="5" fill="none" strokeLinecap="round"/>
    {/* trailing legs/back */}
    <path d="M118 158 Q 130 156 138 158" stroke={color} strokeWidth="6" fill="none" strokeLinecap="round"/>
  </svg>
);

const StarBurst = ({ className = "", color = "currentColor" }) => (
  <svg className={className} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
    <path d="M12 0 L13.5 10.5 L24 12 L13.5 13.5 L12 24 L10.5 13.5 L0 12 L10.5 10.5 Z" fill={color}/>
  </svg>
);

Object.assign(window, { Mountains, Wave, CurlWave, Zeppelin, Sun, Pines, Compass, Cloud, Surfer, Surfboard, StarBurst });
