<x-app-layout>
    @section('page-title', 'Pengaturan Akun')

    <div class="container py-4">
        <div class="row gx-4">
            
            {{-- SIDEBAR MENU (KIRI) --}}
            <div class="col-md-3 mb-4">
                <div class="card border-0 shadow-sm sticky-top" style="top: 80px; z-index: 1;">
                    <div class="card-body p-0">
                        <div class="list-group list-group-flush rounded-3">
                            {{-- Header --}}
                            <div class="p-3 border-bottom bg-light">
                                <h6 class="m-0 fw-bold text-dark">
                                    <i class="bi bi-gear-fill me-2 text-primary"></i>Pengaturan
                                </h6>
                            </div>
                            
                            {{-- Menu Tabs --}}
                            <div class="nav flex-column nav-pills p-2" id="v-pills-tab" role="tablist" aria-orientation="vertical">
                                {{-- Tab Profil --}}
                                <button class="nav-link active d-flex align-items-center mb-1 py-3 px-3" id="v-pills-profile-tab" 
                                    data-bs-toggle="pill" data-bs-target="#v-pills-profile" type="button" role="tab">
                                    <i class="bi bi-person-badge me-3 fs-5"></i>
                                    <div class="text-start">
                                        <div class="fw-bold">Profil Saya</div>
                                        <div class="small opacity-75">Nama, Email, & Hapus Akun</div>
                                    </div>
                                </button>

                                {{-- Tab Keamanan --}}
                                <button class="nav-link d-flex align-items-center py-3 px-3" id="v-pills-security-tab" 
                                    data-bs-toggle="pill" data-bs-target="#v-pills-security" type="button" role="tab">
                                    <i class="bi bi-shield-lock me-3 fs-5"></i>
                                    <div class="text-start">
                                        <div class="fw-bold">Keamanan</div>
                                        <div class="small opacity-75">Kata Sandi & Proteksi</div>
                                    </div>
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            {{-- KONTEN KANAN (FORM) --}}
            <div class="col-md-9">
                <div class="tab-content" id="v-pills-tabContent" style="min-height: 500px;"> 
                    {{-- PROFIL & HAPUS AKUN --}}
                    <div class="tab-pane fade show active" id="v-pills-profile" role="tabpanel">
                        
                        {{-- Form Edit Profil --}}
                        <div class="card border-0 shadow-sm mb-4">
                            <div class="card-header bg-white py-3 border-bottom">
                                <h6 class="m-0 fw-bold text-primary">Informasi Profil</h6>
                            </div>
                            <div class="card-body p-4">
                                @include('profile.partials.update-profile-information-form')
                            </div>
                        </div>

                        {{-- Form Hapus Akun --}}
                        <div class="card border-0 shadow-sm border-danger-subtle">
                            <div class="card-body p-4">
                                <div class="d-flex align-items-start">
                                    <div class="flex-shrink-0">
                                        <i class="bi bi-exclamation-triangle-fill text-danger fs-3 me-3"></i>
                                    </div>
                                    <div>
                                        <h6 class="fw-bold text-danger">Hapus Akun Permanen</h6>
                                        <p class="text-muted small mb-3">
                                            Tindakan ini tidak dapat dibatalkan. Semua data Anda akan hilang.
                                        </p>
                                        @include('profile.partials.delete-user-form')
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    {{-- KEAMANAN (PASSWORD) --}}
                    <div class="tab-pane fade" id="v-pills-security" role="tabpanel">
                        <div class="card border-0 shadow-sm h-100"> 
                            <div class="card-header bg-white py-3 border-bottom">
                                <h6 class="m-0 fw-bold text-primary">Ganti Kata Sandi</h6>
                            </div>
                            <div class="card-body p-4">
                                <div class="alert alert-info border-0 d-flex align-items-center mb-4">
                                    <i class="bi bi-info-circle-fill me-2 fs-5"></i>
                                    <div>
                                        Gunakan password minimal 8 karakter dengan kombinasi huruf dan angka agar akun lebih aman.
                                    </div>
                                </div>
                                
                                @include('profile.partials.update-password-form')
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
    
    @push('styles')
    <style>
        .nav-pills .nav-link {
            color: #495057;
            border-radius: 8px;
            margin-bottom: 4px;
            transition: all 0.2s ease-in-out;
        }
        .nav-pills .nav-link:hover {
            background-color: #e9ecef;
            color: #0d6efd;
        }
        .nav-pills .nav-link.active {
            background-color: #0d6efd;
            color: white;
            box-shadow: 0 4px 6px rgba(13, 110, 253, 0.15);
        }
    </style>
    @endpush
</x-app-layout>