<x-layouts.tenant pageTitle="Agenda avanzada">
    <x-page-header title="Agenda avanzada" subtitle="Configura opciones avanzadas para la visualización de la agenda." />

    <x-card title="Preferencias de agenda">
        <form method="POST" action="{{ route('tenant.advanced-agenda.update') }}" class="space-y-5">
            @csrf
            @method('PUT')
            <div class="grid grid-cols-1 md:grid-cols-2 gap-4">
                <label class="flex items-center justify-between gap-4 rounded-xl border border-ink-100 p-4">
                    <span class="font-semibold text-ink-800">Vista por recursos/equipo</span>
                    <input type="checkbox" name="agenda_resource_view" value="1" @checked((bool) ($settings['agenda_resource_view'] ?? false)) class="rounded border-ink-300 text-brand-600 focus:ring-brand-500">
                </label>
                <label class="flex items-center justify-between gap-4 rounded-xl border border-ink-100 p-4">
                    <span class="font-semibold text-ink-800">Mostrar fines de semana</span>
                    <input type="checkbox" name="agenda_show_weekends" value="1" @checked((bool) ($settings['agenda_show_weekends'] ?? true)) class="rounded border-ink-300 text-brand-600 focus:ring-brand-500">
                </label>
                <label class="block">
                    <span class="text-sm font-semibold text-ink-700">Intervalo de agenda</span>
                    <select name="agenda_slot_minutes" class="input mt-1.5">
                        @foreach ([5, 10, 15, 20, 30, 60] as $minutes)
                            <option value="{{ $minutes }}" @selected((int) ($settings['agenda_slot_minutes'] ?? 30) === $minutes)>{{ $minutes }} minutos</option>
                        @endforeach
                    </select>
                </label>
            </div>
            <x-btn type="submit">Guardar agenda avanzada</x-btn>
        </form>
    </x-card>
</x-layouts.tenant>
