<?php
// Dynamic Variables & Data Setup
$page_title = "Book Badrinath Helicopter Services | Ex Dehradun | 2026";
$meta_description = "Book your Badrinath helicopter services now and travel to Badrinath in 2026 from Dehradun! Enjoy a hassle-free and comfortable spiritual journey.";
$package_price = "₹ 85,000.00";
$package_price_unit = "Per Person";
$package_duration = "SAME DAY";
$banner_image = "assents/images/badrinath-banner.jpg";

// Database Connection Include
require_once __DIR__ . '/db_config.php';

// Form Submission Message Handler
$form_msg = "";
$form_msg_type = "";
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['submit'])) {
    $name       = isset($_POST['name']) ? mysqli_real_escape_string($conn, trim($_POST['name'])) : '';
    $email      = isset($_POST['email']) ? mysqli_real_escape_string($conn, trim($_POST['email'])) : '';
    $phone      = isset($_POST['phone']) ? mysqli_real_escape_string($conn, trim($_POST['phone'])) : '';
    $passengers = !empty($_POST['passanger']) ? intval($_POST['passanger']) : 1;
    $travel_date= !empty($_POST['date']) ? mysqli_real_escape_string($conn, $_POST['date']) : NULL;
    $message    = isset($_POST['message']) ? mysqli_real_escape_string($conn, trim($_POST['message'])) : '';
    $package    = "Badrinath Helicopter Services";

    if (!empty($name) && !empty($phone) && !empty($email) && !empty($travel_date)) {
        $sql = "INSERT INTO enquiries (name, email, phone, passengers, travel_date, message, package) VALUES (?, ?, ?, ?, ?, ?, ?)";
        $stmt = $conn->prepare($sql);
        
        if ($stmt === false) {
            die("Database Query Error (Prepare Failed): " . $conn->error);
        }

        $stmt->bind_param("sssisss", $name, $email, $phone, $passengers, $travel_date, $message, $package);

        if ($stmt->execute()) {
            $form_msg = "Thank you for your enquiry! Our team will contact you shortly.";
            $form_msg_type = "success";
        } else {
            $form_msg = "Query Execution Error: " . $stmt->error;
            $form_msg_type = "danger";
        }
        $stmt->close();
    } else {
        $form_msg = "Please fill in all required fields.";
        $form_msg_type = "danger";
    }
}

include('header.php');
?>

<style type="text/css">
    :root {
        --primary-color: #0b3c5d;
        --primary-dark: #072a42;
        --secondary-color: #d4a359;
        --light-bg: #f8f9fa;
        --text-color: #333333;
        --border-color: #e2e8f0;
    }

    * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
        font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    }

    body {
        color: var(--text-color);
        background-color: #ffffff;
        line-height: 1.6;
        overflow-x: hidden;
    }

    .container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0 15px;
        width: 100%;
    }

    /* Fixed Grid Layout to prevent text cutting */
    .layout-grid {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 30px;
        margin-top: 20px;
        margin-bottom: 50px;
        align-items: start;
    }

    .main-content {
        min-width: 0; /* Prevents flex/grid item overflow */
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .hero-img-wrapper {
        width: 100%;
        border-radius: 8px;
        overflow: hidden;
        background: #000;
    }
    .hero-img {
        width: 100%;
        height: auto;
        max-height: 380px;
        object-fit: cover;
        display: block;
    }

    .main-heading {
        margin-top: 15px;
        font-size: clamp(22px, 4vw, 28px);
        color: var(--primary-color);
        line-height: 1.3;
    }

    .badge-rating {
        color: #f39c12;
        margin: 10px 0;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
    }
    .badge-rating span {
        color: var(--text-color);
    }

    .price-tag {
        font-size: clamp(22px, 4vw, 28px);
        color: var(--primary-color);
        font-weight: 700;
        margin: 10px 0;
    }
    .price-tag span {
        font-size: 14px;
        color: #666;
        font-weight: normal;
    }

    .info-strip {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        background: var(--light-bg);
        border-radius: 8px;
        padding: 15px;
        margin: 20px 0;
        gap: 10px;
        border: 1px solid var(--border-color);
    }
    .info-item {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .info-item i {
        font-size: 20px;
        color: var(--primary-color);
        flex-shrink: 0;
    }
    .info-item h6 {
        font-size: 11px;
        text-transform: uppercase;
        color: #777;
    }
    .info-item p {
        font-size: 13px;
        font-weight: 600;
    }

    .tabs-nav {
        display: flex;
        border-bottom: 2px solid var(--border-color);
        margin-top: 30px;
        overflow-x: auto;
        white-space: nowrap;
        scrollbar-width: none;
    }
    .tabs-nav::-webkit-scrollbar {
        display: none;
    }
    .tab-btn {
        padding: 12px 18px;
        background: none;
        border: none;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        border-bottom: 3px solid transparent;
        color: #555;
    }
    .tab-btn.active {
        border-bottom-color: var(--primary-color);
        color: var(--primary-color);
    }
    .tab-content {
        display: none;
        padding: 20px 0;
    }
    .tab-content.active {
        display: block;
    }
    .tab-content h2 {
        font-size: clamp(20px, 3.5vw, 24px);
        margin-bottom: 12px;
        color: var(--primary-color);
    }

    .custom-list {
        list-style: none;
        margin-top: 10px;
    }
    .custom-list li {
        position: relative;
        padding-left: 22px;
        margin-bottom: 10px;
        font-size: 15px;
    }
    .custom-list.check-list li::before {
        content: "✓";
        position: absolute;
        left: 0;
        color: green;
        font-weight: bold;
    }
    .custom-list.cross-list li::before {
        content: "✕";
        position: absolute;
        left: 0;
        color: red;
        font-weight: bold;
    }
    .mb-20 {
        margin-bottom: 20px;
    }

    .table-responsive {
        width: 100%;
        overflow-x: auto;
        margin: 15px 0;
    }
    table.policy-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 480px;
    }
    table.policy-table th, table.policy-table td {
        border: 1px solid var(--border-color);
        padding: 12px 10px;
        text-align: left;
        font-size: 14px;
    }
    table.policy-table th {
        background: var(--light-bg);
    }

    .sidebar {
        width: 100%;
    }
    .booking-card {
        background: #fff;
        border: 1px solid var(--border-color);
        padding: 25px;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
        position: sticky;
        top: 20px;
    }
    .booking-card h3 {
        font-size: 20px;
        margin-bottom: 15px;
        border-bottom: 2px solid var(--secondary-color);
        padding-bottom: 8px;
        color: var(--primary-color);
    }
    .form-group {
        margin-bottom: 14px;
    }
    .form-group input, .form-group textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid #ccc;
        border-radius: 6px;
        font-size: 14px;
        outline: none;
    }
    .form-group input:focus, .form-group textarea:focus {
        border-color: var(--primary-color);
    }
    .g-recaptcha {
        transform-origin: 0 0;
        -webkit-transform-origin: 0 0;
        max-width: 100%;
    }
    .btn-submit {
        width: 100%;
        background: var(--primary-color);
        color: #fff;
        padding: 14px;
        border: none;
        border-radius: 6px;
        font-size: 16px;
        font-weight: bold;
        cursor: pointer;
    }
    .btn-submit:hover {
        background: var(--primary-dark);
    }
    .alert-msg {
        padding: 12px;
        border-radius: 6px;
        margin-bottom: 15px;
        font-size: 14px;
    }
    .alert-msg.success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }
    .alert-msg.danger {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }
    .link-terms-wrapper {
        margin-bottom: 15px;
        font-size: 13px;
    }
    .link-terms {
        display: inline-block;
        color: var(--primary-color);
        text-decoration: none;
    }

    .mobile-bottom-bar {
        display: none;
    }

    /* Responsive Media Queries */
    @media (max-width: 992px) {
        .layout-grid {
            grid-template-columns: 1fr;
            gap: 25px;
        }
        .booking-card {
            position: static;
        }
    }

    @media (max-width: 768px) {
        body {
            padding-bottom: 85px !important;
        }
        
        .mobile-bottom-bar {
            display: flex;
            position: fixed;
            bottom: 0;
            left: 0;
            width: 100%;
            background: #ffffff;
            padding: 12px 16px;
            box-shadow: 0 -4px 15px rgba(0,0,0,0.15);
            z-index: 9999;
            justify-content: space-between;
            align-items: center;
            border-top: 1px solid var(--border-color);
        }
        .mobile-bottom-bar .price-box span {
            display: block;
            font-size: 11px;
            color: #666;
            text-transform: uppercase;
        }
        .mobile-bottom-bar .price-box strong {
            font-size: 18px;
            color: var(--primary-color);
        }
        .mobile-bottom-bar .btn-quick-book {
            background: var(--primary-color);
            color: #fff;
            padding: 10px 22px;
            border-radius: 6px;
            text-decoration: none;
            font-weight: bold;
            font-size: 14px;
        }

        .info-strip {
            grid-template-columns: repeat(2, 1fr);
        }
    }

    @media (max-width: 480px) {
        .info-strip {
            grid-template-columns: 1fr;
        }
    }
</style>

<div class="container">
    <div class="layout-grid">
        <div class="main-content">
            <div class="hero-img-wrapper">
                <img src="<?php echo $banner_image; ?>" alt="Badrinath Helicopter Services" class="hero-img">
            </div>
            
            <h1 class="main-heading">Badrinath Helicopter Booking</h1>
            
            <div class="badge-rating">
                <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>
                <span>Review <b>4.9</b></span>
            </div>
            
            <!-- Fixed Price Tag Overlap Issue -->
            <div class="price-tag">
                <?php echo $package_price; ?> <span>/ <?php echo $package_price_unit; ?></span>
            </div>
            
            <div class="info-strip">
                <div class="info-item">
                    <i class="fas fa-clock"></i>
                    <div>
                        <h6>Duration</h6>
                        <p><?php echo $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</p>
                    </div>
                </div>
            </div>

            <p>Badrinath Dham is one of the most sacred pilgrimage sites among the Char Dham Yatra and is dedicated to Lord Vishnu. Located in the Chamoli district of Uttarakhand at an elevation of 3,133 meters, Badrinath attracts thousands of devotees every year. Traveling to <strong>Badrinath by Helicopter</strong> provides a smooth, comfortable, and time-saving journey with breathtaking aerial views of the snow-capped Himalayas.</p>
            <br>
            <h3>Badrinath Temple</h3>
            <p>The iconic Badrinath Temple stands between the Nar and Narayana mountain ranges, with the majestic Neelkanth Peak in the background. It is believed that Lord Vishnu meditated here in the form of Badri. Taking a helicopter service allows senior citizens and devotees with time constraints to complete their Darshan with maximum convenience and VIP assistance.</p>
            <br>

            <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>

            <div id="tab-itinerary" class="tab-content active">
                <h2>Tour Itinerary</h2>
                <ul class="custom-list check-list mb-20">
                    <li>Morning departure from Sahastradhara Helidrome, Dehradun.</li>
                    <li>Arrival at Badrinath Helipad (B victory / Sharang helipad).</li>
                    <li>Ground transport provided from helipad to Badrinath Temple.</li>
                    <li>Priority VIP Darshan at Badrinath Temple.</li>
                    <li>Visit to Mana Village (The last Indian village) if time permits.</li>
                    <li>Return to Badrinath Helipad for departure back to Dehradun.</li>
                </ul>
                <hr><br>
                <h3>Essential Tips for Badrinath Yatra</h3>
                <br>
                <p><b>Weather Preparation:</b> Badrinath weather can change rapidly. Always carry heavy woolens, windcheaters, and essential personal medicines.</p>
                <br>
                <p><b>Identity Proofs:</b> Keep your government-issued photo ID cards handy for registration and security checks at the helipad.</p>
            </div>

            <div id="tab-inclusions" class="tab-content">
                <h2>Inclusions of Badrinath Yatra by Helicopter</h2>
                <ul class="custom-list check-list">
                    <li>Helicopter flight from Dehradun to Badrinath & return.</li>
                    <li>VIP Darshan slip/assistance at Badrinath Temple.</li>
                    <li>Local transport facility at Badrinath (Helipad to Temple & back).</li>
                    <li>Breakfast or refreshment at the helipad.</li>
                </ul>
            </div>

            <div id="tab-exclusions" class="tab-content">
                <h2>Exclusions of Badrinath Yatra</h2>
                <ul class="custom-list cross-list">
                    <li>Personal expenses, additional meals, or hotel stays.</li>
                    <li>Any special Puja charges inside the temple premises.</li>
                    <li>Expenses caused due to weather delays, bad weather, or natural hazards.</li>
                </ul>
            </div>

            <div id="tab-payment" class="tab-content">
                <h2>Payment Terms</h2>
                <ul class="custom-list check-list">
                    <li>25% advance payment required to confirm the booking.</li>
                    <li>Balance payment must be cleared 20 days prior to the date of travel.</li>
                </ul>
            </div>

            <div id="tab-cancellation" class="tab-content">
                <h2>Cancellation Policy</h2>
                <div class="table-responsive">
                    <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 Package Cost</td>
                            </tr>
                            <tr>
                                <td>15 Or Less Days Prior To Travel Date</td>
                                <td>No Refund</td>
                            </tr>
                            <tr>
                                <td>No Show / Flight Cancelled due to weather</td>
                                <td>Pro-rata / Standard Refund Policy Applies</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>

        <div class="sidebar" id="booking-section">
            <div class="booking-card">
                <h3>Book Now</h3>
                <?php if(!empty($form_msg)): ?>
                    <div class="alert-msg <?php echo $form_msg_type; ?>"><?php echo $form_msg; ?></div>
                <?php endif; ?>
                <form method="post" action="" name="enquiry">
                    <div class="form-group">
                        <input type="text" required name="name" placeholder="Full Name" autocomplete="name">
                    </div>
                    <div class="form-group">
                        <input type="email" required name="email" placeholder="Email" autocomplete="email">
                    </div>
                    <div class="form-group">
                        <input type="tel" required name="phone" placeholder="Phone Number" autocomplete="tel">
                    </div>
                    <div class="form-group">
                        <input type="number" required name="passanger" min="1" 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>
                    <div class="form-group">
                        <div class="g-recaptcha" data-sitekey="6LeLQDwnAAAAAA_YwdpdtrfWHmovUHYj5jDrnJlf"></div>
                    </div>
                    <div class="link-terms-wrapper">
                        <a href="privacy-policy" class="link-terms">Privacy Policy</a> |
                        <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>

<!-- Mobile Sticky Bottom Bar -->
<div class="mobile-bottom-bar">
    <div class="price-box">
        <span>Package Price</span>
        <strong><?php echo $package_price; ?></strong>
    </div>
    <a href="#booking-section" class="btn-quick-book" onclick="scrollToBooking(event)">Book Now</a>
</div>

<script>
function switchTab(evt, tabId) {
    var i, tabcontent, tablinks;
    tabcontent = document.getElementsByClassName("tab-content");
    for (i = 0; i < tabcontent.length; i++) {
        tabcontent[i].style.display = "none";
    }
    tablinks = document.getElementsByClassName("tab-btn");
    for (i = 0; i < tablinks.length; i++) {
        tablinks[i].className = tablinks[i].className.replace(" active", "");
    }
    document.getElementById(tabId).style.display = "block";
    evt.currentTarget.className += " active";
}

function scrollToBooking(e) {
    e.preventDefault();
    const bookingSection = document.getElementById('booking-section');
    bookingSection.scrollIntoView({ behavior: 'smooth' });
}
</script>

<?php
include('footer.php');
?>