{% extends 'base.html' %}
{% load static %}

{% block content %}
<div class="row justify-content-center">
    <div class="col-lg-10">
        <form method="post">
            {% csrf_token %}
            
            <div class="card border-0 shadow-lg rounded-4 overflow-hidden mb-4">
                <div class="card-header bg-white border-0 py-4 px-4">
                    <div class="d-flex align-items-center">
                        <div class="bg-primary bg-opacity-10 p-3 rounded-4 me-3">
                            <i data-lucide="settings" class="text-primary"></i>
                        </div>
                        <div>
                            <h4 class="fw-bold mb-0">Pengaturan Aplikasi</h4>
                            <p class="text-muted small mb-0">Konfigurasi identitas dan tampilan sistem</p>
                        </div>
                    </div>
                </div>
                <div class="card-body p-4">
                    <div class="row">
                        <!-- Identitas Aplikasi -->
                        <div class="col-md-12 mb-4">
                            <h5 class="fw-bold mb-3 border-bottom pb-2">Identitas Aplikasi</h5>
                        </div>
                        
                        <div class="col-md-12 mb-4">
                            <label class="form-label fw-semibold">Nama Aplikasi</label>
                            {{ form.app_name }}
                        </div>
                        
                        <div class="col-md-12 mb-4">
                            <label class="form-label fw-semibold">Deskripsi</label>
                            {{ form.app_description }}
                        </div>
                        
                        <!-- Tampilan & Gaya -->
                        <div class="col-md-12 mb-4 mt-2">
                            <h5 class="fw-bold mb-3 border-bottom pb-2">Tampilan & Gaya</h5>
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Warna Tema (Aksen)</label>
                            {{ form.theme_color }}
                            <div class="form-text">Warna utama untuk tombol dan aksen UI.</div>
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Gaya Sidebar</label>
                            {{ form.sidebar_theme }}
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Jenis Font</label>
                            {{ form.font_family }}
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Warna Font Utama</label>
                            <div class="d-flex align-items-center gap-2">
                                {{ form.font_color }}
                                <span class="text-muted small">Pilih warna teks global</span>
                            </div>
                        </div>

                        <!-- Kontak -->
                        <div class="col-md-12 mb-4 mt-2">
                            <h5 class="fw-bold mb-3 border-bottom pb-2">Kontak & Alamat</h5>
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Nomor Telepon</label>
                            {{ form.app_phone }}
                        </div>
                        
                        <div class="col-md-6 mb-4">
                            <label class="form-label fw-semibold">Email</label>
                            {{ form.app_email }}
                        </div>
                        
                        <div class="col-md-12 mb-4">
                            <label class="form-label fw-semibold">Alamat</label>
                            {{ form.app_address }}
                        </div>
                    </div>
                    
                    <div class="d-flex justify-content-end gap-2 mt-2">
                        <a href="{% url 'home' %}" class="btn btn-light px-4 rounded-3">Batal</a>
                        <button type="submit" class="btn btn-primary px-4 rounded-3 d-flex align-items-center">
                            <i data-lucide="save" class="me-2 icon-sm"></i> Simpan Perubahan
                        </button>
                    </div>
                </div>
            </div>
        </form>
        
        <div class="card border-0 shadow-sm rounded-4 mb-4">
            <div class="card-body p-4">
                <div class="d-flex align-items-center mb-3">
                    <i data-lucide="info" class="text-info me-2"></i>
                    <h5 class="fw-bold mb-0">Informasi Sistem</h5>
                </div>
                <div class="row g-3">
                    <div class="col-md-6">
                        <div class="p-3 bg-light rounded-3">
                            <div class="text-muted small">Django Version</div>
                            <div class="fw-bold">{{ django_version }}</div>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="p-3 bg-light rounded-3">
                            <div class="text-muted small">Python Version</div>
                            <div class="fw-bold">{{ python_version }}</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}