@props([
    'title' => '',
    'subtitle' => '',
    'header' => true,
    'footer' => false,
    'footerContent' => '',
    'class' => '',
    'headerClass' => '',
    'bodyClass' => '',
    'footerClass' => '',
    'actions' => [],
    'icon' => '',
    'badge' => '',
    'badgeColor' => 'primary'
])

<div class="card {{ $class }}">
    @if($header)
        <div class="card-header {{ $headerClass }}">
            <div class="d-flex justify-content-between align-items-center">
                <div class="d-flex align-items-center">
                    @if($icon)
                        <i class="{{ $icon }} me-2 text-muted"></i>
                    @endif
                    <div>
                        @if($title)
                            <h5 class="card-title mb-0">{{ $title }}</h5>
                        @endif
                        @if($subtitle)
                            <p class="card-subtitle text-muted mb-0">{{ $subtitle }}</p>
                        @endif
                    </div>
                </div>
                <div class="d-flex align-items-center gap-2">
                    @if($badge)
                        <span class="badge bg-{{ $badgeColor }}">{{ $badge }}</span>
                    @endif
                    @if(count($actions) > 0)
                        <div class="dropdown">
                            <button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown">
                                <i class="fas fa-ellipsis-v"></i>
                            </button>
                            <ul class="dropdown-menu">
                                @foreach($actions as $action)
                                    <li>
                                        <a class="dropdown-item" href="{{ $action['url'] ?? '#' }}">
                                            @if(isset($action['icon']))
                                                <i class="{{ $action['icon'] }} me-2"></i>
                                            @endif
                                            {{ $action['label'] }}
                                        </a>
                                    </li>
                                @endforeach
                            </ul>
                        </div>
                    @endif
                </div>
            </div>
        </div>
    @endif

    <div class="card-body {{ $bodyClass }}">
        {{ $slot }}
    </div>

    @if($footer)
        <div class="card-footer {{ $footerClass }}">
            {{ $footerContent }}
        </div>
    @endif
</div>
