document.addEventListener('DOMContentLoaded', function () {
    // Dedicated 1 Subscription
    const firstDedicatedPrices = {
        1: 89,
        3: 200,
        6: 350,
        12: 650,
        24: 1200,
        36: 1800,
        60: 3000
    };

    const firstDedicatedSubscriptionOptions = document.querySelectorAll('.firstDedicatedSubscriptionOptions');

    firstDedicatedSubscriptionOptions.forEach(function (options) {
        options.addEventListener('change', function () {
            const selectedValue = parseInt(this.value);
            const priceElement = this.closest('.feature').querySelector('.firstDedicatedPrice');
            const price = firstDedicatedPrices[selectedValue];
            priceElement.textContent = `$${price}`;
        });
    });


    // Dedicated 2 Subscription
    const secondDedicatedPrices = {
        1: 169,
        3: 400,
        6: 700,
        12: 1300,
        24: 2400,
        36: 3600,
        60: 6000
    };

    const secondDedicatedSubscriptionOptions = document.querySelectorAll('.secondDedicatedSubscriptionOptions');

    secondDedicatedSubscriptionOptions.forEach(function (options) {
        options.addEventListener('change', function () {
            const selectedValue = parseInt(this.value);
            const priceElement = this.closest('.feature').querySelector('.secondDedicatedPrice');
            const price = secondDedicatedPrices[selectedValue];
            priceElement.textContent = `$${price}`;
        });
    });


    // Dedicated 3 Subscription
    const thirdDedicatedPrices = {
        1: 89,
        3: 200,
        6: 350,
        12: 650,
        24: 1200,
        36: 1800,
        60: 3000
    };

    const thirdDedicatedSubscriptionOptions = document.querySelectorAll('.thirdDedicatedSubscriptionOptions');

    thirdDedicatedSubscriptionOptions.forEach(function (options) {
        options.addEventListener('change', function () {
            const selectedValue = parseInt(this.value);
            const priceElement = this.closest('.feature').querySelector('.thirdDedicatedPrice');
            const price = thirdDedicatedPrices[selectedValue];
            priceElement.textContent = `$${price}`;
        });
    });


    // Dedicated 4 Subscription
    const fourthDedicatedPrices = {
        1: 89,
        3: 200,
        6: 350,
        12: 650,
        24: 1200,
        36: 1800,
        60: 3000
    };

    const fourthDedicatedSubscriptionOptions = document.querySelectorAll('.fourthDedicatedSubscriptionOptions');

    fourthDedicatedSubscriptionOptions.forEach(function (options) {
        options.addEventListener('change', function () {
            const selectedValue = parseInt(this.value);
            const priceElement = this.closest('.feature').querySelector('.fourthDedicatedPrice');
            const price = fourthDedicatedPrices[selectedValue];
            priceElement.textContent = `$${price}`;
        });
    });

});
