<?php
// =============================================================================
// ERROR REPORTING (remove in production)
// =============================================================================
ini_set('display_errors', 1);
error_reporting(E_ALL);

/*
================================================================================
                INTRODUCTION TO WEB DEVELOPMENT
                Krane Digital Programming Academy
================================================================================
LESSON: Introduction - How the Web Works
AUTHOR: Udoinyang, M. Clement (Mr. Krane)
DATE: 2026

DESCRIPTION: This comprehensive introduction covers how the web works,
browsers vs servers, HTML basics, your first webpage, development tools,
and practical exercises. Perfect for absolute beginners.
================================================================================
*/

// =============================================================================
// SAFE CONFIGURATION LOADING
// =============================================================================
$config_path = __DIR__ . '/../config.php';
if (file_exists($config_path)) {
    require_once $config_path;
} else {
    // Define essential constants if config doesn't exist
    define('SITE_NAME', 'Krane Digital Programming Academy');
    define('SITE_AUTHOR', 'Udoinyang, M. Clement (Mr. Krane)');
    define('SITE_TAGLINE', 'Empowering Dreams');
}

// =============================================================================
// SAFE SESSION START
// =============================================================================
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

// Initialize completed lessons array if not exists
if (!isset($_SESSION['completed_lessons'])) {
    $_SESSION['completed_lessons'] = [];
}

// Track if user started this lesson
$_SESSION['introduction_started'] = true;

// Check if lesson is completed - using 'introduction' key
$lesson_completed = in_array('introduction', $_SESSION['completed_lessons']);

// Handle lesson completion
if (isset($_POST['mark_complete'])) {
    if (!in_array('introduction', $_SESSION['completed_lessons'])) {
        $_SESSION['completed_lessons'][] = 'introduction';
        $lesson_completed = true;
        // Trigger confetti using JavaScript
        $show_confetti = true;
    }
}

// =============================================================================
// FALLBACK HEADER FUNCTION (if not in config.php)
// =============================================================================
if (!function_exists('renderHeader')) {
    function renderHeader($title = "Introduction", $currentPage = "intro") {
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo $title; ?> - Modern Website Fundamentals</title>
    
    <!-- Fonts & Icons -->
    <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:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&family=JetBrains+Mono:wght@400;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    
    <style>
        /* ===== COMPLETE TECH THEME STYLES ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Inter', sans-serif;
            background: #0b0f1c;
            color: #e2eaff;
            line-height: 1.6;
            scroll-behavior: smooth;
            padding: 2rem 1rem;
        }

        /* Print Styles */
        @media print {
            body { 
                background: white; 
                color: black; 
                padding: 0.5in; 
            }
            .no-print, .btn, .confetti-btn, footer .social-links, .reward-area button, form { 
                display: none !important; 
            }
            a { 
                text-decoration: none; 
                color: black; 
            }
            pre, code { 
                background: #f5f5f5 !important; 
                color: #111; 
                border: 1px solid #ccc; 
            }
            .glass-card, .lesson-container { 
                break-inside: avoid; 
                border: 1px solid #aaa; 
                box-shadow: none;
            }
            h1, h2, h3 { 
                color: black; 
                -webkit-text-fill-color: black;
                background: none;
            }
        }

        /* Main Container */
        .lesson-container {
            max-width: 1300px;
            margin: 0 auto;
            background: rgba(18, 25, 40, 0.95);
            backdrop-filter: blur(2px);
            border-radius: 2.5rem;
            padding: 2.5rem 2rem;
            box-shadow: 0 20px 40px rgba(0, 20, 80, 0.8), inset 0 0 0 1px rgba(120, 180, 255, 0.2);
            border: 1px solid #2d3f66;
        }

        /* Typography */
        h1, h2, h3 {
            font-weight: 700;
            letter-spacing: -0.02em;
        }

        h1 { 
            font-size: 3.5rem; 
            background: linear-gradient(145deg, #b3e0ff, #7aa9ff); 
            -webkit-background-clip: text; 
            -webkit-text-fill-color: transparent; 
            margin-bottom: 0.5rem;
        }
        
        h2 { 
            font-size: 2.2rem; 
            border-left: 6px solid #3b82f6; 
            padding-left: 1.4rem; 
            margin: 2.5rem 0 1.5rem 0; 
            color: #c2daff; 
        }
        
        h3 { 
            font-size: 1.6rem; 
            color: #9bbaff; 
            margin-top: 1.5rem; 
            margin-bottom: 0.75rem; 
        }

        h4 {
            font-size: 1.2rem;
            color: #b3ceff;
            margin: 1rem 0 0.5rem;
        }

        /* Lesson Header */
        .lesson-header {
            text-align: center;
            padding: 3rem 1rem;
            background: linear-gradient(145deg, #0f1a30, #121f3a);
            border-radius: 2rem;
            margin-bottom: 2rem;
            border: 1px solid #3b5b99;
        }

        .lead {
            font-size: 1.3rem;
            color: #b0c9ff;
            margin: 1rem 0;
            max-width: 800px;
            margin-left: auto;
            margin-right: auto;
        }

        .neon-text {
            color: #7aa9ff;
            text-shadow: 0 0 10px #3b82f6, 0 0 20px #1e4b9e;
            animation: neonPulse 3s infinite;
        }

        @keyframes neonPulse {
            0%, 100% { text-shadow: 0 0 10px #3b82f6, 0 0 20px #1e4b9e; }
            50% { text-shadow: 0 0 20px #7aa9ff, 0 0 40px #3b82f6; }
        }

        /* Cards */
        .glass-card {
            background: #0f1829;
            border-radius: 2rem;
            padding: 2rem;
            margin: 2rem 0;
            border: 1px solid #2e4670;
            box-shadow: 0 15px 25px -10px #010314;
            transition: transform 0.3s ease;
        }

        .glass-card:hover {
            transform: translateY(-5px);
            border-color: #4a6eb0;
        }

        /* Grid Layouts */
        .grid-2 {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 2rem;
        }

        .grid-3 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2rem;
        }

        @media (max-width: 768px) {
            .grid-2, .grid-3 { 
                grid-template-columns: 1fr; 
            }
        }

        /* Code Blocks */
        .code-block {
            background: #1a253f;
            border-radius: 1rem;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border-left: 4px solid #3b82f6;
            overflow-x: auto;
            font-family: 'JetBrains Mono', monospace;
        }

        .code-block pre {
            color: #c9e2ff;
            font-family: 'JetBrains Mono', monospace;
            white-space: pre-wrap;
            word-break: break-word;
        }

        /* Live Demo Boxes */
        .live-demo {
            background: #192337;
            border-radius: 1.8rem;
            padding: 2rem;
            margin: 2rem 0;
            border: 1px solid #4a6eb0;
        }

        /* Buttons */
        .btn {
            background: linear-gradient(145deg, #1f3e77, #122b54);
            border: none;
            color: white;
            font-weight: 600;
            padding: 0.8rem 2rem;
            border-radius: 40px;
            font-size: 1rem;
            cursor: pointer;
            border: 1px solid #5480d4;
            box-shadow: 0 7px 0 #0e1a30, 0 4px 12px #1e3f8d;
            transition: all 0.08s linear;
            display: inline-flex;
            align-items: center;
            gap: 10px;
            text-decoration: none;
            margin: 0.25rem;
        }

        .btn:active { 
            transform: translateY(5px); 
            box-shadow: 0 2px 0 #0e1a30; 
        }

        .btn-primary { 
            background: linear-gradient(145deg, #2b4a8a, #1a3370); 
        }
        
        .btn-secondary { 
            background: transparent; 
            border: 2px solid #5480d4; 
            box-shadow: none; 
        }
        
        .btn-large { 
            padding: 1rem 3rem; 
            font-size: 1.2rem; 
        }

        /* Progress Tracker */
        .progress-tracker {
            background: #111b2e;
            border-radius: 40px;
            padding: 1.5rem;
            margin: 2rem auto;
            max-width: 500px;
            border: 1px solid #335599;
        }

        .tracker-header {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            font-weight: 500;
        }

        .tracker-bar {
            height: 10px;
            background: #1f2c47;
            border-radius: 10px;
            overflow: hidden;
        }

        .tracker-fill {
            height: 100%;
            background: linear-gradient(90deg, #3b82f6, #7aa9ff);
            transition: width 0.5s;
        }

        /* Tables */
        .data-table {
            width: 100%;
            border-collapse: collapse;
            background: #0d1424;
            border-radius: 20px;
            overflow: hidden;
            margin: 1.5rem 0;
        }

        .data-table th {
            background: #1e3158;
            color: white;
            font-weight: 600;
            padding: 1rem;
            text-align: left;
        }

        .data-table td {
            padding: 1rem;
            border-bottom: 1px solid #263a60;
            background: #121c30;
        }

        .data-table tr:last-child td {
            border-bottom: none;
        }

        /* TOC Links */
        .toc-container {
            background: #111b2e;
            border-radius: 40px;
            padding: 2rem;
            margin: 2rem 0;
            border: 1px solid #335599;
        }

        .toc-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 0.8rem;
            justify-content: center;
            margin-top: 1rem;
        }

        .toc-link {
            color: #c9ddff;
            text-decoration: none;
            padding: 0.6rem 1.2rem;
            background: #1f2c47;
            border-radius: 40px;
            transition: all 0.2s;
            border: 1px solid #3d5a9b;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 0.95rem;
        }

        .toc-link:hover {
            background: #2950a0;
            color: white;
            transform: scale(1.02);
            border-color: #6b9eff;
        }

        /* Reward Area */
        .reward-area {
            margin-top: 3rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 2rem;
            flex-wrap: wrap;
            border-top: 2px dashed #3e5f96;
            padding-top: 2rem;
        }

        /* Badges */
        .badge {
            background: #28477d;
            border-radius: 30px;
            padding: 0.3rem 1rem;
            font-size: 0.85rem;
            border: 1px solid #6585c2;
            display: inline-block;
            margin: 0.2rem;
        }

        .badge-primary {
            background: #1e3a6f;
            border-color: #3b82f6;
        }

        /* Info Boxes */
        .info-box {
            background: #1a284a;
            border-left: 4px solid #3b82f6;
            padding: 1.5rem;
            border-radius: 1rem;
            margin: 1.5rem 0;
        }

        .tip-box {
            background: #1a3a3a;
            border-left: 4px solid #2ecc71;
        }

        .warning-box {
            background: #3a2a2a;
            border-left: 4px solid #e74c3c;
        }

        /* Lists */
        .styled-list {
            list-style: none;
            padding: 0;
        }

        .styled-list li {
            padding: 0.5rem 0;
            padding-left: 1.5rem;
            position: relative;
        }

        .styled-list li:before {
            content: "→";
            color: #3b82f6;
            position: absolute;
            left: 0;
            font-weight: bold;
        }

        /* Keyboards */
        kbd {
            background: #1f2c47;
            border-radius: 5px;
            padding: 0.2rem 0.5rem;
            border: 1px solid #4a6eb0;
            font-family: 'JetBrains Mono', monospace;
        }

        /* Exercise Box */
        .exercise-box {
            background: #1a1f3a;
            border-radius: 1.5rem;
            padding: 2rem;
            border: 2px solid #4a6eb0;
        }

        /* Navigation */
        .lesson-navigation {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 3rem 0;
        }

        /* Footer */
        .footer {
            margin-top: 4rem;
            border-top: 2px solid #283b60;
            padding: 2rem 0 1rem;
            text-align: center;
        }

        /* Confetti Canvas */
        #confetti-canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 9999;
        }

        /* Animations */
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .fade-in {
            animation: fadeIn 0.5s ease;
        }

        /* Responsive */
        @media (max-width: 768px) {
            h1 { font-size: 2.5rem; }
            h2 { font-size: 1.8rem; }
            .lesson-container { padding: 1.5rem; }
        }
    </style>
</head>
<body>
    <!-- Confetti Canvas -->
    <canvas id="confetti-canvas"></canvas>
    
    <div class="lesson-container">
<?php
    };
}

// =============================================================================
// FALLBACK FOOTER FUNCTION
// =============================================================================
if (!function_exists('renderFooter')) {
    function renderFooter() {
?>
    </div> <!-- Close lesson-container -->
    
    <script>
        // =========================================================================
        // CONFETTI SYSTEM
        // =========================================================================
        const canvas = document.getElementById('confetti-canvas');
        const ctx = canvas.getContext('2d');
        let width, height;
        let particles = [];
        const maxParticles = 150;
        let animationRunning = false;

        function resizeCanvas() {
            width = window.innerWidth;
            height = window.innerHeight;
            canvas.width = width;
            canvas.height = height;
        }
        window.addEventListener('resize', resizeCanvas);
        resizeCanvas();

        function randomRange(min, max) { 
            return Math.random() * (max - min) + min; 
        }

        function createParticle() {
            return {
                x: Math.random() * width,
                y: Math.random() * height - height,
                size: randomRange(5, 12),
                speedY: randomRange(4, 12),
                speedX: randomRange(-3, 3),
                color: `hsl(${Math.random() * 360}, 80%, 60%)`,
            };
        }

        window.throwConfetti = function() {
            for (let i = 0; i < 30; i++) {
                if (particles.length < maxParticles) {
                    particles.push(createParticle());
                }
            }
            if (!animationRunning) {
                animationRunning = true;
                animate();
            }
        };

        function animate() {
            ctx.clearRect(0, 0, width, height);
            let anyAlive = false;

            for (let i = particles.length - 1; i >= 0; i--) {
                const p = particles[i];
                p.x += p.speedX;
                p.y += p.speedY;

                ctx.fillStyle = p.color;
                ctx.beginPath();
                ctx.arc(p.x, p.y, p.size * 0.6, 0, Math.PI * 2);
                ctx.fill();

                if (p.y < height + 30) {
                    anyAlive = true;
                } else {
                    particles.splice(i, 1);
                }
            }

            if (particles.length > 0) {
                requestAnimationFrame(animate);
            } else {
                animationRunning = false;
            }
        }

        // =========================================================================
        // COUNTER FUNCTION
        // =========================================================================
        window.counterClick = function() {
            let span = document.getElementById('clickcount');
            if (span) {
                let current = parseInt(span.innerText) || 0;
                span.innerText = current + 1;
                throwConfetti();
            }
        };

        // =========================================================================
        // AUTO-TRIGGER CONFETTI IF LESSON COMPLETED
        // =========================================================================
        <?php if (isset($show_confetti) && $show_confetti): ?>
        window.onload = function() {
            throwConfetti();
            // Throw multiple times for bigger celebration
            setTimeout(throwConfetti, 300);
            setTimeout(throwConfetti, 600);
        };
        <?php endif; ?>
    </script>
</body>
</html>
<?php
    };
}

// =============================================================================
// RENDER THE PAGE HEADER
// =============================================================================
renderHeader('Introduction to Web Development', 'intro');
?>

<!-- =========================================================================
     LESSON HEADER
     ========================================================================= -->
<section class="lesson-header fade-in">
    <h1 class="neon-text">🌐 INTRODUCTION TO WEB DEVELOPMENT</h1>
    <p class="lead">Your journey into the world of web creation begins here — understand how the web works, meet the tools, and build your very first page.</p>
    
    <!-- Progress Tracker -->
    <div class="progress-tracker">
        <div class="tracker-header">
            <span><i class="fas fa-chart-line"></i> Lesson Progress</span>
            <span><?php echo $lesson_completed ? '✅ Completed' : '⏳ In Progress'; ?></span>
        </div>
        <div class="tracker-bar">
            <div class="tracker-fill" style="width: <?php echo $lesson_completed ? '100' : '15'; ?>%;"></div>
        </div>
    </div>
</section>

<!-- =========================================================================
     TABLE OF CONTENTS
     ========================================================================= -->
<div class="toc-container">
    <h3 style="color: #FFD700; text-align: center; margin-bottom: 1rem;">
        <i class="fas fa-list-ul"></i> In This Lesson
    </h3>
    <div class="toc-grid">
        <a href="#what-is-web-dev" class="toc-link"><i class="fas fa-question-circle"></i> What is Web Dev?</a>
        <a href="#how-web-works" class="toc-link"><i class="fas fa-globe"></i> How the Web Works</a>
        <a href="#frontend-vs-backend" class="toc-link"><i class="fas fa-code-branch"></i> Frontend vs Backend</a>
        <a href="#browsers-servers" class="toc-link"><i class="fas fa-server"></i> Browsers & Servers</a>
        <a href="#html-basics" class="toc-link"><i class="fas fa-code"></i> HTML Basics</a>
        <a href="#first-page" class="toc-link"><i class="fas fa-file"></i> Your First Page</a>
        <a href="#dev-tools" class="toc-link"><i class="fas fa-tools"></i> Development Tools</a>
        <a href="#practice" class="toc-link"><i class="fas fa-pencil-alt"></i> Practice Exercise</a>
        <a href="#resources" class="toc-link"><i class="fas fa-bookmark"></i> Resources</a>
    </div>
</div>

<!-- =========================================================================
     SECTION: WHAT IS WEB DEVELOPMENT?
     ========================================================================= -->
<section id="what-is-web-dev" class="glass-card fade-in">
    <h2><span class="neon-text">1.1</span> What is Web Development?</h2>
    
    <div class="grid-2">
        <div>
            <p>Web development is the process of building and maintaining websites and web applications. It's the work that happens behind the scenes to make a website look great, work fast, and provide a seamless user experience.</p>
            
            <div class="info-box">
                <h4><i class="fas fa-lightbulb" style="color: #FFD700;"></i> Key Insight</h4>
                <p>Every website you've ever visited — from Google to Facebook to this very page — was built using the same fundamental technologies you're about to learn.</p>
            </div>
            
            <h4>The Three Core Technologies:</h4>
            <ul class="styled-list">
                <li><strong>HTML</strong> (HyperText Markup Language) — Structure and content</li>
                <li><strong>CSS</strong> (Cascading Style Sheets) — Presentation and styling</li>
                <li><strong>JavaScript</strong> — Interactivity and behavior</li>
            </ul>
        </div>
        
        <div class="glass-card" style="text-align: center;">
            <div style="font-size: 4rem; margin-bottom: 1rem;">
                <i class="fab fa-html5" style="color: #ff6b6b;"></i>
                <i class="fab fa-css3-alt" style="color: #3b82f6;"></i>
                <i class="fab fa-js" style="color: #ffd93d;"></i>
            </div>
            <p><strong>The Holy Trinity of Web Development</strong></p>
            <p>These three technologies work together to create everything you see on the web.</p>
        </div>
    </div>
</section>

<!-- =========================================================================
     SECTION: HOW THE WEB WORKS
     ========================================================================= -->
<section id="how-web-works" class="glass-card fade-in">
    <h2><span class="neon-text">1.2</span> How the Web Works</h2>
    
    <p>When you type a URL into your browser, a fascinating chain of events occurs in milliseconds. Here's what happens:</p>
    
    <div class="grid-2">
        <div class="glass-card">
            <h3><i class="fas fa-network-wired" style="color: #00ffff;"></i> The Journey of a Web Request</h3>
            <ol style="margin-left: 1.5rem; line-height: 2;">
                <li><strong>You type</strong> a URL (like google.com) in your browser</li>
                <li><strong>DNS Lookup:</strong> Your browser asks a DNS server "Where is this website?"</li>
                <li><strong>IP Address:</strong> DNS responds with an IP address (like 172.217.170.46)</li>
                <li><strong>Connection:</strong> Your browser connects to that server</li>
                <li><strong>Request:</strong> Browser sends an HTTP request for the page</li>
                <li><strong>Response:</strong> Server sends back HTML, CSS, and JavaScript</li>
                <li><strong>Rendering:</strong> Your browser renders the page</li>
            </ol>
        </div>
        
        <div class="glass-card">
            <h3><i class="fas fa-diagram-project" style="color: #9d4edd;"></i> Visual Diagram</h3>
            <div style="background: #1a1a2e; padding: 1.5rem; border-radius: 10px; font-family: monospace; line-height: 1.8;">
                <pre style="color: #fff;">
    [Your Browser] 
         ↓
    [DNS Server] ── finds IP ──→ [Web Server]
         ↓                            ↓
    [Returns IP]                  [Sends Files]
         ↓                            ↓
    [Browser Connects] ←────── [HTML, CSS, JS]
                ↓
         [Page Renders!]</pre>
            </div>
        </div>
    </div>
    
    <div class="info-box tip-box">
        <h4><i class="fas fa-lightbulb" style="color: #2ecc71;"></i> Real-World Analogy</h4>
        <p>Think of it like ordering at a restaurant:</p>
        <ol>
            <li><strong>DNS lookup</strong> — Looking up the restaurant's address</li>
            <li><strong>Connect to server</strong> — Going to the restaurant</li>
            <li><strong>Request page</strong> — Ordering your meal</li>
            <li><strong>Server processes</strong> — Kitchen prepares food</li>
            <li><strong>Server sends HTML</strong> — Waiter brings food</li>
            <li><strong>Browser renders</strong> — You eat and enjoy!</li>
        </ol>
    </div>
    
    <!-- Live Demo -->
    <div class="live-demo">
        <h4><i class="fas fa-flask"></i> 🔬 Live Demo: See HTTP in Action</h4>
        <p>Click the button to simulate what happens when you request a webpage:</p>
        <button class="btn btn-primary" onclick="simulateRequest()">
            <i class="fas fa-play"></i> Simulate Request
        </button>
        <div id="request-output" style="margin-top: 1.5rem; background: #1e1e1e; padding: 1.2rem; border-radius: 8px; font-family: monospace; min-height: 150px;">
            Ready...
        </div>
    </div>
    
    <script>
    function simulateRequest() {
        const output = document.getElementById('request-output');
        output.innerHTML = '';
        
        const steps = [
            { msg: '🌐 Requesting page from google.com...', delay: 0 },
            { msg: '📡 DNS lookup: Found server at 142.250.185.46', delay: 500 },
            { msg: '🔌 Connecting to server (port 80)...', delay: 1000 },
            { msg: '📨 Sending HTTP request (GET /index.html)', delay: 1500 },
            { msg: '📥 Server response: HTTP 200 OK', delay: 2000 },
            { msg: '📄 Receiving HTML document (12.5KB)...', delay: 2500 },
            { msg: '🎨 Downloading CSS (styles.css)...', delay: 2800 },
            { msg: '⚡ Executing JavaScript (script.js)...', delay: 3100 },
            { msg: '✅ Page loaded successfully!', delay: 3500 },
            { msg: '────────────────────────', delay: 3800 },
            { msg: 'Status: Complete - Page rendered in 3.8 seconds', delay: 4000 }
        ];
        
        steps.forEach(step => {
            setTimeout(() => {
                output.innerHTML += step.msg + '\n';
                output.scrollTop = output.scrollHeight;
            }, step.delay);
        });
    }
    </script>
</section>

<!-- =========================================================================
     SECTION: FRONTEND VS BACKEND
     ========================================================================= -->
<section id="frontend-vs-backend" class="glass-card fade-in">
    <h2><span class="neon-text">1.3</span> Frontend vs Backend</h2>
    
    <div class="grid-2">
        <div class="glass-card">
            <h3><i class="fas fa-paint-brush" style="color: #00ffff;"></i> Frontend (Client-side)</h3>
            <p>The frontend is everything users see and interact with directly in their browser.</p>
            <ul class="styled-list">
                <li><strong>Technologies:</strong> HTML, CSS, JavaScript</li>
                <li><strong>Runs on:</strong> User's browser</li>
                <li><strong>Responsible for:</strong> Layout, design, interactivity</li>
                <li><strong>Frameworks:</strong> React, Vue, Angular</li>
            </ul>
            <div class="badge badge-primary">Client-side</div>
        </div>
        
        <div class="glass-card">
            <h3><i class="fas fa-database" style="color: #9d4edd;"></i> Backend (Server-side)</h3>
            <p>The backend handles server logic, databases, and behind-the-scenes processing.</p>
            <ul class="styled-list">
                <li><strong>Technologies:</strong> PHP, Python, Node.js, Ruby</li>
                <li><strong>Runs on:</strong> Web server</li>
                <li><strong>Responsible for:</strong> Data storage, authentication, API</li>
                <li><strong>Frameworks:</strong> Laravel, Django, Express</li>
            </ul>
            <div class="badge badge-primary">Server-side</div>
        </div>
    </div>
    
    <div class="info-box">
        <h4><i class="fas fa-handshake"></i> How They Work Together</h4>
        <p>When you submit a login form:</p>
        <ol>
            <li><strong>Frontend</strong> collects your username/password and sends to backend</li>
            <li><strong>Backend</strong> checks database for matching credentials</li>
            <li><strong>Backend</strong> sends response back to frontend</li>
            <li><strong>Frontend</strong> displays "Login successful" or error message</li>
        </ol>
    </div>
</section>

<!-- =========================================================================
     SECTION: BROWSERS & SERVERS
     ========================================================================= -->
<section id="browsers-servers" class="glass-card fade-in">
    <h2><span class="neon-text">1.4</span> Browsers vs Servers</h2>
    
    <div class="grid-3">
        <div class="glass-card">
            <i class="fas fa-globe" style="font-size: 2.5rem; color: #00ffff;"></i>
            <h4>Browsers</h4>
            <p>Chrome, Firefox, Safari, Edge — they REQUEST and RENDER web pages</p>
            <ul>
                <li>Run on YOUR computer</li>
                <li>Understand HTML, CSS, JS</li>
                <li>Display content visually</li>
                <li>Can store cookies & cache</li>
            </ul>
        </div>
        
        <div class="glass-card">
            <i class="fas fa-server" style="font-size: 2.5rem; color: #9d4edd;"></i>
            <h4>Servers</h4>
            <p>Powerful computers that STORE and SEND websites</p>
            <ul>
                <li>Run 24/7 in data centers</li>
                <li>Store all website files</li>
                <li>Process PHP, databases</li>
                <li>Handle multiple requests</li>
            </ul>
        </div>
        
        <div class="glass-card">
            <i class="fas fa-cloud" style="font-size: 2.5rem; color: #ff6bff;"></i>
            <h4>The Cloud</h4>
            <p>Network of virtual servers working together</p>
            <ul>
                <li>Scalable storage</li>
                <li>Global availability</li>
                <li>Backup & redundancy</li>
                <li>Cost-efficient</li>
            </ul>
        </div>
    </div>
    
    <div class="info-box">
        <h4><i class="fas fa-chart-bar"></i> Browser Market Share (2025)</h4>
        <div style="display: flex; gap: 1rem; flex-wrap: wrap;">
            <div><span class="badge">Chrome: 65%</span></div>
            <div><span class="badge">Safari: 18%</span></div>
            <div><span class="badge">Edge: 5%</span></div>
            <div><span class="badge">Firefox: 3%</span></div>
            <div><span class="badge">Others: 9%</span></div>
        </div>
    </div>
</section>

<!-- =========================================================================
     SECTION: HTML BASICS
     ========================================================================= -->
<section id="html-basics" class="glass-card fade-in">
    <h2><span class="neon-text">1.5</span> HTML - The Structure</h2>
    
    <p>HTML (HyperText Markup Language) is the skeleton of every website. It uses tags to structure content.</p>
    
    <div class="grid-2">
        <div class="glass-card">
            <h4>Basic HTML Structure</h4>
            <div class="code-block">
                <pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
    &lt;head&gt;
        &lt;meta charset="UTF-8"&gt;
        &lt;title&gt;My Page&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;h1&gt;Hello World!&lt;/h1&gt;
        &lt;p&gt;This is my first page.&lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre>
            </div>
            <p><strong>Key components:</strong></p>
            <ul>
                <li><code>&lt;!DOCTYPE html&gt;</code> — Tells browser it's HTML5</li>
                <li><code>&lt;html&gt;</code> — Root element</li>
                <li><code>&lt;head&gt;</code> — Metadata (not displayed)</li>
                <li><code>&lt;body&gt;</code> — Visible content</li>
            </ul>
        </div>
        
        <div class="glass-card">
            <h4>Common Tags Reference</h4>
            <table class="data-table">
                <tr><th>Tag</th><th>Purpose</th></tr>
                <tr><td>&lt;h1&gt; - &lt;h6&gt;</td><td>Headings (h1 most important)</td></tr>
                <tr><td>&lt;p&gt;</td><td>Paragraph</td></tr>
                <tr><td>&lt;a href=""&gt;</td><td>Links</td></tr>
                <tr><td>&lt;img src=""&gt;</td><td>Images</td></tr>
                <tr><td>&lt;ul&gt;, &lt;ol&gt;</td><td>Unordered/Ordered lists</td></tr>
                <tr><td>&lt;div&gt;</td><td>Division/container</td></tr>
                <tr><td>&lt;span&gt;</td><td>Inline container</td></tr>
                <tr><td>&lt;button&gt;</td><td>Clickable button</td></tr>
            </table>
        </div>
    </div>
    
    <!-- Interactive Example -->
    <div class="live-demo">
        <h4><i class="fas fa-pencil-alt"></i> ✏️ Try It Yourself - HTML Playground</h4>
        <p>Edit the HTML below and see the result instantly:</p>
        
        <div style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
            <div>
                <textarea id="html-editor" rows="10" style="width: 100%; background: #1e1e1e; color: #fff; padding: 1rem; border-radius: 8px; font-family: monospace; border: 1px solid #3b82f6;">
<h1>Welcome to My Page!</h1>
<p>This is <strong>bold text</strong> and <em>italic text</em>.</p>
<ul>
  <li>First item</li>
  <li>Second item</li>
  <li>Third item</li>
</ul>
<a href="#">This is a link</a></textarea>
                <div style="display: flex; gap: 0.5rem; margin-top: 0.5rem;">
                    <button class="btn btn-primary" onclick="updatePreview()">
                        <i class="fas fa-eye"></i> Preview
                    </button>
                    <button class="btn btn-secondary" onclick="resetEditor()">
                        <i class="fas fa-undo"></i> Reset
                    </button>
                </div>
            </div>
            
            <div>
                <h5>Live Preview:</h5>
                <div id="html-preview" style="background: white; color: black; padding: 1.5rem; border-radius: 8px; min-height: 250px; border: 2px solid #3b82f6;">
                    <!-- Preview will appear here -->
                </div>
            </div>
        </div>
    </div>
    
    <script>
    function updatePreview() {
        const html = document.getElementById('html-editor').value;
        document.getElementById('html-preview').innerHTML = html;
    }
    
    function resetEditor() {
        document.getElementById('html-editor').value = '<h1>Welcome to My Page!</h1>\n<p>This is <strong>bold text</strong> and <em>italic text</em>.</p>\n<ul>\n  <li>First item</li>\n  <li>Second item</li>\n  <li>Third item</li>\n</ul>\n<a href="#">This is a link</a>';
        updatePreview();
    }
    
    // Initialize preview on page load
    window.onload = function() {
        updatePreview();
    };
    </script>
</section>

<!-- =========================================================================
     SECTION: YOUR FIRST PAGE
     ========================================================================= -->
<section id="first-page" class="glass-card fade-in">
    <h2><span class="neon-text">1.6</span> Your First Complete Web Page</h2>
    
    <p>Let's build a complete, styled webpage together that includes everything we've learned:</p>
    
    <div class="code-block">
        <pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;title&gt;My First Website&lt;/title&gt;
    &lt;style&gt;
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }
        h1 { color: #FFD700; text-align: center; }
        .card {
            background: rgba(255,255,255,0.1);
            padding: 20px;
            border-radius: 10px;
            margin: 20px 0;
            border: 1px solid rgba(255,255,255,0.2);
        }
        .card h2 { color: #FFD700; margin-top: 0; }
        a { color: #FFD700; }
        button {
            background: #FFD700;
            color: #2c3e50;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
            font-weight: bold;
        }
        button:hover {
            background: #ffed4a;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Welcome to My Website!&lt;/h1&gt;
    
    &lt;div class="card"&gt;
        &lt;h2&gt;About Me&lt;/h2&gt;
        &lt;p&gt;I'm learning web development at Krane Digital Academy! This is my first complete webpage with HTML and CSS.&lt;/p&gt;
        &lt;img src="https://via.placeholder.com/300x200/667eea/ffffff?text=Krane+Digital" alt="placeholder" style="max-width:100%; border-radius:5px;"&gt;
    &lt;/div&gt;
    
    &lt;div class="card"&gt;
        &lt;h2&gt;My Skills&lt;/h2&gt;
        &lt;ul&gt;
            &lt;li&gt;✅ HTML5 - Building structure&lt;/li&gt;
            &lt;li&gt;✅ CSS3 - Adding style&lt;/li&gt;
            &lt;li&gt;⏳ JavaScript - Coming soon!&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
    
    &lt;div class="card" style="text-align: center;"&gt;
        &lt;h2&gt;Let's Interact&lt;/h2&gt;
        &lt;button onclick="alert('Hello from Krane Digital!')"&gt;Click Me!&lt;/button&gt;
    &lt;/div&gt;
    
    &lt;p style="text-align: center; margin-top: 30px;"&gt;
        Visit &lt;a href="https://kranedigitalhub.netlify.app" target="_blank"&gt;Krane Digital Hub&lt;/a&gt; for more resources!
    &lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
    </div>
    
    <div style="display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap;">
        <button class="btn btn-primary" onclick="window.open('#preview', '_blank')">
            <i class="fas fa-external-link-alt"></i> View Full Preview
        </button>
        
        <a href="data:text/html;charset=utf-8,%3C!DOCTYPE%20html%3E%3Chtml%20lang%3D%22en%22%3E%3Chead%3E%3Cmeta%20charset%3D%22UTF-8%22%3E%3Cmeta%20name%3D%22viewport%22%20content%3D%22width%3Ddevice-width%2C%20initial-scale%3D1.0%22%3E%3Ctitle%3EMy%20First%20Website%3C%2Ftitle%3E%3Cstyle%3Ebody%7Bfont-family%3AArial%2Csans-serif%3Bmax-width%3A800px%3Bmargin%3A0%20auto%3Bpadding%3A20px%3Bbackground%3Alinear-gradient(135deg%2C%23667eea%2C%23764ba2)%3Bcolor%3Awhite%3B%7Dh1%7Bcolor%3A%23FFD700%3Btext-align%3Acenter%3B%7D.card%7Bbackground%3Argba(255%2C255%2C255%2C0.1)%3Bpadding%3A20px%3Bborder-radius%3A10px%3Bmargin%3A20px%200%3Bborder%3A1px%20solid%20rgba(255%2C255%2C255%2C0.2)%3B%7D.card%20h2%7Bcolor%3A%23FFD700%3Bmargin-top%3A0%3B%7Da%7Bcolor%3A%23FFD700%3B%7Dbutton%7Bbackground%3A%23FFD700%3Bcolor%3A%232c3e50%3Bborder%3Anone%3Bpadding%3A10px%2020px%3Bborder-radius%3A5px%3Bcursor%3Apointer%3Bfont-weight%3Abold%3B%7Dbutton%3Ahover%7Bbackground%3A%23ffed4a%3B%7D%3C%2Fstyle%3E%3C%2Fhead%3E%3Cbody%3E%3Ch1%3EWelcome%20to%20My%20Website!%3C%2Fh1%3E%3Cdiv%20class%3D%22card%22%3E%3Ch2%3EAbout%20Me%3C%2Fh2%3E%3Cp%3EI'm%20learning%20web%20development%20at%20Krane%20Digital%20Academy!%20This%20is%20my%20first%20complete%20webpage%20with%20HTML%20and%20CSS.%3C%2Fp%3E%3Cimg%20src%3D%22https%3A%2F%2Fvia.placeholder.com%2F300x200%2F667eea%2Fffffff%3Ftext%3DKrane%2BDigital%22%20alt%3D%22placeholder%22%20style%3D%22max-width%3A100%25%3Bborder-radius%3A5px%3B%22%3E%3C%2Fdiv%3E%3Cdiv%20class%3D%22card%22%3E%3Ch2%3EMy%20Skills%3C%2Fh2%3E%3Cul%3E%3Cli%3E%E2%9C%85%20HTML5%20-%20Building%20structure%3C%2Fli%3E%3Cli%3E%E2%9C%85%20CSS3%20-%20Adding%20style%3C%2Fli%3E%3Cli%3E%E2%8F%B3%20JavaScript%20-%20Coming%20soon!%3C%2Fli%3E%3C%2Ful%3E%3C%2Fdiv%3E%3Cdiv%20class%3D%22card%22%20style%3D%22text-align%3Acenter%3B%22%3E%3Ch2%3ELet's%20Interact%3C%2Fh2%3E%3Cbutton%20onclick%3D%22alert('Hello%20from%20Krane%20Digital!')%22%3EClick%20Me!%3C%2Fbutton%3E%3C%2Fdiv%3E%3Cp%20style%3D%22text-align%3Acenter%3B%20margin-top%3A30px%3B%22%3EVisit%20%3Ca%20href%3D%22https%3A%2F%2Fkranedigitalhub.netlify.app%22%20target%3D%22_blank%22%3EKrane%20Digital%20Hub%3C%2Fa%3E%20for%20more%20resources!%3C%2Fp%3E%3C%2Fbody%3E%3C%2Fhtml%3E" download="my-first-website.html" class="btn btn-secondary">
            <i class="fas fa-download"></i> Download This Example
        </a>
    </div>
</section>

<!-- =========================================================================
     SECTION: DEVELOPMENT TOOLS
     ========================================================================= -->
<section id="dev-tools" class="glass-card fade-in">
    <h2><span class="neon-text">1.7</span> Development Tools</h2>
    
    <div class="grid-2">
        <div>
            <h3>Essential Tools for Web Developers</h3>
            <ul class="styled-list">
                <li><strong>VS Code</strong> - Most popular code editor (free, extensible)</li>
                <li><strong>Chrome DevTools</strong> - Built-in browser tools for debugging</li>
                <li><strong>Git & GitHub</strong> - Version control and collaboration</li>
                <li><strong>XAMPP</strong> - Local server environment (PHP, MySQL)</li>
                <li><strong>Figma</strong> - Design and prototyping</li>
                <li><strong>Postman</strong> - API testing</li>
            </ul>
            
            <h3 style="margin-top: 2rem;">Browser DevTools Deep Dive</h3>
            <p>Press <kbd>F12</kbd> or <kbd>Ctrl+Shift+I</kbd> (Windows) or <kbd>Cmd+Option+I</kbd> (Mac) to open DevTools:</p>
            <ul>
                <li><strong>Elements</strong> - Inspect and edit HTML/CSS in real-time</li>
                <li><strong>Console</strong> - View errors and test JavaScript</li>
                <li><strong>Network</strong> - Monitor all network requests</li>
                <li><strong>Sources</strong> - Debug JavaScript code</li>
                <li><strong>Application</strong> - Manage storage, cookies, cache</li>
                <li><strong>Performance</strong> - Analyze page speed</li>
            </ul>
        </div>
        
        <div class="glass-card">
            <h4><i class="fas fa-magic"></i> Try DevTools Now!</h4>
            <p>Right-click anywhere on this page and select "Inspect" or "Inspect Element"</p>
            <div style="background: #2a2a4a; padding: 1.5rem; border-radius: 10px;">
                <p style="color: #FFD700; font-size: 1.1rem;">💡 Pro Tip:</p>
                <p>You can edit any website temporarily using DevTools! The changes only affect your view - refresh the page to reset.</p>
                <div style="background: #1a1a2e; padding: 1rem; border-radius: 5px; margin-top: 1rem;">
                    <p><strong>Try this:</strong></p>
                    <ol style="margin-left: 1.2rem;">
                        <li>Right-click this text</li>
                        <li>Select "Inspect"</li>
                        <li>In the Elements panel, double-click the text</li>
                        <li>Change it to anything you want!</li>
                    </ol>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- =========================================================================
     SECTION: PRACTICE EXERCISE
     ========================================================================= -->
<section id="practice" class="glass-card fade-in">
    <h2><span class="neon-text">1.8</span> Practice Exercise</h2>
    
    <div class="exercise-box">
        <h3 style="color: #FFD700;"><i class="fas fa-pencil-alt"></i> 📝 Build Your Personal Profile Page</h3>
        
        <p><strong>Instructions:</strong> Create an HTML page that tells the world about you!</p>
        
        <div class="grid-2" style="margin-top: 1.5rem;">
            <div>
                <h4>✅ Required Elements:</h4>
                <ul class="styled-list">
                    <li>Create a file called <code>profile.html</code></li>
                    <li>Add the complete HTML5 document structure</li>
                    <li>Include a main heading with your name</li>
                    <li>Add a paragraph about why you're learning web development</li>
                    <li>Create an unordered list of 3 things you want to learn</li>
                    <li>Add a link to Krane Digital Hub website</li>
                    <li>Include an image (use placeholder or your own photo)</li>
                    <li>Add a button that shows an alert when clicked</li>
                </ul>
            </div>
            
            <div>
                <h4>🌟 Bonus Challenges:</h4>
                <ul class="styled-list">
                    <li>Add a CSS style block to make it colorful</li>
                    <li>Create a card layout for your information</li>
                    <li>Add a button that changes the background color</li>
                    <li>Include a table of your skills with proficiency levels</li>
                    <li>Add a contact form (just the HTML structure)</li>
                </ul>
            </div>
        </div>
        
        <div class="info-box tip-box" style="margin-top: 1.5rem;">
            <h4><i class="fas fa-lightbulb"></i> Starter Template</h4>
            <div class="code-block">
                <pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;My Profile&lt;/title&gt;
    &lt;style&gt;
        /* Add your CSS here */
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;Your Name Here&lt;/h1&gt;
    &lt;!-- Add your content --&gt;
    
    &lt;script&gt;
        // Add your JavaScript here
    &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
            </div>
        </div>
        
        <div style="display: flex; gap: 1rem; justify-content: center; margin-top: 2rem;">
            <button class="btn btn-primary" onclick="showHint()">
                <i class="fas fa-lightbulb"></i> Show Hint
            </button>
            <button class="btn btn-secondary" onclick="showSolution()">
                <i class="fas fa-code"></i> Show Sample
            </button>
        </div>
        
        <div id="practice-hint" style="display: none; margin-top: 1.5rem;">
            <div class="code-block">
                <pre>&lt;!-- Hint: Start with this structure --&gt;
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;My Profile&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;h1&gt;John Doe&lt;/h1&gt;
    &lt;p&gt;I'm learning web development because...&lt;/p&gt;
    &lt;h2&gt;Goals:&lt;/h2&gt;
    &lt;ul&gt;
        &lt;li&gt;Learn HTML&lt;/li&gt;
        &lt;li&gt;Master CSS&lt;/li&gt;
        &lt;li&gt;Build websites&lt;/li&gt;
    &lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
            </div>
        </div>
        
        <div id="practice-solution" style="display: none; margin-top: 1.5rem;">
            <div class="code-block">
                <pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt;
    &lt;title&gt;My Profile&lt;/title&gt;
    &lt;style&gt;
        body {
            font-family: Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background: #f0f4ff;
            color: #333;
        }
        .profile-card {
            background: white;
            padding: 30px;
            border-radius: 15px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.1);
            text-align: center;
        }
        h1 { color: #667eea; }
        ul { text-align: left; }
        button {
            background: #667eea;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 5px;
            cursor: pointer;
        }
    &lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;div class="profile-card"&gt;
        &lt;h1&gt;John Doe&lt;/h1&gt;
        &lt;img src="https://via.placeholder.com/150" alt="Profile" style="border-radius:50%;"&gt;
        &lt;p&gt;I'm learning web development at Krane Digital Academy to build amazing websites and applications that help people.&lt;/p&gt;
        
        &lt;h2&gt;My Learning Goals&lt;/h2&gt;
        &lt;ul&gt;
            &lt;li&gt;✅ Master HTML5 and semantic structure&lt;/li&gt;
            &lt;li&gt;⏳ Become proficient in CSS3 and Flexbox&lt;/li&gt;
            &lt;li&gt;⏳ Learn JavaScript for interactivity&lt;/li&gt;
        &lt;/ul&gt;
        
        &lt;button onclick="alert('Hello from Krane Digital!')"&gt;Say Hello&lt;/button&gt;
        &lt;p&gt;&lt;a href="https://kranedigitalhub.netlify.app"&gt;Visit Krane Digital Hub&lt;/a&gt;&lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
            </div>
        </div>
    </div>
    
    <script>
    function showHint() {
        const hint = document.getElementById('practice-hint');
        hint.style.display = hint.style.display === 'none' ? 'block' : 'none';
    }
    
    function showSolution() {
        const solution = document.getElementById('practice-solution');
        solution.style.display = solution.style.display === 'none' ? 'block' : 'none';
    }
    </script>
</section>

<!-- =========================================================================
     SECTION: RESOURCES
     ========================================================================= -->
<section id="resources" class="glass-card fade-in">
    <h2><span class="neon-text">1.9</span> Additional Resources</h2>
    
    <div class="grid-3">
        <div class="glass-card">
            <h4><i class="fab fa-youtube" style="color: #ff0000;"></i> Video Tutorials</h4>
            <ul>
                <li><a href="#" style="color: #b3ceff;">freeCodeCamp - HTML Course</a></li>
                <li><a href="#" style="color: #b3ceff;">Traversy Media - Web Dev</a></li>
                <li><a href="#" style="color: #b3ceff;">The Net Ninja</a></li>
            </ul>
        </div>
        
        <div class="glass-card">
            <h4><i class="fas fa-file-pdf" style="color: #ff6b6b;"></i> Documentation</h4>
            <ul>
                <li><a href="https://developer.mozilla.org" target="_blank" style="color: #b3ceff;">MDN Web Docs</a></li>
                <li><a href="https://www.w3schools.com" target="_blank" style="color: #b3ceff;">W3Schools</a></li>
                <li><a href="https://devdocs.io" target="_blank" style="color: #b3ceff;">DevDocs</a></li>
            </ul>
        </div>
        
        <div class="glass-card">
            <h4><i class="fas fa-tools" style="color: #9d4edd;"></i> Practice Platforms</h4>
            <ul>
                <li><a href="https://codepen.io" target="_blank" style="color: #b3ceff;">CodePen</a></li>
                <li><a href="https://jsfiddle.net" target="_blank" style="color: #b3ceff;">JSFiddle</a></li>
                <li><a href="https://replit.com" target="_blank" style="color: #b3ceff;">Replit</a></li>
            </ul>
        </div>
    </div>
</section>

<!-- =========================================================================
     REWARD AREA
     ========================================================================= -->
<div class="reward-area">
    <span><i class="fas fa-gift" style="color:#ffe484; font-size: 1.5rem;"></i> <strong>Lesson completed? Celebrate your progress!</strong></span>
    <button class="btn btn-primary" onclick="throwConfetti()">
        <i class="fas fa-star"></i> Throw Confetti 🎉
    </button>
</div>

<!-- =========================================================================
     LESSON COMPLETION
     ========================================================================= -->
<section style="text-align: center; padding: 3rem;">
    <?php if (!$lesson_completed): ?>
    <form method="POST">
        <button type="submit" name="mark_complete" class="btn btn-primary btn-large">
            <i class="fas fa-check-circle"></i> Mark Lesson Complete
        </button>
    </form>
    <?php else: ?>
    <div style="background: linear-gradient(135deg, #4cd964, #2ecc71); color: #2c3e50; padding: 2rem; border-radius: 15px; display: inline-block; box-shadow: 0 10px 20px rgba(76, 217, 100, 0.3);">
        <i class="fas fa-trophy" style="font-size: 3rem;"></i>
        <h3 style="margin: 1rem 0;">🎉 Congratulations!</h3>
        <p>You've successfully completed the Introduction to Web Development lesson!</p>
        <p>You now understand how the web works and can create basic HTML pages.</p>
        <div style="display: flex; gap: 1rem; justify-content: center; margin-top: 2rem;">
            <a href="html.php" class="btn btn-primary">Continue to HTML →</a>
            <a href="../index.php" class="btn btn-secondary">Back to Home</a>
        </div>
    </div>
    <?php endif; ?>
</section>

<!-- =========================================================================
     LESSON NAVIGATION
     ========================================================================= -->
<div class="lesson-navigation">
    <a href="../index.php" class="btn btn-secondary">
        <i class="fas fa-home"></i> Back to Main Menu
    </a>
    
    <?php if ($lesson_completed): ?>
    <a href="html.php" class="btn btn-primary">
        <i class="fas fa-arrow-right"></i> Next: HTML Fundamentals
    </a>
    <?php endif; ?>
</div>

<!-- =========================================================================
     FOOTER
     ========================================================================= -->
<div class="footer">
    <p>© <?php echo date('Y'); ?> Krane Digital Programming Academy</p>
    <p><span class="badge">Lesson 1: Introduction</span> <span class="badge">By: <?php echo SITE_AUTHOR; ?></span></p>
    <p class="no-print"><small><i class="fas fa-print"></i> <a href="javascript:window.print()" style="color: #b1ccff;">Print this lesson</a></small></p>
</div>

<?php
// =============================================================================
// RENDER FOOTER
// =============================================================================
renderFooter();
?>