@props(['id', 'label', 'icon' => null, 'count' => null, 'active' => false])

<div class="qv-tab {{ $active ? 'active' : '' }}" onclick="switchQvTab('{{ $id }}', this)" {{ $attributes }}>
    <div class="qv-tab-inner">
        @if($icon)
            <i class="{{ $icon }} qv-tab-icon"></i>
        @endif
        <span class="qv-tab-label">{{ $label }}</span>
        @if($count !== null)
            <span class="qv-tab-count">{{ $count }}</span>
        @endif
    </div>
    <div class="qv-tab-indicator"></div>
</div>

<style>
    .qv-tab { 
        position: relative; 
        padding: 0 1.25rem; 
        cursor: pointer; 
        transition: all 0.3s ease;
        height: 52px;
        display: flex;
        align-items: center;
    }
    .qv-tab-inner {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: #64748b;
        font-size: 0.88rem;
        font-weight: 700;
        transition: all 0.2s;
        z-index: 2;
    }
    .qv-tab:hover .qv-tab-inner { color: #1e293b; }
    .qv-tab.active .qv-tab-inner { color: #2563eb; }

    .qv-tab-icon { font-size: 1rem; opacity: 0.7; }
    .qv-tab.active .qv-tab-icon { opacity: 1; }

    .qv-tab-count { 
        font-size: 0.7rem; 
        background: #f1f5f9; 
        color: #64748b; 
        padding: 2px 8px; 
        border-radius: 6px; 
        font-weight: 800;
    }
    .qv-tab.active .qv-tab-count { background: #eff6ff; color: #2563eb; }

    .qv-tab-indicator {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 3px;
        background: #2563eb;
        border-radius: 3px 3px 0 0;
        transform: scaleX(0);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .qv-tab.active .qv-tab-indicator { transform: scaleX(1); }
</style>
