<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Project Details</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        .project-card {
            border: 1px solid #ddd;
            border-radius: 8px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            padding: 20px;
        }

        .project-photo {
            max-width: 100%;
            border-radius: 8px;
        }

        .project-doc {
            max-width: 100%;
            border-radius: 8px;
            padding: 10px 0;
        }

        .project-title {
            font-size: 1.5rem;
            font-weight: bold;
            margin-bottom: 20px;
        }

        .project-details dt {
            font-weight: bold;
        }

        .project-details dd {
            margin-bottom: 10px;
        }
    </style>
</head>

<body>
    <div class="container mt-5">
        <div class="project-card">
            <div class="project-title">
                {{ $project->judul_project }}
            </div>

            <div class="row">
                <div class="col-md-6">
                    <dl class="project-details">
                        <dt>Sub Sector</dt>
                        <dd>{{ $project->bidang_sub_sektor_ekonomi_kreatif }}</dd>

                        <dt>Latar Belakang</dt>
                        <dd>{{ $project->latar_belakang }}</dd>

                        <dt>Penerima Manfaat Pengguna Project</dt>
                        <dd>{!! $project->penerima_manfaat_pengguna_project !!}</dd>

                        <dt>Solusi Project</dt>
                        <dd>{!! $project->solusi_project !!}</dd>

                        <dt>Parameter Kesuksesan</dt>
                        <dd>{!! $project->parameter_kesuksesan !!}</dd>

                        <dt>Rincian Kebutuhan</dt>
                        <dd>{!! $project->rincian_kebutuhan !!}</dd>


                        <dt>Deskripsi Kolaborasi</dt>
                        <dd>{{ $project->deskripsi_kolaborasi }}</dd>

                        <dt>Kata Kunci</dt>
                        <dd>{{ $project->kata_kunci }}</dd>

                        <dt>Batas Terima Tawaran</dt>
                        <dd>{{ $project->batas_terima_tawaran->format('d-m-Y') }}</dd>
                        <!-- Added Fields -->
                        <dt>Tanggal Mulai</dt>
                        <dd>{{ $project->tanggal_mulai->format('d-m-Y') }}</dd>

                        <dt>Tanggal Berakhir</dt>
                        <dd>{{ $project->tanggal_berakhir->format('d-m-Y') }}</dd>

                        <dt>Nominal Kebutuhan</dt>
                        <dd>Rp {{ number_format($project->nominal_kebutuhan, 2, ',', '.') }}</dd>

                        <dt>Kategori</dt>
                        <dd>{{ $project->kategori }}</dd>

                        <dt>Kontak</dt>
                        <dd>{{ $project->kontak }}</dd>
                    </dl>
                </div>
                <div class="col-md-6">
                    @if ($project->foto_proyek)
                    <div class="mb-3">
                        <h5>Foto Project</h5>
                        <img src="{{ Storage::url($project->foto_proyek) }}" alt="Project Photo"
                            class="project-photo">
                    </div>
                    @endif

                    @if ($project->dokumen_pendukung)
                    <div class="mb-3">
                        <h5>Dokumen Pendukung</h5>
                        <a href="{{ Storage::url($project->dokumen_pendukung) }}"
                            download="{{ basename($project->dokumen_pendukung) }}"
                            class="btn btn-primary">Download</a>
                    </div>
                    @endif
                </div>
            </div>
        </div>

        <a href="{{ route('projects.index') }}" class="btn btn-secondary mt-4">Back to List</a>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html>