<div class="panel-box">
    <div class="d-flex align-items-center">
        <img src="{{ asset('theme/assets/image/user.png') }}"
            class="img-fluid img-profile-panel rounded-circle me-3 shadow-md" alt="">
        <div class="d-grid gap-2">
            <h6 class="font-14 main-color-one-color">حساب کاربری من</h6>
            <h6 class="font-14">{{ auth()->user()->first_name }} {{ auth()->user()->last_name }}</h6>
        </div>
    </div>
</div>

<div class="profile-box">
    <nav class="navbar profile-box-nav">
        <ul class="navbar-nav flex-column">
            <li class="nav-item {{ request()->routeIs('panel.index') ? 'active' : '' }}">
                <a href="{{ route('panel.index') }}" class="nav-link">
                    <i class="bi bi-house-door"></i>پروفایل
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.orders.*') ? 'active' : '' }}">
                <a href="{{ route('panel.orders.index') }}" class="nav-link">
                    <i class="bi bi-cart-check"></i>سفارش های من
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.addresses.*') ? 'active' : '' }}">
                <a href="{{ route('panel.addresses.index') }}" class="nav-link">
                    <i class="bi bi-pin-map"></i>آدرس های من
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.announcements.*') ? 'active' : '' }}">
                <a href="{{ route('panel.announcements.index') }}" class="nav-link">
                    <i class="bi bi-bell"></i>اطلاعیه ها
                    @php $unreadAnnouncements = auth()->user()->unreadAnnouncementsCount(); @endphp
                    @if($unreadAnnouncements > 0)
                    <span class="badge rounded-pill bg-danger ms-auto">{{ $unreadAnnouncements }}</span>
                    @endif
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.comments.*') ? 'active' : '' }}">
                <a href="{{ route('panel.comments.index') }}" class="nav-link">
                    <i class="bi bi-chat-dots"></i>نظرات من
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.tickets.*') || request()->routeIs('tickets.*') ? 'active' : '' }}">
                <a href="{{ route('panel.tickets.index') }}" class="nav-link">
                    <i class="bi bi-question-circle"></i>درخواست پشتیبانی
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.wishes.*') ? 'active' : '' }}">
                <a href="{{ route('panel.wishes.index') }}" class="nav-link">
                    <i class="bi bi-heart"></i>محصولات مورد علاقه
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.wallet.*') ? 'active' : '' }}">
                <a href="{{ route('panel.wallet.index') }}" class="nav-link">
                    <i class="bi bi-wallet2"></i>کیف پول
                </a>
            </li>
            <li class="nav-item {{ request()->routeIs('panel.club.*') ? 'active' : '' }}">
                <a href="{{ route('panel.club.index') }}" class="nav-link">
                    <i class="bi bi-trophy"></i>باشگاه مشتریان
                </a>
            </li>
            <li class="nav-item">
                <a href="{{ route('logout') }}" class="nav-link"
                   onclick="event.preventDefault(); document.getElementById('panel-logout-form').submit();">
                    <i class="bi bi-arrow-right-square"></i>خروج از حساب کاربری
                </a>
            </li>
        </ul>
    </nav>
</div>

<form id="panel-logout-form" action="{{ route('logout') }}" method="POST" class="d-none">@csrf</form>
