<?php require __DIR__ . '/../layouts/header.php'; ?>

<section class="hero-section p-5 mb-4 rounded-4 shadow-sm">
    <h1 class="display-6 fw-bold mb-2"><?= e((string) $paper['submission_title']) ?></h1>
    <p class="lead mb-0"><?= e(current_lang() === 'ar' ? (string) $paper['title_ar'] : (string) $paper['title_en']) ?></p>
</section>

<div class="row g-4">
    <div class="col-lg-8">
        <div class="card border-0 shadow-sm rounded-4 mb-4">
            <div class="card-body">
                <div class="mb-2"><strong><?= e(trans('submission_no')) ?>:</strong> <?= e((string) $paper['submission_no']) ?></div>
                <div class="mb-2"><strong><?= e(trans('tracks')) ?>:</strong> <?= e(current_lang() === 'ar' ? (string) $paper['name_ar'] : (string) $paper['name_en']) ?></div>
                <div class="mb-2"><strong><?= e(trans('doi')) ?>:</strong> <?= e((string) ($paper['doi'] ?? '')) ?></div>
                <div class="mb-0"><strong><?= e(trans('abstract')) ?>:</strong><br><?= nl2br(e((string) ($paper['abstract'] ?? ''))) ?></div>
            </div>
        </div>

        <div class="card border-0 shadow-sm rounded-4">
            <div class="card-body">
                <h3 class="h5 fw-bold mb-3"><?= e(trans('authors')) ?></h3>
                <?php if (!empty($authors)): ?>
                    <ul class="mb-0">
                        <?php foreach ($authors as $a): ?>
                            <li><?= e((string) $a['full_name']) ?><?= !empty($a['affiliation']) ? ' — ' . e((string) $a['affiliation']) : '' ?></li>
                        <?php endforeach; ?>
                    </ul>
                <?php else: ?>
                    <div class="alert alert-info rounded-4 mb-0"><?= e(trans('no_data')) ?></div>
                <?php endif; ?>
            </div>
        </div>
    </div>

    <div class="col-lg-4">
        <div class="card border-0 shadow-sm rounded-4">
            <div class="card-body">
                <a href="<?= e(base_path('download?id=' . (int) $paper['paper_id'])) ?>" class="btn btn-primary w-100 rounded-3"><?= e(trans('download_file')) ?></a>
            </div>
        </div>
    </div>
</div>

<?php require __DIR__ . '/../layouts/footer.php'; ?>
