<?php
/**
 * SureCertificate - KnowledgeHut Exact Match Template
 * Clean White Hero | Green Checkmarks | Soft Shadow Sidebar
 */

if (!isset($courseData)) {
    die('Error: $courseData array must be defined before including course-template.php');
}

require_once __DIR__ . '/config.php';

$scriptName = str_replace('\\', '/', $_SERVER['SCRIPT_NAME'] ?? '');
// Always use root BASE_URL as base href so that CSS/JS/images/menu links
// resolve correctly even when page is inside a subdirectory (e.g. /enterprise/)
$pageBaseHref = BASE_URL;
$courseSlug = pathinfo((string) $scriptName, PATHINFO_FILENAME);
// Build absolute schedule URL so it works from any subdirectory
$scheduleUrl = BASE_URL . $courseSlug . '/schedule.php';

$deriveTitleFromScript = static function ($scriptName) {
    $filename = pathinfo((string) $scriptName, PATHINFO_FILENAME);
    $filename = preg_replace('/[0-9a-f]{4,}$/i', '', $filename);
    $filename = str_replace(['_', '-'], ' ', $filename);
    $filename = trim(preg_replace('/\s+/', ' ', $filename));
    return $filename !== '' ? ucwords($filename) : 'Professional Certification Training';
};

$cleanText = static function ($value) {
    $value = is_string($value) ? $value : '';
    $value = strip_tags($value);
    $value = html_entity_decode($value, ENT_QUOTES | ENT_HTML5, 'UTF-8');
    return trim(preg_replace('/\s+/', ' ', $value));
};

$isUsefulText = static function ($value) use ($cleanText) {
    $value = $cleanText($value);
    if ($value === '' || strlen($value) < 3) {
        return false;
    }
    if (preg_match('/^\d[\d\s.,+%-]*(career|workshop|country|rating|transformation)/i', $value)) {
        return false;
    }
    return !preg_match('/^[\d\s.,+%$-]+$/', $value);
};

$isUsefulTitle = static function ($value) use ($cleanText) {
    $value = $cleanText($value);
    if ($value === '' || preg_match('/^(404|head|get|edge|schema|plugins|t|n|o|e)$/i', $value)) {
        return false;
    }
    return !preg_match('/^[\d\s.-]+$/', $value);
};

$isUsefulSubtitle = static function ($value) use ($cleanText) {
    $value = $cleanText($value);
    if ($value === '' || preg_match('/^\d+\s*[.)-]/', $value)) {
        return false;
    }
    return str_word_count($value) >= 5;
};

$isUsableHeroImage = static function ($value) {
    $value = trim((string) $value);
    if ($value === '') {
        return false;
    }

    if (stripos($value, 'unsplash.com') !== false || preg_match('/\.(?:png|jpe?g|webp)(?:\?|$)/i', $value)) {
        return true;
    }

    if (preg_match('/\.svg(?:\?|$)/i', $value)) {
        if (preg_match('/(google|facebook|switchup|logo|user\\s*icons?|combo)/i', $value)) {
            return false;
        }
        return (bool) preg_match('/(banner|course|certification|training|hero)/i', $value);
    }

    return true;
};

$sanitizeList = static function ($items, $minimum, array $fallback) use ($cleanText, $isUsefulText) {
    $normalized = [];

    if (is_array($items)) {
        foreach ($items as $item) {
            $item = $cleanText($item);
            if (!$isUsefulText($item)) {
                continue;
            }
            if (!in_array($item, $normalized, true)) {
                $normalized[] = $item;
            }
        }
    }

    if (count($normalized) < $minimum) {
        return $fallback;
    }

    return $normalized;
};

$normalizeFaqs = static function ($items, array $fallback) use ($cleanText, $isUsefulText) {
    $normalized = [];

    if (is_array($items)) {
        foreach ($items as $item) {
            if (!is_array($item)) {
                continue;
            }

            $question = $cleanText($item['q'] ?? '');
            $answer = $cleanText($item['a'] ?? '');

            if (!$isUsefulText($question) || !$isUsefulText($answer)) {
                continue;
            }

            $normalized[] = ['q' => $question, 'a' => $answer];
        }
    }

    return count($normalized) >= 3 ? $normalized : $fallback;
};

$normalizeReviews = static function ($items, array $fallback) use ($cleanText, $isUsefulText) {
    $normalized = [];

    if (is_array($items)) {
        foreach ($items as $item) {
            if (!is_array($item)) {
                continue;
            }

            $name = $cleanText($item['name'] ?? '');
            $role = $cleanText($item['role'] ?? '');
            $text = $cleanText($item['text'] ?? '');
            $rating = (int) ($item['rating'] ?? 5);

            if (!$isUsefulText($name) || !$isUsefulText($role) || !$isUsefulText($text)) {
                continue;
            }

            $normalized[] = [
                'name' => $name,
                'role' => $role,
                'rating' => max(1, min(5, $rating)),
                'text' => $text,
            ];
        }
    }

    return count($normalized) >= 2 ? $normalized : $fallback;
};

$normalizeHighlights = static function ($items, array $fallback) use ($cleanText, $isUsefulText) {
    $normalized = [];

    if (is_array($items)) {
        foreach ($items as $item) {
            if (!is_array($item)) {
                continue;
            }

            $title = $cleanText($item['title'] ?? '');
            $text = $cleanText($item['text'] ?? '');
            $icon = $cleanText($item['icon'] ?? 'check');

            if (!$isUsefulText($title) || !$isUsefulText($text)) {
                continue;
            }

            $normalized[] = [
                'icon' => $icon !== '' ? $icon : 'check',
                'title' => $title,
                'text' => $text,
            ];
        }
    }

    return count($normalized) >= 4 ? $normalized : $fallback;
};

$normalizeSyllabus = static function ($items, array $fallback) use ($cleanText, $sanitizeList, $isUsefulText) {
    $normalized = [];

    if (is_array($items)) {
        foreach ($items as $item) {
            if (!is_array($item)) {
                continue;
            }

            $title = $cleanText($item['title'] ?? '');
            $modules = $sanitizeList($item['items'] ?? [], 2, []);

            if (!$isUsefulText($title) || count($modules) < 2) {
                continue;
            }

            $normalized[] = [
                'title' => $title,
                'items' => $modules,
            ];
        }
    }

    return count($normalized) >= 3 ? $normalized : $fallback;
};

$rawTitle = $cleanText($courseData['title'] ?? '');
$courseTitle = $isUsefulTitle($rawTitle) ? $rawTitle : $deriveTitleFromScript($scriptName);
$courseCategory = $cleanText($courseData['category'] ?? 'Professional Courses');
$courseDuration = $cleanText($courseData['duration'] ?? '35 Hours');
$courseFocus = preg_replace('/\s+(Certification|Training|Course|Bootcamp|Masters Program|Master Program).*$/i', '', $courseTitle);
$courseFocus = $cleanText($courseFocus !== '' ? $courseFocus : $courseTitle);

$defaultSubtitle = "Build practical {$courseFocus} skills through live {$courseDuration} sessions, hands-on exercises, and expert-led guidance for {$courseCategory} professionals.";
$defaultMetaDescription = "Join {$courseTitle} to gain job-ready {$courseCategory} skills with live training, practical exercises, and flexible schedules.";
$defaultFeatures = [
    "Master {$courseFocus} concepts with instructor-led sessions and structured practice.",
    "Learn through real-world case studies, guided activities, and applied examples.",
    "Strengthen your readiness with curated study resources and flexible batch options."
];
$defaultPrerequisites = [
    "No strict prerequisites are required to begin {$courseTitle}.",
    "Basic professional awareness of {$courseCategory} concepts will help you learn faster.",
    "This course is suitable for beginners, working professionals, and certification aspirants."
];
$defaultHighlights = [
    ['icon' => 'users', 'title' => 'Live Training', 'text' => "{$courseDuration} of instructor-led learning"],
    ['icon' => 'certificate', 'title' => 'Certification Focus', 'text' => "Built to support {$courseFocus} exam readiness"],
    ['icon' => 'clock', 'title' => 'Flexible Schedule', 'text' => 'Weekend and weekday batches available'],
    ['icon' => 'headset', 'title' => 'Learner Support', 'text' => 'Guidance from trainers and support teams'],
    ['icon' => 'file-alt', 'title' => 'Study Material', 'text' => 'Structured notes, templates, and reference assets'],
    ['icon' => 'award', 'title' => 'Practical Learning', 'text' => 'Hands-on exercises and applied scenarios']
];
$defaultSyllabus = [
    ['title' => "Module 1: {$courseFocus} Foundations", 'items' => ['Core concepts and terminology', 'Frameworks, roles, and responsibilities', 'Common use cases and outcomes']],
    ['title' => 'Module 2: Tools and Techniques', 'items' => ['Methods, workflows, and templates', 'Planning and execution approaches', 'Best practices for real teams']],
    ['title' => 'Module 3: Applied Learning', 'items' => ['Scenario-based exercises', 'Case studies and decision-making', 'Troubleshooting common challenges']],
    ['title' => 'Module 4: Certification and Next Steps', 'items' => ['Revision of key concepts', 'Practice questions and exam strategy', 'Roadmap for implementation after training']],
];
$defaultFaqs = [
    ['q' => "What will I learn in {$courseTitle}?", 'a' => "You will learn the core concepts, practical techniques, and applied workflows needed to use {$courseFocus} confidently in real projects."],
    ['q' => "How long is the {$courseFocus} training?", 'a' => "The program typically includes {$courseDuration} of live learning, supported by practice activities and reference material."],
    ['q' => 'Is this course suitable for beginners?', 'a' => "Yes. The course is structured for beginners as well as experienced professionals who want stronger practical understanding or certification preparation."],
    ['q' => 'Will this course help with certification preparation?', 'a' => "Yes. The training covers key concepts, practice-oriented learning, and revision support that help you prepare with more confidence."],
];
$defaultReviews = [
    ['name' => 'Aman S.', 'role' => "{$courseCategory} Professional", 'rating' => 5, 'text' => "The sessions were clear, practical, and directly relevant to the kind of work I handle every week."],
    ['name' => 'Priya R.', 'role' => 'Project Lead', 'rating' => 5, 'text' => "A very structured learning experience with solid examples, good pacing, and useful guidance for certification preparation."],
];

$courseData['title'] = $courseTitle;
$courseData['category'] = $courseCategory !== '' ? $courseCategory : 'Professional Courses';
$courseData['category_url'] = $courseData['category_url'] ?? '../courses.php';
$courseData['duration'] = $courseDuration !== '' ? $courseDuration : '35 Hours';
$rawSubtitle = $cleanText($courseData['subtitle'] ?? '');
$courseData['subtitle'] = $isUsefulSubtitle($rawSubtitle) ? $rawSubtitle : $defaultSubtitle;
$courseData['meta_description'] = $cleanText($courseData['meta_description'] ?? '') ?: $defaultMetaDescription;
$courseData['enrolled'] = $cleanText($courseData['enrolled'] ?? '50,000+') ?: '50,000+';
$courseData['rating'] = $courseData['rating'] ?? ['google' => 4.8, 'facebook' => 4.7];
$courseData['features'] = $sanitizeList($courseData['features'] ?? [], 4, $defaultFeatures);
$courseData['hero_image'] = $isUsableHeroImage($courseData['hero_image'] ?? '') ? $courseData['hero_image'] : 'https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=800';
$courseData['prerequisites'] = $sanitizeList($courseData['prerequisites'] ?? [], 2, $defaultPrerequisites);
$courseData['highlights'] = $normalizeHighlights($courseData['highlights'] ?? [], $defaultHighlights);
$courseData['price'] = $courseData['price'] ?? [
    'current' => '$999',
    'original' => '$1,299',
    'discount' => '23% OFF'
];
$courseData['syllabus'] = $normalizeSyllabus($courseData['syllabus'] ?? [], $defaultSyllabus);
$courseData['faqs'] = $normalizeFaqs($courseData['faqs'] ?? [], $defaultFaqs);
$courseData['reviews'] = $normalizeReviews($courseData['reviews'] ?? [], $defaultReviews);
?><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta name="robots" content="index, follow"/>
  <title><?php echo htmlspecialchars($courseData['title']); ?> | <?php echo SITE_NAME; ?></title>
  <meta name="description" content="<?php echo htmlspecialchars($courseData['meta_description']); ?>"/>
  
  <!-- Fonts -->
  <link rel="preconnect" href="https://fonts.googleapis.com"/>
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet"/>
  
  <!-- Bootstrap -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"/>
  
  <!-- Global Course CSS -->
  <link rel="stylesheet" href="<?php echo css('global-course.css'); ?>?v=6"/>
  
  <!-- Icons -->
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"/>
  
  <!-- AOS Animation CSS -->
  <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet">
  
  <!-- jQuery -->
  <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
  
  <base href="<?php echo htmlspecialchars($pageBaseHref, ENT_QUOTES, 'UTF-8'); ?>"/>
  <style>
    @keyframes floatUp {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-12px); }
    }
    @keyframes floatDown {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(12px); }
    }
    @keyframes formGlow {
      0%, 100% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.2), 0 25px 50px -12px rgba(0, 0, 0, 0.5); border-color: rgba(34, 197, 94, 0.3); }
      50% { box-shadow: 0 0 35px rgba(34, 197, 94, 0.7), 0 25px 50px -12px rgba(0, 0, 0, 0.5); border-color: rgba(34, 197, 94, 1); }
    }
    .kh-contact-form-card {
      border: 2px solid transparent;
      animation: formGlow 3s infinite ease-in-out;
    }
    
    /* Premium Highlights Section */
    .premium-highlights-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 30px;
      margin-top: 30px;
    }
    .premium-highlight-card {
      background: #ffffff;
      border-radius: 16px;
      padding: 35px 25px;
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      border: 1px solid #f1f5f9;
      transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
      box-shadow: 0 10px 30px rgba(0,0,0,0.03);
      overflow: hidden;
      cursor: pointer;
    }
    .premium-highlight-card:hover {
      transform: translateY(-12px);
      border-color: #22c55e;
      box-shadow: 0 25px 50px rgba(34,197,94,0.12);
    }
    .ph-icon-wrapper {
      width: 70px;
      height: 70px;
      border-radius: 50%;
      background: linear-gradient(135deg, #f0fdf4, #dcfce7);
      color: #22c55e;
      font-size: 28px;
      display: flex;
      justify-content: center;
      align-items: center;
      margin-bottom: 25px;
      transition: all 0.6s ease;
      position: relative;
      z-index: 2;
    }
    .premium-highlight-card:hover .ph-icon-wrapper {
      background: #22c55e;
      color: #ffffff;
      transform: rotateY(180deg);
    }
    .premium-highlight-card:hover .ph-icon-wrapper i {
      transform: rotateY(180deg);
    }
    .ph-title {
      font-size: 1.25rem;
      font-weight: 800;
      color: #1e293b;
      margin-bottom: 12px;
      transition: color 0.3s ease;
      z-index: 2;
      position: relative;
    }
    .premium-highlight-card:hover .ph-title {
      color: #22c55e;
    }
    .ph-text {
      font-size: 0.95rem;
      color: #64748b;
      line-height: 1.6;
      z-index: 2;
      position: relative;
    }
    .ph-glow {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background: radial-gradient(circle at center, rgba(34,197,94,0.05) 0%, transparent 70%);
      opacity: 0;
      transition: opacity 0.5s ease;
      z-index: 1;
    }
    .premium-highlight-card:hover .ph-glow {
      opacity: 1;
    }

    /* Premium Reviews Section */
    .premium-reviews-container {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 30px;
      margin-top: 30px;
    }
    .premium-review-card {
      background: #ffffff;
      border-radius: 16px;
      padding: 35px 30px;
      border: 1px solid #f1f5f9;
      position: relative;
      transition: all 0.4s ease;
      box-shadow: 0 5px 20px rgba(0,0,0,0.02);
    }
    .premium-review-card:hover {
      transform: translateY(-8px);
      box-shadow: 0 20px 40px rgba(0,0,0,0.08);
      border-color: #cbd5e1;
    }
    .pr-quote-icon {
      position: absolute;
      top: -15px;
      left: 30px;
      width: 40px;
      height: 40px;
      background: #22c55e;
      color: white;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 18px;
      box-shadow: 0 5px 15px rgba(34,197,94,0.3);
    }
    .pr-text {
      font-size: 1.05rem;
      color: #475569;
      line-height: 1.7;
      font-style: italic;
      margin-top: 15px;
      margin-bottom: 25px;
    }
    .pr-author {
      display: flex;
      align-items: center;
      gap: 15px;
      border-top: 1px solid #f1f5f9;
      padding-top: 20px;
    }
    .pr-avatar {
      width: 45px;
      height: 45px;
      border-radius: 50%;
      background: #e2e8f0;
      color: #0f172a;
      display: flex;
      justify-content: center;
      align-items: center;
      font-weight: 700;
      font-size: 1.1rem;
    }
    .pr-info h4 {
      margin: 0;
      font-size: 1.05rem;
      font-weight: 700;
      color: #1e293b;
    }
    .pr-info span {
      font-size: 0.85rem;
      color: #64748b;
    }
    .pr-stars {
      color: #fbbf24;
      font-size: 0.85rem;
      margin-bottom: 5px;
    }

    @media (max-width: 992px) {
      .floating-box { display: none !important; }
    }
  </style>
</head>
<body class="kh-course-page">

<?php include __DIR__ . '/header.php'; ?>

<!-- ==================== HERO SECTION - Clean White ==================== -->
<section class="kh-hero" style="position: relative; overflow: hidden;">
  <canvas id="hero-canvas" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0.5;"></canvas>
  <div class="kh-hero-container" style="position: relative; z-index: 1;">
    
    <!-- Breadcrumbs -->
    <nav class="kh-breadcrumbs" aria-label="breadcrumb">
      <a href="<?php echo BASE_URL; ?>">Home</a>
      <svg class="kh-breadcrumbs-separator" viewBox="0 0 16 16" fill="currentColor">
        <path fill-rule="evenodd" d="M6.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 010-1.06z"/>
      </svg>
      <a href="<?php echo $courseData['category_url']; ?>"><?php echo htmlspecialchars($courseData['category']); ?></a>
      <svg class="kh-breadcrumbs-separator" viewBox="0 0 16 16" fill="currentColor">
        <path fill-rule="evenodd" d="M6.22 4.22a.75.75 0 011.06 0l3.25 3.25a.75.75 0 010 1.06l-3.25 3.25a.75.75 0 01-1.06-1.06L8.94 8 6.22 5.28a.75.75 0 010-1.06z"/>
      </svg>
      <span class="kh-breadcrumbs-current"><?php echo htmlspecialchars($courseData['title']); ?></span>
    </nav>
    
    <div class="kh-hero-grid">
      <!-- Hero Content -->
      <div>
        
        <!-- Category Label -->
        <div class="kh-category-label"><?php echo htmlspecialchars($courseData['category']); ?></div>
        
        <!-- Title -->
        <h1 class="kh-hero-title"><?php echo htmlspecialchars($courseData['title']); ?></h1>
        
        <!-- Subtitle -->
        <p class="kh-hero-subtitle"><?php echo htmlspecialchars($courseData['subtitle']); ?></p>
        
        <!-- Enrolled Badge -->
        <div class="kh-enrolled-badge">
          <div class="kh-enrolled-avatars">
            <img src="https://i.pravatar.cc/150?img=1" alt="Learner"/>
            <img src="https://i.pravatar.cc/150?img=2" alt="Learner"/>
            <img src="https://i.pravatar.cc/150?img=3" alt="Learner"/>
            <img src="https://i.pravatar.cc/150?img=4" alt="Learner"/>
            <img src="https://i.pravatar.cc/150?img=5" alt="Learner"/>
          </div>
          <span class="kh-enrolled-text"><?php echo htmlspecialchars($courseData['enrolled']); ?> Learners Enrolled</span>
        </div>
        
        <!-- Ratings -->
        <div class="kh-ratings">
          <?php if (!empty($courseData['rating']['google'])): ?>
          <div class="kh-rating">
            <i class="fab fa-google" style="color: #4285F4; font-size: 18px;"></i>
            <span><?php echo $courseData['rating']['google']; ?>/5</span>
            <span class="kh-rating-stars">
              <?php for ($i = 0; $i < 5; $i++): ?>
                <i class="fas fa-star<?php echo $i < floor($courseData['rating']['google']) ? '' : ($i < $courseData['rating']['google'] ? '-half-alt' : ''); ?>"></i>
              <?php endfor; ?>
            </span>
          </div>
          <?php endif; ?>
          <?php if (!empty($courseData['rating']['facebook'])): ?>
          <div class="kh-rating">
            <i class="fab fa-facebook-f" style="color: #1877F2; font-size: 18px;"></i>
            <span><?php echo $courseData['rating']['facebook']; ?>/5</span>
            <span class="kh-rating-stars">
              <?php for ($i = 0; $i < 5; $i++): ?>
                <i class="fas fa-star<?php echo $i < floor($courseData['rating']['facebook']) ? '' : ($i < $courseData['rating']['facebook'] ? '-half-alt' : ''); ?>"></i>
              <?php endfor; ?>
            </span>
          </div>
          <?php endif; ?>
        </div>
        
        <!-- Feature List with Green Checkmarks -->
        <ul class="kh-feature-list" style="list-style: none; padding: 0; margin-top: 25px;">
          <li class="kh-feature-item" style="font-size: 1.15rem; font-weight: 700; color: #1a202c; background: #ffffff; padding: 15px 20px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); margin-bottom: 15px; display: flex; align-items: center; border-left: 5px solid #22c55e; transition: transform 0.3s ease;">
            <span class="kh-feature-icon" style="color: #22c55e; margin-right: 15px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;">
              <i class="fas fa-check-circle"></i>
            </span>
            <span style="line-height: 1.4;">100% Guaranteed Pass for <?php echo htmlspecialchars($courseData['title']); ?></span>
          </li>
          
          <li class="kh-feature-item" style="font-size: 1.15rem; font-weight: 700; color: #1a202c; background: #ffffff; padding: 15px 20px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); margin-bottom: 15px; display: flex; align-items: center; border-left: 5px solid #22c55e; transition: transform 0.3s ease;">
            <span class="kh-feature-icon" style="color: #22c55e; margin-right: 15px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;">
              <i class="fas fa-check-circle"></i>
            </span>
            <span style="line-height: 1.4;">Fee Pay After Result for your complete peace of mind</span>
          </li>
          
          <li class="kh-feature-item" style="font-size: 1.15rem; font-weight: 700; color: #1a202c; background: #ffffff; padding: 15px 20px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); margin-bottom: 15px; display: flex; align-items: center; border-left: 5px solid #22c55e; transition: transform 0.3s ease;">
            <span class="kh-feature-icon" style="color: #22c55e; margin-right: 15px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;">
              <i class="fas fa-check-circle"></i>
            </span>
            <span style="line-height: 1.4;">Get Certification in 1 Week with our intensive bootcamp</span>
          </li>
          
          <li class="kh-feature-item" style="font-size: 1.15rem; font-weight: 700; color: #1a202c; background: #ffffff; padding: 15px 20px; border-radius: 10px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); margin-bottom: 15px; display: flex; align-items: center; border-left: 5px solid #22c55e; transition: transform 0.3s ease;">
            <span class="kh-feature-icon" style="color: #22c55e; margin-right: 15px; font-size: 1.5rem; display: flex; align-items: center; justify-content: center;">
              <i class="fas fa-check-circle"></i>
            </span>
            <span style="line-height: 1.4;">Examination Fees Discount included in the package</span>
          </li>
        </ul>
        
        <!-- CTA Buttons -->
        <div class="kh-hero-buttons">
          <a href="<?php echo htmlspecialchars($scheduleUrl, ENT_QUOTES, 'UTF-8'); ?>" class="kh-btn kh-btn-secondary">
            <i class="fas fa-calendar-alt"></i>
            View Schedules
          </a>
          <button class="kh-btn kh-btn-primary" onclick="if(window.openPopup) window.openPopup()">
            <i class="fas fa-download"></i>
            Download Brochure
          </button>
        </div>
        
        <!-- Team Training Link -->
        <p class="kh-team-link">
          Want to Train Your Team? 
          <a href="<?php echo BASE_URL; ?>corporate-training.php">Get a Quote</a>
        </p>
        
      </div>
      
      <!-- Hero Visual -->
      <div class="kh-hero-visual" style="position: relative;">
        <div class="kh-hero-image-wrap" style="position: relative; z-index: 2; padding: 0; aspect-ratio: 3/4; max-width: 450px; margin: 0 auto; overflow: visible;">
          <!-- Top Left Floating Box -->
          <div class="floating-box top-left" style="position: absolute; top: 20px; left: -50px; background: white; padding: 15px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 10; display: flex; align-items: center; gap: 15px; animation: floatUp 3.5s ease-in-out infinite;">
            <div style="background: #eefdf4; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #22c55e; font-size: 1.3rem;">
              <i class="fas fa-trophy"></i>
            </div>
            <div>
              <div style="font-weight: 800; font-size: 1.05rem; color: #1a202c; white-space: nowrap;">100% Pass Guarantee</div>
              <div style="font-size: 0.85rem; color: #718096; white-space: nowrap;">First Attempt Success</div>
            </div>
          </div>

          <img 
            src="<?php echo $courseData['hero_image']; ?>" 
            alt="<?php echo htmlspecialchars($courseData['title']); ?>"
            class="kh-hero-image"
            style="border-radius: 20px; box-shadow: 0 20px 40px rgba(0,0,0,0.25); width: 100%; height: 100%; object-fit: cover; display: block;"
            onerror="this.src='https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=800&q=80'"
          />

          <!-- Bottom Right Floating Box -->
          <div class="floating-box bottom-right" style="position: absolute; bottom: -10px; right: -30px; background: white; padding: 15px 20px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 10; display: flex; align-items: center; gap: 15px; animation: floatDown 3.5s ease-in-out infinite;">
            <div style="background: #eef2ff; width: 45px; height: 45px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #4f46e5; font-size: 1.3rem;">
              <i class="fas fa-laptop-code"></i>
            </div>
            <div>
              <div style="font-weight: 800; font-size: 1.05rem; color: #1a202c; white-space: nowrap;">Fee Pay After Result</div>
              <div style="font-size: 0.85rem; color: #718096; white-space: nowrap;">Get Certification in 1 Week</div>
            </div>
          </div>
        </div>
        
        <?php if (!empty($courseData['accreditation'])): ?>
        <div class="kh-accreditation-badge" style="position: relative; z-index: 3;">
          <img src="<?php echo $courseData['accreditation']['logo']; ?>" alt="Accredited"/>
          <span><?php echo htmlspecialchars($courseData['accreditation']['text']); ?></span>
        </div>
        <?php endif; ?>
      </div>
    </div>
  </div>
</section>

<!-- ==================== STATS BAR - Light Beige ==================== -->
<section class="kh-stats-section">
  <div class="kh-stats-bar">
    <div class="kh-stat">
      <div class="kh-stat-value">500K+</div>
      <div class="kh-stat-label">Career Transformations</div>
    </div>
    <div class="kh-stat">
      <div class="kh-stat-value">250+</div>
      <div class="kh-stat-label">Workshops Every Month</div>
    </div>
    <div class="kh-stat">
      <div class="kh-stat-value">100+</div>
      <div class="kh-stat-label">Countries and Counting</div>
    </div>
    <div class="kh-stat">
      <div class="kh-stat-value">4.8</div>
      <div class="kh-stat-label">Average Rating</div>
    </div>
  </div>
</section>

<!-- ==================== MAIN CONTENT ==================== -->
<main class="kh-main">
  <div class="kh-container">
        
        <!-- About Course Section (New) -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800">
          <div class="kh-section-header">
            <p class="kh-section-label">Overview</p>
            <h2 class="kh-section-title">About <?php echo htmlspecialchars($courseData['title']); ?></h2>
          </div>
          <div class="kh-about-grid" style="display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; margin-bottom: 20px;">
            <div class="kh-about-content">
              <p>Welcome to the ultimate learning experience for <strong><?php echo htmlspecialchars($courseData['title']); ?></strong>. This intensive, highly-interactive training program is expertly designed to provide you with a profound understanding of <?php echo htmlspecialchars($courseData['category']); ?> concepts, methodologies, and practical applications in real-world scenarios.</p>
              <p>Whether you're looking to elevate your current career trajectory, transition into a high-demand tech role, or simply master the latest industry standards, our curriculum aligns perfectly with global best practices. Enjoy hands-on projects, expert mentorship, and a clear path to certification.</p>
              <p style="margin-top: 15px;">By enrolling in this course, you are taking a definitive step towards securing your future in the ever-evolving IT landscape. We cover every critical domain extensively, ensuring you are not only exam-ready but also equipped to tackle complex industry challenges from day one. You will engage in continuous assessments, case studies, and lab sessions designed to build your practical confidence.</p>
            </div>
            <div class="kh-about-image" style="border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1);">
              <img src="https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800&q=80" alt="About Course" style="width: 100%; height: auto; display: block; transition: transform 0.3s ease;" class="hover-zoom-img" />
            </div>
          </div>
        </section>
        
        <!-- Prerequisites Section -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800">
          <div class="kh-section-header">
            <p class="kh-section-label">Before You Start</p>
            <h2 class="kh-section-title">Prerequisites and Eligibility</h2>
          </div>
          
          <div class="kh-prereq-grid">
            <div>
              <ul class="kh-prereq-list">
                <?php foreach ($courseData['prerequisites'] as $prereq): ?>
                <li class="kh-prereq-item">
                  <span class="kh-prereq-check">
                    <svg viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="2.5">
                      <polyline points="2 6 5 9 10 3"/>
                    </svg>
                  </span>
                  <span><?php echo htmlspecialchars($prereq); ?></span>
                </li>
                <?php endforeach; ?>
              </ul>
            </div>
            <div class="kh-prereq-image kh-hidden-mobile">
              <img src="https://d2o2utebsixu4k.cloudfront.net/Prerequisites-7a0e6d93848a4b9baec819249cc90c5d.svg" alt="Prerequisites"/>
            </div>
          </div>
        </section>
        
        <!-- Course Highlights -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800">
          <div class="kh-section-header">
            <p class="kh-section-label">What You Get</p>
            <h2 class="kh-section-title">Course Highlights</h2>
          </div>
          
          <div class="premium-highlights-container">
            <?php foreach ($courseData['highlights'] as $highlight): ?>
            <div class="premium-highlight-card">
              <div class="ph-glow"></div>
              <div class="ph-icon-wrapper">
                <i class="fas fa-<?php echo $highlight['icon'] ?? 'check'; ?>"></i>
              </div>
              <h3 class="ph-title"><?php echo $highlight['title']; ?></h3>
              <p class="ph-text"><?php echo $highlight['text']; ?></p>
            </div>
            <?php endforeach; ?>
          </div>
        </section>
        
        <!-- Syllabus Accordion -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800" style="padding-top: 40px;">
          <div class="kh-section-header">
            <p class="kh-section-label">Learning Path</p>
            <h2 class="kh-section-title">Course Curriculum</h2>
          </div>
          
          <div class="kh-accordion">
            <?php foreach ($courseData['syllabus'] as $index => $module): ?>
            <div class="kh-accordion-item">
              <button class="kh-accordion-header <?php echo $index === 0 ? 'active' : ''; ?>" onclick="toggleAccordion(this)">
                <span><?php echo htmlspecialchars($module['title']); ?></span>
                <svg class="kh-accordion-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                  <polyline points="6 9 12 15 18 9"/>
                </svg>
              </button>
              <div class="kh-accordion-body <?php echo $index === 0 ? 'open' : ''; ?>">
                <div class="kh-accordion-content">
                  <ul>
                    <?php foreach ($module['items'] as $item): ?>
                    <li><?php echo htmlspecialchars($item); ?></li>
                    <?php endforeach; ?>
                  </ul>
                </div>
              </div>
            </div>
            <?php endforeach; ?>
          </div>
        </section>
        
        <!-- Reviews -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800">
          <div class="kh-section-header">
            <p class="kh-section-label">Student Feedback</p>
            <h2 class="kh-section-title">What Our Learners Say</h2>
          </div>
          
          <?php if (!empty($courseData['reviews'])): ?>
          <div class="premium-reviews-container">
            <?php foreach ($courseData['reviews'] as $review): ?>
            <div class="premium-review-card">
              <div class="pr-quote-icon">
                <i class="fas fa-quote-left"></i>
              </div>
              <div class="pr-stars">
                <?php for ($i = 0; $i < 5; $i++): ?>
                  <i class="fas fa-star<?php echo $i < ($review['rating'] ?? 5) ? '' : ($i < ($review['rating'] ?? 5) ? '-half-alt' : ''); ?>"></i>
                <?php endfor; ?>
              </div>
              <p class="pr-text">"<?php echo htmlspecialchars($review['text']); ?>"</p>
              <div class="pr-author">
                <div class="pr-avatar"><?php echo substr($review['name'], 0, 1); ?></div>
                <div class="pr-info">
                  <h4><?php echo htmlspecialchars($review['name']); ?></h4>
                  <span><?php echo htmlspecialchars($review['role']); ?></span>
                </div>
              </div>
            </div>
            <?php endforeach; ?>
          </div>
          <?php else: ?>
          <div class="premium-reviews-container">
            <div class="premium-review-card">
              <div class="pr-quote-icon">
                <i class="fas fa-quote-left"></i>
              </div>
              <div class="pr-stars">
                <i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i>
              </div>
              <p class="pr-text">"Highly recommended for anyone looking to upskill. The course materials were comprehensive and well-structured."</p>
              <div class="pr-author">
                <div class="pr-avatar">J</div>
                <div class="pr-info">
                  <h4>John D.</h4>
                  <span>Senior Developer</span>
                </div>
              </div>
            </div>
            <div class="premium-review-card">
              <div class="pr-quote-icon">
                <i class="fas fa-quote-left"></i>
              </div>
              <div class="pr-stars">
                <i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i>
              </div>
              <p class="pr-text">"The hands-on projects gave me exactly the practical experience I needed to land my new role."</p>
              <div class="pr-author">
                <div class="pr-avatar">S</div>
                <div class="pr-info">
                  <h4>Sarah M.</h4>
                  <span>Project Lead</span>
                </div>
              </div>
            </div>
          </div>
          <?php endif; ?>
        </section>
        
        <!-- FAQ -->
        <section class="kh-section" data-aos="fade-up" data-aos-duration="800">
          <div class="kh-section-header">
            <p class="kh-section-label">Common Questions</p>
            <h2 class="kh-section-title">Frequently Asked Questions</h2>
          </div>
          
          <div class="kh-faq-list" style="max-width: 100%;">
            <?php foreach ($courseData['faqs'] as $index => $faq): ?>
            <div class="kh-faq-item">
              <div class="kh-faq-question <?php echo $index === 0 ? 'active' : ''; ?>" onclick="toggleFaq(this)">
                <?php echo htmlspecialchars($faq['q']); ?>
                <i class="fas fa-chevron-down kh-faq-icon"></i>
              </div>
              <div class="kh-faq-answer <?php echo $index === 0 ? '' : 'kh-hidden'; ?>">
                <?php echo htmlspecialchars($faq['a']); ?>
              </div>
            </div>
            <?php endforeach; ?>
          </div>
        </section>
        
  </div> <!-- End max-width 900px container -->
</main>

<!-- ==================== CONTACT FORM SECTION ==================== -->
<section class="kh-contact-section" style="background: #0f172a; padding: 60px 0; position: relative; overflow: hidden; margin-top: 50px;">
  <!-- Left Canvas Background -->
  <div style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1;">
    <canvas id="footer-canvas" style="width: 100%; height: 100%; display: block; opacity: 0.6;"></canvas>
  </div>
  
  <div class="kh-container" style="position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; min-height: 500px; flex-wrap: wrap; gap: 40px;">
    
    <!-- Left Side Guarantee Points -->
    <div style="flex: 1; min-width: 300px; max-width: 600px;" data-aos="fade-right" data-aos-duration="1000">
      <h2 style="color: #ffffff; font-size: 2.8rem; font-weight: 800; margin-bottom: 30px; line-height: 1.2;">Your Career, <br><span style="color: #4ade80;">100% Secured.</span></h2>
      <div style="display: flex; flex-direction: column; gap: 15px;">
        <div style="background: rgba(255,255,255,0.05); backdrop-filter: blur(8px); border-left: 4px solid #4ade80; padding: 20px 25px; border-radius: 0 8px 8px 0; transition: transform 0.3s ease; cursor: default;" onmouseover="this.style.transform='translateX(15px)'" onmouseout="this.style.transform='translateX(0)'">
          <div style="color: #ffffff; font-size: 1.4rem; font-weight: 700;">100% Guaranteed Pass</div>
        </div>
        <div style="background: rgba(255,255,255,0.05); backdrop-filter: blur(8px); border-left: 4px solid #4ade80; padding: 20px 25px; border-radius: 0 8px 8px 0; transition: transform 0.3s ease; cursor: default;" onmouseover="this.style.transform='translateX(15px)'" onmouseout="this.style.transform='translateX(0)'">
          <div style="color: #ffffff; font-size: 1.4rem; font-weight: 700;">Fee Pay After Result</div>
        </div>
        <div style="background: rgba(255,255,255,0.05); backdrop-filter: blur(8px); border-left: 4px solid #4ade80; padding: 20px 25px; border-radius: 0 8px 8px 0; transition: transform 0.3s ease; cursor: default;" onmouseover="this.style.transform='translateX(15px)'" onmouseout="this.style.transform='translateX(0)'">
          <div style="color: #ffffff; font-size: 1.4rem; font-weight: 700;">Get Certification in 1 Week</div>
        </div>
        <div style="background: rgba(255,255,255,0.05); backdrop-filter: blur(8px); border-left: 4px solid #4ade80; padding: 20px 25px; border-radius: 0 8px 8px 0; transition: transform 0.3s ease; cursor: default;" onmouseover="this.style.transform='translateX(15px)'" onmouseout="this.style.transform='translateX(0)'">
          <div style="color: #ffffff; font-size: 1.4rem; font-weight: 700;">Examination Fees Discount</div>
        </div>
      </div>
    </div>
    <!-- Right Form -->
    <div class="kh-contact-form-card" style="background: #ffffff; padding: 40px; border-radius: 12px; width: 100%; max-width: 450px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);">
      <h3 style="font-weight: 800; font-size: 1.5rem; color: #1a202c; margin-bottom: 25px;">Building your Career Block by Block</h3>
      <form>
        <div style="margin-bottom: 15px;">
          <label style="display: block; font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 5px;">Name *</label>
          <input type="text" placeholder="Your Name" style="width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;" onfocus="this.style.borderColor='#22c55e'" onblur="this.style.borderColor='#e2e8f0'">
        </div>
        <div style="margin-bottom: 15px;">
          <label style="display: block; font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 5px;">Email *</label>
          <input type="email" placeholder="Your Email" style="width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;" onfocus="this.style.borderColor='#22c55e'" onblur="this.style.borderColor='#e2e8f0'">
        </div>
        <div style="margin-bottom: 15px;">
          <label style="display: block; font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 5px;">Phone Number *</label>
          <input type="tel" placeholder="Your Number" style="width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;" onfocus="this.style.borderColor='#22c55e'" onblur="this.style.borderColor='#e2e8f0'">
        </div>
        <div style="margin-bottom: 15px;">
          <label style="display: block; font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 5px;">Course for Training and Placement *</label>
          <input type="text" placeholder="Interested Areas" style="width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; outline: none; transition: border-color 0.2s;" onfocus="this.style.borderColor='#22c55e'" onblur="this.style.borderColor='#e2e8f0'">
        </div>
        <div style="margin-bottom: 20px;">
          <label style="display: block; font-size: 0.85rem; font-weight: 600; color: #4a5568; margin-bottom: 5px;">Message *</label>
          <textarea placeholder="Message for Placement Team" rows="3" style="width: 100%; padding: 12px 15px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 0.95rem; outline: none; resize: vertical; transition: border-color 0.2s;" onfocus="this.style.borderColor='#22c55e'" onblur="this.style.borderColor='#e2e8f0'"></textarea>
        </div>
        <button type="button" style="width: 100%; background: #22c55e; color: #ffffff; font-weight: 700; font-size: 1.05rem; padding: 15px; border: none; border-radius: 6px; cursor: pointer; transition: background 0.3s;" onmouseover="this.style.background='#16a34a'" onmouseout="this.style.background='#22c55e'">Send Message</button>
      </form>
    </div>
  </div>
  
  <style>
    @media (max-width: 992px) {
      .kh-contact-section > div:first-child { width: 100%; opacity: 0.2; }
      .kh-contact-section .kh-container { justify-content: center; }
    }
  </style>
</section>

<?php include __DIR__ . '/footer.php'; ?>

<script>
// Accordion Toggle
function toggleAccordion(header) {
  const body = header.nextElementSibling;
  const isOpen = body.classList.contains('open');
  
  // Close all
  document.querySelectorAll('.kh-accordion-body').forEach(b => b.classList.remove('open'));
  document.querySelectorAll('.kh-accordion-header').forEach(h => h.classList.remove('active'));
  
  // Open clicked if was closed
  if (!isOpen) {
    body.classList.add('open');
    header.classList.add('active');
  }
}

// FAQ Toggle
function toggleFaq(question) {
  const answer = question.nextElementSibling;
  const isHidden = answer.classList.contains('kh-hidden');
  
  // Close all
  document.querySelectorAll('.kh-faq-answer').forEach(a => a.classList.add('kh-hidden'));
  document.querySelectorAll('.kh-faq-question').forEach(q => q.classList.remove('active'));
  
  // Open clicked if was closed
  if (isHidden) {
    answer.classList.remove('kh-hidden');
    question.classList.add('active');
  }
}
</script>

<!-- AOS Script -->
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
<script>
  AOS.init({
    once: true,
    offset: 50
  });

  // Additional jQuery Effects
  $(document).ready(function(){
    // Hover effects on cards
    $(".kh-highlight-card, .kh-review-card, .kh-sidebar-card").hover(
      function() {
        $(this).css({
          "transform": "translateY(-5px)",
          "box-shadow": "0 15px 30px rgba(0,0,0,0.15)",
          "transition": "all 0.3s ease"
        });
      }, function() {
        $(this).css({
          "transform": "translateY(0)",
          "box-shadow": "",
          "transition": "all 0.3s ease"
        });
      }
    );

    // Image Zoom on Hover
    $(".hover-zoom-img").hover(
      function() {
        $(this).css("transform", "scale(1.05)");
      }, function() {
        $(this).css("transform", "scale(1)");
      }
    );

    // Canvas Background Effect - Cyber Data Waves
    const canvas = document.getElementById('hero-canvas');
    if (canvas) {
      const ctx = canvas.getContext('2d');
      let width, height;
      let time = 0;
      
      function initCanvas() {
        width = canvas.width = canvas.offsetWidth;
        height = canvas.height = canvas.offsetHeight;
      }
      
      function animateCanvas() {
        requestAnimationFrame(animateCanvas);
        ctx.clearRect(0, 0, width, height);
        
        const lines = 5;
        for (let i = 0; i < lines; i++) {
          ctx.beginPath();
          for (let x = 0; x <= width + 50; x += 30) {
            const y = height / 2 + 
                      Math.sin(x * 0.003 + time + i * 0.5) * 80 + 
                      Math.cos(x * 0.001 - time * 0.5) * 40;
            
            if (x === 0) {
              ctx.moveTo(x, y);
            } else {
              ctx.lineTo(x, y);
            }
          }
          ctx.strokeStyle = `rgba(34, 197, 94, ${0.1 + (i * 0.05)})`;
          ctx.lineWidth = 3;
          ctx.stroke();
        }
        time += 0.015;
      }
      
      initCanvas();
      animateCanvas();
      $(window).resize(initCanvas);
    }

    // Footer Canvas - Particle Network
    const footerCanvas = document.getElementById('footer-canvas');
    if (footerCanvas) {
      const fCtx = footerCanvas.getContext('2d');
      let fWidth, fHeight;
      let nodes = [];
      
      function resizeFooter() {
        fWidth = footerCanvas.width = footerCanvas.offsetWidth;
        fHeight = footerCanvas.height = footerCanvas.offsetHeight;
        
        nodes = [];
        const numNodes = Math.floor((fWidth * fHeight) / 10000);
        for(let i=0; i<numNodes; i++) {
          nodes.push({
            x: Math.random() * fWidth,
            y: Math.random() * fHeight,
            vx: (Math.random() - 0.5) * 1.5,
            vy: (Math.random() - 0.5) * 1.5,
            radius: Math.random() * 2 + 1
          });
        }
      }
      
      function animateFooter() {
        requestAnimationFrame(animateFooter);
        fCtx.clearRect(0, 0, fWidth, fHeight);
        
        for(let i=0; i<nodes.length; i++) {
          let node = nodes[i];
          node.x += node.vx;
          node.y += node.vy;
          
          if(node.x < 0 || node.x > fWidth) node.vx *= -1;
          if(node.y < 0 || node.y > fHeight) node.vy *= -1;
          
          fCtx.beginPath();
          fCtx.arc(node.x, node.y, node.radius, 0, Math.PI * 2);
          fCtx.fillStyle = '#22c55e';
          fCtx.fill();
          
          for(let j=i+1; j<nodes.length; j++) {
            let node2 = nodes[j];
            let dist = Math.hypot(node.x - node2.x, node.y - node2.y);
            
            if(dist < 150) {
              fCtx.beginPath();
              fCtx.moveTo(node.x, node.y);
              fCtx.lineTo(node2.x, node2.y);
              fCtx.strokeStyle = `rgba(34, 197, 94, ${1 - dist/150})`;
              fCtx.lineWidth = 1.5;
              fCtx.stroke();
            }
          }
        }
      }
      
      resizeFooter();
      animateFooter();
      $(window).resize(resizeFooter);
    }
  });
</script>

</body>
</html>
