<?php include 'header.php';
include 'backoffice/connection.php'; // Include database connection

// Fetch all facilities from the database
$facilitiesQuery = "SELECT * FROM facilities ORDER BY id ASC";
$facilitiesResult = mysqli_query($conn, $facilitiesQuery);
?>


<!-- Floating Bar -->
  <div class="features-bar d-none d-lg-block">
    <div class="row g-0">
      <div class="col-3">
        <div class="f-item">
          <div class="f-icon"><i class="bi bi-geo-alt"></i></div>
          <div class="f-text"><h6>Prime Location</h6><p>In the heart of city</p></div>
        </div>
      </div>
      <div class="col-3">
        <div class="f-item">
          <div class="f-icon"><i class="bi bi-door-closed"></i></div>
          <div class="f-text"><h6>Elegant Rooms</h6><p>Designed for comfort</p></div>
        </div>
      </div>
      <div class="col-3">
        <div class="f-item">
          <div class="f-icon"><i class="bi bi-cup-hot"></i></div>
          <div class="f-text"><h6>Multi Cuisine</h6><p>Flavors & cultures</p></div>
        </div>
      </div>
      <div class="col-3">
        <div class="f-item">
          <div class="f-icon"><i class="bi bi-heart"></i></div>
          <div class="f-text"><h6>Hospitality</h6><p>Feels like home</p></div>
        </div>
      </div>
    </div>
  </div>
</section>


<!-- ============ ROOMS ============ -->
<section class="section rooms" id="roo">
  <div class="dots d-none d-lg-block"></div>
  <div class="container">
    <div class="row align-items-center g-5">
      <div class="col-lg-5">
        <span class="eyebrow">Stay in Style</span>
        <h2 class="section-title mt-2 mb-3">Rooms That<br>Redefine <span class="text-orange">Comfort</span></h2>
        <p class="muted mb-4" style="max-width:330px">Spacious, elegant and thoughtfully designed rooms equipped with modern amenities for a relaxing stay.</p>
        <a href="#" class="btn-outline-orange">EXPLORE ROOMS <span class="ic-circle"><i class="bi bi-arrow-right"></i></span></a>

    

        <!-- Floating decorative circles -->
        <div class="rooms-float-circle c1"></div>
        <div class="rooms-float-circle c2"></div>
        <div class="rooms-float-circle c3"></div>

        <!-- Subtle cross-hatch pattern -->
        
      </div>

      <div class="col-lg-7">
        <img class="main-img mb-3" src="images/a2.jpg" alt="Luxury Room" onerror="this.onerror=null;this.src='images/a2.jpg';">
        <div class="row g-3">
          <div class="col-4"><img class="sub-img" src="images/a3.jpg" alt="Room Interior" onerror="this.onerror=null;this.src='images/a3.jpg';"></div>
          <div class="col-4"><img class="sub-img" src="images/a4.jpg" alt="Room View" onerror="this.onerror=null;this.src='images/a4.jpg';"></div>
          <div class="col-4"><img class="sub-img" src="images/slide-2.jpg" alt="Room Bed" onerror="this.onerror=null;this.src='images/slide-2.jpg';"></div>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ============ CULINARY ============ -->
<section class="culinary section" id="abt">
  <div class="container-fluid px-0">
    <div class="row g-0 align-items-center">
      <div class="col-lg-6 p-0">
        <img class="food-img" src="images/abt.jpg" alt="Gourmet Dish" onerror="this.onerror=null;this.src='images/abt.jpg';">
      </div>
      <div class="col-lg-6">
        <div class="culinary-content">
          <span class="eyebrow">About Us</span>
          <h2 class="section-title mt-2 mb-3">
            Hotel <span class="text-orange">Kottaram Regency </span>
          </h2>
          <p class="muted mb-4" style="max-width:420px">
           Kottaram Regency – where comfort, convenience, and warm hospitality come together to create unforgettable memories.
          </p>
          <a href="#" class="btn-olive">
            Read More <span class="ic-circle"><i class="bi bi-arrow-right"></i></span>
          </a>
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ============ FACILITIES / EXPERIENCES ============ -->
<section class="section" id="ame">
  <!-- Decorative background elements -->
  <div class="facilities-grid-bg"></div>
  <div class="facilities-deco deco-ring"></div>
  <div class="facilities-deco deco-dots"></div>
  <div class="facilities-deco deco-line"></div>
  <div class="facilities-deco deco-square"></div>

  <div class="container">
    <div class="text-center mb-5">
      <span class="eyebrow"> Facilities</span>
      <h2 class="section-title mt-2">More Than <span class="text-orange">Just a Stay</span></h2>
    </div>
    <div class="row g-4">
      <?php if (mysqli_num_rows($facilitiesResult) > 0): ?>
        <?php while ($facility = mysqli_fetch_assoc($facilitiesResult)): ?>
          <div class="col-lg-3 col-md-6">
            <div class="exp-card">
              <?php if (!empty($facility['image'])): ?>
                <img src="backoffice/facility_images/<?php echo htmlspecialchars($facility['image']); ?>" alt="<?php echo htmlspecialchars($facility['facility_name']); ?>" onerror="this.onerror=null;this.src='images/c1.jpg';">
              <?php else: ?>
                <img src="images/c1.jpg" alt="No Image Available">
              <?php endif; ?>
              <div class="body">
                <div class="exp-ico"><i class="bi bi-check-circle-fill"></i></div>
                <h6><?php echo htmlspecialchars($facility['facility_name']); ?></h6>
                <p><?php echo htmlspecialchars($facility['description']); ?></p>
                <span class="card-arrow"><i class="bi bi-arrow-right"></i></span>
              </div>
            </div>
          </div>
        <?php endwhile; ?>
      <?php else: ?>
        <div class="col-12 text-center">
          <p>No facilities available at the moment.</p>
        </div>
      <?php endif; ?>
    </div>
    <div class="text-center mb-5 mt-3">
      <a href="#" class="btn-outline-orange">VIEW MORE <span class="ic-circle"><i class="bi bi-arrow-right"></i></span></a>
    </div>
  </div>
</section>

<!-- ============ TESTIMONIALS ============ -->
<section class="pb-5">
  <div class="container">
    <div class="testi-wrap">
      <div class="row g-0 align-items-stretch">
        <div class="col-lg-7">
          <div class="testi-left d-flex flex-column justify-content-center h-100">
            <div id="testiCarousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="4000">
              <div class="carousel-inner">
                <div class="carousel-item active">
                  <span class="quote-mark">&ldquo;</span>
                  <p class="testi-text mt-2 mb-2">Wonderful stay! The rooms were spotless, the staff was courteous, and the food was outstanding. Highly recommended!</p>
                  <p class="testi-author mb-0">— Anjali Menon</p>
                </div>
                <div class="carousel-item">
                  <span class="quote-mark">&ldquo;</span>
                  <p class="testi-text mt-2 mb-2">A truly memorable experience. The ambiance, the service and the attention to detail were simply perfect.</p>
                  <p class="testi-author mb-0">— Rahul Nair</p>
                </div>
                <div class="carousel-item">
                  <span class="quote-mark">&ldquo;</span>
                  <p class="testi-text mt-2 mb-2">Felt right at home from the moment we arrived. The culinary journey was the highlight of our trip!</p>
                  <p class="testi-author mb-0">— Sarah Thompson</p>
                </div>
                <div class="carousel-item">
                  <span class="quote-mark">&ldquo;</span>
                  <p class="testi-text mt-2 mb-2">Elegant rooms, warm hospitality and a prime location. We will definitely be coming back soon.</p>
                  <p class="testi-author mb-0">— Vikram Das</p>
                </div>
              </div>
              <div class="carousel-indicators">
                <button type="button" data-bs-target="#testiCarousel" data-bs-slide-to="0" class="active"></button>
                <button type="button" data-bs-target="#testiCarousel" data-bs-slide-to="1"></button>
                <button type="button" data-bs-target="#testiCarousel" data-bs-slide-to="2"></button>
                <button type="button" data-bs-target="#testiCarousel" data-bs-slide-to="3"></button>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-5 p-0">
          <img class="testi-img" src="images/test.jpg" alt="Hotel Building" onerror="this.onerror=null;this.src='images/slide-2.jpg';">
        </div>
      </div>
    </div>
  </div>
</section>

<!-- ============ GALLERY ============ -->
<section class="pb-5" id="gal">
  <div class="container gallery-head mb-4">
    <span class="eyebrow">Gallery</span>
  </div>
  <div class="container">
    <div class="d-flex align-items-center gap-3">
      <button class="gallery-nav" id="galLeft"><i class="bi bi-arrow-left"></i></button>
      <div class="gallery-viewport flex-grow-1">
        <div class="gallery-track" id="galTrack">
          <img src="images/a1.jpg" alt="Gallery 1" onerror="this.onerror=null;this.src='images/a1.jpg';">
          <img src="images/a2.jpg" alt="Gallery 2" onerror="this.onerror=null;this.src='images/a2.jpg';">
          <img src="images/a3.jpg" alt="Gallery 3" onerror="this.onerror=null;this.src='images/a3.jpg';">
          <img src="images/a4.jpg" alt="Gallery 4" onerror="this.onerror=null;this.src='images/a4.jpg';">
          <img src="images/g1.jpg" alt="Gallery 5" onerror="this.onerror=null;this.src='images/g1.jpg';">
          <img src="images/g2.jpg" alt="Gallery 6" onerror="this.onerror=null;this.src='images/g2.jpg';">
          <img src="images/g3.jpg" alt="Gallery 7" onerror="this.onerror=null;this.src='images/g3.jpg';">
          <img src="images/g4.jpg" alt="Gallery 8" onerror="this.onerror=null;this.src='images/g4.jpg';">
        </div>
      </div>
      <button class="gallery-nav" id="galRight"><i class="bi bi-arrow-right"></i></button>
    </div>
  </div>
   <div class="text-center mt-4">
      <a href="#" class="btn-outline-orange">VIEW MORE <span class="ic-circle"><i class="bi bi-arrow-right"></i></span></a>
    </div>
</section>



<?php include 'footer.php'; ?>