const loginButton = document.getElementById('login');
const signupButton = document.getElementById('signup');
const container = document.getElementById('container');

signupButton.addEventListener('click', () => {
  container.classList.add("right-panel-active");
});

loginButton.addEventListener('click', () => {
  container.classList.remove("right-panel-active");
});

// Activate login panel automatically if redirected after signup
window.addEventListener('DOMContentLoaded', () => {
  const params = new URLSearchParams(window.location.search);
  if (params.get('login') === 'true') {
    container.classList.remove("right-panel-active"); // switch to login
    alert('Signup successful! Please log in.');
  }
});
