<!-- ============ FOOTER ============ -->
<footer id="footer">
  <div class="footer-main">
    <div class="container">
      <div class="row g-4">
        <div class="col-lg-4 col-md-6">
          <a class="brand mb-3" href="#">
            <img src="images/3.png" alt="Kottaram Regency" width="40%">
          </a>
          <p class="mt-3" style="max-width:300px">Kottaram Regency – where comfort, convenience, and warm hospitality come together to create unforgettable memories.</p>
          <div class="social mt-3">
            <a href="#"><i class="bi bi-facebook"></i></a>
            <a href="#"><i class="bi bi-instagram"></i></a>
            <a href="#"><i class="bi bi-youtube"></i></a>
          </div>
        </div>
        <div class="col-lg-2 col-md-6 col-6">
          <h6>Quick Links</h6>
          <ul>
            <li><a href="#">Home</a></li>
            <li><a href="#abt">About Us</a></li>
            <li><a href="#roo">Rooms</a></li>
            <li><a href="#ame">Facilities</a></li>
            <li><a href="#gal">Gallery</a></li>
            <li><a href="#footer">Contact</a></li>
          </ul>
        </div>
        <div class="col-lg-3 col-md-6 foo">
          <h6>Contact Us</h6>
          <div class="contact-line"><i class="bi bi-telephone-fill"></i><span>9747088799</span></div>
          <div class="contact-line"><i class="bi bi-envelope-fill"></i><span>hotelkottaramregency@gmail.com</span></div>
          <div class="contact-line"><i class="bi bi-geo-alt-fill"></i><span>Kariyannoor, Erumapetty, Kerala 680584</span></div>
        </div>
        <div class="col-lg-3 col-md-6">
          <h6>Location Map</h6>
          <iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3920.7114467664537!2d76.1543509!3d10.679491!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3ba7c1dd4fc0a677%3A0xa8f438ba34abd118!2sHotel%20Kottaram%20Regency!5e0!3m2!1sen!2sin!4v1784528283145!5m2!1sen!2sin" width="100%" height="180" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="strict-origin-when-cross-origin"></iframe>
        </div>
      </div>
    </div>
  </div>
  <div class="footer-bottom">
    <div class="container">
      <div class="row align-items-center">
        <div class="col-md-6 text-center text-md-start">
          <p class="mb-0">&copy; 2026 <strong>Hotel Kottaram Regency</strong>. All Rights Reserved.</p>
        </div>
        <div class="col-md-6 text-center text-md-end mt-2 mt-md-0">
          <p class="mb-0">Designed By <a href="https://programers.in/" target="_blank">PROGRAMERS.IN</a></p>
        </div>
      </div>
    </div>
  </div>
</footer>

<button class="to-top" id="toTop"><i class="bi bi-arrow-up"></i></button>

<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>

<script>
  window.addEventListener('scroll', function() {
    const nav = document.getElementById('mainNavbar');
    if (window.scrollY > 50) {
      nav.classList.add('scrolled');
    } else {
      nav.classList.remove('scrolled');
    }
  });

  /* ---------- Auto-scroll gallery ---------- */
  (function(){
    const track = document.getElementById('galTrack');
    if (track) {
      track.innerHTML += track.innerHTML;
      let pos = 0, speed = 0.5, half = 0, paused = false;
      function measure(){ half = track.scrollWidth / 2; }
      window.addEventListener('load', measure);
      window.addEventListener('resize', measure);
      measure();
      track.parentElement.addEventListener('mouseenter', ()=> paused = true);
      track.parentElement.addEventListener('mouseleave', ()=> paused = false);
      function loop(){
        if(!paused){
          pos -= speed;
          if(half && pos <= -half) pos += half;
          track.style.transform = 'translateX(' + pos + 'px)';
        }
        requestAnimationFrame(loop);
      }
      loop();
      const galLeft = document.getElementById('galLeft');
      const galRight = document.getElementById('galRight');
      if (galLeft) galLeft.addEventListener('click', ()=>{ pos += 220; });
      if (galRight) galRight.addEventListener('click', ()=>{ pos -= 220; });
    }
  })();

  /* ---------- Dropdown toggle ---------- */
  function toggleDrop() {
    const dropMenu = document.getElementById('dropMenu');
    if (dropMenu) {
      dropMenu.classList.toggle('show');
    }
  }

  // Close dropdown when clicking outside
  document.addEventListener('click', function(e) {
    const filterWrap = document.getElementById('galFilterWrap');
    const dropMenu = document.getElementById('dropMenu');
    if (filterWrap && dropMenu && !filterWrap.contains(e.target)) {
      dropMenu.classList.remove('show');
    }
  });

  /* ---------- Scroll to top ---------- */
  const toTopBtn = document.getElementById('toTop');
  window.addEventListener('scroll', ()=>{
    if(window.scrollY > 300) toTopBtn.classList.add('show');
    else toTopBtn.classList.remove('show');
  });
  toTopBtn.addEventListener('click', ()=> window.scrollTo({top:0,behavior:'smooth'}));
</script>






<script>
/* --- Filter Logic --- */
function filterGal(category, element) {
  // UI update
  document.querySelectorAll('.drop-item').forEach(el => el.classList.remove('selected'));
  element.classList.add('selected');
  document.getElementById('selectedText').innerText = category === 'All' ? 'All Categories' : category;
  toggleDrop(); // Close after select
  
  // Grid filtering
  const items = document.querySelectorAll('.g-item');
  items.forEach(item => {
    const cat = item.getAttribute('data-cat');
    if(category === 'All' || cat === category) {
      item.style.display = 'block';
      setTimeout(() => item.style.opacity = '1', 10);
      item.style.opacity = '0';
    } else {
      item.style.display = 'none';
      item.style.opacity = '0';
    }
  });
}


/* ==============================
   LIGHTBOX LOGIC (Native JS)
   ============================== */
let visibleItems = []; 
let currentIndex = 0;

function refreshVisibleItems() {
  visibleItems = Array.from(document.querySelectorAll('.g-item')).filter(el => el.style.display !== 'none');
}

function openLB(element) {
  refreshVisibleItems();
  const imgSrc = element.querySelector('.g-img').src;
  const caption = element.getAttribute('data-desc');
  
  document.getElementById('lbImg').src = imgSrc;
  document.getElementById('lbCaption').innerText = caption;
  document.getElementById('lightBox').classList.add('active');
  document.body.style.overflow = 'hidden'; // No scroll behind
  
  currentIndex = visibleItems.indexOf(element);
  updateNavButtons();
}

function closeLB(e) {
  if(!e || e.target.id === 'lightBox' || e.target.closest('.lb-close')) {
    document.getElementById('lightBox').classList.remove('active');
    document.body.style.overflow = '';
  }
}

function changeImg(direction) {
  currentIndex += direction;
  
  // Loop handling
  if(currentIndex >= visibleItems.length) currentIndex = 0;
  if(currentIndex < 0) currentIndex = visibleItems.length - 1;
  
  const targetEl = visibleItems[currentIndex];
  const imgSrc = targetEl.querySelector('.g-img').src;
  const caption = targetEl.getAttribute('data-desc');
  
  // Simple fade effect animation
  const mainImg = document.getElementById('lbImg');
  mainImg.style.opacity = '0';
  setTimeout(() => {
    mainImg.src = imgSrc;
    document.getElementById('lbCaption').innerText = caption;
    mainImg.style.opacity = '1';
  }, 150);
  
  updateNavButtons();
}

function updateNavButtons() {
  // Optional: hide buttons if only 1 visible image
  const prevBtn = document.querySelector('.lb-prev');
  const nextBtn = document.querySelector('.lb-next');
  
  if(visibleItems.length <= 1) {
    prevBtn.style.display = 'none';
    nextBtn.style.display = 'none';
  } else {
    prevBtn.style.display = 'flex';
    nextBtn.style.display = 'flex';
  }
}

// Keyboard controls
document.addEventListener('keydown', (e) => {
  if(document.getElementById('lightBox').classList.contains('active')) {
    if(e.key === 'Escape') closeLB();
    if(e.key === 'ArrowRight') changeImg(1);
    if(e.key === 'ArrowLeft') changeImg(-1);
  }
});
  </script>






</body>
</html>