<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Outbound Caller - <?= esc($this->renderSection('title') ?? 'Welcome') ?></title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="<?= base_url('assets/css/app.css') ?>">
    <style>
        * { font-family: 'Inter', sans-serif; }
        .glass {
            background: rgba(255, 255, 255, 0.75);
            backdrop-filter: blur(24px) saturate(180%);
            -webkit-backdrop-filter: blur(24px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.6);
            box-shadow: 0 20px 60px -15px rgba(15, 23, 42, 0.25);
        }
        .input-glass {
            background: rgba(255, 255, 255, 0.6);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid rgba(148, 163, 184, 0.3);
            transition: all 0.2s ease;
        }
        .input-glass:focus {
            background: rgba(255, 255, 255, 0.9);
            border-color: #3b82f6;
            box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
            outline: none;
        }
        .btn-primary {
            background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
            transition: all 0.25s ease;
        }
        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5);
        }
        .btn-primary:active {
            transform: translateY(0);
        }
        .bg-pattern {
            background-color: #0f172a;
            background-image:
                radial-gradient(at 20% 20%, rgba(59, 130, 246, 0.35) 0, transparent 50%),
                radial-gradient(at 80% 0%, rgba(99, 102, 241, 0.3) 0, transparent 50%),
                radial-gradient(at 0% 80%, rgba(20, 184, 166, 0.25) 0, transparent 50%),
                radial-gradient(at 80% 80%, rgba(236, 72, 153, 0.2) 0, transparent 50%);
        }
        .fade-in {
            animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(12px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .float-slow {
            animation: float 8s ease-in-out infinite;
        }
        @keyframes float {
            0%, 100% { transform: translateY(0) rotate(0deg); }
            50% { transform: translateY(-20px) rotate(2deg); }
        }
    </style>
</head>
<body class="bg-pattern min-h-screen flex items-center justify-center p-4 sm:p-6 relative overflow-hidden">

    <div class="absolute top-10 left-10 w-72 h-72 rounded-full bg-blue-500/20 blur-3xl float-slow"></div>
    <div class="absolute bottom-10 right-10 w-96 h-96 rounded-full bg-indigo-500/20 blur-3xl float-slow" style="animation-delay: -4s"></div>
    <div class="absolute top-1/2 left-1/3 w-64 h-64 rounded-full bg-teal-500/10 blur-3xl float-slow" style="animation-delay: -2s"></div>

    <div class="w-full max-w-md fade-in relative z-10">

        <div class="text-center mb-8">
            <div class="inline-flex items-center gap-3 mb-5">
                <div class="w-14 h-14 rounded-2xl bg-gradient-to-br from-blue-500 via-indigo-500 to-purple-600 flex items-center justify-center shadow-2xl shadow-blue-500/30">
                    <svg xmlns="http://www.w3.org/2000/svg" class="w-7 h-7 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.2">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" />
                    </svg>
                </div>
            </div>
            <h1 class="text-3xl font-extrabold text-white tracking-tight">Outbound Caller</h1>
            <p class="text-slate-400 mt-2 text-sm">AI-powered outbound calling & lead management</p>
        </div>

        <?php if (session()->getFlashdata('success')): ?>
            <div class="mb-6 fade-in">
                <div class="glass rounded-2xl border border-emerald-200/60 bg-emerald-50/70 px-5 py-4 flex items-start gap-3">
                    <div class="w-9 h-9 rounded-xl bg-emerald-100 flex items-center justify-center flex-shrink-0">
                        <svg xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 text-emerald-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                            <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
                        </svg>
                    </div>
                    <div>
                        <p class="text-sm font-semibold text-emerald-800">Success</p>
                        <p class="text-sm text-emerald-700 mt-0.5"><?= session()->getFlashdata('success') ?></p>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <?php if (session()->getFlashdata('error')): ?>
            <div class="mb-6 fade-in">
                <div class="glass rounded-2xl border border-red-200/60 bg-red-50/70 px-5 py-4 flex items-start gap-3">
                    <div class="w-9 h-9 rounded-xl bg-red-100 flex items-center justify-center flex-shrink-0">
                        <svg xmlns="http://www.w3.org/2000/svg" class="w-4.5 h-4.5 text-red-600" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
                            <path stroke-linecap="round" stroke-linejoin="round" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" />
                        </svg>
                    </div>
                    <div>
                        <p class="text-sm font-semibold text-red-800">Error</p>
                        <p class="text-sm text-red-700 mt-0.5"><?= session()->getFlashdata('error') ?></p>
                    </div>
                </div>
            </div>
        <?php endif; ?>

        <div class="glass rounded-3xl p-8 sm:p-10">
            <?= $this->renderSection('content') ?>
        </div>

        <p class="text-center text-slate-500 text-xs mt-8">
            &copy; <?= date('Y') ?> Outbound Caller. All rights reserved.
        </p>
    </div>

</body>
</html>
