{% extends 'myadmin/base_myadmin.html' %}

{% block title %}MyAdmin Dashboard | Ensolanka Staff Operations{% endblock %}

{% block content %}
<style>
    .admin-home-hero {
        border-radius: 36px;
        background:
            radial-gradient(circle at top right, rgba(251, 191, 36, 0.14), transparent 34%),
            linear-gradient(135deg, #052e25, #0f766e);
        color: #fff;
        padding: 3rem 2.5rem;
        box-shadow: 0 28px 65px rgba(15, 23, 42, 0.18);
    }

    .admin-home-badge {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        padding: 0.46rem 0.9rem;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.22);
        color: #fef3c7;
        font-weight: 900;
        font-size: 0.82rem;
        text-transform: uppercase;
        letter-spacing: 0.045em;
        margin-bottom: 1rem;
    }

    .admin-home-hero h1 {
        font-weight: 900;
        letter-spacing: -0.04em;
        font-size: clamp(2.2rem, 4vw, 3.4rem);
    }

    .admin-home-hero p {
        color: rgba(255, 255, 255, 0.88);
        line-height: 1.78;
        max-width: 850px;
        margin-bottom: 0;
    }

    .admin-stat-card {
        height: 100%;
        background: #fff;
        border-radius: 28px;
        border: 1px solid #e2e8f0;
        box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
        padding: 1.5rem;
    }

    .admin-stat-icon {
        width: 54px;
        height: 54px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 19px;
        font-size: 1.35rem;
        margin-bottom: 1rem;
        background: #ecfdf5;
        color: #0f766e;
    }

    .admin-stat-icon.gold {
        background: #fef3c7;
        color: #b45309;
    }

    .admin-stat-icon.blue {
        background: #dbeafe;
        color: #1d4ed8;
    }

    .admin-stat-number {
        font-size: 2rem;
        font-weight: 900;
        color: #0f172a;
        line-height: 1;
        margin-bottom: 0.45rem;
    }

    .admin-stat-title {
        color: #334155;
        font-weight: 900;
        margin-bottom: 0.3rem;
    }

    .admin-stat-text {
        color: #64748b;
        line-height: 1.6;
        font-size: 0.92rem;
        margin-bottom: 0;
    }

    .admin-module-card {
        border-radius: 32px;
        background: #fff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 20px 46px rgba(15, 23, 42, 0.09);
        padding: 2rem;
    }

    .admin-module-card h2 {
        color: #0f172a;
        font-weight: 900;
    }

    .admin-module-card p {
        color: #64748b;
        line-height: 1.72;
    }

    .admin-module-grid-card {
        height: 100%;
        border-radius: 32px;
        background: #fff;
        border: 1px solid #e2e8f0;
        box-shadow: 0 20px 46px rgba(15, 23, 42, 0.09);
        padding: 2rem;
        transition: all 0.22s ease-in-out;
        position: relative;
        overflow: hidden;
    }

    .admin-module-grid-card::after {
        content: "";
        position: absolute;
        top: -65px;
        right: -65px;
        width: 150px;
        height: 150px;
        border-radius: 50%;
        background: rgba(15, 118, 110, 0.06);
        pointer-events: none;
    }

    .admin-module-grid-card:hover {
        transform: translateY(-4px);
        border-color: rgba(15, 118, 110, 0.22);
        box-shadow: 0 28px 58px rgba(15, 23, 42, 0.12);
    }

    .admin-module-grid-card > * {
        position: relative;
        z-index: 2;
    }

    .admin-module-icon {
        width: 64px;
        height: 64px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 22px;
        font-size: 1.55rem;
        margin-bottom: 1rem;
        background: #ecfdf5;
        color: #0f766e;
    }

    .admin-module-icon.gold {
        background: #fef3c7;
        color: #b45309;
    }

    .admin-module-grid-card h2,
    .admin-module-grid-card h5 {
        color: #0f172a;
        font-weight: 900;
    }

    .admin-module-grid-card p {
        color: #64748b;
        line-height: 1.72;
    }

    .admin-module-grid-card .btn {
        border-radius: 999px;
        font-weight: 900;
    }
</style>

<section class="py-5">
    <div class="container">

        <div class="admin-home-hero mb-4">
            <span class="admin-home-badge">
                <i class="bi bi-shield-lock-fill"></i>
                Internal Staff Operations
            </span>

            <h1 class="mb-3">
                MyAdmin Dashboard
            </h1>

            <p>
                This staff-only workspace will organize operational workflows across Ensolanka’s platform apps.
                The first active module is Property Care Review Management, where staff can inspect owner-submitted
                property records and mark them approved or rejected.
            </p>
        </div>

        <div class="row g-4 mb-4">

            <div class="col-md-4">
                <div class="admin-stat-card">
                    <span class="admin-stat-icon gold">
                        <i class="bi bi-hourglass-split"></i>
                    </span>

                    <div class="admin-stat-number">{{ submitted_property_count }}</div>
                    <div class="admin-stat-title">Submitted Reviews</div>
                    <p class="admin-stat-text">
                        Property care records awaiting staff review.
                    </p>
                </div>
            </div>

            <div class="col-md-4">
                <div class="admin-stat-card">
                    <span class="admin-stat-icon">
                        <i class="bi bi-check-circle-fill"></i>
                    </span>

                    <div class="admin-stat-number">{{ approved_property_count }}</div>
                    <div class="admin-stat-title">Approved Properties</div>
                    <p class="admin-stat-text">
                        Property records reviewed and approved by staff.
                    </p>
                </div>
            </div>

            <div class="col-md-4">
                <div class="admin-stat-card">
                    <span class="admin-stat-icon blue">
                        <i class="bi bi-x-circle-fill"></i>
                    </span>

                    <div class="admin-stat-number">{{ rejected_property_count }}</div>
                    <div class="admin-stat-title">Rejected Properties</div>
                    <p class="admin-stat-text">
                        Records returned for correction or not approved.
                    </p>
                </div>
            </div>

        </div>

        <div class="row g-4">

            <!-- Property Care Review Module -->
            <div class="col-lg-7">
                <div class="admin-module-grid-card h-100">
                    <span class="admin-module-icon gold">
                        <i class="bi bi-clipboard-check-fill"></i>
                    </span>

                    <h2 class="mb-3">
                        Property Care Review Module
                    </h2>

                    <p class="mb-4">
                        Review properties submitted through the Home in Sri Lanka app, inspect owner details,
                        images, land/building data, current condition, and make an approval decision.
                    </p>

                    <a href="{% url 'myadmin:property_care_property_review_list' %}"
                    class="btn btn-success btn-lg px-4">
                        <i class="bi bi-search me-2"></i>
                        Open Property Review Queue
                    </a>
                </div>
            </div>


            <!-- Property Care Visits Module -->
            <div class="col-lg-5">
                <div class="admin-module-grid-card h-100">
                    <span class="admin-module-icon">
                        <i class="bi bi-clipboard2-pulse-fill"></i>
                    </span>

                    <h2 class="mb-3">
                        Property Care Visits
                    </h2>

                    <p class="mb-4">
                        Review scheduled, in-progress, and completed Property Care maintenance visits,
                        and open visit records for operational tracking and photo evidence management.
                    </p>

                    <a href="{% url 'myadmin:property_care_visit_list' %}"
                    class="btn btn-outline-dark btn-lg px-4">
                        <i class="bi bi-arrow-right-circle-fill me-2"></i>
                        Open Visits
                    </a>
                </div>
            </div>

        </div>
    </div>
</section>
{% endblock %}