<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Support</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- Favicon -->
    <link href="<?= base_url('assets/images/favicon.ico') ?>" rel="icon">
    <style>
    .dashboard-title {
        border-bottom: 4px solid #007bff;
        padding-bottom: 10px;
        width: 100%;
        margin-bottom: 20px;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    @media (max-width: 576px) {
        .pt-3.pb-2.mb-3 {
            padding-left: 0;
        }
    }
    </style>
</head>

<body>
    <?php include(__DIR__ . '/partials/header.php'); ?>
    <?php include(__DIR__ . '/partials/navbar.php'); ?>

    <div class="container-fluid">
        <div class="row">
            <main class="col-12 px-md-4">
                <div class="pt-3 pb-2 mb-3 dashboard-title">
                    <h1 class="h2">Support</h1>
                    <h5 class="h5 mt-2">Submit your support request</h5>
                </div>

                <?php if (session()->getFlashdata('success')): ?>
                <div class="alert alert-success">
                    <?= session()->getFlashdata('success') ?>
                </div>
                <?php endif; ?>

                <?php if (isset($validation)): ?>
                <div class="alert alert-danger">
                    <?= $validation->listErrors() ?>
                </div>
                <?php endif; ?>

                <?php helper(['form']); // Load form helper 
                ?>

                <form action="<?= base_url('/support/submit') ?>" method="post">
                    <div class="form-group">
                        <label for="subject">Subject</label>
                        <input type="text" class="form-control" id="subject" name="subject"
                            value="<?= set_value('subject') ?>" required>
                    </div>
                    <div class="form-group">
                        <label for="message">Message</label>
                        <textarea class="form-control" id="message" name="message" rows="5"
                            required><?= set_value('message') ?></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary mt-3">Submit</button>
                </form>
            </main>
        </div>
    </div>

    <?php include(__DIR__ . '/partials/footer.php'); ?>
</body>

</html>