<!DOCTYPE html>
<html>
<head>
    <title>Dev Max Tools</title> <!-- Initial title with placeholder for link count -->
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f9;
            margin: 0;
            padding: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 200px;
        }
        h1 {
            color: #333;
            font-size: 16px;
            margin-bottom: 10px;
            text-align: center;
        }
        button {
            margin: 5px 0;
            padding: 10px 20px;
            font-size: 12pt;
            font-family: Arial, sans-serif;
            font-weight: bold;
            color: #fff;
            border: 2px solid #fff;
            border-radius: 10px;
            cursor: pointer;
            width: 100%;
            transition: background 0.3s ease;
        }

        /* Green button (start) */
        #start {
            background: linear-gradient(135deg, #008000 0%, #32CD32 50%, #006400 100%);
        }

        #start:hover {
            background: linear-gradient(135deg, #006400 0%, #00FF7F 50%, #008000 100%);
        }

        /* Blue button (save) */
        #save {
            background: linear-gradient(135deg, #00008B 0%, #4169E1 50%, #1E90FF 100%);
        }

        #save:hover {
            background: linear-gradient(135deg, #00005D 0%, #1E90FF 50%, #00008B 100%);
        }

        #linkCount {
            margin-top: 20px;
            font-size: 14px;
            color: #333;
        }
    </style>
</head>
<body>
    <h1>Allin One Tools<p>version 1.6.9</p></h1>
    <button id="start">Click Get Links</button>
    <button id="save">Click To Save</button>
    <div id="linkCount">Total: 0</div> <!-- Initial count with placeholder -->
    <script src="popup.js"></script>
    <script>
        // Function to update the link count in popup.html
        function updateLinkCount(totalLinks) {
            const linkCountElement = document.getElementById('linkCount');
            linkCountElement.textContent = `Total Pictures: ${totalLinks}`;
        }

        // Listen for messages from content script (content.js)
        chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
            if (message.type === 'updateLinkCount') {
                updateLinkCount(message.totalLinks);
            }
        });
    </script>
</body>
</html>
