<?php $__env->startSection('title', 'ড্যাশবোর্ড - আমবাগান যুব কল্যাণ সমিতি'); ?>

<?php $__env->startSection('styles'); ?>
<style>
    .profile-card {
        border-radius: 10px;
        overflow: hidden;
    }
    
    .profile-header {
        background: linear-gradient(135deg, #1a5f7a, #2a9d8f);
        padding: 30px;
        color: white;
    }
    
    .profile-avatar {
        width: 100px;
        height: 100px;
        border-radius: 50%;
        border: 3px solid white;
        object-fit: cover;
    }
    
    .info-card {
        border-left: 4px solid #1a5f7a;
        border-radius: 8px;
        margin-bottom: 20px;
    }
    
    .info-card.saving {
        border-left-color: #28a745;
    }
    
    .info-card.loan {
        border-left-color: #dc3545;
    }
    
    .info-card.notice {
        border-left-color: #17a2b8;
    }
    
    .info-card.meeting {
        border-left-color: #ffc107;
    }
    
    .card-icon {
        font-size: 2rem;
        opacity: 0.8;
    }
    
    .quick-action {
        border: 1px solid #dee2e6;
        border-radius: 8px;
        padding: 20px;
        text-align: center;
        transition: all 0.3s;
        height: 100%;
    }
    
    .quick-action:hover {
        background-color: #f8f9fa;
        transform: translateY(-5px);
    }
    
    .quick-action-icon {
        font-size: 2rem;
        margin-bottom: 10px;
        color: #1a5f7a;
    }
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('breadcrumbs'); ?>
<nav aria-label="breadcrumb">
    <ol class="breadcrumb bg-light">
        <li class="breadcrumb-item active">ড্যাশবোর্ড</li>
    </ol>
</nav>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="container-fluid">
    <!-- প্রোফাইল কার্ড -->
    <div class="card profile-card mb-4">
        <div class="profile-header">
            <div class="row align-items-center">
                <div class="col-md-2 text-center">
                    <?php if($member->photo): ?>
                    <img src="<?php echo e(asset('storage/' . $member->photo)); ?>" alt="Profile" class="profile-avatar">
                    <?php else: ?>
                    <div class="profile-avatar bg-light d-flex align-items-center justify-content-center">
                        <i class="fas fa-user fa-3x text-dark"></i>
                    </div>
                    <?php endif; ?>
                </div>
                <div class="col-md-10">
                    <h3 class="mb-2"><?php echo e($member->name); ?></h3>
                    <p class="mb-1">
                        <i class="fas fa-id-card me-2"></i>সদস্য নং: <?php echo e($member->member_id); ?>

                    </p>
                    <p class="mb-1">
                        <i class="fas fa-phone me-2"></i>ফোন: <?php echo e($member->phone); ?>

                    </p>
                    <p class="mb-1">
                        <i class="fas fa-envelope me-2"></i>ইমেইল: <?php echo e($member->email); ?>

                    </p>
                    <p class="mb-0">
                        <i class="fas fa-calendar-alt me-2"></i>যোগদান: <?php echo e(date('d/m/Y', strtotime($member->join_date))); ?>

                    </p>
                </div>
            </div>
        </div>
    </div>
    
    <!-- তথ্য কার্ড -->
    <div class="row mb-4">
        <div class="col-md-3">
            <div class="card info-card saving">
                <div class="card-body">
                    <div class="d-flex align-items-center">
                        <div class="card-icon text-success me-3">
                            <i class="fas fa-piggy-bank"></i>
                        </div>
                        <div>
                            <h5 class="card-title mb-1"><?php echo e(number_format($totalSavings, 2)); ?> টাকা</h5>
                            <p class="card-text mb-0">মোট সঞ্চয়</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="col-md-3">
            <div class="card info-card loan">
                <div class="card-body">
                    <div class="d-flex align-items-center">
                        <div class="card-icon text-danger me-3">
                            <i class="fas fa-hand-holding-usd"></i>
                        </div>
                        <div>
                            <h5 class="card-title mb-1"><?php echo e($activeLoans->count()); ?></h5>
                            <p class="card-text mb-0">চলমান ঋণ</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="col-md-3">
            <div class="card info-card">
                <div class="card-body">
                    <div class="d-flex align-items-center">
                        <div class="card-icon text-warning me-3">
                            <i class="fas fa-balance-scale"></i>
                        </div>
                        <div>
                            <h5 class="card-title mb-1"><?php echo e(number_format($totalLoanBalance, 2)); ?> টাকা</h5>
                            <p class="card-text mb-0">বকেয়া ঋণ</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="col-md-3">
            <div class="card info-card">
                <div class="card-body">
                    <div class="d-flex align-items-center">
                        <div class="card-icon text-info me-3">
                            <i class="fas fa-calendar-check"></i>
                        </div>
                        <div>
                            <h5 class="card-title mb-1"><?php echo e($member->monthlySavings()->where('status', 'paid')->count()); ?></h5>
                            <p class="card-text mb-0">পরিশোধিত মাস</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- চলমান ঋণ -->
    <?php if($activeLoans->count() > 0): ?>
    <div class="row mb-4">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title mb-0">
                        <i class="fas fa-hand-holding-usd me-2"></i>আমার চলমান ঋণ
                    </h5>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>ঋণ নং</th>
                                    <th>ধরন</th>
                                    <th>পরিমাণ</th>
                                    <th>বকেয়া</th>
                                    <th>মাসিক কিস্তি</th>
                                    <th>স্ট্যাটাস</th>
                                    <th>কার্যক্রম</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__currentLoopData = $activeLoans; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $loan): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td>LN-<?php echo e(str_pad($loan->id, 4, '0', STR_PAD_LEFT)); ?></td>
                                    <td><?php echo e($loan->loan_type_in_bangla); ?></td>
                                    <td><?php echo e(number_format($loan->loan_amount, 2)); ?> টাকা</td>
                                    <td>
                                        <span class="badge bg-warning">
                                            <?php echo e(number_format($loan->remaining_balance, 2)); ?> টাকা
                                        </span>
                                    </td>
                                    <td><?php echo e(number_format($loan->monthly_installment, 2)); ?> টাকা</td>
                                    <td>
                                        <span class="badge bg-<?php echo e($loan->status == 'active' ? 'success' : 'info'); ?>">
                                            <?php echo e($loan->status_in_bangla); ?>

                                        </span>
                                    </td>
                                    <td>
                                        <a href="<?php echo e(route('loans.show', $loan)); ?>" class="btn btn-sm btn-outline-primary">
                                            <i class="fas fa-eye"></i>
                                        </a>
                                    </td>
                                </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php endif; ?>
    
    <!-- দ্রুত কার্যক্রম -->
    <div class="row mb-4">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title mb-0">
                        <i class="fas fa-bolt me-2"></i>দ্রুত কার্যক্রম
                    </h5>
                </div>
                <div class="card-body">
                    <div class="row">
                        <div class="col-md-3 mb-3">
                            <a href="<?php echo e(route('savings.history')); ?>" class="quick-action">
                                <div class="quick-action-icon">
                                    <i class="fas fa-history"></i>
                                </div>
                                <h6>সঞ্চয় ইতিহাস</h6>
                                <p class="text-muted small">আপনার সমস্ত সঞ্চয় দেখুন</p>
                            </a>
                        </div>
                        
                        <div class="col-md-3 mb-3">
                            <a href="<?php echo e(route('loans.my-loans')); ?>" class="quick-action">
                                <div class="quick-action-icon">
                                    <i class="fas fa-file-invoice-dollar"></i>
                                </div>
                                <h6>আমার ঋণ</h6>
                                <p class="text-muted small">ঋণ বিবরণ ও কিস্তি</p>
                            </a>
                        </div>
                        
                        <div class="col-md-3 mb-3">
                            <a href="<?php echo e(route('notices.index')); ?>" class="quick-action">
                                <div class="quick-action-icon">
                                    <i class="fas fa-bullhorn"></i>
                                </div>
                                <h6>নোটিশ বোর্ড</h6>
                                <p class="text-muted small">সকল নোটিশ দেখুন</p>
                            </a>
                        </div>
                        
                        <div class="col-md-3 mb-3">
                            <a href="<?php echo e(route('meetings.index')); ?>" class="quick-action">
                                <div class="quick-action-icon">
                                    <i class="fas fa-calendar-alt"></i>
                                </div>
                                <h6>মিটিং</h6>
                                <p class="text-muted small">আসন্ন ও পুরাতন মিটিং</p>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <!-- সাম্প্রতিক নোটিশ এবং মিটিং -->
    <div class="row">
        <!-- সাম্প্রতিক নোটিশ -->
        <div class="col-md-6">
            <div class="card info-card notice">
                <div class="card-header">
                    <div class="d-flex justify-content-between align-items-center">
                        <h5 class="card-title mb-0">
                            <i class="fas fa-bullhorn me-2"></i>সাম্প্রতিক নোটিশ
                        </h5>
                        <a href="<?php echo e(route('notices.index')); ?>" class="btn btn-sm btn-outline-primary">
                            সব দেখুন
                        </a>
                    </div>
                </div>
                <div class="card-body">
                    <?php if(count($recentNotices) > 0): ?>
                    <?php $__currentLoopData = $recentNotices; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notice): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="mb-3 pb-3 border-bottom">
                        <h6 class="mb-2">
                            <a href="<?php echo e(route('notices.show', $notice)); ?>" class="text-decoration-none">
                                <?php echo e($notice->title); ?>

                            </a>
                            <?php if($notice->is_important): ?>
                            <span class="badge bg-danger ms-2">গুরুত্বপূর্ণ</span>
                            <?php endif; ?>
                        </h6>
                        <p class="mb-2 small text-muted"><?php echo e(Str::limit(strip_tags($notice->content), 80)); ?></p>
                        <div class="d-flex justify-content-between">
                            <small class="text-muted">
                                <i class="fas fa-user me-1"></i>
                                <?php echo e($notice->creator->name ?? 'অজানা'); ?>

                            </small>
                            <small class="text-muted">
                                <i class="fas fa-calendar me-1"></i>
                                <?php echo e($notice->created_at->format('d/m/Y')); ?>

                            </small>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                    <div class="text-center py-3">
                        <i class="fas fa-bell-slash fa-2x text-muted mb-3"></i>
                        <p class="text-muted">কোনো নোটিশ পাওয়া যায়নি</p>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
        
        <!-- আসন্ন মিটিং -->
        <div class="col-md-6">
            <div class="card info-card meeting">
                <div class="card-header">
                    <div class="d-flex justify-content-between align-items-center">
                        <h5 class="card-title mb-0">
                            <i class="fas fa-calendar-alt me-2"></i>আসন্ন মিটিং
                        </h5>
                        <a href="<?php echo e(route('meetings.index')); ?>" class="btn btn-sm btn-outline-primary">
                            সব দেখুন
                        </a>
                    </div>
                </div>
                <div class="card-body">
                    <?php if(count($upcomingMeetings) > 0): ?>
                    <?php $__currentLoopData = $upcomingMeetings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $meeting): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <div class="mb-3 pb-3 border-bottom">
                        <h6 class="mb-2"><?php echo e($meeting->title); ?></h6>
                        <p class="mb-2 small text-muted">
                            <i class="fas fa-map-marker-alt me-1"></i><?php echo e($meeting->location); ?>

                        </p>
                        <div class="d-flex justify-content-between">
                            <small class="text-muted">
                                <i class="fas fa-calendar-day me-1"></i>
                                <?php echo e(date('d/m/Y', strtotime($meeting->date))); ?>

                            </small>
                            <small class="text-muted">
                                <i class="fas fa-clock me-1"></i>
                                <?php echo e(date('h:i A', strtotime($meeting->time))); ?>

                            </small>
                        </div>
                        <div class="mt-2">
                            <a href="<?php echo e(route('meetings.show', $meeting)); ?>" class="btn btn-sm btn-outline-primary">
                                বিস্তারিত
                            </a>
                        </div>
                    </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                    <div class="text-center py-3">
                        <i class="fas fa-calendar-times fa-2x text-muted mb-3"></i>
                        <p class="text-muted">কোনো আসন্ন মিটিং নেই</p>
                    </div>
                    <?php endif; ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
<script>
$(document).ready(function() {
    // ঋণ তথ্য টগল
    $('.loan-details-btn').click(function() {
        const loanId = $(this).data('loan-id');
        $('#loanDetails-' + loanId).toggle();
    });
});
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/naowarin/somoti.naowarinternational.my.id/resources/views/dashboard/member.blade.php ENDPATH**/ ?>