import React from 'react';

// 1. Learning Workspace Illustration (Editorial Hero & Learning overview)
export function LearningWorkspaceIllustration({ className = 'w-full h-auto' }: { className?: string }) {
  return (
    <svg viewBox="0 0 600 420" fill="none" xmlns="http://www.w3.org/2000/svg" className={className} aria-label="PANIA Online Learning Workspace Illustration">
      <defs>
        <linearGradient id="forestGrad" x1="0%" y1="0%" x2="100%" y2="100%">
          <stop offset="0%" stopColor="#0B4035" />
          <stop offset="100%" stopColor="#072C24" />
        </linearGradient>
        <linearGradient id="citronGlow" x1="0%" y1="0%" x2="100%" y2="0%">
          <stop offset="0%" stopColor="#D5E64D" />
          <stop offset="100%" stopColor="#E2F06E" />
        </linearGradient>
        <filter id="softShadow" x="-10%" y="-10%" width="120%" height="120%">
          <feDropShadow dx="0" dy="8" stdDeviation="12" floodColor="#0B4035" floodOpacity="0.08" />
        </filter>
      </defs>

      {/* Background Soft Backdrop */}
      <rect x="20" y="20" width="560" height="380" rx="20" fill="#F6F7F2" />
      <circle cx="510" cy="80" r="45" fill="#D5E64D" fillOpacity="0.35" />
      <circle cx="90" cy="340" r="60" fill="#E8E4F3" fillOpacity="0.6" />

      {/* Main Terminal / Code & Practice Window */}
      <g filter="url(#softShadow)">
        <rect x="60" y="50" width="360" height="240" rx="14" fill="#0B4035" />
        
        {/* Window controls */}
        <circle cx="85" cy="72" r="5" fill="#A95036" />
        <circle cx="100" cy="72" r="5" fill="#D5E64D" />
        <circle cx="115" cy="72" r="5" fill="#345A8A" />
        <text x="140" y="76" fill="#F6F7F2" fillOpacity="0.6" fontSize="11" fontFamily="monospace">pania-academy / practical-session</text>

        {/* Code / Exercise lines */}
        <rect x="85" y="100" width="140" height="8" rx="4" fill="#D5E64D" />
        <rect x="85" y="118" width="220" height="6" rx="3" fill="#F6F7F2" fillOpacity="0.4" />
        <rect x="105" y="132" width="180" height="6" rx="3" fill="#F6F7F2" fillOpacity="0.7" />
        <rect x="105" y="146" width="240" height="6" rx="3" fill="#345A8A" fillOpacity="0.9" />
        <rect x="85" y="160" width="160" height="6" rx="3" fill="#F6F7F2" fillOpacity="0.3" />

        {/* Live Lab execution box */}
        <rect x="85" y="185" width="310" height="80" rx="8" fill="#072C24" />
        <text x="100" y="208" fill="#D5E64D" fontSize="11" fontFamily="monospace">$ pania-verify --module aws-vpc --status</text>
        <text x="100" y="228" fill="#F6F7F2" fillOpacity="0.9" fontSize="11" fontFamily="monospace">[OK] Subnet isolation verified (CIDR: 10.0.1.0/24)</text>
        <text x="100" y="248" fill="#D5E64D" fontSize="11" fontFamily="monospace">[PASS] Security group rules validated</text>
      </g>

      {/* Floating Live Video & Mentorship Indicator Card */}
      <g filter="url(#softShadow)">
        <rect x="330" y="130" width="210" height="150" rx="14" fill="#FFFFFF" stroke="#E5E7DC" strokeWidth="1.5" />
        {/* Header tag */}
        <rect x="345" y="145" width="80" height="18" rx="9" fill="#0B4035" />
        <circle cx="355" cy="154" r="3" fill="#D5E64D" />
        <text x="363" y="157" fill="#FFFFFF" fontSize="9" fontWeight="600" fontFamily="sans-serif">LIVE MENTOR</text>

        {/* Channels */}
        <text x="345" y="182" fill="#0B4035" fontSize="13" fontWeight="700" fontFamily="Georgia, serif">Guided Online Room</text>
        <text x="345" y="198" fill="#667085" fontSize="10" fontFamily="sans-serif">Zoom · Meet · WhatsApp</text>

        {/* Interactive progress pills */}
        <g transform="translate(345, 212)">
          <rect x="0" y="0" width="180" height="6" rx="3" fill="#F6F7F2" />
          <rect x="0" y="0" width="135" height="6" rx="3" fill="#0B4035" />
        </g>
        <text x="345" y="235" fill="#345A8A" fontSize="10" fontWeight="600" fontFamily="sans-serif">Module 3 of 4: Applied Practical</text>
        <text x="345" y="255" fill="#207A78" fontSize="10" fontFamily="sans-serif">Mentor feedback available</text>
      </g>

      {/* Bottom Milestone Card */}
      <g filter="url(#softShadow)">
        <rect x="110" y="305" width="380" height="70" rx="12" fill="#FFFFFF" stroke="#E5E7DC" strokeWidth="1" />
        <circle cx="145" cy="340" r="18" fill="#F3F8D3" />
        <path d="M138 340L143 345L152 335" stroke="#0B4035" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round" />
        <text x="175" y="334" fill="#0B4035" fontSize="13" fontWeight="700" fontFamily="Georgia, serif">Skills to Opportunity Framework</text>
        <text x="175" y="352" fill="#667085" fontSize="11" fontFamily="sans-serif">Training  →  Career Guidance  →  Mentorship  →  Job Linkages</text>
      </g>
    </svg>
  );
}

// 2. Cloud Architecture Multi-Cloud Illustration (AWS, Google Cloud, Azure)
export function CloudArchitectureIllustration({ className = 'w-full h-auto' }: { className?: string }) {
  return (
    <svg viewBox="0 0 540 340" fill="none" xmlns="http://www.w3.org/2000/svg" className={className} aria-label="Multi-Cloud Architecture Diagram: AWS, GCP, Azure">
      <defs>
        <filter id="cloudShadow" x="-10%" y="-10%" width="120%" height="120%">
          <feDropShadow dx="0" dy="6" stdDeviation="8" floodColor="#0B4035" floodOpacity="0.06" />
        </filter>
      </defs>

      {/* Cloud perimeter outline */}
      <rect x="15" y="15" width="510" height="310" rx="16" fill="#F6F7F2" stroke="#E5E7DC" strokeWidth="1.5" />
      <text x="35" y="44" fill="#0B4035" fontSize="12" fontWeight="700" letterSpacing="0.05em" fontFamily="sans-serif">
        MULTI-CLOUD INFRASTRUCTURE · PRACTICAL TRAINING LABS
      </text>

      {/* Connecting Grid Lines */}
      <path d="M120 160 H420 M270 90 V250" stroke="#0B4035" strokeOpacity="0.15" strokeDasharray="4 4" strokeWidth="1.5" />

      {/* Central Architecture Hub */}
      <circle cx="270" cy="170" r="32" fill="#0B4035" filter="url(#cloudShadow)" />
      <circle cx="270" cy="170" r="16" fill="#D5E64D" />
      <text x="270" y="218" textAnchor="middle" fill="#0B4035" fontSize="11" fontWeight="700" fontFamily="sans-serif">Unified VPC / Transit Gateway</text>

      {/* Node 1: AWS Node (Left) */}
      <g filter="url(#cloudShadow)">
        <rect x="40" y="115" width="135" height="110" rx="12" fill="#FFFFFF" stroke="#0B4035" strokeWidth="1.5" />
        <rect x="52" y="128" width="50" height="18" rx="4" fill="#F3F8D3" />
        <text x="60" y="141" fill="#0B4035" fontSize="10" fontWeight="700" fontFamily="sans-serif">AWS</text>
        <text x="52" y="165" fill="#0B4035" fontSize="13" fontWeight="700" fontFamily="Georgia, serif">IAM · EC2 · S3</text>
        <text x="52" y="183" fill="#667085" fontSize="10" fontFamily="sans-serif">VPC & RDS Workflows</text>
        <circle cx="150" cy="138" r="6" fill="#D5E64D" />
      </g>

      {/* Node 2: Google Cloud Node (Top Right) */}
      <g filter="url(#cloudShadow)">
        <rect x="360" y="55" width="140" height="95" rx="12" fill="#FFFFFF" stroke="#345A8A" strokeWidth="1.5" />
        <rect x="372" y="68" width="75" height="18" rx="4" fill="#EBF1FA" />
        <text x="380" y="81" fill="#345A8A" fontSize="10" fontWeight="700" fontFamily="sans-serif">GOOGLE CLOUD</text>
        <text x="372" y="105" fill="#0B4035" fontSize="13" fontWeight="700" fontFamily="Georgia, serif">GKE · BigQuery</text>
        <text x="372" y="123" fill="#667085" fontSize="10" fontFamily="sans-serif">Cloud Run & IAM</text>
      </g>

      {/* Node 3: Microsoft Azure Node (Bottom Right) */}
      <g filter="url(#cloudShadow)">
        <rect x="360" y="185" width="140" height="95" rx="12" fill="#FFFFFF" stroke="#207A78" strokeWidth="1.5" />
        <rect x="372" y="198" width="80" height="18" rx="4" fill="#E8F4F3" />
        <text x="380" y="211" fill="#207A78" fontSize="10" fontWeight="700" fontFamily="sans-serif">AZURE</text>
        <text x="372" y="235" fill="#0B4035" fontSize="13" fontWeight="700" fontFamily="Georgia, serif">Entra ID · VMs</text>
        <text x="372" y="253" fill="#667085" fontSize="10" fontFamily="sans-serif">VNet & App Services</text>
      </g>

      {/* Legend / Status */}
      <g transform="translate(40, 275)">
        <circle cx="6" cy="6" r="4" fill="#D5E64D" />
        <text x="18" y="10" fill="#0B4035" fontSize="11" fontFamily="sans-serif">Distinct cloud provider curricula: AWS, GCP & Azure</text>
      </g>
    </svg>
  );
}

// 3. AI & Data Connections Illustration
export function AIConnectionsIllustration({ className = 'w-full h-auto' }: { className?: string }) {
  return (
    <svg viewBox="0 0 540 340" fill="none" xmlns="http://www.w3.org/2000/svg" className={className} aria-label="AI Connections and Data Annotation Pipeline">
      <rect x="15" y="15" width="510" height="310" rx="16" fill="#F6F7F2" stroke="#E5E7DC" strokeWidth="1.5" />
      <text x="35" y="44" fill="#0B4035" fontSize="12" fontWeight="700" letterSpacing="0.05em" fontFamily="sans-serif">
        AI CONCEPTS · DATA SCIENCE · ANNOTATION MASTERY
      </text>

      {/* Neural Network Nodes */}
      <g stroke="#0B4035" strokeOpacity="0.2" strokeWidth="1.5">
        <line x1="80" y1="120" x2="180" y2="90" />
        <line x1="80" y1="120" x2="180" y2="170" />
        <line x1="80" y1="200" x2="180" y2="170" />
        <line x1="80" y1="200" x2="180" y2="240" />
        <line x1="180" y1="90" x2="290" y2="130" />
        <line x1="180" y1="170" x2="290" y2="130" />
        <line x1="180" y1="170" x2="290" y2="210" />
        <line x1="180" y1="240" x2="290" y2="210" />
      </g>

      {/* Input Nodes */}
      <circle cx="80" cy="120" r="14" fill="#FFFFFF" stroke="#0B4035" strokeWidth="2" />
      <circle cx="80" cy="120" r="5" fill="#D5E64D" />
      <circle cx="80" cy="200" r="14" fill="#FFFFFF" stroke="#0B4035" strokeWidth="2" />
      <circle cx="80" cy="200" r="5" fill="#345A8A" />

      {/* Middle Layer */}
      <circle cx="180" cy="90" r="16" fill="#0B4035" />
      <circle cx="180" cy="170" r="16" fill="#0B4035" />
      <circle cx="180" cy="240" r="16" fill="#0B4035" />
      <text x="180" y="174" textAnchor="middle" fill="#D5E64D" fontSize="10" fontFamily="sans-serif" fontWeight="700">ML</text>

      {/* Data Annotation Sample Box (Right Card) */}
      <g>
        <rect x="310" y="80" width="185" height="180" rx="12" fill="#FFFFFF" stroke="#E5E7DC" strokeWidth="1.5" />
        <rect x="325" y="95" width="155" height="95" rx="8" fill="#F6F7F2" />
        
        {/* 2D Bounding Box */}
        <rect x="340" y="110" width="70" height="50" rx="2" fill="none" stroke="#A95036" strokeWidth="2" strokeDasharray="3 3" />
        <rect x="340" y="98" width="45" height="12" rx="2" fill="#A95036" />
        <text x="343" y="107" fill="#FFFFFF" fontSize="8" fontWeight="700" fontFamily="sans-serif">Vehicle [0.98]</text>

        {/* 3D Cuboid hint */}
        <polygon points="420,125 450,115 470,122 440,132" fill="#D5E64D" fillOpacity="0.6" stroke="#0B4035" strokeWidth="1.5" />
        <polygon points="420,125 440,132 440,150 420,143" fill="#D5E64D" fillOpacity="0.4" stroke="#0B4035" strokeWidth="1.5" />
        <polygon points="440,132 470,122 470,140 440,150" fill="#D5E64D" fillOpacity="0.5" stroke="#0B4035" strokeWidth="1.5" />

        <text x="325" y="210" fill="#0B4035" fontSize="12" fontWeight="700" fontFamily="Georgia, serif">Precision Ground Truth</text>
        <text x="325" y="226" fill="#667085" fontSize="10" fontFamily="sans-serif">Image · Audio · 3D Point Cloud</text>
        <text x="325" y="244" fill="#207A78" fontSize="10" fontWeight="600" fontFamily="sans-serif">Applied Workshop Training Data</text>
      </g>
    </svg>
  );
}

// 4. Cybersecurity Shield Illustration
export function CybersecurityShieldIllustration({ className = 'w-full h-auto' }: { className?: string }) {
  return (
    <svg viewBox="0 0 540 320" fill="none" xmlns="http://www.w3.org/2000/svg" className={className} aria-label="Cybersecurity Defense and Security Architecture">
      <rect x="15" y="15" width="510" height="290" rx="16" fill="#F6F7F2" stroke="#E5E7DC" strokeWidth="1.5" />
      
      {/* Central Shield */}
      <g transform="translate(180, 50)">
        <path d="M90 20 L160 55 V125 C160 170 90 210 90 210 C90 210 20 170 20 125 V55 Z" fill="#0B4035" />
        <path d="M90 35 L145 65 V120 C145 158 90 192 90 192 C90 192 35 158 35 120 V65 Z" fill="#072C24" />
        <path d="M90 60 V165 C90 165 125 140 125 115 V80 Z" fill="#D5E64D" fillOpacity="0.85" />
        
        {/* Security Lock core */}
        <circle cx="90" cy="115" r="16" fill="#FFFFFF" />
        <circle cx="90" cy="112" r="5" fill="#0B4035" />
        <path d="M90 117 V123" stroke="#0B4035" strokeWidth="3" strokeLinecap="round" />
      </g>

      {/* Threat and Defense Monitoring Cards */}
      <g transform="translate(35, 80)">
        <rect x="0" y="0" width="130" height="70" rx="8" fill="#FFFFFF" stroke="#E5E7DC" />
        <text x="14" y="24" fill="#0B4035" fontSize="11" fontWeight="700" fontFamily="sans-serif">Zero-Trust Model</text>
        <text x="14" y="42" fill="#667085" fontSize="10" fontFamily="sans-serif">MFA · Principle of Least Privilege</text>
        <rect x="14" y="52" width="60" height="6" rx="3" fill="#207A78" />
      </g>

      <g transform="translate(375, 80)">
        <rect x="0" y="0" width="130" height="70" rx="8" fill="#FFFFFF" stroke="#E5E7DC" />
        <text x="14" y="24" fill="#0B4035" fontSize="11" fontWeight="700" fontFamily="sans-serif">Incident Response</text>
        <text x="14" y="42" fill="#667085" fontSize="10" fontFamily="sans-serif">Detection · Containment · Triage</text>
        <rect x="14" y="52" width="80" height="6" rx="3" fill="#D5E64D" />
      </g>

      <g transform="translate(375, 175)">
        <rect x="0" y="0" width="130" height="70" rx="8" fill="#FFFFFF" stroke="#E5E7DC" />
        <text x="14" y="24" fill="#0B4035" fontSize="11" fontWeight="700" fontFamily="sans-serif">Cisco & Firewalls</text>
        <text x="14" y="42" fill="#667085" fontSize="10" fontFamily="sans-serif">VLANs · ACLs · Packet Triage</text>
        <rect x="14" y="52" width="70" height="6" rx="3" fill="#345A8A" />
      </g>
    </svg>
  );
}

// 5. Category-Specific Vector Badges / Visual Glyphs (for Course Cards & Subjects)
export function CategoryGlyph({ category, className = 'w-6 h-6' }: { category: string; className?: string }) {
  switch (category) {
    case 'Cloud Computing':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" />
        </svg>
      );
    case 'Artificial Intelligence':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" />
          <circle cx="12" cy="12" r="4" />
        </svg>
      );
    case 'Cybersecurity':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
          <path d="m9 12 2 2 4-4" />
        </svg>
      );
    case 'Data Science':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="M3 3v18h18" />
          <path d="m19 9-5 5-4-4-3 3" />
          <circle cx="19" cy="9" r="2" />
        </svg>
      );
    case 'Networking':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <rect width="6" height="6" x="9" y="2" rx="1" />
          <rect width="6" height="6" x="2" y="16" rx="1" />
          <rect width="6" height="6" x="16" y="16" rx="1" />
          <path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3" />
          <path d="M12 12V8" />
        </svg>
      );
    case 'Linux':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <polyline points="4 17 10 11 4 5" />
          <line x1="12" y1="19" x2="20" y2="19" />
        </svg>
      );
    case 'Virtual Assistance':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <rect width="18" height="18" x="3" y="4" rx="2" />
          <path d="M3 10h18" />
          <path d="M9 16l2 2 4-4" />
        </svg>
      );
    case 'Online Work Readiness':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <circle cx="12" cy="12" r="10" />
          <line x1="2" y1="12" x2="22" y2="12" />
          <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" />
        </svg>
      );
    case 'Data Annotation':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="m14 2 4 4-10 10H4v-4L14 2z" />
          <path d="m10 6 4 4" />
          <rect x="2" y="18" width="6" height="4" rx="1" />
        </svg>
      );
    case 'Communication Skills':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
          <line x1="9" y1="9" x2="15" y2="9" />
          <line x1="9" y1="13" x2="13" y2="13" />
        </svg>
      );
    case 'Coding & Software Development':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <polyline points="16 18 22 12 16 6" />
          <polyline points="8 6 2 12 8 18" />
        </svg>
      );
    case 'Graphics Design':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <circle cx="13.5" cy="6.5" r=".5" fill="currentColor" />
          <circle cx="17.5" cy="10.5" r=".5" fill="currentColor" />
          <circle cx="8.5" cy="7.5" r=".5" fill="currentColor" />
          <circle cx="6.5" cy="12.5" r=".5" fill="currentColor" />
          <path d="M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z" />
        </svg>
      );
    case 'Financial Literacy':
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <line x1="12" y1="1" x2="12" y2="23" />
          <path d="M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6" />
        </svg>
      );
    default:
      return (
        <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className={className}>
          <circle cx="12" cy="12" r="10" />
          <path d="m10 15 5-3-5-3v6z" />
        </svg>
      );
  }
}
