{{-- Esnek deadline kuralı (tam sayfa modal / Bootstrap). Modal JS ile doldurulur.
     Gerekli: $name, $label. Opsiyonel: $anchors (value=>label) --}}
@php $anchors = $anchors ?? ['departure' => 'Kalkış', 'publish' => 'Yayın Tarihi']; @endphp
<div class="row align-items-end mb-2 dp-rule">
    <div class="col-md-4">
        <label class="form-label">{{ $label }}</label>
        <select name="{{ $name }}[mode]" id="{{ $name }}_mode" class="form-select dp-rule-mode">
            <option value="">— Yok —</option>
            <option value="datetime">Belirli Tarih & Saat</option>
            <option value="relative">Göreli (saat/gün)</option>
        </select>
    </div>
    <div class="col-md-3 dp-rule-at" style="display:none">
        <label class="form-label">Tarih & Saat</label>
        <input type="datetime-local" name="{{ $name }}[at]" id="{{ $name }}_at" class="form-control">
    </div>
    <div class="col-md-5 dp-rule-rel" style="display:none">
        <label class="form-label">Ne zaman?</label>
        <div class="d-flex gap-2">
            <input type="number" min="1" name="{{ $name }}[amount]" id="{{ $name }}_amount" class="form-control" placeholder="12" style="max-width:90px">
            <select name="{{ $name }}[unit]" id="{{ $name }}_unit" class="form-select"><option value="hours">saat</option><option value="days">gün</option></select>
            <select name="{{ $name }}[direction]" id="{{ $name }}_direction" class="form-select"><option value="before">önce</option><option value="after">sonra</option></select>
            <select name="{{ $name }}[anchor]" id="{{ $name }}_anchor" class="form-select">@foreach($anchors as $v => $l)<option value="{{ $v }}">{{ $l }}</option>@endforeach</select>
        </div>
    </div>
</div>
