{{-- TUREB sicil kaydı detayı (drawer). Salt-okunur: kaynak TUREB'dir, düzenlenemez. --}}
<div class="p-4">

    <div class="d-flex align-items-center gap-3 mb-4">
        <div style="width:56px;height:56px;border-radius:16px;background:linear-gradient(135deg,#3b82f6,#2563eb);
                    color:#fff;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:1.3rem;">
            {{ mb_strtoupper(mb_substr($guide->full_name, 0, 1)) }}
        </div>
        <div style="min-width:0">
            <h5 class="fw-800 text-dark mb-1">{{ $guide->full_name }}</h5>
            <div>
                @if($guide->chamber_code)
                    <span class="badge bg-light text-dark border">{{ $guide->chamber_code }}</span>
                @endif
                <span class="badge {{ $guide->is_active_guide ? 'bg-success' : 'bg-secondary' }}">{{ $guide->status ?: '—' }}</span>
            </div>
        </div>
    </div>

    @if($imported)
        <div class="alert alert-success d-flex align-items-center gap-2 py-2">
            <i class="fas fa-circle-check"></i>
            <div class="small">
                Bu rehber kaynaklarınızda kayıtlı:
                <a href="{{ route('agency.resources.edit', $imported) }}" class="fw-700">{{ $imported->name }}</a>
            </div>
        </div>
    @endif

    <div class="card border-0 bg-light p-4 mb-3" style="border-radius:20px;">
        <h6 class="fw-800 text-dark mb-3"><i class="fas fa-address-card text-primary me-2"></i>Sicil Bilgileri</h6>

        <div class="mb-3">
            <label class="text-muted small fw-600">BAĞLI OLDUĞU ODA</label>
            <div class="fw-700 text-dark">{{ $guide->chamber?->label ?? ($guide->chamber_code ?: '—') }}</div>
        </div>

        <div class="mb-3">
            <label class="text-muted small fw-600">YABANCI DİL</label>
            <div class="fw-700 text-dark">{{ $guide->languages_text }}</div>
        </div>

        <div class="mb-3">
            <label class="text-muted small fw-600">BÖLGE</label>
            <div class="fw-700 text-dark">{{ $guide->regions_text }}</div>
        </div>

        <div class="mb-3">
            <label class="text-muted small fw-600">TELEFON</label>
            <div class="fw-700 text-dark">
                @if($guide->phone)
                    <a href="tel:{{ $guide->phone }}">{{ $guide->phone }}</a>
                @else
                    <span class="text-muted">TUREB'de yayımlanmamış</span>
                @endif
            </div>
        </div>

        <div>
            <label class="text-muted small fw-600">E-POSTA</label>
            <div class="fw-700 text-dark text-break">
                @if($guide->email)
                    <a href="mailto:{{ $guide->email }}">{{ $guide->email }}</a>
                @else
                    <span class="text-muted">TUREB'de yayımlanmamış</span>
                @endif
            </div>
        </div>
    </div>

    @if(!$imported)
        <form method="POST" action="{{ route('agency.guide-registry.import', $guide) }}">
            @csrf
            <button class="btn btn-dark w-100 fw-700" style="border-radius:12px;padding:11px;">
                <i class="fas fa-plus me-1"></i> Kaynaklarıma Ekle
            </button>
        </form>
        <div class="text-muted small mt-2 text-center">
            Kopya oluşturulur; sonrasında kendi kaynağınız üzerinde serbestçe düzenleyebilirsiniz.
        </div>
    @endif

    <div class="text-muted small mt-3 pt-3 border-top">
        <i class="fas fa-database me-1"></i>
        Kaynak: <a href="https://www.tureb.org.tr/RehberVeritabani" target="_blank" rel="noopener">TUREB Rehber Veritabanı</a>
        @if($guide->fetched_at)
            · Çekilme: {{ $guide->fetched_at->translatedFormat('d F Y H:i') }}
        @endif
    </div>
</div>
