@extends('layouts.masterbeta')

@section('title', 'Click ERP - Dashboard')

@push('styles')
    <style>
        /* Typography overrides for Dashboard headers */
        .card-heading { font-size: 0.95rem; font-weight: 600; color: #4a90e2; padding: 1rem 1.25rem; border-bottom: 1px solid #eaedf1; }
        .kpi-title { color: #4a90e2; font-size: 1.1rem; font-weight: 600; }
        .kpi-value { font-size: 2.2rem; font-weight: 700; color: #4b5563; line-height: 1; }
        .kpi-icon { font-size: 3rem; color: #d1d5db; }

        /* Quotes Section */
        .quote-block { border-left: 3px solid #e5e7eb; padding-left: 1rem; margin-bottom: 1rem; color: #4b5563; font-size: 0.95rem; }
        .quote-author { font-size: 0.8rem; color: #6b7280; }
        
        /* Badges */
        .badge-rounded { border-radius: 12px; padding: 0.25rem 0.6rem; font-size: 0.75rem; font-weight: bold; }
        .bg-red-custom { background-color: #ef4444; color: white; }
        .bg-orange-custom { background-color: #f59e0b; color: white; }
        .bg-teal-custom { background-color: #14b8a6; color: white; }

        /* Timeline / Recent Activities */
        .activity-timeline { position: relative; padding-left: 1.5rem; list-style: none; margin: 0; }
        .activity-timeline::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #e5e7eb; }
        .timeline-item { position: relative; margin-bottom: 1.5rem; }
        .timeline-item:last-child { margin-bottom: 0; }
        .timeline-item::before { content: ''; position: absolute; left: -1.8rem; top: 0.2rem; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 2px solid #cbd5e1; }
        .timeline-text { font-size: 0.85rem; color: #4b5563; margin-bottom: 0.25rem; }
        .timeline-time { font-size: 0.75rem; color: #9ca3af; font-style: italic; }

        /* Client Date Badge */
        .date-badge { background-color: #d97706; color: white; border-radius: 6px; text-align: center; width: 45px; padding: 0.3rem 0; flex-shrink: 0; }
        .date-badge .month { font-size: 0.7rem; text-transform: uppercase; line-height: 1; }
        .date-badge .day { font-size: 1.1rem; font-weight: bold; line-height: 1.1; margin: 0.1rem 0; }
        .date-badge .year { font-size: 0.7rem; line-height: 1; }
        
        /* Empty States */
        .empty-state { min-height: 200px; display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 0.9rem; }
    </style>
@endpush

@section('breadcrumbs')
    <i class="bi bi-list text-secondary me-3" style="font-size: 1.5rem; cursor: pointer;"></i>
@endsection

@section('content')
    <!-- KPI Row -->
    <div class="row g-3 mb-4">
        <!-- SMS Clients -->
        <div class="col-xl-3 col-md-6">
            <div class="content-card p-4 d-flex justify-content-between align-items-center h-100">
                <div>
                    <div class="kpi-value mb-1">{{ $sms }}</div>
                    <div class="kpi-title">SMS Clients</div>
                </div>
                <i class="bi bi-chat-dots kpi-icon"></i>
            </div>
        </div>
        <!-- USSD Clients -->
        <div class="col-xl-3 col-md-6">
            <div class="content-card p-4 d-flex justify-content-between align-items-center h-100">
                <div>
                    <div class="kpi-value mb-1">230</div>
                    <div class="kpi-title">USSD Clients</div>
                </div>
                <i class="bi bi-phone kpi-icon"></i>
            </div>
        </div>
        <!-- Voice Clients -->
        <div class="col-xl-3 col-md-6">
            <div class="content-card p-4 d-flex justify-content-between align-items-center h-100">
                <div>
                    <div class="kpi-value mb-1">5</div>
                    <div class="kpi-title">Voice Clients</div>
                </div>
                <i class="bi bi-megaphone kpi-icon"></i>
            </div>
        </div>
        <!-- Airtime Clients -->
        <div class="col-xl-3 col-md-6">
            <div class="content-card p-4 d-flex justify-content-between align-items-center h-100">
                <div>
                    <div class="kpi-value mb-1">6</div>
                    <div class="kpi-title">Airtime Clients</div>
                </div>
                <i class="bi bi-patch-check kpi-icon" style="transform: rotate(45deg);"></i>
            </div>
        </div>
    </div>

    <!-- Quotes & Contracts Row -->
    <div class="row g-4 mb-4">
        
        <!-- Quotes Section -->
        <div class="col-lg-6">
            <div class="content-card h-100">
                <div class="card-heading">Quotes</div>
                <div class="p-4 row g-0">
                    <div class="col-sm-6 border-end pe-sm-4 mb-4 mb-sm-0 d-flex flex-column">
                        <div class="quote-block">Change in all things is sweet.</div>
                        <div class="quote-author mt-2">Aristotle</div>
                        <div class="mt-auto pt-4 text-danger fw-bold" style="font-size: 0.85rem;">Quote of the Day</div>
                    </div>
                    <div class="col-sm-6 ps-sm-4 d-flex flex-column">
                        <div class="quote-block">Genius is one percent inspiration and ninety-nine percent perspiration.</div>
                        <div class="quote-author mt-2">Thomas Edison</div>
                        <div class="mt-auto pt-4 text-primary fw-bold" style="font-size: 0.85rem; color: #4a90e2 !important;">Message of the Day</div>
                    </div>
                </div>
            </div>
        </div>

        <!-- Contract Expiry Notice -->
        <div class="col-lg-6">
            <div class="content-card h-100">
                <div class="card-heading">Contract Expiry Notice</div>
                <div class="p-4">
                    <!-- MNO Contracts -->
                    <div class="text-center mb-4">
                        <a href="#" class="text-decoration-underline fw-semibold d-block mb-3" style="color: #4a90e2;">MNO Contracts</a>
                        <div class="row text-center">
                            <div class="col-4">
                                <div class="text-danger fw-bold mb-1" style="font-size: 0.8rem;">Expired</div>
                                <span class="badge-rounded bg-red-custom">9</span>
                            </div>
                            <div class="col-4">
                                <div class="text-warning fw-bold mb-1" style="font-size: 0.8rem; color: #d97706 !important;">Expiring This Month</div>
                                <span class="badge-rounded bg-orange-custom">0</span>
                            </div>
                            <div class="col-4">
                                <div class="text-success fw-bold mb-1" style="font-size: 0.8rem; color: #0d9488 !important;">Expiring in 3 months</div>
                                <span class="badge-rounded bg-teal-custom">0</span>
                            </div>
                        </div>
                    </div>

                    <hr class="text-secondary opacity-25 my-4">

                    <!-- Client Contracts -->
                    <div class="text-center">
                        <a href="#" class="text-decoration-underline fw-semibold d-block mb-3" style="color: #4a90e2;">Client Contracts</a>
                        <div class="row text-center">
                            <div class="col-4">
                                <div class="text-danger fw-bold mb-1" style="font-size: 0.8rem;">Expired</div>
                                <span class="badge-rounded bg-red-custom">313</span>
                            </div>
                            <div class="col-4">
                                <div class="text-warning fw-bold mb-1" style="font-size: 0.8rem; color: #d97706 !important;">Expiring This Month</div>
                                <span class="badge-rounded bg-orange-custom">12</span>
                            </div>
                            <div class="col-4">
                                <div class="text-success fw-bold mb-1" style="font-size: 0.8rem; color: #0d9488 !important;">Expiring in 3 months</div>
                                <span class="badge-rounded bg-teal-custom">0</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Bottom Lists Row -->
    <div class="row g-4">
        
        <!-- Recent Activities -->
        <div class="col-xl-3 col-lg-6">
            <div class="content-card h-100 d-flex flex-column">
                <div class="card-heading">Recent Activities</div>
                <div class="p-4 flex-grow-1">
                    <ul class="activity-timeline">
                        <li class="timeline-item">
                            <div class="timeline-text">User ID : 15 (Mphatso Katundu) Added a new Note for : CLOUD COM</div>
                            <div class="timeline-time">7 months ago</div>
                        </li>
                        <li class="timeline-item">
                            <div class="timeline-text">User ID : 16 (Diana Towett) Added a new Note for : PCCW</div>
                            <div class="timeline-time">7 months ago</div>
                        </li>
                        <li class="timeline-item">
                            <div class="timeline-text">User ID : 16 (Diana Towett) Added a new Note for : Panacea</div>
                            <div class="timeline-time">7 months ago</div>
                        </li>
                        <li class="timeline-item">
                            <div class="timeline-text">User ID : 16 (Diana Towett) Added a new Note for : Termii</div>
                            <div class="timeline-time">7 months ago</div>
                        </li>
                        <li class="timeline-item">
                            <div class="timeline-text">Diana Towett Successfully Logged In</div>
                            <div class="timeline-time">7 months ago</div>
                        </li>
                    </ul>
                </div>
                <div class="p-3 border-top">
                    <a href="#" class="text-decoration-none" style="font-size: 0.85rem; color: #4a90e2;">View More</a>
                </div>
            </div>
        </div>

        <!-- Upcoming Holidays -->
        <div class="col-xl-3 col-lg-6">
            <div class="content-card h-100">
                <div class="card-heading">Upcoming Holidays</div>
                <div class="empty-state">
                    No upcoming holidays
                </div>
            </div>
        </div>

        <!-- Upcoming Birthdays -->
        <div class="col-xl-3 col-lg-6">
            <div class="content-card h-100">
                <div class="card-heading">Upcoming Birthdays</div>
                <div class="empty-state">
                    No upcoming birthdays
                </div>
            </div>
        </div>

        <!-- Newly Added Clients -->
        <div class="col-xl-3 col-lg-6">
            <div class="content-card h-100">
                <div class="card-heading">Newly Added Clients</div>
                <div class="p-3">
                    
                    <div class="d-flex align-items-start mb-3 border-bottom pb-3">
                        <div class="date-badge me-3">
                            <div class="month">Nov</div>
                            <div class="day">10</div>
                            <div class="year">2025</div>
                        </div>
                        <div>
                            <div class="fw-bold" style="font-size: 0.8rem; color: #374151;">Solidaridad Network</div>
                            <div class="text-secondary mt-1" style="font-size: 0.7rem; line-height: 1.4;">
                                Company Type : ENTERPRISE<br>
                                Account Manager : KWESI BANSON
                            </div>
                        </div>
                    </div>

                    <div class="d-flex align-items-start mb-3 border-bottom pb-3">
                        <div class="date-badge me-3">
                            <div class="month">Nov</div>
                            <div class="day">10</div>
                            <div class="year">2025</div>
                        </div>
                        <div>
                            <div class="fw-bold" style="font-size: 0.8rem; color: #374151;">Avada Pay</div>
                            <div class="text-secondary mt-1" style="font-size: 0.7rem; line-height: 1.4;">
                                Company Type : AGGREGATOR/SUPPLIER<br>
                                Account Manager : MELISSA SHUMA
                            </div>
                        </div>
                    </div>

                    <div class="d-flex align-items-start mb-3 border-bottom pb-3">
                        <div class="date-badge me-3">
                            <div class="month">Nov</div>
                            <div class="day">10</div>
                            <div class="year">2025</div>
                        </div>
                        <div>
                            <div class="fw-bold" style="font-size: 0.8rem; color: #374151;">Pezesha Limited</div>
                            <div class="text-secondary mt-1" style="font-size: 0.7rem; line-height: 1.4;">
                                Company Type : ENTERPRISE<br>
                                Account Manager : MELISSA SHUMA
                            </div>
                        </div>
                    </div>

                    <div class="d-flex align-items-start mb-3 border-bottom pb-3">
                        <div class="date-badge me-3">
                            <div class="month">Nov</div>
                            <div class="day">10</div>
                            <div class="year">2025</div>
                        </div>
                        <div>
                            <div class="fw-bold" style="font-size: 0.8rem; color: #374151;">NUETECH STACK LLC</div>
                            <div class="text-secondary mt-1" style="font-size: 0.7rem; line-height: 1.4;">
                                Company Type : AGGREGATOR/SUPPLIER<br>
                                Account Manager : MELISSA SHUMA
                            </div>
                        </div>
                    </div>

                    <div class="d-flex align-items-start">
                        <div class="date-badge me-3">
                            <div class="month">Oct</div>
                            <div class="day">29</div>
                            <div class="year">2025</div>
                        </div>
                        <div>
                            <div class="fw-bold" style="font-size: 0.8rem; color: #374151; line-height: 1.2;">THABA-ENHLE ZIM (PRIVATE) LIMITED-ChapChapBet</div>
                            <div class="text-secondary mt-1" style="font-size: 0.7rem; line-height: 1.4;">
                                Company Type : ENTERPRISE<br>
                                Account Manager : CHARITY MTEMBEZEKA
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
@endsection