<?php
// Bible Study: Tribulation Period (70th Week of Daniel)

$tribulationStudy = [
    "title" => "Bible Study: The Tribulation Period – 70th Week of Daniel",

    "overview" => "The Tribulation, also known as the 70th Week of Daniel, is a seven-year period of judgment and purification on the earth prior to Christ's millennial reign. It is part of God’s prophetic timeline and occurs after the Church Age and the Rapture. The Tribulation serves to fulfill God’s justice, bring Israel to repentance, and prepare the world for Christ’s Millennial Kingdom.",

    "timeline_context" => [
        "Church Age" => [
            "description" => "The current period from Pentecost to the Rapture. Believers are saved by grace through faith in Jesus Christ. The Church is being prepared as the Bride of Christ."
        ],
        "Rapture" => [
            "description" => "Christ will catch away the Church to Himself, removing true believers from the earth before the full fury of the Tribulation begins (1 Thessalonians 4:16-17)."
        ],
        "Tribulation / 70th Week" => [
            "duration" => "7 years (divided into two halves of 3.5 years each)",
            "description" => "A period of intense judgment on the earth. The Antichrist rises, Israel faces trials, and God’s wrath is poured out to bring about repentance and fulfill prophecy (Daniel 9:27; Revelation 6-19).",
            "purpose" => [
                "Fulfill God’s covenant with Israel",
                "Judge sin and rebellion on the earth",
                "Prepare the nations for Christ’s millennial reign"
            ],
            "key_scriptures" => [
                "Daniel 9:24-27",
                "Revelation 6-19",
                "Matthew 24:21-22",
                "2 Thessalonians 2:3-12"
            ]
        ],
        "Millennial Kingdom" => [
            "duration" => "1000 years",
            "description" => "Christ reigns on Earth from Jerusalem. Righteousness, peace, and justice prevail. Israel is restored, and nations are ruled with Godly authority (Revelation 20:1-6)."
        ],
        "New Heaven & New Earth" => [
            "description" => "After the 1000-year reign, the final judgment occurs (Great White Throne Judgment), and God creates a new heaven and new earth where sin, death, and suffering are eliminated forever (Revelation 21:1-4)."
        ]
    ],

    "purpose_of_tribulation" => [
        "God’s Justice" => "The Tribulation demonstrates God’s righteous judgment on sin and rebellion.",
        "Israel’s Restoration" => "God will bring Israel to repentance and fulfill the covenants promised to them.",
        "Purification of the Nations" => "The Tribulation exposes false systems, unrepentant humanity, and the Antichrist, preparing the world for Christ’s reign.",
        "Prophetic Fulfillment" => "Many end-time prophecies, including the 70th week of Daniel, must be fulfilled to complete God’s plan."
    ],

    "common_misunderstandings" => [
        "Thinking the Church will experience the full Tribulation (pre-trib view says Church is raptured before Tribulation).",
        "Confusing Israel with the Church in end-time prophecy.",
        "Assuming Tribulation is just natural disasters; it also includes divine judgments, spiritual deception, and the rise of the Antichrist."
    ],

    "practical_application" => [
        "Live in readiness for Christ’s return: faithfulness, holiness, and vigilance.",
        "Pray for Israel and the nations, understanding God’s heart for repentance.",
        "Study prophecy in context: distinguish between Church Age and Israel’s end-time role.",
        "Avoid deception: be grounded in Scripture and the finished work of Christ."
    ],

    "group_discussion_questions" => [
        "Why is the Tribulation necessary in God’s plan for the world?",
        "How does understanding the Rapture clarify the Church’s role in end-times events?",
        "What lessons can we learn from the Tribulation about God’s justice and mercy?",
        "How should knowledge of end-times events affect our daily walk of faith?",
        "Why is distinguishing between Israel and the Church important when studying prophecy?"
    ]
];

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><?php echo $tribulationStudy['title']; ?></title>
    <style>
        body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; max-width: 900px; }
        h1, h2, h3 { color: #2c3e50; }
        ul { margin-bottom: 20px; }
        li { margin-bottom: 10px; }
        .section { margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #ccc; }
        .theme { font-style: italic; color: #34495e; }
    </style>
</head>
<body>

<h1><?php echo $tribulationStudy['title']; ?></h1>
<p><?php echo $tribulationStudy['overview']; ?></p>

<h2>1. Timeline Context</h2>
<?php foreach ($tribulationStudy['timeline_context'] as $period => $details) { ?>
    <div class="section">
        <h3><?php echo $period; ?></h3>
        <?php if (isset($details['duration'])) echo "<p><strong>Duration:</strong> ".$details['duration']."</p>"; ?>
        <p><?php echo $details['description']; ?></p>
        <?php if (isset($details['key_scriptures'])) echo "<p><strong>Key Scriptures:</strong> ".implode(", ", $details['key_scriptures'])."</p>"; ?>
        <?php if (isset($details['purpose'])) echo "<p><strong>Purpose:</strong> ".implode("; ", $details['purpose'])."</p>"; ?>
    </div>
<?php } ?>

<h2>2. Purpose of the Tribulation</h2>
<ul>
<?php foreach ($tribulationStudy['purpose_of_tribulation'] as $title => $desc) {
    echo "<li><strong>$title:</strong> $desc</li>";
} ?>
</ul>

<h2>3. Common Misunderstandings</h2>
<ul>
<?php foreach ($tribulationStudy['common_misunderstandings'] as $mistake) {
    echo "<li>$mistake</li>";
} ?>
</ul>

<h2>4. Practical Application</h2>
<ul>
<?php foreach ($tribulationStudy['practical_application'] as $action) {
    echo "<li>$action</li>";
} ?>
</ul>

<h2>5. Group Discussion Questions</h2>
<ul>
<?php foreach ($tribulationStudy['group_discussion_questions'] as $question) {
    echo "<li>$question</li>";
} ?>
</ul>

</body>
</html>
