// Basic JS for future use

console.log("App Loaded");

// Example: confirm delete
function confirmDelete() {
    return confirm("Are you sure you want to delete?");
}

function toggleSidebar(){
    const sidebar = document.getElementById("sidebar");
    const overlay = document.getElementById("overlay");

    sidebar.classList.toggle("active");

    if(sidebar.classList.contains("active")){
        overlay.style.display = "block";
    } else {
        overlay.style.display = "none";
    }
}

function closeSidebar(){
    document.getElementById("sidebar").classList.remove("active");
    document.getElementById("overlay").style.display = "none";
}


window.addEventListener("resize", function(){
    if(window.innerWidth > 768){
        closeSidebar();
    }
});

document.querySelector("form").addEventListener("submit", function(){
    let btn = document.getElementById("saveBtn");
    btn.innerText = "Saving...";
    btn.disabled = true;
});