// Student theme: Ocean Explorer mascot, greeting, top bar, and decorations.
const StxOceanWave = () => (
  <svg
    viewBox="0 0 24 24"
    width="22"
    height="22"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    aria-hidden="true"
  >
    <path
      d="M2 12C4.5 12 5.5 9 8 9C10.5 9 11.5 12 14 12C16.5 12 17.5 9 20 9C21.5 9 22 10 22 10"
      stroke="#ffffff"
      strokeWidth="2.5"
      strokeLinecap="round"
      strokeLinejoin="round"
    />
    <path
      d="M2 16C4.5 16 5.5 13 8 13C10.5 13 11.5 16 14 16C16.5 16 17.5 13 20 13C21.5 13 22 14 22 14"
      stroke="#ffffff"
      strokeWidth="2.5"
      strokeLinecap="round"
      strokeLinejoin="round"
      opacity="0.75"
    />
  </svg>
);

const StxOceanCoralIcon = () => (
  <svg
    className="stx-ocean-coral-icon"
    viewBox="0 0 32 32"
    width="28"
    height="28"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    aria-hidden="true"
  >
    <path
      d="M16 28V14M16 20C13 19 10 16 9 12M9 12C8 9 9 7 10 7C11.5 7 12 9 12 12M16 16C18.5 14.5 21 14 23 10M23 10C24 8 25.5 8 26 9.5C26.5 11 24.5 13 23 14M16 14C15 10 16 7 17.5 6C19 5 20 7 19.5 9.5M16 28H12M16 28H20"
      stroke="#ff7185"
      strokeWidth="3"
      strokeLinecap="round"
      strokeLinejoin="round"
    />
    <circle cx="10" cy="6" r="2.5" fill="#ff7185"/>
    <circle cx="18" cy="5" r="2.5" fill="#ff7185"/>
    <circle cx="26" cy="8.5" r="2.5" fill="#ff7185"/>
  </svg>
);

const StxOceanFish = () => (
  <svg
    className="stx-ocean-fish"
    viewBox="0 0 130 90"
    width="110"
    height="76"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    aria-hidden="true"
  >
    <defs>
      <linearGradient id="stx-fish-orange" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="#ffa05c"/>
        <stop offset="45%" stopColor="#ff7828"/>
        <stop offset="100%" stopColor="#e04e0b"/>
      </linearGradient>
      <filter id="stx-fish-shadow" x="-10%" y="-10%" width="120%" height="120%">
        <feDropShadow dx="0" dy="4" stdDeviation="3" floodColor="#042838" floodOpacity="0.35"/>
      </filter>
    </defs>

    <g filter="url(#stx-fish-shadow)">
      <path
        d="M32 45 L12 24 C9 21 5 24 6 30 L12 45 L6 60 C5 66 9 69 12 66 L32 45 Z"
        fill="url(#stx-fish-orange)"
        stroke="#1e293b"
        strokeWidth="2.2"
        strokeLinejoin="round"
      />
      <path d="M12 32 L8 45 L12 58" stroke="#ffffff" strokeWidth="3" strokeLinecap="round"/>

      <path
        d="M48 24 C56 10 74 10 84 20 Z"
        fill="url(#stx-fish-orange)"
        stroke="#1e293b"
        strokeWidth="2.2"
        strokeLinejoin="round"
      />
      <path d="M54 16 Q65 12 76 17" stroke="#ffffff" strokeWidth="2.5" strokeLinecap="round"/>

      <path
        d="M50 66 C56 78 70 78 76 68 Z"
        fill="url(#stx-fish-orange)"
        stroke="#1e293b"
        strokeWidth="2.2"
        strokeLinejoin="round"
      />

      <ellipse
        cx="70"
        cy="45"
        rx="42"
        ry="26"
        fill="url(#stx-fish-orange)"
        stroke="#1e293b"
        strokeWidth="2.5"
      />

      <path
        d="M38 29 C34 38 34 52 38 61 C42 60 44 54 43 45 C43 36 42 30 38 29 Z"
        fill="#ffffff"
        stroke="#1e293b"
        strokeWidth="2"
      />
      <path
        d="M62 20 C57 32 57 58 62 70 C69 69 72 61 70 45 C70 29 69 21 62 20 Z"
        fill="#ffffff"
        stroke="#1e293b"
        strokeWidth="2"
      />
      <path
        d="M90 21 C85 33 85 57 90 69 C96 67 98 60 97 45 C97 30 96 23 90 21 Z"
        fill="#ffffff"
        stroke="#1e293b"
        strokeWidth="2"
      />

      <path
        d="M64 47 C69 58 63 68 54 66 C50 64 52 53 64 47 Z"
        fill="#ffa86b"
        stroke="#1e293b"
        strokeWidth="2.2"
        strokeLinejoin="round"
      />
      <path d="M57 56 Q61 61 65 52" stroke="#1e293b" strokeWidth="1.5" strokeLinecap="round"/>

      <circle cx="98" cy="38" r="7" fill="#ffffff" stroke="#1e293b" strokeWidth="2"/>
      <circle cx="99.5" cy="38" r="4.2" fill="#0f172a"/>
      <circle cx="98" cy="36" r="1.8" fill="#ffffff"/>
      <circle cx="101" cy="39.5" r="0.9" fill="#ffffff"/>

      <path
        d="M106 46 Q102 51 98 48"
        stroke="#7c2d12"
        strokeWidth="2"
        strokeLinecap="round"
        fill="none"
      />
    </g>
  </svg>
);

const StxOceanTurtle = () => (
  <svg
    className="stx-ocean-turtle"
    viewBox="0 0 320 260"
    width="250"
    height="205"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
    aria-hidden="true"
  >
    <defs>
      <linearGradient id="stx-turtle-skin" x1="0.2" y1="0" x2="0.8" y2="1">
        <stop offset="0%" stopColor="#a7f3d0"/>
        <stop offset="35%" stopColor="#6ee7b7"/>
        <stop offset="80%" stopColor="#34d399"/>
        <stop offset="100%" stopColor="#10b981"/>
      </linearGradient>

      <linearGradient id="stx-turtle-skin-dark" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="#34d399"/>
        <stop offset="100%" stopColor="#059669"/>
      </linearGradient>

      <radialGradient id="stx-turtle-shell-radial" cx="45%" cy="35%" r="65%">
        <stop offset="0%" stopColor="#34d399"/>
        <stop offset="50%" stopColor="#10b981"/>
        <stop offset="85%" stopColor="#059669"/>
        <stop offset="100%" stopColor="#047857"/>
      </radialGradient>

      <linearGradient id="stx-scute-fill" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="#6ee7b7"/>
        <stop offset="50%" stopColor="#34d399"/>
        <stop offset="100%" stopColor="#10b981"/>
      </linearGradient>

      <linearGradient id="stx-turtle-belly" x1="0" y1="0" x2="0" y2="1">
        <stop offset="0%" stopColor="#fffbeb"/>
        <stop offset="70%" stopColor="#fef3c7"/>
        <stop offset="100%" stopColor="#fde68a"/>
      </linearGradient>

      <linearGradient id="stx-goggle-glass" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0%" stopColor="#e0f7fa" stopOpacity="0.95"/>
        <stop offset="45%" stopColor="#67e8f9" stopOpacity="0.85"/>
        <stop offset="100%" stopColor="#06b6d4" stopOpacity="0.92"/>
      </linearGradient>

      <filter id="stx-turtle-shadow" x="-15%" y="-15%" width="130%" height="130%">
        <feDropShadow dx="0" dy="8" stdDeviation="6" floodColor="#042a3d" floodOpacity="0.4"/>
      </filter>
    </defs>

    <g filter="url(#stx-turtle-shadow)">
      <path
        d="M92 148 C74 162 58 158 50 150 C44 144 52 130 68 128 C82 126 90 138 92 148 Z"
        fill="url(#stx-turtle-skin-dark)"
        stroke="#065f46"
        strokeWidth="3"
        strokeLinejoin="round"
      />

      <path
        d="M182 86 C194 56 216 36 238 34 C248 33 252 44 240 60 C225 80 204 92 188 94 Z"
        fill="url(#stx-turtle-skin-dark)"
        stroke="#065f46"
        strokeWidth="3"
        strokeLinejoin="round"
      />

      <ellipse
        cx="148"
        cy="166"
        rx="56"
        ry="32"
        fill="url(#stx-turtle-belly)"
        stroke="#d97706"
        strokeWidth="2.5"
      />

      <g className="stx-turtle-shell-group">
        <path
          d="M102 162 C78 132 84 86 128 56 C170 30 212 42 232 78 C248 112 236 156 200 182 C158 208 118 192 102 162 Z"
          fill="url(#stx-turtle-shell-radial)"
          stroke="#064e3b"
          strokeWidth="4"
          strokeLinejoin="round"
        />

        <path d="M102 162 L120 148 M128 56 L136 74 M232 78 L220 86 M200 182 L182 164 M140 188 L152 166 M86 116 L108 120" stroke="#065f46" strokeWidth="2.5"/>

        <path
          d="M136 74 L162 62 L184 78 L174 104 L146 108 L130 92 Z"
          fill="url(#stx-scute-fill)"
          stroke="#064e3b"
          strokeWidth="3"
          strokeLinejoin="round"
        />
        <path
          d="M162 62 L190 56 L208 72 L200 90 L184 78 Z"
          fill="url(#stx-scute-fill)"
          stroke="#064e3b"
          strokeWidth="2.8"
          strokeLinejoin="round"
        />
        <path
          d="M174 104 L184 78 L200 90 L194 120 L168 132 Z"
          fill="url(#stx-scute-fill)"
          stroke="#064e3b"
          strokeWidth="2.8"
          strokeLinejoin="round"
        />
        <path
          d="M146 108 L174 104 L168 132 L140 138 L124 122 Z"
          fill="url(#stx-scute-fill)"
          stroke="#064e3b"
          strokeWidth="2.8"
          strokeLinejoin="round"
        />

        <path
          d="M136 68 C158 52 186 52 204 64"
          stroke="#ffffff"
          strokeWidth="3.5"
          strokeLinecap="round"
          opacity="0.55"
        />
      </g>

      <path
        d="M116 182 C106 208 92 220 78 216 C68 212 70 198 84 188 C98 178 110 176 116 182 Z"
        fill="url(#stx-turtle-skin)"
        stroke="#065f46"
        strokeWidth="3"
        strokeLinejoin="round"
      />

      <g>
        <path
          d="M192 144 C220 172 264 196 292 186 C304 182 304 168 284 152 C252 128 220 114 196 120 Z"
          fill="url(#stx-turtle-skin)"
          stroke="#065f46"
          strokeWidth="3.5"
          strokeLinejoin="round"
        />
        <circle cx="244" cy="154" r="3.5" fill="#059669" opacity="0.35"/>
        <circle cx="262" cy="166" r="3" fill="#059669" opacity="0.35"/>
        <circle cx="276" cy="174" r="2.5" fill="#059669" opacity="0.35"/>
      </g>

      <g className="stx-turtle-head-group">
        <path
          d="M190 94 C200 86 212 86 220 92 C228 98 226 112 214 118 C206 120 196 112 190 94 Z"
          fill="url(#stx-turtle-skin)"
        />

        <ellipse
          cx="234"
          cy="96"
          rx="38"
          ry="34"
          fill="url(#stx-turtle-skin)"
          stroke="#065f46"
          strokeWidth="3.5"
        />

        <circle cx="248" cy="114" r="7.5" fill="#ff7185" opacity="0.45"/>

        <ellipse cx="242" cy="90" rx="10" ry="13" fill="#0f172a"/>
        <circle cx="239" cy="85" r="4.2" fill="#ffffff"/>
        <circle cx="245" cy="95" r="2.2" fill="#ffffff"/>

        <path
          d="M238 110 Q250 120 262 108"
          stroke="#065f46"
          strokeWidth="3"
          strokeLinecap="round"
          fill="#065f46"
        />
        <path
          d="M245 115 Q250 119 255 115"
          fill="#ff7185"
        />

        <g className="stx-turtle-goggles">
          <path
            d="M200 86 Q215 74 256 74"
            stroke="#0284c7"
            strokeWidth="5"
            strokeLinecap="round"
          />

          <rect
            x="214"
            y="66"
            width="22"
            height="20"
            rx="8"
            fill="url(#stx-goggle-glass)"
            stroke="#0284c7"
            strokeWidth="3.5"
            transform="rotate(-10 225 76)"
          />

          <rect
            x="240"
            y="62"
            width="22"
            height="20"
            rx="8"
            fill="url(#stx-goggle-glass)"
            stroke="#0284c7"
            strokeWidth="3.5"
            transform="rotate(-5 251 72)"
          />

          <path d="M233 73 H242" stroke="#0284c7" strokeWidth="4" strokeLinecap="round"/>

          <path
            d="M218 72 L224 72 M220 76 L226 76"
            stroke="#ffffff"
            strokeWidth="2"
            strokeLinecap="round"
            opacity="0.9"
          />
          <path
            d="M244 68 L250 68 M246 72 L252 72"
            stroke="#ffffff"
            strokeWidth="2"
            strokeLinecap="round"
            opacity="0.9"
          />
        </g>
      </g>
    </g>
  </svg>
);

const StxOceanHeroGreeting = ({ name, level }) => (
  <div className="stx-ocean-greeting">
    <div className="stx-ocean-greeting-content">
      <h1 className="stx-page-title stx-ocean-greeting-title">
        Hey {name},
        <br/>
        let’s learn!
      </h1>
      <p className="stx-ocean-greeting-sub">Level {level} Explorer</p>
    </div>
  </div>
);

const StxOceanTopBar = ({ session, logout, student, loading, route, go }) => (
  <header className="stx-topbar stx-ocean-topbar">
    <div className="stx-brand">
      <span className="stx-brand-tile stx-ocean-brand-tile" aria-hidden="true">
        <StxOceanWave/>
      </span>
      <b>EpiqMinds</b>
      <StxChip className="stx-ocean-chip">STUDENT</StxChip>
    </div>
    <StxNav placement="top" route={route} go={go}/>
    <div className="stx-ocean-topbar-actions">
      {typeof NotificationBell !== "undefined" && (
        <div className="stx-ocean-bell-wrapper">
          <NotificationBell session={session}/>
        </div>
      )}
      <StxAccountMenu
        session={session}
        logout={logout}
        student={student}
        loading={loading}
        route={route}
        go={go}
        compact
        triggerVariant="avatar"
      />
    </div>
  </header>
);

const StxOceanDecorations = () => (
  <div className="stx-ocean-decorations" aria-hidden="true">
    {/* Subtle animated rising bubbles over the artwork */}
    <div className="stx-ocean-bubble stx-bubble-1"/>
    <div className="stx-ocean-bubble stx-bubble-2"/>
    <div className="stx-ocean-bubble stx-bubble-3"/>
    <div className="stx-ocean-bubble stx-bubble-4"/>
    <div className="stx-ocean-bubble stx-bubble-5"/>
    <div className="stx-ocean-bubble stx-bubble-6"/>
    <div className="stx-ocean-bubble stx-bubble-7"/>
    <div className="stx-ocean-bubble stx-bubble-8"/>
    <div className="stx-ocean-bubble stx-bubble-9"/>
    <div className="stx-ocean-bubble stx-bubble-10"/>
  </div>
);

Object.assign(window, {
  StxOceanWave,
  StxOceanCoralIcon,
  StxOceanFish,
  StxOceanTurtle,
  StxOceanHeroGreeting,
  StxOceanTopBar,
  StxOceanDecorations,
});
