<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title><?= $this->renderSection('title') ?> - ready.bd</title>
    <link rel="stylesheet" href="<?= base_url('assets/css/style.css') ?>">
</head>
<body>
    <header>
        <div class="container navbar">
            <a href="<?= base_url() ?>" class="brand">
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                    <circle cx="12" cy="12" r="10"></circle>
                    <line x1="2" y1="12" x2="22" y2="12"></line>
                    <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
                </svg>
                ready.bd
            </a>
            
            <nav class="nav-links">
                <a href="#features">Features</a>
                <a href="#suffixes">Suffixes</a>
                <a href="#how">How It Works</a>
                <a href="#faq">FAQ</a>
            </nav>
            
            <div class="auth-buttons">
                <?php if(session()->get('isLoggedIn')): ?>
                    <a href="<?= base_url(session()->get('role') === 'admin' ? 'admin/dashboard' : 'dashboard') ?>" class="btn btn-outline">Dashboard</a>
                    <a href="<?= base_url('logout') ?>" class="btn btn-primary">Logout</a>
                <?php else: ?>
                    <a href="<?= base_url('login') ?>" class="btn btn-outline">Login</a>
                    <a href="<?= base_url('register') ?>" class="btn btn-primary">Register</a>
                <?php endif; ?>
            </div>
        </div>
    </header>

    <main>
        <?php if(session()->getFlashdata('success')): ?>
            <div class="container" style="margin-top: 1rem;">
                <div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
            </div>
        <?php endif; ?>
        <?php if(session()->getFlashdata('error')): ?>
            <div class="container" style="margin-top: 1rem;">
                <div class="alert alert-error"><?= session()->getFlashdata('error') ?></div>
            </div>
        <?php endif; ?>

        <?= $this->renderSection('content') ?>
    </main>

    <footer>
        <div class="container">
            <div class="footer-grid">
                <div class="footer-col">
                    <a href="<?= base_url() ?>" class="brand" style="margin-bottom: 1rem;">
                        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
                            <circle cx="12" cy="12" r="10"></circle>
                            <line x1="2" y1="12" x2="22" y2="12"></line>
                            <path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path>
                        </svg>
                        ready.bd
                    </a>
                    <p class="suffix-desc">Providing free personal domain names. A community project.</p>
                </div>
                <div class="footer-col">
                    <h4>Product</h4>
                    <ul>
                        <li><a href="#">Features</a></li>
                        <li><a href="#">Domain Extensions</a></li>
                        <li><a href="#">Pricing</a></li>
                    </ul>
                </div>
                <div class="footer-col">
                    <h4>Legal</h4>
                    <ul>
                        <li><a href="#">Privacy Policy</a></li>
                        <li><a href="#">Terms of Service</a></li>
                    </ul>
                </div>
                <div class="footer-col">
                    <h4>Community</h4>
                    <ul>
                        <li><a href="#">Facebook Group</a></li>
                        <li><a href="#">Support</a></li>
                    </ul>
                </div>
            </div>
            <div class="footer-bottom">
                <div>&copy; 2026 Ready.bd. All rights reserved.</div>
                <div>All systems operational</div>
            </div>
        </div>
    </footer>
    <?= $this->renderSection('scripts') ?>
</body>
</html>
