<x-layouts.admin :title="__('Edit') . ' ' . $pageTitle" :subtitle="__('Update the content displayed on the') . ' ' . $pageTitle . ' ' . __('page.')">

    @if(session('success'))
    <div x-data="{ show: true }" x-show="show" x-init="setTimeout(() => show = false, 5000)"
         class="mb-6 p-4 bg-success/10 border border-success/20 rounded-xl text-sm font-medium text-success flex items-center gap-2">
        <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>
        {{ session('success') }}
        <button @click="show = false" class="ml-auto opacity-60 hover:opacity-100">&times;</button>
    </div>
    @endif

    <form method="POST" action="{{ route('admin.frontend-settings.update', $type) }}" class="space-y-6">
        @csrf
        @method('PUT')

        @include('admin.frontend-settings.partials.' . $type)

        <div class="flex items-center justify-between pt-4">
            <a href="{{ route('admin.frontend-settings.index') }}" class="inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-muted hover:text-ink border border-border rounded-xl hover:bg-surface-2 transition-colors">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7"/></svg>
                {{ __('Back') }}
            </a>
            <button type="submit" class="settings-save-btn">
                <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"/></svg>
                {{ __('Save Settings') }}
            </button>
        </div>
    </form>

</x-layouts.admin>
