<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Donation Settings | CAC Gambia Admin</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary-color: #ff6b35;
            --secondary-color: #004e64;
            --sidebar-width: 250px;
        }
        body {
            background: #f5f6fa;
        }
        .sidebar {
            position: fixed;
            top: 0;
            left: 0;
            width: var(--sidebar-width);
            height: 100vh;
            background: linear-gradient(180deg, var(--secondary-color), #001a2b);
            color: white;
            padding: 20px;
            z-index: 1000;
        }
        .sidebar-brand {
            font-size: 1.4rem;
            font-weight: 700;
            padding: 15px 0;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            margin-bottom: 30px;
        }
        .sidebar-menu {
            list-style: none;
            padding: 0;
        }
        .sidebar-menu li {
            margin-bottom: 5px;
        }
        .sidebar-menu a {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            color: rgba(255,255,255,0.8);
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.3s;
        }
        .sidebar-menu a:hover, .sidebar-menu a.active {
            background: var(--primary-color);
            color: white;
        }
        .sidebar-menu i {
            width: 30px;
        }
        .main-content {
            margin-left: var(--sidebar-width);
            padding: 30px;
        }
    </style>
</head>
<body>
    <div class="sidebar">
        <div class="sidebar-brand">
            <i class="fas fa-church me-2"></i>CAC Gambia
        </div>
        <ul class="sidebar-menu">
            <li>
                <a href="{{ route('admin.dashboard') }}">
                    <i class="fas fa-home"></i> Dashboard
                </a>
            </li>
            <li>
                <a href="{{ route('admin.departments') }}">
                    <i class="fas fa-users"></i> Departments
                </a>
            </li>
            <li>
                <a href="{{ route('admin.menu') }}">
                    <i class="fas fa-bars"></i> Menu Management
                </a>
            </li>
            <li>
                <a href="{{ route('admin.donation') }}" class="active">
                    <i class="fas fa-donate"></i> Donation Settings
                </a>
            </li>
            <li>
                <a href="#">
                    <i class="fas fa-newspaper"></i> Content
                </a>
            </li>
            <li>
                <a href="#">
                    <i class="fas fa-images"></i> Media
                </a>
            </li>
            <li>
                <a href="#">
                    <i class="fas fa-cog"></i> Settings
                </a>
            </li>
            <li class="mt-5">
                <a href="{{ route('admin.logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
                    <i class="fas fa-sign-out-alt"></i> Logout
                </a>
                <form id="logout-form" action="{{ route('admin.logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            </li>
        </ul>
    </div>

    <div class="main-content">
        <div class="d-flex justify-content-between align-items-center mb-4">
            <h2 class="mb-0">Donation Settings</h2>
            <a href="{{ route('home') }}" target="_blank" class="btn btn-outline-primary">
                <i class="fas fa-external-link-alt me-2"></i>View Donation Page
            </a>
        </div>

        @if(session('success'))
            <div class="alert alert-success alert-dismissible fade show" role="alert">
                {{ session('success') }}
                <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
            </div>
        @endif

        <div class="card border-0 shadow-sm">
            <div class="card-body p-4">
                <form action="{{ route('admin.donation.update') }}" method="POST">
                    @csrf
                    @method('PUT')
                    
                    <h5 class="mb-4"><i class="fas fa-university me-2" style="color: var(--primary-color);"></i>Bank Transfer Details</h5>
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Bank Name</label>
                            <input type="text" name="bank_name" class="form-control" value="{{ $donation->bank_name ?? '' }}" placeholder="e.g., EcoBank Gambia">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Account Name</label>
                            <input type="text" name="account_name" class="form-control" value="{{ $donation->account_name ?? '' }}" placeholder="e.g., Christ Apostolic Church Gambia">
                        </div>
                    </div>
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Account Number</label>
                            <input type="text" name="account_number" class="form-control" value="{{ $donation->account_number ?? '' }}" placeholder="e.g., 001234567890">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Sort Code</label>
                            <input type="text" name="sort_code" class="form-control" value="{{ $donation->sort_code ?? '' }}" placeholder="e.g., ECBGMB">
                        </div>
                    </div>

                    <hr class="my-4">

                    <h5 class="mb-4"><i class="fas fa-mobile-alt me-2" style="color: var(--primary-color);"></i>Mobile Money Details</h5>
                    
                    <div class="row">
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Mobile Money Number</label>
                            <input type="text" name="mobile_money" class="form-control" value="{{ $donation->mobile_money ?? '' }}" placeholder="e.g., +220 7900881">
                        </div>
                        <div class="col-md-6 mb-3">
                            <label class="form-label">Provider</label>
                            <input type="text" name="mobile_provider" class="form-control" value="{{ $donation->mobile_provider ?? '' }}" placeholder="e.g., Africell / Gamcel">
                        </div>
                    </div>

                    <div class="mt-4">
                        <button type="submit" class="btn btn-primary" style="background: var(--primary-color); border: none;">
                            <i class="fas fa-save me-2"></i>Save Changes
                        </button>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
