<?php 
include 'db_connect.php'; 

// --- SEO CONFIGURATION ---
$page_title = "Aastha Padghan Surgical Hospital – Best Laparoscopic & General Surgery Hospital in Chikhali";
$meta_desc = "Aastha Surgical Hospital, Chikhali — Expert laparoscopic & general surgery by Dr. Gajanan Padghan and Dr. Anita Padghan. Specialists in gallbladder, appendix, hernia, piles, fistula & skin treatments. 24x7 Emergency care.";
$meta_keywords = "Aastha Padghan Hospital, Laparoscopic Surgeon Chikhali, General Surgeon Buldhana, Piles treatment Chikhali, Gallbladder surgery Chikhali, Hernia specialist, Cosmetologist Chikhali";
?>
<!DOCTYPE html>
<html lang="en" class="scroll-smooth">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <title><?php echo $page_title; ?></title>
    <meta name="description" content="<?php echo $meta_desc; ?>">
    <meta name="keywords" content="<?php echo $meta_keywords; ?>">
    <meta name="author" content="Dr. Gajanan Padghan">
    
    <meta property="og:title" content="Aastha Padghan Surgical Hospital - Chikhali">
    <meta property="og:site_name" content="Aastha Padghan Surgical Hospital">
    <meta property="og:description" content="Trusted surgical care & advanced laparoscopy. Book your appointment online.">
    <meta property="og:image" content="https://aasthapadghanhospital.com/assets/logo.png">
    <meta property="og:url" content="https://aasthapadghanhospital.com">

    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "name": "Aastha Padghan Surgical Hospital",
      "alternateName": ["Aastha Hospital", "Padghan Hospital"],
      "url": "https://aasthapadghanhospital.com/"
    }
    </script>
    <script type="application/ld+json">
    {
      "@context": "https://schema.org",
      "@type": "MedicalOrganization",
      "name": "Aastha Padghan Surgical Hospital",
      "alternateName": "Padghan Hospital Chikhali",
      "url": "https://aasthapadghanhospital.com",
      "logo": "https://aasthapadghanhospital.com/assets/logo.png",
      "contactPoint": {
        "@type": "ContactPoint",
        "telephone": "+91-9922346009",
        "contactType": "emergency"
      },
      "address": {
        "@type": "PostalAddress",
        "streetAddress": "Ambika Urban Bank Samor, Khandala Road",
        "addressLocality": "Chikhali",
        "addressRegion": "Maharashtra",
        "postalCode": "443201",
        "addressCountry": "IN"
      },
      "medicalSpecialty": ["General Surgery", "Laparoscopic Surgery", "Cosmetology"]
    }
    </script>

    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <style>
        body { font-family: 'Poppins', sans-serif; }
        .hero-bg { 
            background: linear-gradient(rgba(0,137,123,0.95), rgba(0,137,123,0.85)), url('assets/hospital-bg.jpg'); 
            background-size: cover; 
            background-position: center; 
        }
        .btn-primary { background-color: #00897B; color: white; padding: 10px 20px; border-radius: 5px; transition: 0.3s; }
        .btn-primary:hover { background-color: #00695C; }
        .zoom-in { animation: zoomIn 0.3s ease-out; }
        @keyframes zoomIn { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
    </style>
</head>
<body class="bg-gray-50 text-gray-800 w-full overflow-x-hidden">

    <?php include 'includes/header.php'; ?>

    <section id="home" class="bg-teal-900 text-white relative w-full overflow-hidden">
        <div class="absolute inset-0 opacity-10 bg-[url('assets/logo.png')] bg-repeat space-x-4"></div>

        <div class="container mx-auto px-6 md:px-12 pt-16 pb-12 md:pt-20 md:pb-20 flex flex-col-reverse md:flex-row items-center min-h-[85vh]">
            <div class="w-full md:w-1/2 z-10 text-center md:text-left pb-12 md:pb-0">
                <span class="bg-teal-700 text-teal-100 py-1 px-4 rounded-full text-xs font-bold uppercase tracking-wider mb-6 inline-block border border-teal-500 shadow-sm">
                    Chief Surgeon
                </span>
                <h1 class="text-2xl md:text-4xl font-bold mb-4 leading-tight drop-shadow-md">
    Dr. Gajanan D. Padghan
</h1>

                <p class="text-xl md:text-2xl text-teal-200 font-medium mb-6">M.S.(ISM) — General Surgeon | FMAS, DMAS</p>
                
                <p class="text-gray-100 text-sm md:text-lg mb-10 max-w-2xl mx-auto md:mx-0 leading-relaxed text-justify opacity-90">
                    Specialist in <strong>Advanced Laparoscopic Surgery</strong>, Advanced Proctology, Piles, Fistula, Fissure, Pilonidal Sinus, Rectal Prolapse, Rectal Carcinoma treatment and Hernia repair. Trusted by thousands of patients in Buldhana for safe and effective care.
                    <span class="block mt-6 border-l-4 border-yellow-400 pl-4 py-2 text-teal-50 font-medium bg-teal-800/30 rounded-r">
                        "आधुनिक दुर्बिणीद्वारे शस्त्रक्रिया, तसेच गुदभाग आधुनिक शस्त्रक्रिया ज्यात मूळव्याध, भगंदर, फिशर, पायलोनायडल सायन्स आणि गुदभाग बाहेर येणे, गुदाशयाच्या कर्करोगावरील उपचार आणि हर्निया दुरुस्ती यांचा समावेश आहे. सुरक्षित आणि प्रभावी उपचारांसाठी बुलढाणाकरांचे एकमेव हक्काचे विश्वसनीय ठिकाण, एकवेळ अवश्य भेट द्या!"
                    </span>
                </p>
                
                <div class="flex flex-col sm:flex-row gap-4 justify-center md:justify-start">
                    <a href="#appointment" class="bg-yellow-500 text-teal-900 font-bold py-4 px-8 rounded-full hover:bg-yellow-400 transition shadow-lg transform hover:-translate-y-1 text-center">Book Appointment</a>
                    <a href="https://wa.me/919922346009" class="border-2 border-white text-white font-bold py-4 px-8 rounded-full hover:bg-white hover:text-teal-900 transition flex items-center justify-center gap-2">
                        <img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/WhatsApp.svg" class="w-5 h-5"> WhatsApp
                    </a>
                </div>
            </div>
            
            <div class="w-full md:w-1/2 flex justify-center md:justify-end relative z-0 mt-8 md:mt-0">
                <div class="absolute bg-teal-600 rounded-full w-64 h-64 md:w-[500px] md:h-[500px] -z-10 top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 blur-3xl opacity-40 animate-pulse"></div>
                <img src="assets/dr-gajanan-hero.png" alt="Dr. Gajanan Padghan" class="max-h-[50vh] md:max-h-[85vh] w-auto object-contain drop-shadow-2xl hover:scale-105 transition duration-500">
            </div>
        </div>
    </section>

    <section id="doctors" class="py-20 w-full bg-white">
        <div class="container mx-auto px-6 md:px-12">
            <h2 class="text-3xl md:text-4xl font-bold text-center text-gray-800 mb-12">Meet Our Specialists</h2>
            <div class="grid md:grid-cols-2 gap-8 max-w-5xl mx-auto">
                <?php
                $sql = "SELECT * FROM doctors";
                $result = $conn->query($sql);
                if ($result->num_rows > 0) {
                    while($row = $result->fetch_assoc()) {
                        echo '<a href="doctor_details.php?id=' . $row['id'] . '" class="block bg-white p-8 rounded-2xl shadow-lg border border-gray-100 text-center hover:shadow-2xl transition transform hover:-translate-y-2 group">';
                        echo '<img src="assets/' . $row["image_url"] . '" class="w-32 h-32 md:w-40 md:h-40 rounded-full mx-auto mb-6 object-cover border-4 border-teal-50 group-hover:border-teal-200 transition">';
                        echo '<h3 class="text-2xl font-bold text-teal-800 mb-2">' . $row["name"] . '</h3>';
                        echo '<p class="text-sm font-semibold text-gray-600 mb-3 uppercase tracking-wide">' . $row["qualification"] . '</p>';
                        echo '<span class="inline-block bg-teal-50 text-teal-700 px-3 py-1 rounded-full text-sm font-medium">' . $row["speciality"] . '</span>';
                        echo '</a>';
                    }
                }
                ?>
            </div>
        </div>
    </section>

    <section id="services" class="py-20 w-full bg-teal-50">
        <div class="container mx-auto px-6 md:px-12">
            <h2 class="text-3xl md:text-4xl font-bold text-center text-gray-800 mb-12">Our Services</h2>
            <div class="grid md:grid-cols-2 gap-8 max-w-6xl mx-auto">
                <div class="bg-white p-8 md:p-10 rounded-2xl shadow-md border-t-8 border-teal-600 hover:shadow-xl transition">
                    <h3 class="text-2xl font-bold text-teal-800 mb-8 flex items-center"><span class="mr-3 text-3xl">🏥</span> Surgical & Laparoscopy</h3>
                    <div class="space-y-4">
                        <?php
                        $s_sql = "SELECT * FROM services WHERE category='Surgical'";
                        $s_res = $conn->query($s_sql);
                        if ($s_res->num_rows > 0) {
                            while($row = $s_res->fetch_assoc()) {
                                echo '<div class="pb-4 border-b border-gray-100 last:border-0"><h4 class="font-bold text-lg text-gray-800 mb-2">' . $row['title'] . '</h4>';
                                $items = explode(',', $row['items']);
                                echo '<div class="flex flex-wrap gap-2">';
                                foreach($items as $item) { echo '<span class="text-sm text-gray-600 bg-gray-100 px-2 py-1 rounded">' . trim($item) . '</span>'; }
                                echo '</div></div>';
                            }
                        }
                        ?>
                    </div>
                </div>
                <div class="bg-white p-8 md:p-10 rounded-2xl shadow-md border-t-8 border-pink-500 hover:shadow-xl transition">
                    <h3 class="text-2xl font-bold text-pink-600 mb-8 flex items-center"><span class="mr-3 text-3xl">✨</span> Skin & Cosmetology</h3>
                    <div class="space-y-4">
                        <?php
                        $c_sql = "SELECT * FROM services WHERE category='Cosmetology'";
                        $c_res = $conn->query($c_sql);
                        if ($c_res->num_rows > 0) {
                            while($row = $c_res->fetch_assoc()) {
                                echo '<div class="pb-4 border-b border-gray-100 last:border-0"><h4 class="font-bold text-lg text-gray-800 mb-2">' . $row['title'] . '</h4>';
                                $items = explode(',', $row['items']);
                                echo '<div class="flex flex-wrap gap-2">';
                                foreach($items as $item) { echo '<span class="text-sm text-gray-600 bg-gray-100 px-2 py-1 rounded">' . trim($item) . '</span>'; }
                                echo '</div></div>';
                            }
                        }
                        ?>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <section id="appointment" class="py-20 w-full bg-white">
        <div class="container mx-auto px-6 md:px-12">
            <div class="max-w-3xl mx-auto bg-white p-8 md:p-12 rounded-3xl shadow-2xl border border-gray-100 relative overflow-hidden">
                <div class="absolute top-0 left-0 w-full h-2 bg-gradient-to-r from-teal-500 to-blue-500"></div>
                <h2 class="text-3xl md:text-4xl font-bold text-center mb-8 text-gray-800">Book an Appointment</h2>
                <form action="submit_appointment.php" method="POST" class="space-y-6">
                    <div class="grid md:grid-cols-2 gap-6">
                        <div><label class="block text-sm font-bold text-gray-700 mb-2">Patient Name</label><input type="text" name="name" placeholder="Full Name" required class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 transition bg-gray-50 focus:bg-white"></div>
                        <div><label class="block text-sm font-bold text-gray-700 mb-2">Phone Number</label><input type="tel" name="phone" placeholder="10-digit Mobile" required class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 transition bg-gray-50 focus:bg-white"></div>
                    </div>
                    <div class="grid md:grid-cols-2 gap-6">
                        <div><label class="block text-sm font-bold text-gray-700 mb-2">Select Specialist</label><select name="doctor" class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 transition bg-gray-50 focus:bg-white"><option value="Dr. Gajanan Padghan">Dr. Gajanan Padghan (Surgery)</option><option value="Dr. Anita Padghan">Dr. Anita Padghan (Skin)</option></select></div>
                        <div><label class="block text-sm font-bold text-gray-700 mb-2">Preferred Date</label><input type="date" name="date" required class="w-full p-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-teal-500 transition bg-gray-50 focus:bg-white"></div>
                    </div>
                    <button type="submit" class="w-full bg-teal-600 text-white font-bold text-lg py-4 rounded-lg hover:bg-teal-700 transition transform hover:scale-[1.02] shadow-lg">Confirm Booking</button>
                </form>
            </div>
        </div>
    </section>

   <section id="gallery" class="py-20 w-full bg-gray-50">
        <div class="container mx-auto px-6 md:px-12">
            <h2 class="text-3xl font-bold text-center text-gray-800 mb-10">Hospital Gallery</h2>
            
            <div class="relative group">
                <button id="slideLeft" class="absolute left-0 top-1/2 -translate-y-1/2 -ml-4 z-10 bg-white text-teal-800 p-3 rounded-full shadow-lg hover:bg-teal-50 transition opacity-0 group-hover:opacity-100 duration-300 hidden md:block border border-gray-200">
                    <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"></path></svg>
                </button>

                <div id="gallerySlider" class="flex overflow-x-auto space-x-6 pb-8 px-2 scroll-smooth scrollbar-hide">
                    <?php
                    // Fetch last 10 images for the slider
                    $gal_sql = "SELECT * FROM gallery ORDER BY id DESC LIMIT 10";
                    $gal_res = $conn->query($gal_sql);
                    if ($gal_res->num_rows > 0) {
                        while($row = $gal_res->fetch_assoc()) {
                            $imgTitle = !empty($row['title']) ? $row['title'] : $row['category'];
                            
                            echo '
                            <div class="flex-none w-80 md:w-96 aspect-[4/3] relative overflow-hidden rounded-xl shadow-md cursor-pointer group/card" 
                                 onclick="openLightbox(\''.$row['image_path'].'\', \''.$imgTitle.'\')">
                                
                                <img src="'.$row['image_path'].'" class="w-full h-full object-cover transform group-hover/card:scale-110 transition duration-700 ease-in-out">
                                
                                <div class="absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent opacity-0 group-hover/card:opacity-100 transition duration-300 flex flex-col justify-end p-6">
                                    <p class="text-white font-bold text-lg">'.$imgTitle.'</p>
                                    <p class="text-teal-200 text-xs uppercase tracking-wider">Click to Expand</p>
                                </div>
                            </div>';
                        }
                    } else {
                        echo '<p class="text-center w-full text-gray-500">No images uploaded yet.</p>';
                    }
                    ?>
                </div>

                <button id="slideRight" class="absolute right-0 top-1/2 -translate-y-1/2 -mr-4 z-10 bg-white text-teal-800 p-3 rounded-full shadow-lg hover:bg-teal-50 transition opacity-0 group-hover:opacity-100 duration-300 hidden md:block border border-gray-200">
                    <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg>
                </button>
            </div>

            <div class="text-center mt-6">
                <a href="gallery.php" class="inline-block border-2 border-teal-600 text-teal-600 font-bold py-2 px-8 rounded-full hover:bg-teal-600 hover:text-white transition">View All Photos →</a>
            </div>
        </div>
    </section>

    <style>
        /* Hide scrollbar for Chrome, Safari and Opera */
        .scrollbar-hide::-webkit-scrollbar {
            display: none;
        }
        /* Hide scrollbar for IE, Edge and Firefox */
        .scrollbar-hide {
            -ms-overflow-style: none;  /* IE and Edge */
            scrollbar-width: none;  /* Firefox */
        }
    </style>

    <script>
        document.getElementById('slideLeft').onclick = function () {
            document.getElementById('gallerySlider').scrollLeft -= 400;
        };
        document.getElementById('slideRight').onclick = function () {
            document.getElementById('gallerySlider').scrollLeft += 400;
        };
    </script>

    <section id="videos" class="py-20 w-full bg-white">
        <div class="container mx-auto px-6 md:px-12">
            <h2 class="text-3xl font-bold text-center text-gray-800 mb-12">Health Education Videos</h2>
            <div class="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto">
                <?php
                $vid_sql = "SELECT * FROM videos ORDER BY id DESC LIMIT 3";
                $vid_res = $conn->query($vid_sql);
                if ($vid_res->num_rows > 0) {
                    while($row = $vid_res->fetch_assoc()) {
                        echo '<div class="bg-white rounded-xl shadow-lg overflow-hidden border border-gray-100 hover:shadow-2xl transition">';
                        echo '<iframe class="w-full h-56" src="https://www.youtube.com/embed/' . $row['youtube_id'] . '" allowfullscreen loading="lazy"></iframe>';
                        echo '<div class="p-5"><h3 class="font-bold text-lg text-gray-800 leading-snug">' . $row['title'] . '</h3></div>';
                        echo '</div>';
                    }
                }
                ?>
            </div>
        </div>
    </section>
    
    <section class="py-20 w-full bg-gray-50">
        <div class="container mx-auto px-6 md:px-12 text-center">
            <h2 class="text-3xl font-bold text-gray-800 mb-2">Patient Stories</h2>
            <p class="text-gray-500 mb-12 text-lg">What our patients say about us</p>
            <div class="grid md:grid-cols-3 gap-8 max-w-6xl mx-auto">
                <?php
                $rev_sql = "SELECT * FROM reviews ORDER BY id DESC LIMIT 3";
                $rev_res = $conn->query($rev_sql);
                if ($rev_res->num_rows > 0) {
                    while($row = $rev_res->fetch_assoc()) {
                        echo '<div class="bg-white p-8 rounded-xl shadow-md transform hover:-translate-y-2 transition duration-300 border border-gray-100 relative">';
                        echo '<div class="text-4xl text-gray-200 absolute top-4 left-4">“</div>';
                        echo '<div class="text-yellow-400 text-xl mb-4">';
                        for($i=0; $i<$row['rating']; $i++) { echo '★'; }
                        echo '</div>';
                        echo '<p class="text-gray-600 italic mb-6 leading-relaxed relative z-10">' . $row['review_text'] . '</p>';
                        echo '<div class="flex items-center gap-3 border-t pt-4">';
                        echo '<div class="w-10 h-10 bg-teal-100 rounded-full flex items-center justify-center text-teal-700 font-bold">' . substr($row['patient_name'], 0, 1) . '</div>';
                        echo '<h4 class="font-bold text-gray-800">' . $row['patient_name'] . '</h4>';
                        echo '</div></div>';
                    }
                }
                ?>
            </div>
            <div class="mt-16">
                <a href="https://www.google.com/search?sca_esv=93a27070e35a51f2&authuser=4&sxsrf=AE3TifO__W-ZdrBrnja2cV5WaOr1-AWOOw:1764442884991&si=AMgyJEtREmoPL4P1I5IDCfuA8gybfVI2d5Uj7QMwYCZHKDZ-E2rkEZ4Bs4Ky3NjdC-SPDw0gbhMHEkeWxR5MAapoZmj3_vAHNCpsfYKzF84j6-DI6-wJSVWLlo6KzeHTlYv9rZozE14qyCs6URkr1PHlk2It7m3-kY6qP64rx6n4d8AYf8S_zHUU1khjFnACttbFafp7GZUZmLYKv8QG2IjT9tgthCUrkA%3D%3D&q=%E0%A4%86%E0%A4%B8%E0%A5%8D%E0%A4%A5%E0%A4%BE+%E0%A4%AA%E0%A4%A1%E0%A4%98%E0%A4%BE%E0%A4%A8+%E0%A4%B8%E0%A4%B0%E0%A5%8D%E0%A4%9C%E0%A4%BF%E0%A4%95%E0%A4%B2+-+Aastha+Padghan+Hospital+Reviews&sa=X&ved=2ahUKEwjDsov7hZiRAxXBzzgGHZiDJa0Q0bkNegQIIhAE&cshid=1764442890487644&biw=1280&bih=598&dpr=1.5#lrd=0x3bda11c738ec55d3:0xfed3ef426a6309b8,3" target="_blank" class="inline-flex items-center gap-3 bg-white text-gray-800 font-bold py-4 px-8 rounded-full border border-gray-300 hover:bg-white hover:text-blue-600 hover:border-blue-300 hover:shadow-lg transition shadow-sm">
                    <img src="https://upload.wikimedia.org/wikipedia/commons/c/c1/Google_%22G%22_logo.svg" class="w-6 h-6"> Write a Review on Google
                </a>
            </div>
        </div>
    </section>

    <section class="py-16 w-full bg-white border-t border-gray-100">
        <div class="container mx-auto px-6 md:px-12">
            <div class="grid md:grid-cols-2 gap-12 mb-10">
                <div>
                    <h2 class="text-2xl font-bold text-teal-800 mb-4">Best Surgical Hospital in Chikhali & Buldhana</h2>
                    <p class="text-gray-600 text-sm leading-relaxed text-justify mb-4">Aastha Padghan Surgical Hospital is the trusted destination for <strong>advanced laparoscopic surgery in Chikhali</strong>. Led by <strong>Dr. Gajanan Padghan</strong>, the best general surgeon in Buldhana district, we specialize in minimally invasive treatments for Gallbladder stones, Appendix, Hernia, and Piles.</p>
                    <p class="text-gray-600 text-sm leading-relaxed text-justify">Our facility also houses a modern <strong>Cosmetology Clinic</strong> led by <strong>Dr. Anita Padghan</strong>, offering expert skin and hair treatments. Whether you are looking for a <em>fistula treatment specialist</em> or a <em>skin doctor near you</em>, Aastha Hospital ensures affordable and compassionate care 24x7.</p>
                </div>
                <div>
                    <h3 class="text-xl font-bold text-gray-800 mb-4">Specialized Treatments</h3>
                    <div class="flex flex-wrap gap-2">
                        <span class="bg-gray-50 border border-gray-200 px-3 py-1 rounded-full text-xs text-gray-600 hover:bg-teal-50 hover:text-teal-700 transition cursor-default">Laparoscopic Surgery</span>
                        <span class="bg-gray-50 border border-gray-200 px-3 py-1 rounded-full text-xs text-gray-600 hover:bg-teal-50 hover:text-teal-700 transition cursor-default">Gallbladder Stone</span>
                        <span class="bg-gray-50 border border-gray-200 px-3 py-1 rounded-full text-xs text-gray-600 hover:bg-teal-50 hover:text-teal-700 transition cursor-default">Piles Laser Treatment</span>
                        <span class="bg-gray-50 border border-gray-200 px-3 py-1 rounded-full text-xs text-gray-600 hover:bg-teal-50 hover:text-teal-700 transition cursor-default">Hernia Repair</span>
                        <span class="bg-gray-50 border border-gray-200 px-3 py-1 rounded-full text-xs text-gray-600 hover:bg-teal-50 hover:text-teal-700 transition cursor-default">Acne & Pigmentation</span>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-100 pt-8">
                <h4 class="text-sm font-bold text-gray-400 uppercase mb-3 tracking-widest">Serving Patients From Nearby Areas</h4>
                <p class="text-xs text-gray-400 leading-loose">Hospital near Deulgaon Raja | Hospital near Mehkar | Hospital near Khamgaon | Hospital near Lonar | Hospital near Malkapur | Doctor near Sultanpur | Best doctor near Bawanbir | Surgical hospital near Ruikhed | Emergency hospital near Chikhali Bus Stand.</p>
            </div>
        </div>
    </section>

    <section class="py-12 w-full bg-white border-t-4 border-teal-600 shadow-inner">
        <div class="container mx-auto px-6 md:px-12">
            <h2 class="text-xl font-bold text-center text-gray-800 mb-2">Cashless Treatment Available</h2>
            <p class="text-center text-gray-500 mb-8 text-sm">We are empanelled with major TPA and Insurance Companies</p>
            <div class="flex flex-wrap justify-center items-center gap-8 opacity-80 grayscale hover:grayscale-0 transition duration-500">
                <?php
                $ins_sql = "SELECT * FROM insurance";
                $ins_res = $conn->query($ins_sql);
                while($row = $ins_res->fetch_assoc()) {
                    echo '<div class="bg-white p-4 rounded-lg shadow-sm hover:shadow-md transition w-36 h-20 flex items-center justify-center border border-gray-100">';
                    echo '<img src="' . $row['logo'] . '" alt="' . $row['name'] . '" class="max-h-full max-w-full object-contain filter hover:brightness-110">';
                    echo '</div>';
                }
                ?>
            </div>
        </div>
    </section>

    <?php include 'includes/footer.php'; ?>

    <div id="lightbox" class="fixed inset-0 z-[100] bg-black/95 hidden flex items-center justify-center p-4 backdrop-blur-sm" onclick="closeLightbox()">
        <button class="absolute top-5 right-5 text-white text-5xl font-thin hover:text-red-500 transition">&times;</button>
        <div class="text-center max-w-4xl w-full" onclick="event.stopPropagation()">
            <img id="lb-img" src="" class="max-h-[80vh] w-auto mx-auto rounded-lg shadow-2xl zoom-in">
            <h3 id="lb-caption" class="text-white text-xl mt-4 font-bold tracking-wide"></h3>
        </div>
    </div>

    <?php
    $sets_res = $conn->query("SELECT * FROM settings");
    $settings = [];
    while($row = $sets_res->fetch_assoc()) { $settings[$row['setting_key']] = $row['setting_value']; }

    if(isset($settings['popup_active']) && $settings['popup_active'] == '1') {
    ?>
    <div id="announcement-modal" class="fixed inset-0 bg-black/60 z-[100] flex items-center justify-center p-4 backdrop-blur-sm">
        <div class="bg-white rounded-2xl shadow-2xl max-w-md w-full p-8 relative animate-[bounce_1s_ease-in-out]">
            <button onclick="document.getElementById('announcement-modal').style.display='none'" class="absolute top-4 right-4 text-gray-400 hover:text-red-500 text-2xl font-bold transition">&times;</button>
            <div class="text-center">
                <div class="mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-purple-100 mb-6"><span class="text-3xl">📢</span></div>
                <h3 class="text-xl font-bold text-gray-900 mb-3">Notice</h3>
                <p class="text-gray-600 leading-relaxed mb-6"><?php echo nl2br($settings['popup_message']); ?></p>
                <button onclick="document.getElementById('announcement-modal').style.display='none'" class="w-full inline-flex justify-center rounded-lg border border-transparent shadow-md px-6 py-3 bg-purple-600 text-base font-bold text-white hover:bg-purple-700 transition">OK, Got it</button>
            </div>
        </div>
    </div>
    <?php } ?>

    <script>
        function openLightbox(src, title) {
            const lightbox = document.getElementById('lightbox');
            const img = document.getElementById('lb-img');
            const caption = document.getElementById('lb-caption');
            img.src = src;
            caption.innerText = title;
            lightbox.classList.remove('hidden');
            document.body.style.overflow = 'hidden'; 
        }
        function closeLightbox() {
            document.getElementById('lightbox').classList.add('hidden');
            document.body.style.overflow = 'auto'; 
        }
    </script>

</body>
</html>