<style>
    .buyer-sidebar .list-group-item {
        border: none;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
        font-weight: 500;
    }
    
    .buyer-sidebar .list-group-item:hover {
        background-color: #f7fafc !important;
        border-left-color: #3b82f6;
        color: #2563eb !important;
        transform: translateX(3px);
    }
    
    .buyer-sidebar .list-group-item.active {
        background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
        color: white !important;
        border-left-color: #1e40af;
        font-weight: 600;
    }
    
    .buyer-sidebar .list-group-item.active:hover {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
        transform: translateX(0);
    }
    
    .buyer-sidebar .list-group-item i {
        min-width: 20px;
        text-align: center;
    }
</style>

<div class="card border-0 shadow-sm buyer-sidebar">
    <div class="card-body text-center tw-py-6">
        <div class="tw-w-20 tw-h-20 tw-bg-primary tw-text-white tw-rounded-full tw-flex tw-items-center tw-justify-center tw-mx-auto tw-mb-4 tw-text-3xl">
            <i class="bi bi-person"></i>
        </div>
        <h5 class="fw-bold mb-1">{{ Auth::user()->name }}</h5>
        <p class="text-muted tw-text-sm mb-3">Buyer Account</p>
        <a href="{{ route('buyer.profile') }}" class="btn btn-outline-primary btn-sm rounded-pill px-4">Edit Profile</a>
    </div>
    <div class="list-group list-group-flush border-top">
        <a href="{{ route('buyer.dashboard') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.dashboard') ? 'active' : '' }}">
            <i class="bi bi-speedometer2 me-2"></i> Dashboard
        </a>
        <a href="{{ route('buyer.rfqs.index') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.rfqs.*') ? 'active' : '' }}">
            <i class="bi bi-megaphone me-2"></i> My Requirements
        </a>
        <a href="{{ route('buyer.inquiries.index') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.inquiries.*') ? 'active' : '' }}">
            <i class="bi bi-chat-dots me-2"></i> Inquiries / Messages
        </a>
        <a href="{{ route('buyer.quotes.index') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.quotes.*') ? 'active' : '' }}">
            <i class="bi bi-inbox me-2"></i> Quote Requests
            @php
                $pendingQuotes = \App\Models\Quote::whereHas('rfq', fn($q) => $q->where('buyer_id', Auth::user()->buyer?->id))->whereIn('status', ['pending', 'viewed'])->count();
            @endphp
            @if($pendingQuotes > 0)
                <span class="badge bg-warning rounded-pill float-end">{{ $pendingQuotes }}</span>
            @endif
        </a>
        <a href="{{ route('buyer.favorites') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.favorites') ? 'active' : '' }}">
            <i class="bi bi-heart me-2"></i> Favorites
        </a>
        <a href="{{ route('buyer.saved-searches') }}" class="list-group-item list-group-item-action border-0 px-4 py-3 {{ request()->routeIs('buyer.saved-searches') ? 'active' : '' }}">
            <i class="bi bi-search me-2"></i> Saved Searches
        </a>
        
        <div class="mt-2 px-4 py-2 bg-light border-top border-bottom">
            <small class="text-muted fw-bold">ACCOUNT</small>
        </div>
        <a href="#" class="list-group-item list-group-item-action border-0 px-4 py-3 text-danger" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
            <i class="bi bi-box-arrow-right me-2"></i> Logout
        </a>
    </div>
</div>
