<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <!-- Bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous">
    
    <!-- AOS -->
    <link rel="stylesheet" href="https://unpkg.com/aos@2.3.1/dist/aos.css">
    <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script>
    
    <!-- Custom Font -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap" rel="stylesheet">
    
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        body {
            display: flex;
            flex-direction: column;
            align-items: center;
            min-height: 100vh;
            background: conic-gradient(from -15deg, #ca49f7, #5a8ade, #62c6e0, #ca49f7);
            text-align: center;
            padding: 20px;
        }

        .header-image {
            max-width: 100%;
            height: auto;
            margin-bottom: 20px;
        }

        h1 {
            font-size: 3em;
            margin-bottom: 20px;
        }

        #catatan {
            width: 90%;
            max-height: 80vh;
            border: 5px solid #ccc;
            padding: 20px;
            margin: 0 auto 40px auto;
            border-radius: 20px;
            background: #fff;
            overflow-y: auto;
        }

        #catatan .catatan {
            text-align: left;
            white-space: pre-wrap;
        }

        @media (max-width: 576px) {
            h1 {
                font-size: 3em;
            }

            #catatan {
                padding: 15px;
                font-size: 0.9em;
            }
        }
    </style>

    <title>Gkpb-Mdc Jombang</title>
    <link rel="icon" href="https://mdcjombang.id/asecet/icon.png" type="image/x-icon">
</head>
<body>

    <img src="https://mdcjombang.id/asecet/warta.png" alt="Warta GKPB" class="header-image" data-aos="fade-down">

    <div id="catatan" data-aos="fade-up">
        <?php
        include 'db.php';

        $sql = "SELECT description FROM catatan";
        $result = $conn->query($sql);

        if ($result) {
            if ($result->num_rows > 0) {
                while($row = $result->fetch_assoc()) {
                    echo '<div class="catatan">' . htmlspecialchars($row["description"]) . '</div>';
                }
            } else {
                echo "<div class='catatan'>Tidak ada catatan tersedia.</div>";
            }
        } else {
            echo "<div class='catatan'>Terjadi kesalahan: " . htmlspecialchars($conn->error) . "</div>";
        }
        $conn->close();
        ?>
    </div>

    <!-- Ionicons -->
    <script type="module" src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
    <script nomodule src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>

    <!-- AOS init -->
    <script>
        AOS.init();
    </script>

</body>
</html>
