function calculateProfit() {
  const price = parseFloat(document.getElementById("price").value) || 0;
  const material = parseFloat(document.getElementById("material").value) || 0;
  const shipping = parseFloat(document.getElementById("shipping").value) || 0;

  const etsyFee = price * 0.065;
  const totalCost = material + shipping + etsyFee;
  const profit = price - totalCost;
  const profitPercent = ((profit / price) * 100).toFixed(2);

  let result = document.getElementById("result");
  result.innerHTML = `
    <p>Etsy Fee (6.5%): $${etsyFee.toFixed(2)}</p>
    <p>Total Cost: $${totalCost.toFixed(2)}</p>
    <p><strong>Profit: $${profit.toFixed(2)} (${profitPercent}%)</strong></p>
  `;
}

// 🌙 Light/Dark mode toggle
const toggleSwitch = document.getElementById("switch");
toggleSwitch.addEventListener("change", () => {
  document.body.classList.toggle("dark-mode");
});
