

<?php $__env->startSection('title', 'My Requirements'); ?>

<?php $__env->startSection('buyer-content'); ?>
    <!-- Page Header -->
    <div class="page-header">
        <div>
            <h3 class="page-title">My Requirements</h3>
            <p class="text-muted mb-0">Manage your buying requirements and view quotes</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 New 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-list-ul 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-list-ul fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Total Requirements</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($rfqs->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-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">Open Requirements</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($rfqs->where('status', 'open')->count()); ?></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-chat-quote 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-chat-quote 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($rfqs->sum('quotes_count') ?? 0); ?></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-archive display-1 text-info"></i>
                    </div>
                    <div class="position-relative z-1">
                        <div class="d-flex align-items-center mb-3">
                            <div class="rounded-3 bg-info bg-opacity-10 p-2 text-info">
                                <i class="bi bi-archive fs-4"></i>
                            </div>
                            <h6 class="ms-3 mb-0 text-muted fw-bold small text-uppercase spacing-1">Closed</h6>
                        </div>
                        <h2 class="fw-bold mb-0 text-dark"><?php echo e($rfqs->where('status', 'closed')->count()); ?></h2>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Requirements List -->
    <div class="card border-0 shadow-sm rounded-4 overflow-hidden">
        <div class="card-header bg-transparent py-3 d-flex justify-content-between align-items-center">
            <h6 class="fw-bold mb-0">
                <i class="bi bi-list-check me-2 text-primary"></i>All Requirements
            </h6>
        </div>
        
        <div class="card-body p-0">
            <?php $__empty_1 = true; $__currentLoopData = $rfqs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $rfq): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <div class="p-4 border-bottom <?php echo e($rfq->status == 'open' ? 'hover-bg-light transition-all' : 'bg-light bg-opacity-50'); ?>">
                    <div class="row align-items-center">
                        <div class="col-lg-6 mb-3 mb-lg-0">
                            <div class="d-flex align-items-start">
                                <div class="rounded-3 bg-primary bg-opacity-10 text-primary p-3 me-3 flex-shrink-0">
                                    <i class="bi bi-file-text fs-4"></i>
                                </div>
                                <div>
                                    <h6 class="fw-bold mb-1 text-dark"><?php echo e($rfq->title); ?></h6>
                                    <p class="text-muted small mb-2 d-none d-md-block"><?php echo e(Str::limit($rfq->description, 100)); ?></p>
                                    <div class="d-flex flex-wrap gap-2">
                                        <span class="badge bg-white text-dark border shadow-sm fw-normal px-2 py-1">
                                            <i class="bi bi-box-seam me-1 text-muted"></i><?php echo e($rfq->quantity ?? 'N/A'); ?> units
                                        </span>
                                        <?php if($rfq->category): ?>
                                            <span class="badge bg-white text-dark border shadow-sm fw-normal px-2 py-1">
                                                <i class="bi bi-tag me-1 text-muted"></i><?php echo e($rfq->category->name); ?>

                                            </span>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-2 col-4 text-center">
                            <div class="rounded-circle bg-success-subtle text-success d-flex align-items-center justify-content-center mx-auto mb-1" style="width: 44px; height: 44px;">
                                <span class="fw-bold fs-5"><?php echo e($rfq->quotes_count ?? 0); ?></span>
                            </div>
                            <small class="text-muted fw-medium" style="font-size: 0.75rem;">QUOTES</small>
                        </div>
                        <div class="col-lg-2 col-4 text-center">
                            <span class="badge bg-<?php echo e($rfq->status == 'open' ? 'success' : 'secondary'); ?> rounded-pill px-3 py-2">
                                <?php echo e(ucfirst($rfq->status)); ?>

                            </span>
                            <div class="text-muted fw-medium mt-1" style="font-size: 0.75rem;"><?php echo e($rfq->created_at->format('d M Y')); ?></div>
                        </div>
                        <div class="col-lg-2 col-4 text-end">
                            <a href="<?php echo e(route('buyer.rfqs.show', $rfq->id)); ?>" class="btn btn-primary btn-sm rounded-pill shadow-sm px-3 fw-medium">
                                View Details <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-megaphone fs-1 text-muted opacity-50"></i>
                    </div>
                    <h5 class="fw-bold mb-2">No Requirements Posted Yet</h5>
                    <p class="text-muted mb-4">Post your first 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($rfqs->hasPages()): ?>
                <div class="p-3 bg-light border-top">
                    <?php echo e($rfqs->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/rfqs/index.blade.php ENDPATH**/ ?>