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

@php
    $isDisabled = $attributes->has('disabled');
    $base = 'btn-press inline-flex items-center justify-center rounded-full px-4 py-2 text-xs font-semibold transition focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-emerald-500 focus-visible:ring-offset-2 focus-visible:ring-offset-white aria-disabled:pointer-events-none aria-disabled:opacity-60 sm:px-6 sm:py-3 sm:text-sm';
    $styles = [
        'primary' => 'bg-emerald-600 text-white hover:bg-emerald-700 disabled:cursor-not-allowed disabled:opacity-70 disabled:hover:bg-emerald-600',
        'ghost' => 'border border-slate-300 text-slate-700 hover:border-slate-400 hover:text-slate-900 disabled:cursor-not-allowed disabled:opacity-60',
    ];
@endphp

<a {{ $attributes->except('disabled')->merge(['class' => $base . ' ' . ($styles[$variant] ?? $styles['primary'])]) }} @if ($isDisabled) aria-disabled="true" tabindex="-1" @endif>
    {{ $slot }}
</a>
