

<?php $__env->startSection('title', 'Quote Requests'); ?>

<?php $__env->startSection('buyer-content'); ?>
    <!-- Page Header -->
    <div class="page-header">
        <div>
            <h3 class="page-title">Quote Requests</h3>
            <p class="text-muted mb-0">Review and manage quotes from suppliers</p>
        </div>
        <a href="<?php echo e(route('post.requirement.index')); ?>" class="btn btn-primary-gradient shadow-sm">
            <i class="bi bi-plus-lg me-2"></i> Post Requirement
        </a>
    </div>

    <!-- Stats Cards -->
    <div class="row g-3 mb-4">
        <div class="col-xl-3 col-md-6">
            <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden group-hover-lift">
                <div class="card-body p-4 position-relative">
                    <div class="position-absolute top-0 end-0 p-3" style="opacity: 0.1;">
                        <i class="bi bi-inbox display-1 text-primary"></i>
                    </div>
                    <div class="position-relative z-1">
                        <div class="d-flex align-items-center mb-3">
                            <div class="rounded-3 bg-primary bg-opacity-10 p-2 text-primary">
                                <i class="bi bi-inbox fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Total Quotes</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($stats['total']); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-md-6">
            <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden group-hover-lift">
                <div class="card-body p-4 position-relative">
                    <div class="position-absolute top-0 end-0 p-3" style="opacity: 0.1;">
                        <i class="bi bi-hourglass-split display-1 text-warning"></i>
                    </div>
                    <div class="position-relative z-1">
                        <div class="d-flex align-items-center mb-3">
                            <div class="rounded-3 bg-warning bg-opacity-10 p-2 text-warning">
                                <i class="bi bi-hourglass-split fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Pending Review</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($stats['pending']); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-md-6">
            <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden group-hover-lift">
                <div class="card-body p-4 position-relative">
                    <div class="position-absolute top-0 end-0 p-3" style="opacity: 0.1;">
                        <i class="bi bi-check-circle display-1 text-success"></i>
                    </div>
                    <div class="position-relative z-1">
                        <div class="d-flex align-items-center mb-3">
                            <div class="rounded-3 bg-success bg-opacity-10 p-2 text-success">
                                <i class="bi bi-check-circle fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Accepted</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($stats['accepted']); ?></h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-xl-3 col-md-6">
            <div class="card h-100 border-0 shadow-sm rounded-4 overflow-hidden group-hover-lift">
                <div class="card-body p-4 position-relative">
                    <div class="position-absolute top-0 end-0 p-3" style="opacity: 0.1;">
                        <i class="bi bi-x-circle display-1 text-danger"></i>
                    </div>
                    <div class="position-relative z-1">
                        <div class="d-flex align-items-center mb-3">
                            <div class="rounded-3 bg-danger bg-opacity-10 p-2 text-danger">
                                <i class="bi bi-x-circle fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Rejected</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($stats['rejected']); ?></h2>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Quotes List -->
    <div class="card border-0 shadow-sm rounded-4 overflow-hidden">
        <div class="card-header bg-transparent py-3">
            <h6 class="fw-bold mb-0">
                <i class="bi bi-chat-quote me-2 text-primary"></i>All Received Quotes
            </h6>
        </div>
        
        <div class="card-body p-0">
            <?php $__empty_1 = true; $__currentLoopData = $quotes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $quote): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="p-4 border-bottom <?php echo e($quote->status == 'pending' ? 'bg-warning-subtle bg-opacity-10' : ($quote->status == 'accepted' ? 'bg-success-subtle bg-opacity-10' : '')); ?>">
                    <div class="row align-items-center">
                        <div class="col-lg-4 mb-3 mb-lg-0">
                            <div class="d-flex align-items-center">
                                <?php if($quote->seller && $quote->seller->logo): ?>
                                    <img src="<?php echo e(asset('storage/' . $quote->seller->logo)); ?>" class="rounded-circle me-3 shadow-sm" style="width: 50px; height: 50px; object-fit: cover;">
                                <?php else: ?>
                                    <div class="rounded-circle bg-primary bg-opacity-10 text-primary d-flex align-items-center justify-content-center me-3 fw-bold fs-4" style="width: 50px; height: 50px;">
                                        <?php echo e(strtoupper(substr($quote->seller->company_name ?? 'S', 0, 1))); ?>

                                    </div>
                                <?php endif; ?>
                                <div>
                                    <h6 class="fw-bold mb-0 text-dark">
                                        <?php echo e($quote->seller->company_name ?? 'Seller'); ?>

                                        <?php if($quote->seller && $quote->seller->isPaid()): ?>
                                            <i class="bi bi-patch-check-fill text-warning ms-1" title="Premium Seller"></i>
                                        <?php endif; ?>
                                    </h6>
                                    <div class="text-muted small mt-1 text-truncate" style="max-width: 200px;">
                                        <i class="bi bi-clipboard me-1"></i><?php echo e($quote->rfq->title ?? 'N/A'); ?>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-2 col-4 text-center">
                            <div class="fw-bold text-success fs-5">₹<?php echo e(number_format($quote->revised_price ?? $quote->price, 0)); ?></div>
                            <small class="text-muted fw-medium text-uppercase" style="font-size: 0.7rem;">Quoted Price</small>
                        </div>
                        <div class="col-lg-2 col-4 text-center">
                            <div class="fw-medium text-dark"><?php echo e($quote->delivery_timeline); ?></div>
                            <small class="text-muted fw-medium text-uppercase" style="font-size: 0.7rem;">Delivery</small>
                        </div>
                        <div class="col-lg-2 col-4 text-center">
                            <?php echo $quote->status_badge; ?>

                            <div class="small text-muted mt-1"><?php echo e($quote->created_at->format('d M')); ?></div>
                        </div>
                        <div class="col-lg-2 text-end mt-3 mt-lg-0">
                            <a href="<?php echo e(route('buyer.quotes.show', $quote)); ?>" class="btn btn-primary btn-sm rounded-pill shadow-sm px-3 fw-medium">
                                Review Quote <i class="bi bi-arrow-right ms-1"></i>
                            </a>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <div class="text-center py-5">
                    <div class="rounded-circle bg-light d-inline-flex align-items-center justify-content-center mb-4" style="width: 80px; height: 80px;">
                        <i class="bi bi-inbox fs-1 text-muted opacity-50"></i>
                    </div>
                    <h5 class="fw-bold mb-2">No Quotes Received Yet</h5>
                    <p class="text-muted mb-4 opacity-75">Post a buying requirement to start receiving quotes from verified suppliers.</p>
                    <a href="<?php echo e(route('post.requirement.index')); ?>" class="btn btn-primary rounded-pill px-4 shadow-sm hover-lift">
                        <i class="bi bi-plus-lg me-1"></i> Post Your First Requirement
                    </a>
                </div>
            <?php endif; ?>

            <?php if($quotes->hasPages()): ?>
                <div class="p-3 bg-light border-top">
                    <?php echo e($quotes->links()); ?>

                </div>
            <?php endif; ?>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.buyer', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u281583269/domains/theminiport.com/public_html/resources/views/buyer/quotes/index.blade.php ENDPATH**/ ?>