@extends('layouts.admin')
@section('title', 'Sliders')
@section('breadcrumb')<li class="active">Sliders</li>@endsection
@section('admin-content')
<div class="d-flex justify-content-between align-items-center mb-3">
    <h4 class="mb-0">Sliders</h4>
    <a href="{{ route('admin.sliders.create') }}" class="btn btn-primary btn-sm"><i class="fas fa-plus mr-1"></i> Add Slider</a>
</div>
<div class="admin-card"><div class="card-body p-0"><table class="admin-table">
<thead><tr><th>Name</th><th>Position</th><th>Slides</th><th>Status</th><th>Actions</th></tr></thead>
<tbody>
@forelse($sliders as $s)
<tr>
    <td><strong>{{ $s->name }}</strong></td>
    <td><span class="badge badge-info">{{ $s->position }}</span></td>
    <td>{{ $s->slides_count }}</td>
    <td>{!! $s->is_active ? '<span class="badge badge-success">Active</span>' : '<span class="badge badge-secondary">Inactive</span>' !!}</td>
    <td>
        <a href="{{ route('admin.sliders.slides', $s) }}" class="btn btn-sm btn-outline-info" title="Manage Slides"><i class="fas fa-images"></i></a>
        <a href="{{ route('admin.sliders.edit', $s) }}" class="btn btn-sm btn-outline-primary"><i class="fas fa-edit"></i></a>
        <form method="POST" action="{{ route('admin.sliders.destroy', $s) }}" class="d-inline" onsubmit="return confirm('Delete slider and all slides?')">@csrf @method('DELETE')<button class="btn btn-sm btn-outline-danger"><i class="fas fa-trash"></i></button></form>
    </td>
</tr>
@empty<tr><td colspan="5" class="text-center text-muted py-4">No sliders.</td></tr>@endforelse
</tbody></table></div></div>
<div class="mt-3">{{ $sliders->links() }}</div>
@endsection
