{% extends 'base.html' %}

{% block title %}Dashboard - SJP Admin{% endblock %}
{% block page_title %}Dashboard Overview{% endblock %}

{% block content %}
<div class="row g-4 mb-4">
    <!-- Stat Cards -->
    <div class="col-xl-3 col-md-6">
        <div class="card stat-card border-0 h-100">
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-center mb-3">
                    <div class="stat-icon bg-primary bg-opacity-10 text-primary">
                        <i class="fas fa-university fa-lg"></i>
                    </div>
                </div>
                <h3 class="fw-bold mb-1">{{ count_prodi }}</h3>
                <p class="text-muted mb-0 small text-uppercase fw-bold">Program Studi</p>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="card stat-card border-0 h-100">
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-center mb-3">
                    <div class="stat-icon bg-success bg-opacity-10 text-success">
                        <i class="fas fa-user-tie fa-lg"></i>
                    </div>
                </div>
                <h3 class="fw-bold mb-1">{{ count_dosen }}</h3>
                <p class="text-muted mb-0 small text-uppercase fw-bold">Total Dosen</p>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="card stat-card border-0 h-100">
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-center mb-3">
                    <div class="stat-icon bg-info bg-opacity-10 text-info">
                        <i class="fas fa-book fa-lg"></i>
                    </div>
                </div>
                <h3 class="fw-bold mb-1">{{ count_matkul }}</h3>
                <p class="text-muted mb-0 small text-uppercase fw-bold">Mata Kuliah</p>
            </div>
        </div>
    </div>
    <div class="col-xl-3 col-md-6">
        <div class="card stat-card border-0 h-100">
            <div class="card-body">
                <div class="d-flex justify-content-between align-items-center mb-3">
                    <div class="stat-icon bg-danger bg-opacity-10 text-danger">
                        <i class="fas fa-clipboard-check fa-lg"></i>
                    </div>
                </div>
                <h3 class="fw-bold mb-1">{{ count_daftar_hadir }}</h3>
                <p class="text-muted mb-0 small text-uppercase fw-bold">Log Kehadiran</p>
            </div>
        </div>
    </div>
</div>

<div class="row g-4">
    <div class="col-md-8">
        <div class="card border-0 shadow-sm h-100">
            <div class="card-header bg-white py-3 border-0">
                <h6 class="m-0 font-weight-bold text-dark">Quick Actions</h6>
            </div>
            <div class="card-body">
                <div class="row g-3">
                    <div class="col-md-6">
                        <a href="{% url 'buat_jadwal' %}" class="btn btn-primary w-100 py-4 rounded-4 shadow-sm text-start position-relative overflow-hidden">
                            <div class="position-relative z-index-1">
                                <h5 class="fw-bold mb-1"><i class="fas fa-magic me-2"></i>Generate Jadwal</h5>
                                <p class="mb-0 small opacity-75">Buat jadwal otomatis dengan satu klik.</p>
                            </div>
                            <i class="fas fa-magic position-absolute end-0 bottom-0 opacity-10 fa-5x me-n3 mb-n3"></i>
                        </a>
                    </div>
                    <div class="col-md-6">
                        <a href="{% url 'daftar_hadir_list' %}" class="btn btn-danger w-100 py-4 rounded-4 shadow-sm text-start position-relative overflow-hidden">
                            <div class="position-relative z-index-1">
                                <h5 class="fw-bold mb-1"><i class="fas fa-clipboard-list me-2"></i>Input Absensi</h5>
                                <p class="mb-0 small opacity-75">Catat kehadiran dosen hari ini.</p>
                            </div>
                            <i class="fas fa-check-double position-absolute end-0 bottom-0 opacity-10 fa-5x me-n3 mb-n3"></i>
                        </a>
                    </div>
                    <div class="col-md-6">
                        <a href="{% url 'jadwal_list' %}" class="btn btn-dark w-100 py-4 rounded-4 shadow-sm text-start position-relative overflow-hidden">
                            <div class="position-relative z-index-1">
                                <h5 class="fw-bold mb-1"><i class="fas fa-list-check me-2"></i>Lihat Jadwal</h5>
                                <p class="mb-0 small opacity-75">Lihat hasil jadwal yang telah dibuat.</p>
                            </div>
                            <i class="fas fa-calendar-alt position-absolute end-0 bottom-0 opacity-10 fa-5x me-n3 mb-n3"></i>
                        </a>
                    </div>
                    <div class="col-md-6">
                        <a href="{% url 'dosen_list' %}" class="btn btn-outline-secondary w-100 py-4 rounded-4 shadow-sm text-start position-relative overflow-hidden">
                            <div class="position-relative z-index-1">
                                <h5 class="fw-bold mb-1"><i class="fas fa-users me-2"></i>Kelola Dosen</h5>
                                <p class="mb-0 small">Update data dan import NIDN.</p>
                            </div>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="col-md-4">
        <div class="card border-0 shadow-sm h-100">
            <div class="card-header bg-white py-3 border-0">
                <h6 class="m-0 font-weight-bold text-dark">Status Sistem</h6>
            </div>
            <div class="card-body">
                <div class="d-flex align-items-center mb-4">
                    <div class="stat-icon bg-success rounded-circle me-3" style="width: 12px; height: 12px;"></div>
                    <div>
                        <h6 class="mb-0 fw-bold">Jadwal Terdaftar</h6>
                        <p class="text-muted small mb-0">{{ count_jadwal }} Entry</p>
                    </div>
                </div>
                <div class="d-flex align-items-center mb-4">
                    <div class="stat-icon bg-info rounded-circle me-3" style="width: 12px; height: 12px;"></div>
                    <div>
                        <h6 class="mb-0 fw-bold">Kelas Aktif</h6>
                        <p class="text-muted small mb-0">{{ count_kelas }} Kelas</p>
                    </div>
                </div>
                <div class="d-flex align-items-center mb-4">
                    <div class="stat-icon bg-warning rounded-circle me-3" style="width: 12px; height: 12px;"></div>
                    <div>
                        <h6 class="mb-0 fw-bold">Ruangan Terdaftar</h6>
                        <p class="text-muted small mb-0">{{ count_ruangan }} Ruangan</p>
                    </div>
                </div>
                <hr>
                <div class="text-center">
                    <p class="text-muted small">Versi Aplikasi 1.1.0</p>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}
