Changed around line 1
+ // Theme Toggle
+ const themeToggle = document.querySelector('.theme-toggle');
+ const body = document.body;
+
+ themeToggle.addEventListener('click', () => {
+ body.dataset.theme = body.dataset.theme === 'dark' ? 'light' : 'dark';
+ localStorage.setItem('theme', body.dataset.theme);
+ });
+
+ // Load saved theme
+ const savedTheme = localStorage.getItem('theme');
+ if (savedTheme) {
+ body.dataset.theme = savedTheme;
+ }
+
+ // Chat Bot
+ const chatToggle = document.querySelector('.chat-toggle');
+ const chatWindow = document.querySelector('.chat-window');
+ const closeChat = document.querySelector('.close-chat');
+ const chatInput = document.querySelector('.chat-input');
+ const chatMessages = document.querySelector('.chat-messages');
+
+ chatToggle.addEventListener('click', () => {
+ chatWindow.classList.toggle('hidden');
+ });
+
+ closeChat.addEventListener('click', () => {
+ chatWindow.classList.add('hidden');
+ });
+
+ chatInput.addEventListener('keypress', (e) => {
+ if (e.key === 'Enter' && chatInput.value.trim()) {
+ const message = document.createElement('div');
+ message.classList.add('message');
+ message.textContent = chatInput.value;
+ chatMessages.appendChild(message);
+ chatInput.value = '';
+
+ // Simple bot response
+ setTimeout(() => {
+ const response = document.createElement('div');
+ response.classList.add('message', 'bot');
+ response.textContent = "Thanks for your message! Our team will get back to you soon.";
+ chatMessages.appendChild(response);
+ chatMessages.scrollTop = chatMessages.scrollHeight;
+ }, 1000);
+ }
+ });
+
+ // Mobile Menu
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+
+ mobileMenu.addEventListener('click', () => {
+ navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
+ });