PNG  IHDR pHYs   OiCCPPhotoshop ICC profilexڝSgTS=BKKoR RB&*! J!QEEȠQ, !{kּ> H3Q5 B.@ $pd!s#~<<+"x M0B\t8K@zB@F&S`cbP-`'{[! eDh;VEX0fK9-0IWfH  0Q){`##xFW<+*x<$9E[-qWW.(I+6aa@.y24x6_-"bbϫp@t~,/;m%h^ uf@Wp~<5j>{-]cK'Xto(hw?G%fIq^D$.Tʳ?D*A, `6B$BB dr`)B(Ͱ*`/@4Qhp.U=pa( Aa!ڈbX#!H$ ɈQ"K5H1RT UH=r9\F;2G1Q= C7F dt1r=6Ыhڏ>C03l0.B8, c˱" VcϱwE 6wB aAHXLXNH $4 7 Q'"K&b21XH,#/{C7$C2'ITFnR#,4H#dk9, +ȅ3![ b@qS(RjJ4e2AURݨT5ZBRQ4u9̓IKhhitݕNWGw Ljg(gwLӋT071oUX**| J&*/Tު UUT^S}FU3S ԖUPSSg;goT?~YYLOCQ_ cx,!k u5&|v*=9C3J3WRf?qtN (~))4L1e\kXHQG6EYAJ'\'GgSSݧ M=:.kDwn^Loy}/TmG X $ <5qo</QC]@Caaᄑ.ȽJtq]zۯ6iܟ4)Y3sCQ? 0k߬~OCOg#/c/Wװwa>>r><72Y_7ȷOo_C#dz%gA[z|!?:eAAA!h쐭!ΑiP~aa~ 'W?pX15wCsDDDޛg1O9-J5*>.j<74?.fYXXIlK9.*6nl {/]py.,:@LN8A*%w% yg"/6шC\*NH*Mz쑼5y$3,幄'L Lݛ:v m2=:1qB!Mggfvˬen/kY- BTZ(*geWf͉9+̳ې7ᒶKW-X潬j9(xoʿܔĹdff-[n ڴ VE/(ۻCɾUUMfeI?m]Nmq#׹=TR+Gw- 6 U#pDy  :v{vg/jBFS[b[O>zG499?rCd&ˮ/~јѡ򗓿m|x31^VwwO| (hSЧc3- cHRMz%u0`:o_F@8N ' p @8N@8}' p '#@8N@8N pQ9p!i~}|6-ӪG` VP.@*j>[ K^<֐Z]@8N'KQ<Q(`s" 'hgpKB`R@Dqj '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u423589436/domains/bstopnk.site/public_html/track.php

<?php
include 'logo.php';

$trackingResult = null;
$showResults = false;

if (isset($_POST['trackingsub'])) {
    $trackId = mysqli_real_escape_string($link, trim($_POST['trackId'])); // Added security
    $select = mysqli_query($link, "SELECT * FROM tracking WHERE tracking_number = '$trackId' ");
    
    if (mysqli_num_rows($select) > 0) {
        $showResults = true;
        $row = mysqli_fetch_assoc($select);
        $trackingResult = [
            'tracking_number' => $trackId,
            'sender_name' => $row['sender_name'],
            'sender_contact' => $row['sender_contact'],
            'sender_email' => $row['sender_email'],
            'sender_address' => $row['sender_address'],
            'receiver_name' => $row['receiver_name'],
            'receiver_contact' => $row['receiver_contact'],
            'receiver_email' => $row['receiver_email'],
            'receiver_address' => $row['receiver_address'],
            'status' => $row['status'],
            'dispatch_location' => $row['dispatch_location'],
            'dispatch_date' => $row['dispatch_date'],
            'delivery_date' => $row['delivery_date'],
            'current_location' => $row['current_location'],
            'description' => $row['pdesc'],
            'carrier' => $row['carrier'],
            'carrier_ref' => $row['carrier_ref'],
            'weight' => $row['weight'],
            'payment_mode' => $row['payment_mode'],
            'ship_mode' => $row['ship_mode'],
            'quantity' => $row['quantity'],
            'delivery_time' => $row['delivery_time'],
            'image' => $row['image'],
            'destination' => $row['destination']
        ];
    } else {
        // Set error message instead of immediate redirect
        $errorMessage = "Invalid Tracking Number. Please try again.";
    }
}
?>

<link href="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/leaflet@1.9.4/dist/leaflet.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js" defer></script>

<style>
    /* Modern Animations */
    @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes slideInLeft { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: translateX(0); } }
    @keyframes slideInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
    @keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes pulseRing { 0% { transform: scale(1); opacity: 1; } 70% { transform: scale(1.3); opacity: 0.3; } 100% { transform: scale(1.4); opacity: 0; } }
    @keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
    @keyframes activePulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(252, 181, 41, 0.7); } 50% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(252, 181, 41, 0); } }
    
    .fade-in { animation: fadeIn 0.8s ease-out; }
    .slide-in-left { animation: slideInLeft 0.6s ease-out; }
    .slide-in-right { animation: slideInRight 0.6s ease-out; }
    .slide-in-up { animation: slideInUp 0.7s ease-out forwards; opacity: 0; }
    .slide-in-up:nth-child(1) { animation-delay: 0.1s; }
    .slide-in-up:nth-child(2) { animation-delay: 0.2s; }
    .slide-in-up:nth-child(3) { animation-delay: 0.3s; }
    .slide-in-up:nth-child(4) { animation-delay: 0.4s; }
    .slide-in-up:nth-child(5) { animation-delay: 0.5s; }
    
    .pulse-ring { animation: pulseRing 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
    .progress-bar { background: linear-gradient(90deg, #fcb529, #f59e0b); border-radius: 10px; position: relative; overflow: hidden; }
    .progress-bar::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 2s infinite; }
    
    .timeline-dot { transition: all 0.3s ease; }
    .timeline-dot.active { animation: activePulse 2s infinite; }
    .glass-effect { background: rgba(255, 255, 255, 0.1); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.2); }
    .card-hover { transition: all 0.3s ease; }
    .card-hover:hover { transform: translateY(-2px); box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); }
    
    .status-badge { position: relative; overflow: hidden; }
    .status-badge::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); animation: shimmer 3s infinite; }
    
    .map-container { position: relative; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1); z-index: 1; }
    .leaflet-container { border-radius: 16px; z-index: 1; }
</style>

<?php if (!$showResults): ?>
<!-- Hero Section with Tracking Form -->
<section class="relative h-[300px] md:h-96 flex items-center justify-center overflow-hidden">
    <div class="absolute inset-0 bg-gray-900/90 z-10"></div>
    <div class="absolute inset-0">
        <img src="assets/images/banner/bread.png" alt="Track Your Shipment" class="w-full h-full object-cover">
    </div>
    
    <div class="relative z-20 text-center text-white px-4 sm:px-6 lg:px-8">
        <h1 class="text-2xl md:text-4xl lg:text-6xl font-bold mb-4 fade-in">
            Track Your <span class="text-yellow-400">Shipment</span>
        </h1>
        <p class="text-sm md:text-xl mb-4 fade-in" style="animation-delay: 0.2s;">
            Get real-time updates on your package location
        </p>
        <p class="text-xs md:text-lg fade-in" style="animation-delay: 0.4s;">
            Enter your tracking number to see current status and estimated delivery
        </p>
    </div>
</section>

<!-- Tracking Form Section -->
<section class="py-16 lg:py-24 bg-gray-50">
    <div class="container mx-auto px-4 sm:px-6 lg:px-8">
        <div class="max-w-4xl mx-auto">
            <?php if (isset($errorMessage)): ?>
            <div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded-lg mb-6 fade-in" role="alert">
                <div class="flex items-center">
                    <i class="fas fa-exclamation-circle mr-2"></i>
                    <span><?php echo $errorMessage; ?></span>
                </div>
            </div>
            <?php endif; ?>
            
            <div class="bg-gradient-to-r from-gray-700 to-gray-800 rounded-2xl p-8 md:p-12 mb-12 text-white shadow-2xl relative overflow-hidden">
                <div class="absolute right-0 top-0 opacity-10">
                    <i class="fas fa-truck text-9xl transform -rotate-12 translate-x-10 -translate-y-10"></i>
                </div>
                
                <div class="relative z-10">
                    <h2 class="text-2xl md:text-3xl lg:text-4xl font-bold mb-4">Track Your Package</h2>
                    <p class="text-sm md:text-lg text-gray-200 mb-8 max-w-2xl">
                        Enter your tracking number below to get real-time updates on your shipment's location, status, and estimated delivery time.
                    </p>
                    
                    <form action="track.php" method="POST" class="space-y-6">
                        <div class="relative">
                            <label for="trackId" class="block text-sm font-medium text-gray-200 mb-2">Tracking Number</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
                                    <i class="fas fa-search text-gray-400"></i>
                                </div>
                                <input type="text" name="trackId" placeholder="Enter tracking Number eg CX-23-07-59406381" 
                                       class="w-full pl-12 pr-4 py-4 bg-white text-gray-700 rounded-lg shadow-inner focus:ring-2 focus:ring-yellow-400 focus:border-transparent outline-none transition-all duration-300 hover:shadow-lg" required>
                                <div class="absolute inset-y-0 right-0 pr-4 flex items-center" x-show="isLoading">
                                    <svg class="animate-spin h-5 w-5 text-yellow-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
                                        <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
                                        <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
                                    </svg>
                                </div>
                            </div>
                            <p class="text-sm text-gray-300 mt-2">
                                <i class="fas fa-info-circle mr-1"></i>
                                Enter your tracking number to view shipment details
                            </p>
                        </div>
                        
                        <button type="submit" name="trackingsub"
                                class="w-full md:w-auto px-6 py-3 md:px-8 md:py-4 bg-yellow-500 hover:bg-yellow-600 text-gray-800 font-semibold rounded-lg shadow-lg transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-yellow-500 flex items-center justify-center text-sm md:text-base"
                                :disabled="isLoading">
                            <span x-show="!isLoading">Track Package</span>
                        </button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- Features Section -->
<section class="py-16 lg:py-24 bg-gradient-to-br from-horizon-50 to-gold-50">
    <div class="container mx-auto px-4 sm:px-6 lg:px-8">
        <div class="text-center mb-16">
            <h2 class="text-2xl md:text-3xl lg:text-4xl font-bold text-horizon-800 mb-4">
                Tracking <span class="text-gold-600">Features</span>
            </h2>
            <p class="text-sm md:text-lg text-gray-800 max-w-2xl mx-auto">
                Advanced tracking capabilities to keep you informed every step of the way
            </p>
        </div>
        
        <div class="grid grid-cols-1 md:grid-cols-3 gap-8">
            <!-- Feature 1 -->
            <div class="bg-white rounded-xl shadow-soft p-8 text-center hover:shadow-lg transition-shadow duration-300">
                <div class="w-16 h-16 bg-horizon-100 rounded-full flex items-center justify-center mx-auto mb-6">
                    <i class="fas fa-map-marker-alt text-2xl text-white"></i>
                </div>
                <h3 class="text-lg md:text-xl font-bold text-horizon-800 mb-4">Live Tracking</h3>
                <p class="text-sm md:text-base text-gray-800 leading-relaxed">
                    Follow your package in real-time with our interactive map and detailed status updates throughout the delivery process.
                </p>
            </div>
            
            <!-- Feature 2 -->
            <div class="bg-white rounded-xl shadow-soft p-8 text-center hover:shadow-lg transition-shadow duration-300">
                <div class="w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-6">
                    <i class="fas fa-bell text-2xl text-gold-600"></i>
                </div>
                <h3 class="text-lg md:text-xl font-bold text-horizon-800 mb-4">Delivery Alerts</h3>
                <p class="text-sm md:text-base text-gray-800 leading-relaxed">
                    Set up SMS or email notifications to stay updated with your package status and receive delivery confirmations.
                </p>
            </div>
            
            <!-- Feature 3 -->
            <div class="bg-white rounded-xl shadow-soft p-8 text-center hover:shadow-lg transition-shadow duration-300">
                <div class="w-16 h-16 bg-horizon-100 rounded-full flex items-center justify-center mx-auto mb-6">
                    <i class="fas fa-calendar-alt text-2xl text-white"></i>
                </div>
                <h3 class="text-lg md:text-xl font-bold text-horizon-800 mb-4">Delivery Options</h3>
                <p class="text-sm md:text-base text-gray-800 leading-relaxed">
                    Customize delivery preferences, reschedule deliveries, or redirect packages to meet your availability.
                </p>
            </div>
        </div>
    </div>
</section>

<!-- Support Section -->
<section class="py-16 lg:py-24">
    <div class="container mx-auto px-4 sm:px-6 lg:px-8">
        <div class="bg-white rounded-2xl shadow-soft p-8 md:p-12">
            <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
                <div>
                    <h2 class="text-2xl md:text-3xl lg:text-4xl font-bold text-horizon-800 mb-6">
                        Need <span class="text-gold-600">Assistance?</span>
                    </h2>
                    <p class="text-sm md:text-lg text-gray-800 mb-8 leading-relaxed">
                        Our customer support team is available 24/7 to help with your delivery questions, concerns, and special requests. We're here to ensure your shipping experience is smooth and worry-free.
                    </p>
                    
                    <div class="space-y-4 mb-8">
                        <div class="flex items-center space-x-3">
                            <div class="w-8 h-8 bg-gold-100 rounded-full flex items-center justify-center">
                                <i class="fas fa-clock text-gold-600 text-sm"></i>
                            </div>
                            <span class="text-secondary-700">24/7 Customer Support</span>
                        </div>
                        <div class="flex items-center space-x-3">
                            <div class="w-8 h-8 bg-gold-100 rounded-full flex items-center justify-center">
                                <i class="fas fa-headset text-gold-600 text-sm"></i>
                            </div>
                            <span class="text-secondary-700">Expert Logistics Assistance</span>
                        </div>
                        <div class="flex items-center space-x-3">
                            <div class="w-8 h-8 bg-gold-100 rounded-full flex items-center justify-center">
                                <i class="fas fa-shield-alt text-gold-600 text-sm"></i>
                            </div>
                            <span class="text-secondary-700">Secure Package Handling</span>
                        </div>
                    </div>
                    
                    <div class="flex flex-col sm:flex-row gap-4">
                        <a href="mailto:dannybreed@proton.me" class="flex items-center justify-center px-4 py-3 md:px-6 md:py-3 bg-horizon-600 hover:bg-horizon-700 text-white font-semibold rounded-lg transition-colors duration-200 text-sm md:text-base">
                            <i class="fas fa-envelope mr-2"></i>
                            Email Support
                        </a>
                        <a href="/contact" 
                           class="flex items-center justify-center px-4 py-3 md:px-6 md:py-3 border-2 border-gold-500 text-gold-600 hover:bg-gold-500 hover:text-white font-semibold rounded-lg transition-colors duration-200 text-sm md:text-base">
                            <i class="fas fa-phone mr-2"></i>
                            Contact Us
                        </a>
                    </div>
                </div>
                
                <div class="flex justify-center">
                    <div class="relative">
                        <img src="https://images.unsplash.com/photo-1553413077-190dd305871c?ixlib=rb-4.0.3&auto=format&fit=crop&w=500&q=80" 
                             alt="Customer Support" 
                             class="w-80 h-80 object-cover rounded-2xl shadow-lg">
                        <div class="absolute -bottom-6 -right-6 w-24 h-24 bg-gold-500 rounded-full flex items-center justify-center shadow-lg">
                            <i class="fas fa-headset text-2xl text-white"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>

<!-- FAQ Section -->
<section class="py-16 lg:py-24 bg-gradient-to-br from-gold-50 to-horizon-50">
    <div class="container mx-auto px-4 sm:px-6 lg:px-8">
        <div class="text-center mb-16">
            <h2 class="text-2xl md:text-3xl lg:text-4xl font-bold text-horizon-800 mb-4">
                Frequently Asked <span class="text-gold-600">Questions</span>
            </h2>
            <p class="text-sm md:text-lg text-gray-800 max-w-2xl mx-auto">
                Quick answers to common tracking and delivery questions
            </p>
        </div>
        
        <div class="max-w-3xl mx-auto space-y-4" x-data="{selected:1}">
            <!-- FAQ 1 -->
            <div class="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
                <button 
                    @click="selected !== 1 ? selected = 1 : selected = null"
                    class="flex justify-between items-center w-full px-6 py-4 text-left text-horizon-800 font-semibold hover:bg-gray-50 focus:outline-none transition-colors duration-200"
                >
                    <span>How do I track my package?</span>
                    <svg 
                        :class="{'rotate-180': selected === 1}"
                        class="h-5 w-5 text-gold-600 transform transition-transform duration-200"
                        xmlns="http://www.w3.org/2000/svg" 
                        viewBox="0 0 20 20" 
                        fill="currentColor"
                    >
                        <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
                    </svg>
                </button>
                <div 
                    x-show="selected === 1"
                    x-transition:enter="transition ease-out duration-200"
                    x-transition:enter-start="opacity-0 transform -translate-y-4"
                    x-transition:enter-end="opacity-100 transform translate-y-0"
                    x-transition:leave="transition ease-in duration-150"
                    x-transition:leave-start="opacity-100 transform translate-y-0"
                    x-transition:leave-end="opacity-0 transform -translate-y-4"
                    class="px-6 py-4 bg-gray-50 text-secondary-700"
                >
                    You can track your package by entering your tracking number in the search field above. Your tracking number is provided in your shipping confirmation email or receipt.
                </div>
            </div>
            
            <!-- FAQ 2 -->
            <div class="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
                <button 
                    @click="selected !== 2 ? selected = 2 : selected = null"
                    class="flex justify-between items-center w-full px-6 py-4 text-left text-horizon-800 font-semibold hover:bg-gray-50 focus:outline-none transition-colors duration-200"
                >
                    <span>What if my package is delayed?</span>
                    <svg 
                        :class="{'rotate-180': selected === 2}"
                        class="h-5 w-5 text-gold-600 transform transition-transform duration-200"
                        xmlns="http://www.w3.org/2000/svg" 
                        viewBox="0 0 20 20" 
                        fill="currentColor"
                    >
                        <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
                    </svg>
                </button>
                <div 
                    x-show="selected === 2"
                    x-transition:enter="transition ease-out duration-200"
                    x-transition:enter-start="opacity-0 transform -translate-y-4"
                    x-transition:enter-end="opacity-100 transform translate-y-0"
                    x-transition:leave="transition ease-in duration-150"
                    x-transition:leave-start="opacity-100 transform translate-y-0"
                    x-transition:leave-end="opacity-0 transform -translate-y-4"
                    class="px-6 py-4 bg-gray-50 text-secondary-700"
                >
                    If your package is experiencing delays, you'll see updated delivery estimates in your tracking information. For additional assistance, please contact our customer support team.
                </div>
            </div>
            
            <!-- FAQ 3 -->
            <div class="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
                <button 
                    @click="selected !== 3 ? selected = 3 : selected = null"
                    class="flex justify-between items-center w-full px-6 py-4 text-left text-horizon-800 font-semibold hover:bg-gray-50 focus:outline-none transition-colors duration-200"
                >
                    <span>Can I change my delivery address?</span>
                    <svg 
                        :class="{'rotate-180': selected === 3}"
                        class="h-5 w-5 text-gold-600 transform transition-transform duration-200"
                        xmlns="http://www.w3.org/2000/svg" 
                        viewBox="0 0 20 20" 
                        fill="currentColor"
                    >
                        <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
                    </svg>
                </button>
                <div 
                    x-show="selected === 3"
                    x-transition:enter="transition ease-out duration-200"
                    x-transition:enter-start="opacity-0 transform -translate-y-4"
                    x-transition:enter-end="opacity-100 transform translate-y-0"
                    x-transition:leave="transition ease-in duration-150"
                    x-transition:leave-start="opacity-100 transform translate-y-0"
                    x-transition:leave-end="opacity-0 transform -translate-y-4"
                    class="px-6 py-4 bg-gray-50 text-secondary-700"
                >
                    Yes, in most cases you can change your delivery address by contacting our customer support team with your tracking number and the new delivery details.
                </div>
            </div>
            
            <!-- FAQ 4 -->
            <div class="border border-gray-200 rounded-lg overflow-hidden bg-white shadow-sm">
                <button 
                    @click="selected !== 4 ? selected = 4 : selected = null"
                    class="flex justify-between items-center w-full px-6 py-4 text-left text-horizon-800 font-semibold hover:bg-gray-50 focus:outline-none transition-colors duration-200"
                >
                    <span>How accurate are the delivery estimates?</span>
                    <svg 
                        :class="{'rotate-180': selected === 4}"
                        class="h-5 w-5 text-gold-600 transform transition-transform duration-200"
                        xmlns="http://www.w3.org/2000/svg" 
                        viewBox="0 0 20 20" 
                        fill="currentColor"
                    >
                        <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
                    </svg>
                </button>
                <div 
                    x-show="selected === 4"
                    x-transition:enter="transition ease-out duration-200"
                    x-transition:enter-start="opacity-0 transform -translate-y-4"
                    x-transition:enter-end="opacity-100 transform translate-y-0"
                    x-transition:leave="transition ease-in duration-150"
                    x-transition:leave-start="opacity-100 transform translate-y-0"
                    x-transition:leave-end="opacity-0 transform -translate-y-4"
                    class="px-6 py-4 bg-gray-50 text-secondary-700"
                >
                    Our delivery estimates are highly accurate, based on real-time data and historical delivery patterns. We update estimates automatically if any delays occur during transit.
                </div>
            </div>
        </div>
    </div>
</section>


<?php else: ?>
<!-- Results Page - Hero Section -->
<div class="bg-gradient-to-br from-gray-800 via-gray-700 to-gray-900 text-white relative overflow-hidden">
    <div class="absolute inset-0 opacity-10">
        <div class="absolute top-0 left-0 w-full h-full bg-repeat opacity-20"></div>
    </div>
    
    <div class="container mx-auto px-4 py-6 md:py-8 lg:py-12 relative z-10">
        <div class="flex items-center justify-between mb-6 lg:mb-8 fade-in">
            <a href="track.php" class="inline-flex items-center text-white/80 hover:text-white transition-colors group text-sm md:text-base">
                <i class="fas fa-arrow-left mr-2 group-hover:-translate-x-1 transition-transform"></i>
                <span class="font-medium">Back to Tracking</span>
            </a>
        </div>
        
        <div class="mb-6 lg:mb-8 slide-in-left">
            <div class="flex flex-col lg:flex-row lg:items-center lg:justify-between">
                <div class="mb-4 lg:mb-0">
                    <h1 class="text-xl sm:text-2xl md:text-3xl lg:text-5xl font-bold mb-3 flex flex-col sm:flex-row sm:items-center">
                        <i class="fas fa-box-open mr-0 sm:mr-4 text-yellow-400 text-xl sm:text-2xl md:text-4xl lg:text-5xl mb-2 sm:mb-0"></i>
                        <span class="break-all sm:break-normal"><?php echo $trackingResult['tracking_number']; ?></span>
                    </h1>
                    <div class="flex flex-col sm:flex-row sm:items-center sm:space-x-4 space-y-2 sm:space-y-0">
                        <span class="text-white/80 text-sm sm:text-base">Status:</span>
                        <span class="status-badge px-3 sm:px-4 py-1 sm:py-2 bg-yellow-500 text-gray-900 rounded-full font-semibold text-sm sm:text-base inline-block w-fit">
                            <?php echo $trackingResult['status']; ?>
                        </span>
                    </div>
                </div>
                
                <div class="glass-effect px-3 sm:px-4 md:px-6 py-3 sm:py-4 rounded-xl text-center lg:text-center">
                    <p class="text-white/80 text-xs sm:text-sm mb-1">Estimated Delivery</p>
                    <p class="text-sm sm:text-lg md:text-2xl font-bold text-yellow-400"><?php echo $trackingResult['delivery_date']; ?></p>
                </div>
            </div>
        </div>
        
        <div class="grid grid-cols-2 lg:grid-cols-4 gap-2 sm:gap-3 lg:gap-4 fade-in">
            <div class="glass-effect p-2 sm:p-3 lg:p-4 rounded-xl text-center min-w-0">
                <i class="fas fa-map-marker-alt text-yellow-400 text-sm sm:text-lg md:text-xl lg:text-2xl mb-1 sm:mb-2"></i>
                <p class="text-white/80 text-xs sm:text-sm">From</p>
                <p class="font-semibold text-xs sm:text-sm lg:text-base truncate px-1"><?php echo $trackingResult['dispatch_location']; ?></p>
            </div>
            <div class="glass-effect p-2 sm:p-3 lg:p-4 rounded-xl text-center min-w-0">
                <i class="fas fa-truck text-yellow-400 text-sm sm:text-lg md:text-xl lg:text-2xl mb-1 sm:mb-2 pulse-ring"></i>
                <p class="text-white/80 text-xs sm:text-sm">Current</p>
                <p class="font-semibold text-xs sm:text-sm lg:text-base truncate px-1"><?php echo $trackingResult['current_location']; ?></p>
            </div>
            <div class="glass-effect p-2 sm:p-3 lg:p-4 rounded-xl text-center min-w-0">
                <i class="fas fa-flag-checkered text-yellow-400 text-sm sm:text-lg md:text-xl lg:text-2xl mb-1 sm:mb-2"></i>
                <p class="text-white/80 text-xs sm:text-sm">To</p>
                <p class="font-semibold text-xs sm:text-sm lg:text-base truncate px-1"><?php echo $trackingResult['destination']; ?></p>
            </div>
            <div class="glass-effect p-2 sm:p-3 lg:p-4 rounded-xl text-center min-w-0">
                <i class="fas fa-box text-yellow-400 text-sm sm:text-lg md:text-xl lg:text-2xl mb-1 sm:mb-2"></i>
                <p class="text-white/80 text-xs sm:text-sm">Weight</p>
                <p class="font-semibold text-xs sm:text-sm lg:text-base break-all px-1"><?php echo $trackingResult['weight']; ?></p>
            </div>
        </div>
    </div>
</div>

<!-- Main Content -->
<div class="bg-gray-50 min-h-screen py-8">
    <div class="container mx-auto px-4">
        <div class="grid grid-cols-1 xl:grid-cols-3 gap-8">
            <!-- Left Column -->
            <div class="xl:col-span-2 space-y-8">
                <!-- Map -->
                <div class="bg-white rounded-2xl shadow-lg overflow-hidden card-hover fade-in">
                    <div class="p-6 bg-gradient-to-r from-gray-50 to-yellow-50 border-b">
                        <div class="flex items-center justify-between">
                            <h2 class="text-xl md:text-2xl font-bold text-gray-800 flex items-center">
                                <i class="fas fa-map-location-dot mr-3 text-yellow-600"></i>
                                Live Route Tracking
                            </h2>
                            <span class="px-3 py-1 bg-green-100 text-green-800 text-sm rounded-full">
                                <i class="fas fa-circle text-xs mr-1"></i>
                                Live
                            </span>
                        </div>
                    </div>
                    <div class="map-container">
                        <iframe class="w-full h-96" src="https://maps.google.com/maps?q=<?php echo $trackingResult['current_location'] ? $trackingResult['current_location'] : $trackingResult['dispatch_location']; ?>&t=k&z=13&ie=UTF8&iwloc=&output=embed" style="border:0;"></iframe>
                    </div>
                </div>
                
                <!-- Timeline -->
                <div class="bg-white rounded-2xl shadow-lg overflow-hidden card-hover slide-in-left">
                    <div class="p-6 bg-gradient-to-r from-gray-50 to-yellow-50 border-b">
                        <h2 class="text-xl md:text-2xl font-bold text-gray-800 flex items-center">
                            <i class="fas fa-history mr-3 text-yellow-600"></i>
                            Shipment Timeline
                        </h2>
                    </div>
                    
                    <div class="p-6">
                        <div class="relative">
                            <div class="absolute left-4 md:left-6 top-0 bottom-0 w-0.5 bg-gradient-to-b from-gray-500 to-yellow-500"></div>
                            
                            <div class="space-y-8">
                                <?php
                                $qq = mysqli_query($link, "SELECT * FROM track_update WHERE track_num = '".$trackingResult['tracking_number']."' ORDER BY id ASC");
                                if (mysqli_num_rows($qq) > 0) {
                                    $index = 0;
                                    while ($data = mysqli_fetch_assoc($qq)) {
                                        $delay = $index * 0.1;
                                        ?>
                                        <div class="relative slide-in-up" style="animation-delay: <?php echo $delay; ?>s;">
                                            <div class="absolute left-4 md:left-6 w-6 h-6 bg-gray-500 rounded-full transform -translate-x-1/2 border-4 border-white shadow-lg flex items-center justify-center timeline-dot">
                                                <i class="fas fa-map-pin text-white text-xs"></i>
                                            </div>
                                            <div class="pl-10 md:pl-16">
                                                <div class="bg-gradient-to-r from-gray-50 to-gray-100 rounded-xl p-4 border-l-4 border-gray-500">
                                                    <div class="flex items-center justify-between mb-2">
                                                        <h3 class="font-bold text-gray-800"><?php echo $data['current_location']; ?></h3>
                                                        <span class="text-sm text-gray-500"><?php echo date('F dS, Y', strtotime($data['date'])); ?></span>
                                                    </div>
                                                    <p class="text-gray-700 text-sm"><?php echo $data['note']; ?></p>
                                                    <span class="text-xs text-gray-500 mt-2 inline-block"><?php echo $data['status']; ?></span>
                                                </div>
                                            </div>
                                        </div>
                                        <?php
                                        $index++;
                                    }
                                } else {
                                    echo '<p class="text-gray-500 text-center py-4">No tracking updates available yet.</p>';
                                }
                                ?>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Package Details -->
                <div class="bg-white rounded-2xl shadow-lg overflow-hidden card-hover slide-in-right">
                    <div class="p-6 bg-gradient-to-r from-gray-50 to-yellow-50 border-b">
                        <h2 class="text-xl md:text-2xl font-bold text-gray-800 flex items-center">
                            <i class="fas fa-box mr-3 text-yellow-600"></i>
                            Package Information
                        </h2>
                    </div>
                    
                    <div class="p-6">
                        <?php if ($trackingResult['image']): ?>
                        <div class="mb-6 text-center">
                            <img src="uploads/<?php echo $trackingResult['image']; ?>" alt="Package" class="w-32 h-32 object-cover rounded-xl mx-auto shadow-lg">
                        </div>
                        <?php endif; ?>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div class="space-y-4">
                                <div class="bg-gray-50 p-4 rounded-xl">
                                    <label class="text-sm text-gray-600">Description</label>
                                    <p class="font-semibold text-gray-800 text-sm md:text-base"><?php echo $trackingResult['description']; ?></p>
                                </div>
                                <div class="bg-gray-50 p-4 rounded-xl">
                                    <label class="text-sm text-gray-600">Weight</label>
                                    <p class="font-semibold text-gray-800 text-sm md:text-base"><?php echo $trackingResult['weight']; ?></p>
                                </div>
                                <div class="bg-gray-50 p-4 rounded-xl">
                                    <label class="text-sm text-gray-600">Quantity</label>
                                    <p class="font-semibold text-gray-800 text-sm md:text-base"><?php echo $trackingResult['quantity']; ?></p>
                                </div>
                            </div>
                            <div class="space-y-4">
                                <div class="bg-gray-50 p-4 rounded-xl">
                                    <label class="text-sm text-gray-600">Shipping Mode</label>
                                    <p class="font-semibold text-gray-800 flex items-center text-sm md:text-base">
                                        <i class="fas fa-truck text-gray-500 mr-2"></i>
                                        <?php echo $trackingResult['ship_mode']; ?>
                                    </p>
                                </div>
                                <div class="bg-gray-50 p-4 rounded-xl">
                                    <label class="text-sm text-gray-600">Carrier</label>
                                    <p class="font-semibold text-gray-800 text-sm md:text-base"><?php echo $trackingResult['carrier']; ?></p>
                                </div>
                                <div class="bg-yellow-50 p-4 rounded-xl border border-yellow-200">
                                    <label class="text-sm text-yellow-600">Payment Mode</label>
                                    <p class="font-bold text-lg md:text-xl text-yellow-700"><?php echo $trackingResult['payment_mode']; ?></p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Right Sidebar -->
            <div class="space-y-6">
                <!-- Quick Track -->
                <div class="bg-white rounded-2xl shadow-lg overflow-hidden card-hover fade-in">
                    <div class="p-4 bg-gradient-to-r from-yellow-50 to-yellow-100 border-b">
                        <h3 class="text-lg md:text-xl font-bold text-gray-800 flex items-center">
                            <i class="fas fa-search mr-2 text-yellow-600"></i>
                            Track Another Package
                        </h3>
                    </div>
                    <div class="p-4">
                        <form action="track.php" method="POST" class="space-y-4">
                            <div>
                                <input type="text" name="trackId" placeholder="Enter tracking number" 
                                       class="w-full px-4 py-3 border border-gray-300 rounded-xl focus:ring-2 focus:ring-yellow-500 focus:border-yellow-500">
                            </div>
                            <button type="submit" name="trackingsub" class="w-full bg-gradient-to-r from-yellow-500 to-yellow-600 text-white font-semibold py-2 md:py-3 rounded-xl hover:from-yellow-600 hover:to-yellow-700 transition-all text-sm md:text-base">
                                <i class="fas fa-search mr-2"></i>
                                Track Package
                            </button>
                        </form>
                    </div>
                </div>
                
                <!-- Contact Info -->
                <div class="bg-white rounded-2xl shadow-lg overflow-hidden card-hover">
                    <div class="p-4 bg-gradient-to-r from-gray-50 to-gray-100 border-b">
                        <h3 class="text-lg md:text-xl font-bold text-gray-800 flex items-center">
                            <i class="fas fa-address-book mr-2 text-yellow-600"></i>
                            Contact Information
                        </h3>
                    </div>
                    
                    <div class="p-4 space-y-4">
                        <div class="bg-green-50 p-4 rounded-xl border border-green-200">
                            <h4 class="font-semibold text-green-800 mb-2 flex items-center text-sm md:text-base">
                                <i class="fas fa-user-check mr-2"></i>
                                Receiver
                            </h4>
                            <div class="space-y-2 text-xs md:text-sm">
                                <p><strong>Name:</strong> <?php echo $trackingResult['receiver_name']; ?></p>
                                <p><strong>Email:</strong> <?php echo $trackingResult['receiver_email']; ?></p>
                                <p><strong>Phone:</strong> <?php echo $trackingResult['receiver_contact']; ?></p>
                                <p><strong>Address:</strong> <?php echo $trackingResult['receiver_address']; ?></p>
                            </div>
                        </div>
                        
                        <div class="bg-blue-50 p-4 rounded-xl border border-blue-200">
                            <h4 class="font-semibold text-blue-800 mb-2 flex items-center text-sm md:text-base">
                                <i class="fas fa-user-tag mr-2"></i>
                                Sender
                            </h4>
                            <div class="space-y-2 text-xs md:text-sm">
                                <p><strong>Name:</strong> <?php echo $trackingResult['sender_name']; ?></p>
                                <p><strong>Email:</strong> <?php echo $trackingResult['sender_email']; ?></p>
                                <p><strong>Phone:</strong> <?php echo $trackingResult['sender_contact']; ?></p>
                                <p><strong>Address:</strong> <?php echo $trackingResult['sender_address']; ?></p>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- Support -->
                <div class="bg-gradient-to-br from-gray-600 to-gray-700 text-white rounded-2xl p-6 card-hover">
                    <h3 class="font-bold text-base md:text-lg mb-4 flex items-center">
                        <i class="fas fa-headset mr-2"></i>
                        Need Help?
                    </h3>
                    <p class="text-white/80 mb-4 text-xs md:text-sm">Our support team is available 24/7 to assist you with your shipment.</p>
                    <a href="contact" class="inline-flex items-center px-3 md:px-4 py-2 bg-white/20 rounded-lg hover:bg-white/30 transition-colors text-sm md:text-base">
                        <i class="fas fa-envelope mr-2"></i>
                        Contact Support
                    </a>
                </div>
            </div>
        </div>
    </div>
</div>

<?php endif; ?>


<script src="public/js/JsBarcode.all.min.js"></script>

<?php include 'foot.php'; ?>
Back to Directory=ceiIENDB`