@props(['variant' => 'primary', 'type' => 'button'])

@php
    $baseClasses = 'px-4 py-2 text-[10px] font-bold uppercase tracking-widest rounded-sm transition-all active:scale-[0.97] inline-flex items-center justify-center';
    
    $variants = [
        'primary' => 'bg-amber-600 hover:bg-amber-500 text-white shadow-lg shadow-amber-900/10',
        'secondary' => 'bg-zinc-900 hover:bg-black text-white shadow-md',
        'danger' => 'bg-red-600 hover:bg-red-500 text-white',
        'outline' => 'border border-zinc-200 text-zinc-600 hover:bg-zinc-50',
        'ghost' => 'text-zinc-400 hover:text-amber-600 hover:bg-amber-50',
    ];

    $classes = $variants[$variant] ?? $variants['primary'];
@endphp

@if($attributes->has('href'))
    <a {{ $attributes->merge(['class' => "$baseClasses $classes"]) }}>
        {{ $slot }}
    </a>
@else
    <button type="{{ $type }}" {{ $attributes->merge(['class' => "$baseClasses $classes"]) }}>
        {{ $slot }}
    </button>
@endif
