@extends('front-end.layouts.apps')

@section('title', ($centry->title_ps ?? 'پېړۍ') . ' | تفصیلات')

@section('page_title', $centry->title_ps ?? 'پېړۍ')

@section('main_container')
<div class="container" dir="rtl">
    {{-- Back button --}}
    <div class="mb-3">
        <a href="{{ url()->previous() }}" class="btn btn-outline-secondary rounded-pill">
            <i class="fas fa-arrow-right ms-1"></i> شاته
        </a>
    </div>

    {{-- Century title card --}}
    <div class="century-card mb-4 p-4">
        <div class="d-flex align-items-center gap-3">
            <i class="fas fa-clock" style="font-size: 2.5rem; color: var(--adabi-gold);"></i>
            <div>
                <h2 class="fw-bold" style="color: var(--adabi-dark);">{{ $centry->title_ps }}</h2>
                <p class="text-muted mb-0">{{ $centry->number ?? '' }} پېړۍ</p>
            </div>
        </div>
    </div>

    {{-- Poets of this century --}}
    <div class="section-header">
        <i class="fas fa-users"></i>
        <h3>د دې پېړۍ شاعران</h3>
    </div>

    @if($poets->count() > 0)
        <div class="poet-grid mb-5">
            @foreach($poets as $poet)
                <div class="poet-card">
                    <img src="{{ asset('storage/' . ($poet->image ?? 'front-end/images/person.png')) }}"
                         alt="{{ $poet->name }}"
                         class="avatar">
                    <a href="{{ route('public.poet_details', $poet->id) }}" class="name">{{ $poet->name }}</a>
                </div>
            @endforeach
        </div>
    @else
        <div class="alert alert-info text-center">
            <i class="fas fa-info-circle"></i> په دې پېړۍ کې شاعران نه دي ثبت شوي.
        </div>
    @endif

    {{-- All centuries chips --}}
    <div class="section-header">
        <i class="fas fa-hourglass-half"></i>
        <h3>ټولې پېړۍ</h3>
    </div>
    <div class="century-chips mb-5">
        @foreach($centries as $cent)
            <a href="{{ route('public.category_related_general', $cent->id) }}" class="chip {{ $cent->id == $centry->id ? 'active' : '' }}">
                {{ $cent->number }}
            </a>
        @endforeach
    </div>

    {{-- Bottom Navigation --}}
    <nav class="bottom-nav">
        <a href="{{ url('/') }}" class="nav-item {{ request()->is('/') ? 'active' : '' }}">
            <i class="fas fa-home"></i> <span>کور</span>
        </a>
        <a href="{{ route('public.categories') }}" class="nav-item {{ request()->is('categories*') ? 'active' : '' }}">
            <i class="fas fa-list-ul"></i> <span>کټګورۍ</span>
        </a>
        <a href="{{ route('public.poetry_search') }}" class="nav-item {{ request()->is('poetry/search') ? 'active' : '' }}">
            <i class="fas fa-search"></i> <span>لټون</span>
        </a>
    </nav>
</div>
@endsection

