package templates

templ ProfileModal(user User) {
	<div id="profile-modal" class="fixed inset-0 flex items-center justify-center z-50" x-data="profileModal" x-init="setupProfileModal()" style="background-color: rgba(0,0,0,0.5);">
		<div class="rounded-lg shadow-xl max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto" style="background-color: var(--bg-secondary);">
			<!-- Modal Header -->
			<div class="flex justify-between items-center p-6 border-b" style="border-color: var(--border);">
				<div>
					<h2 class="text-2xl font-bold" style="color: var(--text-primary)">Edit User Profile</h2>
					<p class="text-sm mt-1" style="color: var(--text-secondary);">
						{ user.Username } ({ user.Email })
					</p>
				</div>
				<button
					@click="closeProfileModal()"
					class="text-2xl"
					style="color: var(--text-secondary);"
				>
					&times;
				</button>
			</div>

			<!-- Modal Body - uses reusable form -->
			<div class="p-6">
				@ProfileForm(user, "/api/auth/profile/" + user.ID, false, true, true)
			</div>
		</div>
	</div>
}
