<?php
ob_start();
include 'master.php';

$_email  = $_SESSION['email'] ?? '';
$_u      = $conn->query("SELECT * FROM users WHERE email = '" . $conn->real_escape_string($_email) . "' LIMIT 1");
$_ud     = $_u ? $_u->fetch_assoc() : [];

$_parts  = explode(' ', $_ud['fullname'] ?? '', 2);
$_fname  = $_parts[0] ?? '';
$_lname  = $_parts[1] ?? '';
$_acc_no = $_ud['acc_no'] ?? '';
$_phone  = $_ud['phone_number'] ?? '';
$_dob    = $_ud['date_of_birth'] ?? '';
$_address= $_ud['residential_address'] ?? '';

$_set_msg = '';
$_set_err = '';

if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'changepin') {
    $new_pin  = trim($_POST['pin'] ?? '');
    $cur_pass = trim($_POST['current_password'] ?? '');
    $db_pass  = $_ud['password'] ?? '';

    if (empty($new_pin) || empty($cur_pass)) {
        $_set_err = 'All fields are required.';
    } elseif (!password_verify($cur_pass, $db_pass)) {
        $_set_err = 'Current password is incorrect.';
    } else {
        $stmt = $conn->prepare("UPDATE users SET pin = ? WHERE email = ?");
        $stmt->bind_param('ss', $new_pin, $_email);
        $stmt->execute();
        $stmt->close();
        ob_end_clean();
        header('Location: account-settings?pin_updated=1');
        exit;
    }
}
?>


    

                <!-- Main Content -->
                <main class="flex-1 overflow-y-auto bg-gray-50 dark:bg-gray-900 min-h-0">
                    <div class="h-full overflow-y-auto">
                        
<div x-data="{ 
    showProfilePictureModal: false,
    showTransactionPinModal: false
}" class="p-4 space-y-4">
    <!-- Alerts -->
    <?php if (!empty($_GET['success'])): ?>
        <div class="p-3 bg-green-100 dark:bg-green-900/30 border border-green-300 dark:border-green-700 rounded-xl text-sm text-green-700 dark:text-green-300">
            Profile picture updated successfully.
        </div>
    <?php elseif (!empty($_GET['pin_updated'])): ?>
        <div class="p-3 bg-green-100 dark:bg-green-900/30 border border-green-300 dark:border-green-700 rounded-xl text-sm text-green-700 dark:text-green-300">
            Transaction PIN updated successfully.
        </div>
    <?php elseif (!empty($_GET['error'])): ?>
        <div class="p-3 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded-xl text-sm text-red-700 dark:text-red-300">
            <?php
            $errs = ['invalid_type' => 'Only JPG, PNG, GIF, or WebP files are allowed.', 'too_large' => 'File must be under 2 MB.', 'upload_failed' => 'Upload failed. Please try again.'];
            echo $errs[$_GET['error']] ?? 'An error occurred.';
            ?>
        </div>
    <?php endif; ?>
    <?php if (!empty($_set_err)): ?>
        <div class="p-3 bg-red-100 dark:bg-red-900/30 border border-red-300 dark:border-red-700 rounded-xl text-sm text-red-700 dark:text-red-300">
            <?php echo htmlspecialchars($_set_err); ?>
        </div>
    <?php endif; ?>
    <!-- Mobile Header -->
    <div class="lg:hidden mb-2">
        <div class="lg:hidden" x-data="{ showMobileNotifications: false }">
    <!-- Header Section -->
    <div class="flex items-center justify-between mb-6">
        <div class="flex items-center space-x-2">
                            <!-- Back Button -->
                <a href="../dashboard" class="w-10 h-10 bg-gray-100 dark:bg-gray-800 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-200 hover:bg-gray-200 dark:hover:bg-gray-700 mr-2">
                    <i class="fa-solid fa-arrow-left text-gray-700 dark:text-gray-300 text-base"></i>
                </a>
                        
            <div>
                                    <!-- Custom Title -->
                    <p class="text-gray-900 dark:text-white font-semibold text-base">Account Settings</p>
                            </div>
        </div>
        
        <div class="flex items-center space-x-2">
              <!-- Dark Mode Toggle -->
             <!--   <button @click="toggleDarkMode()" 
                        class="w-10 h-10 bg-white/10 dark:bg-white/20 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-200 hover:bg-white/20 dark:hover:bg-white/30">
                    <i x-show="!darkMode" class="fa-solid fa-moon text-white text-base"></i>
                    <i x-show="darkMode" class="fa-solid fa-sun text-yellow-400 text-base"></i>
                </button> 
Notifications -->
             <!--   <div class="relative">
                    <button @click="showMobileNotifications = !showMobileNotifications" class="w-10 h-10 bg-white/10 dark:bg-white/20 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-200 hover:bg-white/20 dark:hover:bg-white/30">
                        <i class="fa-solid fa-bell text-white text-base"></i>
                    </button>
                                                        </div>-->
                    </div>
    </div>

            <!-- Mobile Notifications Panel -->
        <div x-show="showMobileNotifications" 
             x-transition:enter="transition ease-out duration-300" 
             x-transition:enter-start="opacity-0 -translate-y-4" 
             x-transition:enter-end="opacity-100 translate-y-0"
             x-transition:leave="transition ease-in duration-200" 
             x-transition:leave-start="opacity-100 translate-y-0" 
             x-transition:leave-end="opacity-0 -translate-y-4"
             class="fixed inset-0 z-50 bg-black/20 backdrop-blur-sm" 
             @click="showMobileNotifications = false">
            
            <div @click.stop class="absolute top-0 left-0 right-0 bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 dark:from-slate-950 dark:via-slate-900 dark:to-slate-950 text-white rounded-b-3xl shadow-2xl dark:shadow-slate-900/50 max-h-[80vh] overflow-hidden">
                <!-- Header -->
                <div class="flex items-center justify-between p-4 border-b border-white/10 dark:border-white/20">
                    <div class="flex items-center space-x-3">
                        <div class="w-10 h-10 bg-white/10 dark:bg-white/20 rounded-2xl flex items-center justify-center">
                            <i class="fa-solid fa-bell text-white text-sm"></i>
                        </div>
                        <div>
                            <h3 class="text-lg font-bold text-white">Notifications</h3>
                                                                                        <p class="text-xs text-white/60">All caught up!</p>
                                                    </div>
                    </div>
                    <button @click="showMobileNotifications = false" class="w-8 h-8 bg-white/10 dark:bg-white/20 rounded-xl flex items-center justify-center hover:bg-white/20 dark:hover:bg-white/30 transition-colors">
                        <i class="fa-solid fa-times text-white text-sm"></i>
                    </button>
                </div>

                <!-- Notifications List -->
                <div class="overflow-y-auto max-h-96 custom-scrollbar">
                                        
                                        <div class="p-8 text-center">
                        <div class="w-16 h-16 bg-white/10 dark:bg-white/20 rounded-3xl flex items-center justify-center mx-auto mb-4">
                            <i class="fa-solid fa-bell-slash text-white/40 dark:text-white/60 text-2xl"></i>
                        </div>
                        <p class="text-white font-semibold mb-1">No notifications yet</p>
                        <p class="text-xs text-white/60 dark:text-white/70">We'll notify you when something happens</p>
                    </div>
                                    </div>
                
                <!-- Footer Actions -->
                            </div>
        </div>
    </div>     </div>

    <!-- Desktop Header -->
    <div class="hidden lg:block">
        <div class="bg-white/80 dark:bg-gray-800/80 backdrop-blur-xl rounded-2xl shadow-lg dark:shadow-gray-900/50 border border-white/20 dark:border-gray-700/50 p-4">
            <div class="flex items-center justify-between">
                <div>
                    <h1 class="text-lg font-bold text-gray-900 dark:text-white">Account Settings</h1>
                    <p class="text-xs text-gray-500 dark:text-gray-400 mt-1">Manage your profile and security settings</p>
                </div>
                <div class="w-8 h-8 bg-primary-500 rounded-xl flex items-center justify-center">
                    <i class="fa-solid fa-user text-white text-sm"></i>
                </div>
            </div>
        </div>
    </div>

    <!-- Main Content Grid -->
    <div class="grid grid-cols-1 lg:grid-cols-12 gap-4">
        <!-- Left Column - Profile Card -->
        <div class="lg:col-span-4 space-y-4">
            <!-- Profile Card -->
            <div class="bg-white/80 dark:bg-gray-800/80 backdrop-blur-xl rounded-2xl shadow-lg dark:shadow-gray-900/50 border border-white/20 dark:border-gray-700/50 overflow-hidden">
                <!-- Profile Header -->
                <div class="relative bg-gradient-to-br from-primary-500 to-primary-600 p-4">
                    <div class="flex flex-col items-center text-center">
                        <!-- Profile Photo -->
                        <div class="relative mb-3">
                            <div class="h-16 w-16 rounded-2xl border-2 border-white/50 overflow-hidden bg-white shadow-lg">
                                <img
                                src="<?php echo $_profile_img_url; ?>"
                                class="h-full w-full object-cover"
                                alt="<?php echo htmlspecialchars($_SESSION['email'] ?? ''); ?>"
                                onerror="this.onerror=null;this.src='../uploads/profile_pictures/default.jpg'"
                            />
                            </div>
                            <button 
                                @click="showProfilePictureModal = true"
                                class="absolute -bottom-1 -right-1 h-6 w-6 rounded-xl bg-white shadow-md flex items-center justify-center hover:bg-gray-100 transition-colors"
                            >
                                <i class="fa-solid fa-camera text-primary-600 text-xs"></i>
                            </button>
                        </div>
                        
                        <!-- User Info -->
                        <h2 class="text-sm font-bold text-white"><?php echo htmlspecialchars(getUserDetails('fullname', $_SESSION['email']) ?: ''); ?></h2>
                        <p class="text-white/80 text-xs">Account #<?php echo htmlspecialchars(getUserDetails('acc_no', $_SESSION['email']) ?: ''); ?></p>
                    </div>
                </div>
                
                <!-- Navigation Menu -->
                <div class="p-3">
                    <nav class="space-y-1">
                        <a href="account-settings" class="flex items-center px-3 py-2 rounded-xl bg-primary-50 dark:bg-primary-900/30 text-primary-700 dark:text-primary-300 font-medium text-xs">
                            <i class="fa-solid fa-user text-xs mr-2"></i>
                            <span>Profile Information</span>
                        </a>
                        
                        <a href="editpass" class="flex items-center px-3 py-2 rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50 font-medium text-xs transition-colors">
                            <i class="fa-solid fa-key text-xs mr-2"></i>
                            <span>Password Settings</span>
                        </a>
                        
                        <a href="manage-account-security" class="flex items-center px-3 py-2 rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50 font-medium text-xs transition-colors">
                            <i class="fa-solid fa-shield text-xs mr-2"></i>
                            <span>Two-Factor Authentication</span>
                                                    </a>
                        
                        <button @click="showTransactionPinModal = true" class="w-full flex items-center px-3 py-2 rounded-xl text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700/50 font-medium text-xs text-left transition-colors">
                            <i class="fa-solid fa-credit-card text-xs mr-2"></i>
                            <span>Transaction PIN</span>
                        </button>
                    </nav>
                </div>
            </div>
            
            <!-- Support Card -->
            <div class="bg-white/80 dark:bg-gray-800/80 backdrop-blur-xl rounded-2xl shadow-lg dark:shadow-gray-900/50 overflow-hidden border border-white/20 dark:border-gray-700/50 relative">
    <!-- Gradient Background -->
    <div class="absolute inset-0 bg-gradient-to-br from-primary-50/80 via-primary-100/50 to-primary-200/30 dark:from-gray-900/80 dark:via-gray-800/50 dark:to-gray-700/30"></div>
    
    <!-- Content -->
    <div class="relative p-4">
        <!-- Icon Section -->
        <div class="flex items-center justify-center mb-3">
            <div class="relative">
                <div class="h-10 w-10 rounded-2xl bg-gradient-to-br from-primary-500 to-primary-600 flex items-center justify-center shadow-lg shadow-primary-500/25 dark:shadow-primary-900/50">
                    <i class="fa-solid fa-headset text-sm text-white"></i>
                </div>
                <!-- Floating indicator -->
                <div class="absolute -top-0.5 -right-0.5 w-3 h-3 bg-green-500 rounded-full border border-white dark:border-gray-800 flex items-center justify-center">
                    <div class="w-1 h-1 bg-white rounded-full animate-pulse"></div>
                </div>
            </div>
        </div>
        
        <!-- Text Content -->
        <div class="text-center mb-3">
            <h3 class="text-sm font-bold text-gray-900 dark:text-white mb-1">Need Assistance?</h3>
            <p class="text-xs text-gray-700 dark:text-gray-300 font-medium mb-1">Our expert support team is available</p>
            <div class="flex items-center justify-center text-xs text-primary-700 dark:text-primary-300 font-semibold">
                <div class="w-1.5 h-1.5 bg-green-500 rounded-full mr-1 animate-pulse"></div>
                <span>24/7 Live Support</span>
            </div>
        </div>
        
        <!-- Features -->
        <div class="grid grid-cols-2 gap-2 mb-3">
            <div class="flex items-center p-2 bg-white/60 dark:bg-gray-700/60 rounded-xl border border-slate-100/50 dark:border-gray-600/70">
                <div class="w-6 h-6 bg-slate-100 dark:bg-gray-600/50 rounded-lg flex items-center justify-center mr-2">
                    <i class="fa-solid fa-clock text-slate-600 dark:text-slate-300 text-xs"></i>
                </div>
                <div>
                    <p class="text-xs font-bold text-slate-900 dark:text-slate-50">Quick Response</p>
                    <p class="text-xs text-slate-600 dark:text-slate-400">< 5 minutes</p>
                </div>
            </div>
            <div class="flex items-center p-2 bg-white/60 dark:bg-gray-700/60 rounded-xl border border-slate-100/50 dark:border-gray-600/70">
                <div class="w-6 h-6 bg-green-100 dark:bg-green-900/50 rounded-lg flex items-center justify-center mr-2">
                    <i class="fa-solid fa-shield-check text-green-600 dark:text-green-400 text-xs"></i>
                </div>
                <div>
                    <p class="text-xs font-bold text-slate-900 dark:text-slate-50">Secure Chat</p>
                    <p class="text-xs text-slate-600 dark:text-slate-400">Encrypted</p>
                </div>
            </div>
        </div>
        
        <!-- Action Button -->
        <div class="flex justify-center">
            <a href="support" 
               class="group inline-flex items-center justify-center px-4 py-2 bg-gradient-to-r from-primary-500 to-primary-600 hover:from-primary-600 hover:to-primary-700 text-white font-bold rounded-xl shadow-lg shadow-primary-500/25 dark:shadow-primary-900/50 hover:shadow-primary-500/40 dark:hover:shadow-primary-800/50 transition-all duration-300 transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800 text-sm">
                <i class="fa-solid fa-comments text-xs mr-2 group-hover:animate-bounce"></i>
                <span>Start Live Chat</span>
                <div class="ml-2 w-1.5 h-1.5 bg-white/80 rounded-full group-hover:bg-white transition-colors duration-300"></div>
            </a>
        </div>
        
        <!-- Additional Info -->
        <div class="mt-2 text-center">
            <p class="text-xs text-gray-600 dark:text-gray-400">
                <i class="fa-solid fa-phone mr-1 text-primary-500 text-xs"></i>
                Or call us directly for urgent matters
            </p>
        </div>
    </div>
    
    <!-- Decorative Elements -->
    <div class="absolute top-2 right-2 w-8 h-8 bg-primary-200/30 dark:bg-gray-700/30 rounded-full blur-xl"></div>
    <div class="absolute bottom-2 left-2 w-6 h-6 bg-primary-300/20 dark:bg-gray-600/20 rounded-full blur-lg"></div>
</div>        </div>
        
        <!-- Right Column - Main Content -->
        <div class="lg:col-span-8">
            <div class="bg-white/80 dark:bg-gray-800/80 backdrop-blur-xl rounded-2xl shadow-lg dark:shadow-gray-900/50 border border-white/20 dark:border-gray-700/50 overflow-hidden">
                <!-- Content Header -->
                <div class="border-b border-gray-200/50 dark:border-gray-700/50 px-4 py-3">
                    <div class="flex items-center">
                        <div class="w-6 h-6 bg-primary-500 rounded-lg flex items-center justify-center mr-2">
                            <i class="fa-solid fa-user text-white text-xs"></i>
                        </div>
                        <div>
                            <h2 class="text-sm font-bold text-gray-900 dark:text-white">Profile Information</h2>
                            <p class="text-xs text-gray-500 dark:text-gray-400">Your personal information and account details</p>
                        </div>
                    </div>
                </div>
                
                <!-- Form Content -->
                <div class="p-4">
                    <form action="account-settings" method="post" class="space-y-4">
                        <!-- Name Fields -->
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-3">
                            <div>
                                <label for="name" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">First Name</label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                        <i class="fa-solid fa-user text-gray-400 text-xs"></i>
                                    </div>
                                    <input 
                                        type="text" 
                                        id="name" 
                                        name="name"
                                        class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                        value="<?php echo htmlspecialchars($_fname); ?>"
                                        readonly
                                    />
                                </div>
                            </div>

                            <div>
                                <label for="lastname" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Last Name</label>
                                <div class="relative">
                                    <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                        <i class="fa-solid fa-user text-gray-400 text-xs"></i>
                                    </div>
                                    <input
                                        type="text"
                                        id="lastname"
                                        name="lastname"
                                        class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                        value="<?php echo htmlspecialchars($_lname); ?>"
                                        readonly
                                    />
                                </div>
                            </div>
                        </div>
                        
                        <!-- Account Number -->
                        <div>
                            <label for="accountnumber" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Account Number</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fa-solid fa-hashtag text-gray-400 text-xs"></i>
                                </div>
                                <input 
                                    type="text" 
                                    id="accountnumber" 
                                    class="block w-full pl-8 pr-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                    value="<?php echo htmlspecialchars($_acc_no); ?>"
                                    readonly
                                />
                                <div class="absolute inset-y-0 right-0 pr-3 flex items-center">
                                    <button
                                        type="button"
                                        class="text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none"
                                        onclick="navigator.clipboard.writeText('<?php echo htmlspecialchars($_acc_no); ?>').then(() => alert('Account number copied!'))"
                                    >
                                        <i class="fa-solid fa-copy text-xs"></i>
                                    </button>
                                </div>
                            </div>
                            <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Your unique account identifier</p>
                        </div>
                        
                        <!-- Email -->
                        <div>
                            <label for="email" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Email Address</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fa-solid fa-envelope text-gray-400 text-xs"></i>
                                </div>
                                <input 
                                    type="email" 
                                    id="email" 
                                    name="email"
                                    class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                    value="<?php echo htmlspecialchars($_SESSION['email'] ?? ''); ?>" 
                                    readonly
                                />
                            </div>
                        </div>
                        
                        <!-- Date of Birth -->
                        <div>
                            <label for="dob" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Date of Birth</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fa-solid fa-calendar text-gray-400 text-xs"></i>
                                </div>
                                <input 
                                    type="date" 
                                    id="dob" 
                                    name="dob"
                                    class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                    value="<?php echo htmlspecialchars($_dob); ?>"
                                    readonly
                                />
                            </div>
                        </div>

                        <!-- Phone -->
                        <div>
                            <label for="phone" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Phone Number</label>
                            <div class="relative">
                                <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                    <i class="fa-solid fa-phone text-gray-400 text-xs"></i>
                                </div>
                                <input 
                                    type="tel" 
                                    id="phone" 
                                    name="phone"
                                    class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                    value="<?php echo htmlspecialchars($_phone); ?>"
                                    readonly
                                />
                            </div>
                        </div>
                        
                        <!-- Address -->
                        <div>
                            <label for="address" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Address</label>
                            <div class="relative">
                                <div class="absolute top-2 left-3 flex items-start pointer-events-none">
                                    <i class="fa-solid fa-map-pin text-gray-400 text-xs"></i>
                                </div>
                                <textarea 
                                    id="address" 
                                    name="address"
                                    rows="2"
                                    class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-gray-50 dark:bg-gray-700/50 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500 resize-none"
                                    readonly
                                ><?php echo htmlspecialchars($_address); ?></textarea>
                            </div>
                        </div>
                        
                        <!-- Info Card -->
                        <div class="bg-blue-50 dark:bg-blue-900/20 rounded-xl p-3 border border-blue-100 dark:border-blue-800/50">
                            <div class="flex">
                                <div class="flex-shrink-0">
                                    <i class="fa-solid fa-info-circle text-blue-500 text-sm"></i>
                                </div>
                                <div class="ml-2">
                                    <h3 class="text-xs font-medium text-blue-800 dark:text-blue-300">Account Information</h3>
                                    <p class="mt-1 text-xs text-blue-700 dark:text-blue-400">
                                        To update your personal information, please contact our customer support team.
                                    </p>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <!-- Profile Picture Modal -->
    <div 
        x-show="showProfilePictureModal" 
        x-cloak
        class="fixed inset-0 overflow-y-auto z-50 flex items-center justify-center p-4"
        x-transition:enter="transition ease-out duration-300"
        x-transition:enter-start="opacity-0"
        x-transition:enter-end="opacity-100"
        x-transition:leave="transition ease-in duration-200"
        x-transition:leave-start="opacity-100"
        x-transition:leave-end="opacity-0"
    >
        <div class="fixed inset-0 bg-black/50 backdrop-blur-sm" @click="showProfilePictureModal = false"></div>
        
        <div class="relative bg-white dark:bg-gray-800 rounded-2xl w-full max-w-md shadow-2xl border border-gray-200 dark:border-gray-700"
            x-transition:enter="transition ease-out duration-300"
            x-transition:enter-start="opacity-0 scale-95"
            x-transition:enter-end="opacity-100 scale-100"
            x-transition:leave="transition ease-in duration-200"
            x-transition:leave-start="opacity-100 scale-100"
            x-transition:leave-end="opacity-0 scale-95">
            
            <div class="p-4">
                <div class="flex justify-between items-center mb-4">
                    <h3 class="text-sm font-bold text-gray-900 dark:text-white">Upload Profile Picture</h3>
                    <button @click="showProfilePictureModal = false" class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300">
                        <i class="fa-solid fa-times text-sm"></i>
                    </button>
                </div>
                
                <form action="update-profile-photo.php" method="post" enctype="multipart/form-data" class="space-y-3">

                    <div>
                        <label for="photo" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-2">Select New Profile Picture</label>
                        <div class="flex items-center justify-center w-full">
                            <label for="photo-upload" class="flex flex-col items-center justify-center w-full h-24 border-2 border-gray-300 dark:border-gray-600 border-dashed rounded-xl cursor-pointer bg-gray-50 dark:bg-gray-700/50 hover:bg-gray-100 dark:hover:bg-gray-700">
                                <div class="flex flex-col items-center justify-center pt-2 pb-2">
                                    <i class="fa-solid fa-cloud-upload text-gray-400 text-lg mb-1"></i>
                                    <p class="text-xs text-gray-500 dark:text-gray-400">
                                        <span class="font-semibold">Click to upload</span>
                                    </p>
                                    <p class="text-xs text-gray-500 dark:text-gray-400">PNG, JPG (MAX. 2MB)</p>
                                </div>
                                <input id="photo-upload" type="file" name="photo" class="hidden" required />
                            </label>
                        </div>
                    </div>
                    
                    <button type="submit" class="w-full px-3 py-2 border border-transparent rounded-xl text-xs font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors">
                        <i class="fa-solid fa-upload text-xs mr-1"></i>
                        Upload Profile Picture
                    </button>
                </form>
            </div>
        </div>
    </div>
    
    <!-- Transaction PIN Modal -->
    <div 
        x-show="showTransactionPinModal" 
        x-cloak
        class="fixed inset-0 overflow-y-auto z-50 flex items-center justify-center p-4"
        x-transition:enter="transition ease-out duration-300"
        x-transition:enter-start="opacity-0"
        x-transition:enter-end="opacity-100"
        x-transition:leave="transition ease-in duration-200"
        x-transition:leave-start="opacity-100"
        x-transition:leave-end="opacity-0"
    >
        <div class="fixed inset-0 bg-black/50 backdrop-blur-sm" @click="showTransactionPinModal = false"></div>
        
        <div class="relative bg-white dark:bg-gray-800 rounded-2xl w-full max-w-md shadow-2xl border border-gray-200 dark:border-gray-700"
            x-transition:enter="transition ease-out duration-300"
            x-transition:enter-start="opacity-0 scale-95"
            x-transition:enter-end="opacity-100 scale-100"
            x-transition:leave="transition ease-in duration-200"
            x-transition:leave-start="opacity-100 scale-100"
            x-transition:leave-end="opacity-0 scale-95">
            
            <div class="p-4">
                <div class="flex justify-between items-center mb-4">
                    <h3 class="text-sm font-bold text-gray-900 dark:text-white">Change Transaction PIN</h3>
                    <button @click="showTransactionPinModal = false" class="text-gray-400 hover:text-gray-500 dark:hover:text-gray-300">
                        <i class="fa-solid fa-times text-sm"></i>
                    </button>
                </div>
                
                <form action="account-settings" method="post" class="space-y-3">
                    <input type="hidden" name="action" value="changepin">                    
                    <div>
                        <label for="pin" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">New Transaction PIN</label>
                        <div class="relative">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa-solid fa-key text-gray-400 text-xs"></i>
                            </div>
                            <input 
                                type="password" 
                                id="pin" 
                                name="pin"
                                class="block w-full pl-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                placeholder="Enter new transaction PIN"
                                required
                            />
                        </div>
                        <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">Create a secure PIN you can remember</p>
                    </div>
                    
                    <div>
                        <label for="password" class="block text-xs font-medium text-gray-700 dark:text-gray-300 mb-1">Current Password</label>
                        <div class="relative" x-data="{ showPassword: false }">
                            <div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
                                <i class="fa-solid fa-lock text-gray-400 text-xs"></i>
                            </div>
                            <input 
                                :type="showPassword ? 'text' : 'password'" 
                                id="password" 
                                name="current_password"
                                class="block w-full pl-8 pr-8 py-2 text-xs border border-gray-200 dark:border-gray-600 rounded-xl bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-primary-500"
                                placeholder="Enter your current password"
                                required
                            />
                            <div class="absolute inset-y-0 right-0 pr-3 flex items-center">
                                <button 
                                    type="button"
                                    @click="showPassword = !showPassword"
                                    class="text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 focus:outline-none"
                                >
                                    <i x-show="!showPassword" class="fa-solid fa-eye text-xs"></i>
                                    <i x-show="showPassword" class="fa-solid fa-eye-slash text-xs"></i>
                                </button>
                            </div>
                        </div>
                        <p class="mt-1 text-xs text-gray-500 dark:text-gray-400">For security verification</p>
                    </div>
                    
                    <div class="bg-yellow-50 dark:bg-yellow-900/20 rounded-xl p-3 border border-yellow-100 dark:border-yellow-800/50">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fa-solid fa-exclamation-triangle text-yellow-500 text-sm"></i>
                            </div>
                            <div class="ml-2">
                                <h3 class="text-xs font-medium text-yellow-800 dark:text-yellow-300">Security Alert</h3>
                                <p class="mt-1 text-xs text-yellow-700 dark:text-yellow-400">
                                    Keep your transaction PIN confidential. Never share it with anyone.
                                </p>
                            </div>
                        </div>
                    </div>
                    
                    <button type="submit" class="w-full px-3 py-2 border border-transparent rounded-xl text-xs font-medium text-white bg-primary-600 hover:bg-primary-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500 transition-colors">
                        <i class="fa-solid fa-rotate-right text-xs mr-1"></i>
                        Update Transaction PIN
                    </button>
                </form>
            </div>
        </div>
    </div>
</div>

<style>
    [x-cloak] { display: none !important; }
</style>

                                </div>
             <?php include 'footer.php'; ?>