<x-layout title="Muse - 记录生活的美好">
    <!-- Hero Section -->
    <section class="relative overflow-hidden">
        <div class="absolute inset-0 bg-gradient-to-br from-rose-50 via-fuchsia-50/50 to-indigo-50"></div>
        <div class="absolute inset-0" style="background-image: radial-gradient(circle at 20% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 50%), radial-gradient(circle at 80% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);"></div>
        
        <div class="relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16 lg:py-24">
            <div class="text-center max-w-3xl mx-auto">
                <h1 class="font-serif text-4xl sm:text-5xl lg:text-6xl font-bold text-stone-900 mb-6">
                    <span class="bg-gradient-to-r from-rose-600 via-fuchsia-600 to-indigo-600 bg-clip-text text-transparent">探索</span>
                    生活的诗意
                </h1>
                <p class="text-lg sm:text-xl text-stone-600 leading-relaxed">
                    每一个瞬间都值得被记录，每一段故事都值得被聆听。<br class="hidden sm:block">
                    在这里，发现属于你的灵感与共鸣。
                </p>
            </div>
        </div>
    </section>
    
    <!-- Featured Posts -->
    @if($featuredPosts->isNotEmpty())
        <section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 -mt-8">
            <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
                @foreach($featuredPosts as $post)
                    <x-post-card :post="$post" :featured="true" />
                @endforeach
            </div>
        </section>
    @endif
    
    <!-- Categories Pills -->
    @if($categories->isNotEmpty())
        <section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
            <div class="flex flex-wrap items-center justify-center gap-3">
                <a href="{{ route('home') }}" 
                   class="px-5 py-2.5 text-sm font-medium rounded-full transition-all duration-300
                          {{ !request()->routeIs('category') ? 'bg-stone-900 text-white shadow-lg shadow-stone-900/25' : 'bg-white text-stone-700 hover:bg-stone-100 shadow-sm' }}">
                    全部
                </a>
                @foreach($categories as $cat)
                    <a href="{{ route('category', $cat) }}" 
                       class="px-5 py-2.5 text-sm font-medium rounded-full bg-white text-stone-700 hover:bg-stone-100 shadow-sm transition-all duration-300">
                        {{ $cat->name }}
                        <span class="ml-1 text-stone-400">({{ $cat->published_posts_count }})</span>
                    </a>
                @endforeach
            </div>
        </section>
    @endif
    
    <!-- Posts Grid -->
    <section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pb-16">
        <div class="flex items-center justify-between mb-8">
            <h2 class="font-serif text-2xl sm:text-3xl font-semibold text-stone-900">最新文章</h2>
        </div>
        
        @if($posts->isNotEmpty())
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6 lg:gap-8">
                @foreach($posts as $post)
                    <x-post-card :post="$post" />
                @endforeach
            </div>
            
            <!-- Pagination -->
            <div class="mt-12">
                {{ $posts->links() }}
            </div>
        @else
            <div class="text-center py-20">
                <div class="w-20 h-20 mx-auto mb-6 bg-stone-100 rounded-full flex items-center justify-center">
                    <svg class="w-10 h-10 text-stone-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
                        <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" d="M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z" />
                    </svg>
                </div>
                <h3 class="text-xl font-medium text-stone-900 mb-2">暂无文章</h3>
                <p class="text-stone-500">敬请期待更多精彩内容</p>
            </div>
        @endif
    </section>
</x-layout>

