{% extends 'admin/base_admin.html' %}

{% block content %}
<h1>대시보드</h1>

<!-- Stats Cards -->
<div class="uk-grid uk-child-width-1-2@s uk-child-width-1-4@m uk-grid-match" uk-grid>
    <div>
        <div class="stat__card">
            <h3>총 포스트</h3>
            <p class="stat__number">{{ stats.total_posts }}</p>
        </div>
    </div>
    <div>
        <div class="stat__card">
            <h3>공개 포스트</h3>
            <p class="stat__number green">{{ stats.public_posts }}</p>
        </div>
    </div>
    <div>
        <div class="stat__card">
            <h3>비공개 포스트</h3>
            <p class="stat__number orange">{{ stats.private_posts }}</p>
        </div>
    </div>
    <div>
        <div class="stat__card">
            <h3>총 회원 수</h3>
            <p class="stat__number blue">{{ stats.total_members }}</p>
        </div>
    </div>
</div>

<!-- Deleted Posts Alert -->
{% if stats.deleted_posts > 0 %}
<div class="uk-alert-warning uk-margin-top" uk-alert>
    <a class="uk-alert-close" uk-close></a>
    <p>
        <span uk-icon="icon: warning"></span>
        삭제된 포스트 <strong>{{ stats.deleted_posts }}개</strong>가 있습니다.
        <a href="/admin/posts?use_yn=N">삭제된 포스트 보기</a>
    </p>
</div>
{% endif %}

<!-- Quick Links -->
<div class="uk-margin-large-top">
    <h2 class="uk-heading-line"><span>바로가기</span></h2>
    <div class="uk-grid uk-child-width-1-3@m" uk-grid>
        <div>
            <a href="/admin/posts" class="uk-card uk-card-default uk-card-body uk-card-hover uk-text-center" style="display: block; text-decoration: none;">
                <span uk-icon="icon: file-text; ratio: 2"></span>
                <p class="uk-margin-small-top uk-text-bold">포스트 관리</p>
            </a>
        </div>
        <div>
            <a href="/admin/members" class="uk-card uk-card-default uk-card-body uk-card-hover uk-text-center" style="display: block; text-decoration: none;">
                <span uk-icon="icon: users; ratio: 2"></span>
                <p class="uk-margin-small-top uk-text-bold">회원 관리</p>
            </a>
        </div>
        <div>
            <a href="/write" class="uk-card uk-card-default uk-card-body uk-card-hover uk-text-center" style="display: block; text-decoration: none;">
                <span uk-icon="icon: plus-circle; ratio: 2"></span>
                <p class="uk-margin-small-top uk-text-bold">새 포스트 작성</p>
            </a>
        </div>
    </div>
</div>
{% endblock %}
