@extends('layouts.app')

@section('title', 'Juzs')

@section('content')
<div class="page-content">
    <div class="container-fluid">
        <!-- Page Title -->
        <div class="row">
            <div class="col-12">
                <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                    <h4 class="mb-sm-0">Juzs (Parts)</h4>
                    <div class="page-title-right">
                        <ol class="breadcrumb m-0">
                            <li class="breadcrumb-item"><a href="{{ route('home') }}">Home</a></li>
                            <li class="breadcrumb-item"><a href="{{ route('quran.index') }}">Quran</a></li>
                            <li class="breadcrumb-item active">Juzs</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>

        <div class="row g-3">
            @foreach($juzs as $juz)
            <div class="col-xl-3 col-md-6">
                <div class="card border-0 shadow-sm card-animate h-100" style="border-top: 4px solid #3b82f6 !important;">
                    <div class="card-body p-4">
                        <div class="d-flex align-items-center justify-content-between mb-3">
                            <div>
                                <p class="text-uppercase fw-medium text-muted mb-1 small">Juz</p>
                                <h3 class="mb-0">{{ $juz->juz_number }}</h3>
                            </div>
                            <div class="avatar-sm rounded-circle bg-soft-info d-flex align-items-center justify-content-center">
                                <i class="ri-bookmark-line text-info fs-3"></i>
                            </div>
                        </div>
                        @if($juz->ayahs_data && isset($juz->ayahs_data['ayahs']))
                        <p class="text-muted mb-3">
                            <i class="ri-file-text-line me-1"></i>{{ count($juz->ayahs_data['ayahs']) }} Ayats
                        </p>
                        @endif
                        <a href="{{ route('quran.juz.show', $juz->juz_number) }}" class="btn btn-sm btn-primary w-100 rounded-pill">
                            <i class="ri-eye-line me-1"></i> View Details
                        </a>
                    </div>
                </div>
            </div>
            @endforeach
        </div>
    </div>
</div>
@endsection

