<?php
// 1. Database connection include karein
include('db_config.php');

// 2. Iss page ka Unique Slug set karein
$slug = "kedarnath-by-helicopter"; 

// 3. Database se page data fetch karein
$stmt = $conn->prepare("SELECT * FROM packages WHERE slug = ?");
$stmt->bind_param("s", $slug);
$stmt->execute();
$package = $stmt->get_result()->fetch_assoc();

// 4. Dynamic Variables Setup (Database fallback values ke saath)
$page_title         = $package['title'] ?? "Book Kedarnath Helicopter Services | Ex Dehradun | 2026";
$meta_description   = $package['meta_description'] ?? "Book your Kedarnath helicopter services now and travel to Kedarnath in 2026 from Dehradun!";
$package_price      = $package['price'] ?? "₹ 85,000.00";
$package_price_unit = $package['price_unit'] ?? "Per Person";
$package_duration   = $package['duration'] ?? "SAME DAY";
$banner_image       = !empty($package['banner_image']) ? $package['banner_image'] : "assents/images/kedarnath-3n4d.jpg";

// 5. Form Submission Handler (Direct Database Entry)
$form_msg = "";
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
    $name       = $_POST['name'];
    $email      = $_POST['email'];
    $phone      = $_POST['phone'];
    $passengers = intval($_POST['passanger']);
    $travel_date= $_POST['date'];
    $message    = $_POST['message'];

    $inq_stmt = $conn->prepare("INSERT INTO inquiries (package_name, name, email, phone, passengers, travel_date, message) VALUES (?, ?, ?, ?, ?, ?, ?)");
    $inq_stmt->bind_param("ssssiss", $slug, $name, $email, $phone, $passengers, $travel_date, $message);
    
    if ($inq_stmt->execute()) {
        $form_msg = "Thank you for your enquiry! Our team will contact you shortly.";
    } else {
        $form_msg = "Something went wrong. Please try again.";
    }
}

// 6. Include Header
include('header.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?php echo htmlspecialchars($page_title); ?></title>
    <meta name="description" content="<?php echo htmlspecialchars($meta_description); ?>">
    <link rel="icon" type="image/png" href="home/img/favicon.jpg">

    <!-- External CSS & Google Recaptcha -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap" rel="stylesheet">
    <script src="https://www.google.com/recaptcha/api.js" async defer></script>

    <!-- INTERNAL MODERN UI CSS -->
    <style type="text/css">
        :root {
            --primary-color: #0F172A;
            --secondary-color: #D4A359;
            --brand-green: #12521f;
            --light-bg: #F8FAFC;
            --text-color: #334155;
            --border-color: #E2E8F0;
        }

        * { 
            box-sizing: border-box; 
            margin: 0; 
            padding: 0; 
            font-family: 'Poppins', sans-serif; 
        }
        
        body { 
            color: var(--text-color); 
            background-color: #FDFDFD; 
            line-height: 1.7; 
        }

        .container { 
            max-width: 1200px; 
            margin: 0 auto; 
            padding: 0 20px; 
        }

        /* Main Content Layout */
        .layout-grid { 
            display: grid; 
            grid-template-columns: 2fr 1fr; 
            gap: 35px; 
            margin: 30px 0; 
        }

        /* Hero Image & Headings */
        .hero-img { 
            width: 100%; 
            max-height: 420px; 
            object-fit: cover; 
            border-radius: 14px; 
            box-shadow: 0 4px 20px rgba(0,0,0,0.06);
        }
        .main-heading {
            margin-top: 20px; 
            font-size: 26px; 
            color: var(--primary-color);
            font-weight: 700;
        }
        .badge-rating { 
            color: #D97706; 
            margin: 12px 0; 
            display: flex; 
            align-items: center; 
            gap: 8px; 
            font-size: 14px;
        }
        .badge-rating b { color: var(--primary-color); }
        
        .price-tag { 
            font-size: 28px; 
            color: var(--brand-green); 
            font-weight: 700; 
            margin: 12px 0; 
        }
        .price-tag span { 
            font-size: 14px; 
            color: #64748B; 
            font-weight: 500; 
        }

        .mt-8 { margin-top: 12px; }

        /* Key Highlights Strip */
        .info-strip { 
            display: grid; 
            grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
            background: var(--light-bg); 
            border-radius: 12px; 
            padding: 18px; 
            margin: 25px 0; 
            gap: 15px; 
            border: 1px solid var(--border-color); 
        }
        .info-item { 
            display: flex; 
            align-items: center; 
            gap: 12px; 
        }
        .info-item i { 
            font-size: 22px; 
            color: var(--secondary-color); 
            background: #FEF3C7;
            padding: 10px;
            border-radius: 8px;
        }
        .info-item h6 { 
            font-size: 11px; 
            text-transform: uppercase; 
            color: #64748B; 
            letter-spacing: 0.5px;
        }
        .info-item p { 
            font-size: 13.5px; 
            font-weight: 600; 
            color: var(--primary-color); 
        }

        /* Sidebar Booking Form */
        .booking-card { 
            background: #fff; 
            border: 1px solid var(--border-color); 
            padding: 28px; 
            border-radius: 14px; 
            box-shadow: 0 4px 20px rgba(0,0,0,0.04); 
            position: sticky; 
            top: 25px; 
        }
        .booking-card h3 { 
            font-size: 18px; 
            margin-bottom: 20px; 
            border-bottom: 2px solid var(--secondary-color); 
            padding-bottom: 8px; 
            color: var(--primary-color);
            font-weight: 600;
        }
        .form-group { 
            margin-bottom: 15px; 
        }
        .form-group input, .form-group textarea { 
            width: 100%; 
            padding: 12px 14px; 
            border: 1px solid var(--border-color); 
            border-radius: 8px; 
            font-size: 13.5px; 
            outline: none;
            transition: border-color 0.2s;
        }
        .form-group input:focus, .form-group textarea:focus {
            border-color: var(--secondary-color);
        }
        .btn-submit { 
            width: 100%; 
            background: var(--brand-green); 
            color: #fff; 
            padding: 13px; 
            border: none; 
            border-radius: 8px; 
            font-size: 15px; 
            font-weight: 600; 
            cursor: pointer; 
            transition: opacity 0.2s; 
            margin-top: 5px;
        }
        .btn-submit:hover { opacity: 0.9; }

        /* Navigation Tabs */
        .tabs-nav { 
            display: flex; 
            border-bottom: 2px solid var(--border-color); 
            margin-top: 35px; 
            overflow-x: auto; 
            gap: 5px;
        }
        .tab-btn { 
            padding: 12px 20px; 
            background: none; 
            border: none; 
            font-size: 13.5px; 
            font-weight: 600; 
            cursor: pointer; 
            border-bottom: 3px solid transparent; 
            white-space: nowrap; 
            color: #64748B;
            transition: color 0.2s;
        }
        .tab-btn:hover { color: var(--primary-color); }
        .tab-btn.active { 
            border-bottom-color: var(--secondary-color); 
            color: var(--primary-color); 
        }
        .tab-content { 
            display: none; 
            padding: 30px 0; 
        }
        .tab-content.active { 
            display: block; 
        }
        .tab-content h2 {
            font-size: 20px;
            color: var(--primary-color);
            margin-bottom: 15px;
            font-weight: 600;
        }
        .tab-content h3 {
            font-size: 16px;
            color: var(--primary-color);
            margin-bottom: 10px;
            font-weight: 600;
        }

        /* List & Table Formatting */
        .custom-list { 
            list-style: none; 
            margin-top: 12px; 
        }
        .custom-list.mb-20 {
            margin-bottom: 20px;
        }
        .custom-list li { 
            position: relative; 
            padding-left: 24px; 
            margin-bottom: 10px; 
            font-size: 14px;
        }
        .custom-list.check-list li::before { 
            content: "✓"; 
            position: absolute; 
            left: 0; 
            color: var(--brand-green); 
            font-weight: bold; 
        }
        .custom-list.cross-list li::before { 
            content: "✕"; 
            position: absolute; 
            left: 0; 
            color: #EF4444; 
            font-weight: bold; 
        }

        table.policy-table { 
            width: 100%; 
            border-collapse: collapse; 
            margin: 20px 0; 
            font-size: 14px;
        }
        table.policy-table th, table.policy-table td { 
            border: 1px solid var(--border-color); 
            padding: 12px 15px; 
            text-align: left; 
        }
        table.policy-table th { 
            background: var(--light-bg); 
            color: var(--primary-color);
            font-weight: 600;
        }

        .alert-success { 
            background: #DCFCE7; 
            color: #166534; 
            padding: 12px; 
            border-radius: 8px; 
            margin-bottom: 15px; 
            font-size: 13.5px;
            border: 1px solid #BBF7D0;
        }
        .link-terms { 
            font-size: 12.5px; 
            color: var(--secondary-color); 
            text-decoration: none; 
            font-weight: 500;
        }
        .link-terms:hover { text-decoration: underline; }

        @media (max-width: 992px) { 
            .layout-grid { 
                grid-template-columns: 1fr; 
                gap: 25px;
            } 
            .booking-card {
                position: relative;
                top: 0;
            }
        }
    
        /* Premium responsive refinements — visual only; PHP, form and tab logic unchanged */
        html { scroll-behavior: smooth; }
        body { overflow-x: hidden; }
        .container { width: min(100% - 40px, 1200px); }
        .layout-grid { align-items: start; }
        .main-content, .sidebar { min-width: 0; }
        .hero-img { display:block; height:clamp(230px,36vw,420px); object-position:center; background:#e2e8f0; }
        .main-heading { font-size:clamp(23px,2.3vw,30px); line-height:1.3; letter-spacing:-.45px; }
        .main-content > p { font-size:14px; line-height:1.85; color:#475569; }
        .main-content > h3 { color:var(--primary-color); font-size:19px; margin:12px 0 8px; }
        .price-tag { display:flex; align-items:baseline; flex-wrap:wrap; gap:5px; }
        .info-strip { grid-template-columns:repeat(4,minmax(0,1fr)); }
        .info-item, .info-item > div { min-width:0; }
        .info-item p { overflow-wrap:anywhere; }
        .booking-card { box-shadow:0 12px 35px rgba(15,23,42,.09); }
        .booking-card h3 { font-size:20px; }
        .form-group input, .form-group textarea { min-height:46px; background:#fff; color:#0f172a; }
        .form-group textarea { min-height:96px; resize:vertical; }
        .form-group input:focus, .form-group textarea:focus { border-color:var(--secondary-color); box-shadow:0 0 0 3px rgba(212,163,89,.16); }
        .btn-submit { min-height:48px; }
        .tabs-nav { scrollbar-width:thin; scrollbar-color:#d4a359 #f1f5f9; -webkit-overflow-scrolling:touch; }
        .tab-btn { flex:0 0 auto; }
        .tab-content { overflow-wrap:anywhere; }
        table.policy-table { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
        table.policy-table th, table.policy-table td { min-width:150px; }
        @media (max-width:992px) {
            .container { width:min(100% - 32px,760px); }
            .layout-grid { grid-template-columns:minmax(0,1fr); gap:24px; }
            .booking-card { position:static; }
            .info-strip { grid-template-columns:repeat(2,minmax(0,1fr)); }
        }
        @media (max-width:600px) {
            .container { width:calc(100% - 28px); padding:0; }
            .layout-grid { margin:18px 0 28px; gap:22px; }
            .hero-img { height:235px; border-radius:12px; }
            .main-heading { margin-top:15px; font-size:23px; }
            .badge-rating { margin:8px 0; font-size:13px; }
            .price-tag { margin:9px 0 13px; font-size:25px; }
            .price-tag span { font-size:12px; }
            .info-strip { padding:13px; gap:13px 10px; margin:18px 0; border-radius:10px; }
            .info-item { gap:9px; align-items:flex-start; }
            .info-item i { flex:0 0 38px; width:38px; height:38px; display:grid; place-items:center; padding:0; font-size:17px; }
            .info-item h6 { font-size:10px; line-height:1.4; }
            .info-item p { font-size:12px; line-height:1.45; }
            .main-content > p { font-size:13.5px; line-height:1.75; }
            .main-content > h3 { font-size:17px; }
            .tabs-nav { margin-top:25px; gap:0; }
            .tab-btn { padding:11px 13px; font-size:11px; }
            .tab-content { padding:22px 0; }
            .tab-content h2 { font-size:18px; line-height:1.4; }
            .tab-content h3 { font-size:15px; }
            .custom-list li { font-size:13px; line-height:1.65; }
            .booking-card { padding:20px 16px; border-radius:12px; }
            .booking-card h3 { font-size:19px; margin-bottom:16px; }
            .form-group { margin-bottom:12px; }
            .form-group input, .form-group textarea { font-size:14px; padding:11px 12px; }
            .btn-submit { font-size:14px; }
            .g-recaptcha { max-width:100%; overflow:hidden; transform-origin:left top; }
            table.policy-table { font-size:12px; }
            table.policy-table th, table.policy-table td { padding:10px; }
        }
        @media (max-width:360px) {
            .info-strip { grid-template-columns:1fr; }
            .info-item { align-items:center; }
            .hero-img { height:205px; }
        }

    </style>
</head>
<body>

    <!-- Main Container -->
    <div class="container">
        <div class="layout-grid">
            
            <!-- Main Content Area (Left) -->
            <div class="main-content">
                <img src="<?php echo htmlspecialchars($banner_image); ?>" alt="Kedarnath Helicopter Services" class="hero-img">
                
                <h1 class="main-heading">Kedarnath Helicopter Booking</h1>
                
                <div class="badge-rating">
                    <span>Review <b>4.8 / 5.0</b></span>
                    <div>
                        <i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i><i class="fas fa-star"></i>
                    </div>
                </div>

                <div class="price-tag">
                    Rs. <?php echo htmlspecialchars($package_price); ?> <span>/ <?php echo htmlspecialchars($package_price_unit); ?></span>
                </div>

                <!-- Info Highlights Strip -->
                <div class="info-strip">
                    <div class="info-item">
                        <i class="fas fa-clock"></i>
                        <div>
                            <h6>Duration</h6>
                            <p><?php echo htmlspecialchars($package_duration); ?></p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-place-of-worship"></i>
                        <div>
                            <h6>Tour Type</h6>
                            <p>Pilgrimage</p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-language"></i>
                        <div>
                            <h6>Languages</h6>
                            <p>Hindi, English</p>
                        </div>
                    </div>
                    <div class="info-item">
                        <i class="fas fa-users"></i>
                        <div>
                            <h6>Group Size</h6>
                            <p>6 - 12 Persons</p>
                        </div>
                    </div>
                </div>

                <!-- Overview Section -->
                <p>Counted as one of the pious Dham in Char Dham Yatra, Kedarnath Dham is dedicated to Hindu Lord Shiva. The temple is open to the general public from April to November. It requires an uphill <strong>trek of around 22 km from Gaurikund</strong>. It is an important and highest Jyotirlinga among the total of 12 Jyotirlinga. Located in the Garhwal Himalayan Range in Uttarakhand, Kedarnath is in the top list of pilgrims for its auspicious sanctity. The most recommended way to visit Kedarnath temple is <strong>Kedarnath Yatra by Helicopter</strong> using our Helicopter Charter Services.</p>
                <br>
                <h3>Kedarnath Temple</h3>
                <p>Kedarnath is a holy pilgrimage place located in the Indian state of Uttarakhand, at an altitude of 3,583 meters (11,755 feet) in the Himalayas and known as the home to Kedarnath temple. This Temple was built first by Pandavas during Dwapar Yug after completion of Mahabharat when 5 Pandavas were searching for Moksha.</p>
                <p class="mt-8">The Kedarnath Temple is believed to have been established by the Hindu sage <strong>Adi guru Shankaracharya</strong> in the 8th century and is considered one of the twelve Jyotirlingas. It is also an essential stop on the Char Dham Yatra or Do Dham Yatra.</p>
                <br>
                <p>Online helicopter booking for Kedarnath is easy and quick. We ensure a hassle-free booking and a wonderful Yatra experience with our helicopter services to Kedarnath. We also offer tailor-made packages for Ek Dham Kedarnath Yatra by Helicopter to deliver an impeccable journey experience.</p>

                <!-- Navigation Tabs -->
                <div class="tabs-nav">
                    <button class="tab-btn active" onclick="switchTab(event, 'tab-itinerary')">TOUR ITINERARY</button>
                    <button class="tab-btn" onclick="switchTab(event, 'tab-inclusions')">INCLUSION</button>
                    <button class="tab-btn" onclick="switchTab(event, 'tab-exclusions')">EXCLUSIONS</button>
                    <button class="tab-btn" onclick="switchTab(event, 'tab-payment')">PAYMENT POLICY</button>
                    <button class="tab-btn" onclick="switchTab(event, 'tab-cancellation')">CANCELLATION POLICY</button>
                </div>

                <!-- Tab 1: Itinerary -->
                <div id="tab-itinerary" class="tab-content active">
                    <h2>Tour Itinerary</h2>
                    <ul class="custom-list check-list mb-20">
                        <li>Early morning departure from Sahastradhara Helidrome, Dehradun</li>
                        <li>Arrival at Guptkashi/Phata helipad for change of helicopter</li>
                        <li>Within 1 hour departure to Kedarnath temple lower helipad by another helicopter (as per government rule)</li>
                        <li>Visit to Kedarnath Temple</li>
                        <li>VIP Mandir Darshan</li>
                        <li>Departure from Kedarnath Helipad</li>
                        <li>Arrival at Kedarnath helibase at Sersi / Phata / Guptkashi</li>
                        <li>Departure from Sersi / Phata / Guptkashi Helipad</li>
                    </ul>

                    <hr style="border: 0; border-top: 1px solid var(--border-color); margin: 25px 0;"><br>
                    <h3>Essential Tips for a Successful Kedarnath Yatra</h3>
                    <br>
                    <p><b>Start with a plan:</b> Before embarking on your Kedarnath Yatra, make sure you have a plan. Decide if you will take your own transport, hire a car or book a tour package. Research the best route and accommodation services along the way.</p>
                    <br>
                    <p><b>Understand the weather and pack accordingly:</b> Kedarnath's terrain can be tough to navigate in the monsoon season, while the winter months can be freezing. Pack light-weight, warm clothing and waterproof gear during monsoons, or heavy woolens during colder months.</p>
                    <br>
                    <p><b>Book in advance:</b> Book your Kedarnath Yatra by helicopter in advance to secure comfortable options and avoid unpleasant surprises.</p>
                    <br>
                    <p><b>Carry Necessary Documents:</b> Make sure you carry all necessary documents for registration along with valid original ID proofs (e.g., Passport, Driver's License, Voter ID, or other government-issued IDs).</p>
                </div>

                <!-- Tab 2: Inclusions -->
                <div id="tab-inclusions" class="tab-content">
                    <h2>Inclusions of Kedarnath Yatra by Helicopter</h2>
                    <ul class="custom-list check-list">
                        <li>Pick and drop facility from the Dehradun helipad (optional)</li>
                        <li>Helicopter transportation to Kedarnath ji</li>
                        <li>Breakfast or Lunch arrangement for passengers (optional)</li>
                        <li>Local transportation provided at Dham</li>
                        <li>Shuttle Tickets to Kedarnath ji</li>
                        <li>VIP Darshan tickets at the Kedarnath temple</li>
                    </ul>
                </div>

                <!-- Tab 3: Exclusions -->
                <div id="tab-exclusions" class="tab-content">
                    <h2>Exclusions of Chardham Yatra by Helicopter</h2>
                    <ul class="custom-list cross-list">
                        <li>Any personal expenses, extra meals, or accommodations not mentioned in inclusions.</li>
                        <li>Special Palki, Pony, or Porter charges if opted.</li>
                        <li>Cost arising due to flight delays/cancellation caused by bad weather or natural calamities.</li>
                    </ul>
                </div>

                <!-- Tab 4: Payment Policy -->
                <div id="tab-payment" class="tab-content">
                    <h2>Payment Terms</h2>
                    <ul class="custom-list check-list">
                        <li>The booking has to be done in advance with a deposit of 25% of the total amount. Balance payment has to be deposited 20 days prior to the date of arrival at Dehradun.</li>
                        <li>Passengers will not be permitted to board or commence the tour, unless full & final payment of the tour has been done.</li>
                    </ul>
                </div>

                <!-- Tab 5: Cancellation Policy -->
                <div id="tab-cancellation" class="tab-content">
                    <h2>Cancellation Policy</h2>
                    <p>If passengers cancel their booking prior or after commencement of tour, following cancellation charges will be applicable:</p>
                    
                    <table class="policy-table">
                        <thead>
                            <tr>
                                <th>Cancellation Timing</th>
                                <th>Applicable Charges</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>More Than 15 Days Prior To Travel</td>
                                <td>50% of Total Cost</td>
                            </tr>
                            <tr>
                                <td>15 Or Less Days Prior To Travel Date</td>
                                <td>No Refund</td>
                            </tr>
                            <tr>
                                <td>No Show</td>
                                <td>No Refund</td>
                            </tr>
                            <tr>
                                <td>After Commencement Of Tour</td>
                                <td>No Refund</td>
                            </tr>
                        </tbody>
                    </table>
                </div>

            </div>

            <!-- Booking Form Sidebar (Right) -->
            <div class="sidebar">
                <div class="booking-card">
                    <h3>Book Now</h3>

                    <?php if(!empty($form_msg)): ?>
                        <div class="alert-success"><?php echo htmlspecialchars($form_msg); ?></div>
                    <?php endif; ?>

                    <form method="post" action="" name="enquiry">
                        <div class="form-group">
                            <input type="text" required name="name" placeholder="Full Name">
                        </div>
                        <div class="form-group">
                            <input type="email" required name="email" placeholder="Email Address">
                        </div>
                        <div class="form-group">
                            <input type="text" required name="phone" placeholder="Phone Number">
                        </div>
                        <div class="form-group">
                            <input type="number" required name="passanger" placeholder="No of Passengers">
                        </div>
                        <div class="form-group">
                            <input type="date" name="date" required>
                        </div>
                        <div class="form-group">
                            <textarea required name="message" rows="3" placeholder="Write Your Comment"></textarea>
                        </div>

                        <!-- Recaptcha Widget -->
                        <div class="form-group" style="margin-bottom: 12px;">
                            <div class="g-recaptcha" data-sitekey="6LeLQDwnAAAAAA_YwdpdtrfWHmovUHYj5jDrnJlf"></div>
                        </div>

                        <div style="margin-bottom: 15px; font-size: 13px;">
                            <a href="privacy-policy" class="link-terms">Privacy Policy</a> &bull; 
                            <a href="terms-and-conditions" class="link-terms">Terms & Conditions</a>
                        </div>

                        <button type="submit" name="submit" class="btn-submit">Send Message</button>
                    </form>
                </div>
            </div>

        </div>
    </div>

    <!-- Tab Switcher Script -->
    <script>
        function switchTab(evt, tabId) {
            let contents = document.getElementsByClassName("tab-content");
            for (let i = 0; i < contents.length; i++) {
                contents[i].classList.remove("active");
            }

            let buttons = document.getElementsByClassName("tab-btn");
            for (let i = 0; i < buttons.length; i++) {
                buttons[i].classList.remove("active");
            }

            document.getElementById(tabId).classList.add("active");
            evt.currentTarget.classList.add("active");
        }
    </script>
</body>
</html>
<?php
// Include Footer
include('footer.php');
?>