Changed around line 1
+ // Theme Toggle
+ const themeToggle = document.querySelector('.theme-toggle');
+ const prefersDarkScheme = window.matchMedia('(prefers-color-scheme: dark)');
+
+ function setTheme(theme) {
+ document.documentElement.setAttribute('data-theme', theme);
+ localStorage.setItem('theme', theme);
+ }
+
+ themeToggle.addEventListener('click', () => {
+ const currentTheme = document.documentElement.getAttribute('data-theme');
+ setTheme(currentTheme === 'dark' ? 'light' : 'dark');
+ });
+
+ // Initialize theme
+ const savedTheme = localStorage.getItem('theme');
+ if (savedTheme) {
+ setTheme(savedTheme);
+ } else {
+ setTheme(prefersDarkScheme.matches ? 'dark' : 'light');
+ }
+
+ // Mobile Menu
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+
+ mobileMenu.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // Carousel
+ let currentSlide = 0;
+ const track = document.querySelector('.carousel-track');
+ const slides = document.querySelectorAll('.doctor-card');
+
+ function updateCarousel() {
+ track.style.transform = `translateX(-${currentSlide * 100}%)`;
+ }
+
+ setInterval(() => {
+ currentSlide = (currentSlide + 1) % slides.length;
+ updateCarousel();
+ }, 5000);
+
+ // Calendar
+ const calendar = document.querySelector('.calendar');
+ const slotGrid = document.querySelector('.slot-grid');
+
+ function generateCalendar() {
+ // Calendar generation logic here
+ }
+
+ function generateTimeSlots() {
+ // Time slot generation logic here
+ }
+
+ generateCalendar();
+ generateTimeSlots();