@extends('layouts.app')

@section('title', 'Detail OPD - SKM Survey')

@section('content')
<div class="container-fluid">
    <div class="row mb-4">
        <div class="col-12">
            <a href="{{ route('admin.opds.index') }}" class="btn btn-secondary mb-3">
                <i class="bi bi-arrow-left"></i> Kembali
            </a>
            <h2 style="color: #1e3a8a; font-weight: 700;">
                <i class="bi bi-eye me-2"></i> Detail Organisasi Perangkat Daerah (OPD)
            </h2>
        </div>
    </div>

    <div class="card card-gov shadow-sm mb-4">
        <div class="card-header">
            <h5 class="mb-0">Informasi OPD</h5>
        </div>
        <div class="card-body">
            <div class="row">
                <div class="col-md-6 mb-3">
                    <strong>Nama OPD:</strong>
                    <p class="mb-0">{{ $opd->name }}</p>
                </div>
                <div class="col-md-6 mb-3">
                    <strong>Kode:</strong>
                    <p class="mb-0"><span class="badge-gov">{{ $opd->code }}</span></p>
                </div>
                <div class="col-md-6 mb-3">
                    <strong>Status:</strong>
                    <p class="mb-0">
                        @if($opd->is_active)
                            <span class="badge bg-success">Aktif</span>
                        @else
                            <span class="badge bg-secondary">Nonaktif</span>
                        @endif
                    </p>
                </div>
                <div class="col-md-6 mb-3">
                    <strong>Total Response:</strong>
                    <p class="mb-0"><span class="badge bg-info">{{ $opd->responses_count }}</span></p>
                </div>
                <div class="col-12 mb-3">
                    <strong>Deskripsi:</strong>
                    <p class="mb-0">{{ $opd->description ?? '-' }}</p>
                </div>
            </div>
        </div>
    </div>

    <div class="card card-gov shadow-sm">
        <div class="card-header d-flex justify-content-between align-items-center">
            <h5 class="mb-0">Aksi</h5>
        </div>
        <div class="card-body">
            <div class="btn-group" role="group">
                <a href="{{ route('admin.opds.edit', $opd->id) }}" class="btn btn-primary">
                    <i class="bi bi-pencil me-2"></i> Edit OPD
                </a>
                <a href="{{ route('admin.opd.results', $opd->id) }}" class="btn btn-success">
                    <i class="bi bi-graph-up me-2"></i> Lihat Hasil Survey
                </a>
                <a href="{{ route('admin.opd.export.excel', $opd->id) }}" class="btn btn-info">
                    <i class="bi bi-file-earmark-excel me-2"></i> Export Excel
                </a>
                <a href="{{ route('admin.opd.export.pdf', $opd->id) }}" class="btn btn-danger">
                    <i class="bi bi-file-earmark-pdf me-2"></i> Export PDF
                </a>
            </div>
        </div>
    </div>
</div>
@endsection



