<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Tennis Buddy Machine (TBM) - Interactive Business Plan</title>

    <script src="https://cdn.tailwindcss.com"></script>

    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>

    <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&display=swap" rel="stylesheet">

    <!-- Chosen Palette: Calm Neutrals with Green Accent -->

    <!-- Application Structure Plan: The SPA is structured as a narrative dashboard to attract investors. It starts with a high-level summary, then interactively compares the two core business models. It transitions into a visual breakdown of financials and a profit simulator for both models. It addresses key investor concerns: market size, team credibility, and competitive differentiation. The plan concludes with a clear, visual roadmap. This structure was chosen to guide the user from the core business concept, through its financial and strategic viability, to the implementation plan, creating a comprehensive and persuasive interactive pitch. -->

    <!-- Visualization & Content Choices: 

        - Business Models: Report Info -> Two distinct business models with target markets, services, pricing. Goal -> Compare. Viz/Method -> Interactive Tabs (HTML/CSS/JS). Interaction -> Click to switch views. Justification -> Allows for a direct, clutter-free comparison of the two core strategies.

        - Startup Expenses: Report Info -> Table of initial investment costs. Goal -> Inform (show proportions). Viz/Method -> Donut Chart (Chart.js/Canvas). Interaction -> Hover for details. Justification -> Visually breaks down the budget, making it easy to see where capital is allocated.

        - Profit Simulators (Dual): Report Info -> Daily projections for both models. Goal -> Explore profitability & breakeven. Viz/Method -> Two separate interactive calculators with dynamic Bar Charts (HTML inputs + Chart.js/Canvas). Interaction -> Users adjust a slider which updates revenue, costs, and profit in real-time. Justification -> Transforms static projections into engaging simulators for both models, powerfully demonstrating profitability and low risk.

        - Market Projections: Report Info -> Market size and segment data. Goal -> Demonstrate opportunity. Viz/Method -> Bar Chart (Chart.js/Canvas). Justification -> Clearly visualizes the scale of the target market, a critical piece of information for investors.

        - The Team: Report Info -> Profiles of key personnel. Goal -> Build trust. Viz/Method -> Profile Cards (HTML/CSS). Justification -> Presents a professional and trustworthy image of the management team.

        - Competitive Advantage: Report Info -> List of business strengths. Goal -> Articulate differentiation. Viz/Method -> Interactive Cards (HTML/CSS/JS). Interaction -> Click to reveal details. Justification -> Engages the user and allows them to explore the key benefits in a dynamic, organized format.

        - Next Steps/Roadmap: Report Info -> 6-step list for launch. Goal -> Organize. Viz/Method -> Vertical Timeline (HTML/CSS). Justification -> Presents the implementation plan in a clear, sequential, and easily digestible format.

    -->

    <!-- CONFIRMATION: NO SVG graphics used. NO Mermaid JS used. -->

    <style>

        body {

            font-family: 'Inter', sans-serif;

            background-color: #f8f7f4;

            color: #333;

        }

        .chart-container {

            position: relative;

            width: 100%;

            max-width: 500px;

            margin-left: auto;

            margin-right: auto;

            height: 320px;

            max-height: 400px;

        }

        @media (min-width: 768px) {

            .chart-container {

                height: 400px;

            }

        }

        .tab-button {

            transition: all 0.3s ease;

        }

        .tab-button.active {

            background-color: #4A5568;

            color: #FFFFFF;

        }

        .timeline-item::before {

            content: '';

            position: absolute;

            left: -31px;

            top: 50%;

            transform: translateY(-50%);

            width: 20px;

            height: 20px;

            border-radius: 50%;

            background-color: #4A5568;

            border: 3px solid #f8f7f4;

        }

    </style>

</head>

<body class="antialiased">

    <div class="container mx-auto p-4 sm:p-6 md:p-8 max-w-7xl">

        

        <!-- Header -->

        <header class="text-center mb-12">

            <h1 class="text-4xl md:text-5xl font-bold text-gray-800">Tennis Buddy Machine (TBM)</h1>

            <p class="text-lg text-gray-600 mt-2">An Interactive Business Plan for the Klang Valley Market</p>

        </header>


        <!-- Executive Summary -->

        <section id="summary" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">Executive Summary</h2>

            <p class="text-gray-700 leading-relaxed">

                Tennis Buddy Machine (TBM) introduces a dual-model rental service for tennis ball machines in the Klang Valley, targeting both premium and casual market segments. By offering a convenient mobile delivery service alongside a low-cost, fixed-location pop-up, we provide a flexible and professional solution for players of all levels. This plan outlines our strategy to achieve significant market penetration, profitability, and scalability within the first year, establishing Tennis Buddy Machine as the leading name in accessible tennis training equipment.

            </p>

        </section>


        <!-- Business Models Section -->

        <section id="models" class="mb-12">

            <h2 class="text-3xl font-bold text-gray-800 text-center mb-8">Our Business Models</h2>

            <div class="max-w-4xl mx-auto">

                <div class="flex justify-center bg-gray-200 rounded-lg p-1 mb-6">

                    <button class="tab-button active w-1/2 py-2 px-4 rounded-md font-semibold" onclick="showTab('delivery')">A: Mobile Delivery</button>

                    <button class="tab-button w-1/2 py-2 px-4 rounded-md font-semibold" onclick="showTab('popup')">B: Fixed-Location Pop-Up</button>

                </div>


                <div id="delivery" class="tab-content bg-white p-8 rounded-xl shadow-md">

                    <h3 class="text-2xl font-bold text-gray-800 mb-4">Model A: The Mobile Delivery Service</h3>

                    <div class="grid md:grid-cols-2 gap-6">

                        <div>

                            <h4 class="font-semibold text-lg text-gray-700 mb-2">Target Market</h4>

                            <p class="text-gray-600">Busy professionals, serious hobbyists, and coaches who prioritize convenience and are willing to pay a premium for a hassle-free experience.</p>

                        </div>

                        <div>

                            <h4 class="font-semibold text-lg text-gray-700 mb-2">Service Offering</h4>

                            <p class="text-gray-600">Full-service delivery, setup, and pickup of a machine, 100 balls, and a ball picker directly to the customer's court of choice.</p>

                        </div>

                        <div class="md:col-span-2">

                             <h4 class="font-semibold text-lg text-gray-700 mb-2">Pricing Structure</h4>

                             <div class="flex flex-col sm:flex-row gap-4">

                                <div class="bg-gray-50 p-4 rounded-lg flex-1">

                                    <p class="font-bold text-2xl text-gray-800">RM60</p>

                                    <p class="text-gray-600">1-Hour Rental</p>

                                </div>

                                <div class="bg-green-50 p-4 rounded-lg flex-1 border-2 border-green-600">

                                    <p class="font-bold text-2xl text-green-700">RM90</p>

                                    <p class="text-green-800">2-Hour Rental (Best Value)</p>

                                </div>

                             </div>

                        </div>

                    </div>

                </div>


                <div id="popup" class="tab-content bg-white p-8 rounded-xl shadow-md hidden">

                    <h3 class="text-2xl font-bold text-gray-800 mb-4">Model B: The Fixed-Location Pop-Up</h3>

                    <div class="grid md:grid-cols-2 gap-6">

                        <div>

                            <h4 class="font-semibold text-lg text-gray-700 mb-2">Target Market</h4>

                            <p class="text-gray-600">Beginners, students, and casual players who are price-sensitive and value a low-commitment, walk-up service for fun or practice.</p>

                        </div>

                        <div>

                            <h4 class="font-semibold text-lg text-gray-700 mb-2">Service Offering</h4>

                            <p class="text-gray-600">On-site rental per basket of balls at a designated, high-traffic public court, managed by an on-site agent.</p>

                        </div>

                         <div class="md:col-span-2">

                             <h4 class="font-semibold text-lg text-gray-700 mb-2">Pricing Structure</h4>

                             <div class="flex flex-col sm:flex-row gap-4">

                                <div class="bg-gray-50 p-4 rounded-lg flex-1">

                                    <p class="font-bold text-2xl text-gray-800">RM25</p>

                                    <p class="text-gray-600">First Basket (100 Balls)</p>

                                </div>

                                <div class="bg-gray-50 p-4 rounded-lg flex-1">

                                    <p class="font-bold text-2xl text-gray-800">RM20</p>

                                    <p class="text-gray-600">Subsequent Baskets</p>

                                </div>

                             </div>

                        </div>

                    </div>

                </div>

            </div>

        </section>


        <!-- Financial Dashboard Section -->

        <section id="financials" class="mb-12">

            <h2 class="text-3xl font-bold text-gray-800 text-center mb-8">Financial Dashboard</h2>

            <p class="text-gray-700 text-center leading-relaxed mb-8 max-w-3xl mx-auto">

                Explore the financial viability of both business models. Use the sliders to see how daily revenue and profit change based on key performance indicators. This demonstrates the strong profitability potential of both our mobile delivery and fixed-location strategies.

            </p>

            <div class="grid lg:grid-cols-2 gap-8">

                

                <!-- Fixed-Location Simulator -->

                <div class="bg-white p-8 rounded-xl shadow-md">

                    <h3 class="text-2xl font-bold text-gray-800 mb-2">Fixed-Location Profit Simulator</h3>

                    <p class="text-gray-600 mb-6">

                        Daily fixed costs of **RM290**. Break-even at **15 baskets per day**.

                    </p>

                    

                    <div>

                        <label for="popupBaskets" class="font-medium text-gray-700">Baskets Sold Per Day: <span id="popupBasketsValue" class="font-bold text-green-600">25</span></label>

                        <input type="range" id="popupBaskets" min="0" max="50" value="25" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">

                    </div>


                    <div class="mt-6 chart-container">

                         <canvas id="popupProfitChart"></canvas>

                    </div>

                </div>


                <!-- Mobile Delivery Simulator -->

                <div class="bg-white p-8 rounded-xl shadow-md">

                    <h3 class="text-2xl font-bold text-gray-800 mb-2">Mobile Delivery Profit Simulator</h3>

                    <p class="text-gray-600 mb-6">

                        Daily fixed costs of **RM380**. Plus **RM2 per km** for delivery.

                    </p>

                    

                    <div class="mb-4">

                        <label for="mobileRentals" class="font-medium text-gray-700">2-Hour Rentals Per Day: <span id="mobileRentalsValue" class="font-bold text-green-600">10</span></label>

                        <input type="range" id="mobileRentals" min="0" max="20" value="10" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">

                    </div>

                    

                    <div>

                        <label for="kmPerDelivery" class="font-medium text-gray-700">Avg. Kilometers Per Delivery: <span id="kmPerDeliveryValue" class="font-bold text-green-600">5</span>km</label>

                        <input type="range" id="kmPerDelivery" min="0" max="20" value="5" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">

                    </div>


                    <div class="mt-6 chart-container">

                         <canvas id="mobileProfitChart"></canvas>

                    </div>

                </div>

                

                <!-- Startup Costs Section -->

                <div class="lg:col-span-2 bg-white p-8 rounded-xl shadow-md">

                    <h3 class="text-2xl font-bold text-gray-800 mb-4">Initial Startup Costs</h3>

                    <p class="text-gray-700 leading-relaxed mb-6">

                        Our initial investment is focused on securing the core assets needed to launch both business models. The total startup cost is **RM12,400**. This donut chart provides a visual breakdown of where the initial capital is allocated.

                    </p>

                    <div class="chart-container">

                         <canvas id="startupChart"></canvas>

                    </div>

                </div>

            </div>

        </section>


        <!-- New sections for investors -->

        <section id="market" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">Market Opportunity & Projections</h2>

            <p class="text-gray-700 mb-6 leading-relaxed">

                The Klang Valley tennis market is a vibrant and growing ecosystem. Our dual business model allows us to capture significant market share by targeting two distinct player segments. This chart visualizes the estimated size of our target market.

            </p>

            <div class="chart-container">

                <canvas id="marketChart"></canvas>

            </div>

        </section>


        <!-- Operations & Location Section (New) -->

        <section id="operations" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">Operations & Locations</h2>

            <div class="mb-6">

                <h3 class="font-semibold text-xl text-gray-700 mb-2">Fixed-Location Pop-Up Operating Hours</h3>

                <p class="text-gray-600">

                    The fixed-location pop-up will operate during peak hours to serve the casual tennis community.

                </p>

                <ul class="list-disc list-inside text-gray-600 mt-2">

                    <li>**Weekdays:** 5:00 PM - 10:00 PM</li>

                    <li>**Weekends & Public Holidays:** 8:00 AM - 12:00 PM & 4:00 PM - 10:00 PM</li>

                </ul>

            </div>

            <div>

                <h3 class="font-semibold text-xl text-gray-700 mb-2">Potential Fixed-Location Sites</h3>

                <p class="text-gray-600 mb-2">

                    Our strategy is to partner with public sports complexes and clubs that have high foot traffic and accessible courts. These are some ideal locations for the pop-up model:

                </p>

                <ul class="list-disc list-inside text-gray-600">

                    <li>**Stadium Titiwangsa** (Taman Tasik Titiwangsa) - Central and popular location.</li>

                    <li>**Kelana Jaya Municipal Park (Taman Bandaran Kelana Jaya)** - A large, well-known public park in Petaling Jaya with tennis facilities.</li>

                    <li>**SMK La Salle PJ Sports Facilities** - Known for its sports amenities and community focus.</li>

                    <li>**Pusat Tenis UPM (Universiti Putra Malaysia)** - A great location to target students and academic staff.</li>

                </ul>

            </div>

        </section>


        <!-- Team Breakdown (New) -->

        <section id="team" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">The Team & Vision</h2>

            <p class="text-gray-700 mb-6 leading-relaxed">

                We are a passionate team with a deep understanding of the tennis community. Our experience and vision are the driving forces behind this business's unique approach and commitment to customer service.

            </p>

            <div class="grid md:grid-cols-2 gap-8">

                <div class="bg-gray-50 p-6 rounded-xl flex items-start">

                    <div class="text-5xl mr-6">👤</div>

                    <div>

                        <h3 class="font-semibold text-xl text-gray-800">Founder & CEO</h3>

                        <p class="text-gray-600">A lifelong tennis player with extensive knowledge of equipment and the local market. Responsible for strategic planning, business development, financial oversight, and investor relations. Their role is to set the long-term vision and ensure all operational segments are aligned with our mission.</p>

                    </div>

                </div>

                <div class="bg-gray-50 p-6 rounded-xl flex items-start">

                    <div class="text-5xl mr-6">🏃</div>

                    <div>

                        <h3 class="font-semibold text-xl text-gray-800">Operations & Logistics Lead</h3>

                        <p class="text-gray-600">Manages the day-to-day operations for both business models. This includes coordinating the mobile delivery schedule, ensuring all equipment is well-maintained, and overseeing the on-site agents for the fixed-location pop-up. They are the key to a seamless customer experience and efficient service delivery.</p>

                    </div>

                </div>

            </div>

        </section>


        <section id="advantage" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">Our Competitive Advantage</h2>

            <p class="text-gray-700 mb-6 leading-relaxed">

                Tennis Buddy Machine is not just another rental service. We stand out by offering key benefits that our competitors cannot match. Click on the cards below to learn more about what makes us the best choice for players and investors.

            </p>

            <div class="grid md:grid-cols-3 gap-6">

                <div class="bg-gray-50 p-6 rounded-xl shadow-sm hover:shadow-lg transition-all cursor-pointer" onclick="toggleAdvantage('convenience')">

                    <h3 class="font-semibold text-lg text-gray-800">Unmatched Convenience</h3>

                    <p class="text-sm text-gray-500 mt-1">Our mobile service comes to you.</p>

                    <p id="convenience" class="text-gray-600 mt-4 hidden">We eliminate the hassle of transporting bulky equipment by delivering and setting up everything for our customers, saving them time and effort.</p>

                </div>

                <div class="bg-gray-50 p-6 rounded-xl shadow-sm hover:shadow-lg transition-all cursor-pointer" onclick="toggleAdvantage('flexibility')">

                    <h3 class="font-semibold text-lg text-gray-800">Pricing Flexibility</h3>

                    <p class="text-sm text-gray-500 mt-1">Two models for every budget.</p>

                    <p id="flexibility" class="text-gray-600 mt-4 hidden">Our dual pricing strategy (per-hour vs. per-basket) allows us to serve both high-end clients and price-conscious beginners, broadening our market reach.</p>

                </div>

                <div class="bg-gray-50 p-6 rounded-xl shadow-sm hover:shadow-lg transition-all cursor-pointer" onclick="toggleAdvantage('profitability')">

                    <h3 class="font-semibold text-lg text-gray-800">Clear Profitability</h3>

                    <p class="text-sm text-gray-500 mt-1">Low overhead, high potential.</p>

                    <p id="profitability" class="text-gray-600 mt-4 hidden">The fixed-location pop-up model has an extremely low break-even point, allowing us to generate consistent cash flow and prove profitability from day one.</p>

                </div>

            </div>

        </section>


        <!-- Marketing Strategy Section -->

        <section id="marketing" class="bg-white p-8 rounded-xl shadow-md mb-12">

            <h2 class="text-2xl font-bold text-gray-800 mb-4">Marketing & Promotion Strategy</h2>

            <p class="text-gray-700 leading-relaxed mb-4">

                Our marketing strategy is designed to build brand awareness and drive demand by leveraging both digital and community-based channels. We will focus on two key areas to reach our target audience effectively.

            </p>

            <h3 class="text-xl font-bold text-gray-700 mb-2">Online Presence & Digital Marketing</h3>

            <p class="text-gray-600 mb-4">

                We will utilize targeted social media advertising on platforms like Instagram and Facebook to reach tennis players in the Klang Valley. Our content will feature short, engaging videos of the ball machines in action, highlighting their ease of use and the convenience of our delivery service. A user-friendly website with online booking and payment will serve as the hub for all customer interactions.

            </p>

            <h3 class="text-xl font-bold text-gray-700 mb-2">Community & Local Partnerships</h3>

            <p class="text-gray-600">

                To build trust and direct engagement, we will partner with local tennis clubs, public court operators, and coaches. We plan to sponsor local tournaments and offer special introductory deals to club members. This grassroots approach will help us establish a strong reputation within the local tennis community.

            </p>

        </section>


        <!-- Implementation Roadmap -->

        <section id="roadmap">

            <h2 class="text-3xl font-bold text-gray-800 text-center mb-10">Implementation Roadmap</h2>

            <div class="relative max-w-2xl mx-auto">

                <div class="border-l-2 border-gray-300 absolute h-full top-0 left-[-21px]"></div>

                <div class="space-y-12">

                    <div class="relative pl-8 timeline-item">

                        <h4 class="font-bold text-lg text-gray-800">1. Secure & Purchase</h4>

                        <p class="text-gray-600">Finalize business registration and purchase all initial equipment, including two tennis ball machines and a vehicle.</p>

                    </div>

                    <div class="relative pl-8 timeline-item">

                        <h4 class="font-bold text-lg text-gray-800">2. Launch Pilot Program</h4>

                        <p class="text-gray-600">Launch the fixed-location "pop-up" model at a high-traffic public court to test the market, validate pricing, and generate initial cash flow.</p>

                    </div>

                    <div class="relative pl-8 timeline-item">

                        <h4 class="font-bold text-lg text-gray-800">3. Reinvest & Expand</h4>

                        <p class="text-gray-600">Use profits from the pop-up model to fund the expansion of the machine fleet and prepare for the mobile service launch.</p>

                    </div>

                    <div class="relative pl-8 timeline-item">

                        <h4 class="font-bold text-lg text-gray-800">4. Launch Mobile Service</h4>

                        <p class="text-gray-600">Officially launch the premium mobile delivery service, targeting the three key geographical zones in the Klang Valley.</p>

                    </div>

                     <div class="relative pl-8 timeline-item">

                        <h4 class="font-bold text-lg text-gray-800">5. Monitor & Optimize</h4>

                        <p class="text-gray-600">Continuously track key metrics like bookings, customer feedback, and profitability to refine marketing strategies and operational efficiency.</p>

                    </div>

                </div>

            </div>

        </section>


    </div>


    <script>

        function showTab(tabName) {

            const contents = document.querySelectorAll('.tab-content');

            contents.forEach(content => content.classList.add('hidden'));

            document.getElementById(tabName).classList.remove('hidden');


            const buttons = document.querySelectorAll('.tab-button');

            buttons.forEach(button => button.classList.remove('active'));

            document.querySelector(`button[onclick="showTab('${tabName}')"]`).classList.add('active');

        }


        function toggleAdvantage(id) {

            const element = document.getElementById(id);

            element.classList.toggle('hidden');

        }


        const createProfitChart = (canvasId) => {

            return new Chart(document.getElementById(canvasId), {

                type: 'bar',

                data: {

                    labels: ['Revenue', 'Costs', 'Profit'],

                    datasets: [{

                        label: 'Amount (RM)',

                        data: [0, 0, 0],

                        backgroundColor: [

                            'rgba(75, 192, 192, 0.6)',

                            'rgba(255, 99, 132, 0.6)',

                            'rgba(54, 162, 235, 0.6)'

                        ],

                        borderColor: [

                            'rgba(75, 192, 192, 1)',

                            'rgba(255, 99, 132, 1)',

                            'rgba(54, 162, 235, 1)'

                        ],

                        borderWidth: 1

                    }]

                },

                options: {

                    indexAxis: 'y',

                    responsive: true,

                    maintainAspectRatio: false,

                    scales: {

                        x: {

                            beginAtZero: true,

                            title: {

                                display: true,

                                text: 'Amount (RM)'

                            }

                        }

                    },

                    plugins: {

                        legend: {

                            display: false

                        },

                        tooltip: {

                            callbacks: {

                                label: function(context) {

                                    return `RM ${context.raw.toFixed(2)}`;

                                }

                            }

                        }

                    }

                }

            });

        };


        const popupBasketsSlider = document.getElementById('popupBaskets');

        const popupBasketsValueSpan = document.getElementById('popupBasketsValue');

        const popupDailyFixedCosts = 290;

        const popupAvgRevenuePerBasket = 22.50;


        const mobileRentalsSlider = document.getElementById('mobileRentals');

        const mobileRentalsValueSpan = document.getElementById('mobileRentalsValue');

        const kmPerDeliverySlider = document.getElementById('kmPerDelivery');

        const kmPerDeliveryValueSpan = document.getElementById('kmPerDeliveryValue');

        const mobileDailyFixedCosts = 380;

        const mobileAvgRevenuePerRental = 90;

        const mobileRevenuePerKm = 2.00;


        function updatePopupProfitSimulator() {

            const basketsSold = parseInt(popupBasketsSlider.value);

            popupBasketsValueSpan.textContent = basketsSold;

            

            const totalRevenue = basketsSold * popupAvgRevenuePerBasket;

            const projectedProfit = totalRevenue - popupDailyFixedCosts;

            

            if (window.popupProfitChart) {

                window.popupProfitChart.data.datasets[0].data = [totalRevenue, popupDailyFixedCosts, projectedProfit];

                window.popupProfitChart.update();

            }

        }


        function updateMobileProfitSimulator() {

            const rentals = parseInt(mobileRentalsSlider.value);

            const kmPerDelivery = parseInt(kmPerDeliverySlider.value);

            mobileRentalsValueSpan.textContent = rentals;

            kmPerDeliveryValueSpan.textContent = kmPerDelivery;


            const totalRevenue = (rentals * mobileAvgRevenuePerRental) + (rentals * kmPerDelivery * mobileRevenuePerKm);

            const projectedProfit = totalRevenue - mobileDailyFixedCosts;

            

            if (window.mobileProfitChart) {

                window.mobileProfitChart.data.datasets[0].data = [totalRevenue, mobileDailyFixedCosts, projectedProfit];

                window.mobileProfitChart.update();

            }

        }

        

        // Wrap all chart initializations in a DOMContentLoaded event listener

        document.addEventListener('DOMContentLoaded', () => {

             const startupData = {

                labels: [

                    'Tennis Ball Machines (RM5,000)',

                    'Vehicle Down Payment (RM3,000)',

                    'Tennis Balls (5 packs for RM1200)',

                    'Contingency Fund (RM1,000)',

                    'Website Development (RM500)',

                    'Initial Marketing (RM500)',

                    'Legal & Registration (RM500)',

                    'Ball Pickers (4 poles @ RM50/each)',

                ],

                datasets: [{

                    data: [5000, 3000, 1200, 1000, 500, 500, 500, 200],

                    backgroundColor: ['#4A5568', '#718096', '#A0AEC0', '#CBD5E0', '#E2E8F0', '#EDF2F7', '#F7FAFC', '#4FD1C5'],

                    hoverOffset: 4

                }]

            };


            const startupConfig = {

                type: 'doughnut',

                data: startupData,

                options: {

                    responsive: true,

                    maintainAspectRatio: false,

                    plugins: {

                        legend: {

                            position: 'bottom',

                            labels: {

                                padding: 15,

                                boxWidth: 12,

                                font: {

                                    size: 12

                                },

                                generateLabels: function(chart) {

                                    const data = chart.data;

                                    if (data.labels.length && data.datasets.length) {

                                        const { labels, datasets } = data;

                                        return labels.map((label, i) => {

                                            const meta = chart.getDatasetMeta(0);

                                            const style = meta.controller.getStyle(i);

                                            let simpleLabel = label.split('(')[0].trim();

                                            return {

                                                text: simpleLabel.length > 16 ? simpleLabel.substring(0, 13) + '...' : simpleLabel,

                                                fillStyle: style.backgroundColor,

                                                strokeStyle: style.borderColor,

                                                lineWidth: style.borderWidth,

                                                hidden: !chart.getDataVisibility(i),

                                                index: i

                                            };

                                        });

                                    }

                                    return [];

                                }

                            }

                        },

                        tooltip: {

                            callbacks: {

                                label: function(context) {

                                    return context.label || '';

                                }

                            }

                        }

                    }

                },

            };


            const startupChart = new Chart(

                document.getElementById('startupChart'),

                startupConfig

            );

            

            const marketData = {

                labels: ['Beginner Players', 'Hobbyists', 'Pro/Coaches'],

                datasets: [{

                    label: 'Estimated Market Size (Thousand Players)',

                    data: [120, 55, 10],

                    backgroundColor: ['#4A5568', '#718096', '#A0AEC0'],

                    borderColor: ['#4A5568', '#718096', '#A0AEC0'],

                    borderWidth: 1

                }]

            };


            const marketConfig = {

                type: 'bar',

                data: marketData,

                options: {

                    responsive: true,

                    maintainAspectRatio: false,

                    scales: {

                        y: {

                            beginAtZero: true,

                            title: {

                                display: true,

                                text: 'Number of Players (in Thousands)'

                            }

                        }

                    },

                    plugins: {

                        legend: {

                            display: false

                        }

                    }

                }

            };


            new Chart(

                document.getElementById('marketChart'),

                marketConfig

            );


            // Chart instances must be declared after the DOM is ready

            window.popupProfitChart = createProfitChart('popupProfitChart');

            window.mobileProfitChart = createProfitChart('mobileProfitChart');


            popupBasketsSlider.addEventListener('input', updatePopupProfitSimulator);

            mobileRentalsSlider.addEventListener('input', updateMobileProfitSimulator);

            kmPerDeliverySlider.addEventListener('input', updateMobileProfitSimulator);


            updatePopupProfitSimulator();

            updateMobileProfitSimulator();

        });

    </script>

</body>

</html>