<?php $title = 'New Topic - Forum'; ?>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-white font-weight-bold">New Topic in <?= htmlspecialchars($category->name) ?></h1>
</div>
<div class="glass-card">
    <form method="POST" action="<?= $baseUrl ?>/forum/store-topic" enctype="multipart/form-data">
        <input type="hidden" name="category_id" value="<?= $category->id ?>">
        <div class="form-group">
            <label style="color: rgba(255,255,255,0.7);">Title</label>
            <input type="text" name="title" class="form-control glass-input" required>
        </div>
        <div class="form-group">
            <label style="color: rgba(255,255,255,0.7);">Body</label>
            <textarea name="body" class="form-control glass-input" rows="8" required></textarea>
        </div>
        <div class="form-group">
            <label style="color: rgba(255,255,255,0.7);">Attachment (optional)</label>
            <input type="file" name="media" class="form-control-file" style="color: rgba(255,255,255,0.7);">
            <small style="color: rgba(255,255,255,0.4);">Allowed: jpg, png, gif, svg, pdf, doc, docx, xls, xlsx, zip</small>
        </div>
        <div class="text-right">
            <a href="<?= $baseUrl ?>/forum/category/<?= $category->id ?>" class="glass-btn mr-2">Cancel</a>
            <button type="submit" class="glass-btn glass-btn-primary">Create Topic</button>
        </div>
    </form>
</div>