{% if topics and topics.items %}
<div class="space-y-3">
    {% for topic in topics.items %}
    <div class="card flex items-center gap-4 p-5 transition-all duration-300 group
                {% if topic.is_pinned %}{% else %}{% endif %}"
         style="border: 1px solid {% if topic.is_pinned %}rgba(92,184,44,0.3){% else %}rgba(255,255,255,0.05){% endif %};">
        <div class="avatar w-10 h-10 text-sm font-bold flex-shrink-0">{{ topic.author.username[0].upper() }}</div>
        <div class="flex-grow min-w-0">
            <div class="flex items-center gap-2 mb-1 flex-wrap">
                {% if topic.is_pinned %}
                <span class="badge badge-primary text-xs">Pinned</span>
                {% endif %}
                {% if topic.is_locked %}
                <span class="badge badge-red text-xs">Locked</span>
                {% endif %}
                <a href="{{ url_for('forum_topic', category_slug=category.slug, topic_id=topic.id) }}"
                   class="text-sm font-semibold text-gray-200 hover:text-primary-300 transition-colors truncate">
                    {{ topic.title }}
                </a>
            </div>
            <div class="text-xs" style="color: #6b6b8a;">
                by {{ topic.author.username }} &middot; {{ topic.created_at.strftime('%b %d, %Y') }}
            </div>
        </div>
        <div class="text-right flex-shrink-0">
            <div class="text-sm font-semibold" style="color: #e8e6f0;">{{ topic.reply_count }}</div>
            <div class="text-xs" style="color: #6b6b8a;">{{ topic.last_activity.strftime('%b %d') }}</div>
        </div>
    </div>
    {% endfor %}
</div>
{% else %}
<div class="text-center py-16">
    <div class="w-14 h-14 rounded-xl flex items-center justify-center mx-auto mb-4"
         style="background: rgba(92,184,44,0.1); border: 1px solid rgba(92,184,44,0.2);">
        <svg class="w-7 h-7 text-primary-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" />
        </svg>
    </div>
    <h3 class="text-lg font-bold mb-2" style="font-family: 'Syne', sans-serif; color: #f1f0ff;">No topics yet</h3>
    <p class="text-sm" style="color: #6b6b8a;">Be the first to start a discussion!</p>
</div>
{% endif %}
