<?php
// 1. Settings Data
/*
if (!isset($settings)) {
    require_once '../includes/db.php'; 
    $settings = $conn->query("SELECT * FROM settings WHERE id=1")->fetch_assoc();
}
*/

// 2. Dynamic Links and Text
$fb_link = !empty($settings['facebook']) ? $settings['facebook'] : '#';
$ins_link = !empty($settings['instagram']) ? $settings['instagram'] : '#';
$tg_link = !empty($settings['telegram']) ? $settings['telegram'] : '#';

$footer_site_name = !empty($settings['site_name']) ? $settings['site_name'] : 'Bet365';
$currentYear = date("Y");
?>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

<style>
    /* --- Footer CSS Reset --- */
    .footer-section {
        background-color: #126E51; /* Changed to 365 Green as requested */
        color: #f3f4f6; /* Lighter text for contrast on green */
        font-family: 'Segoe UI', Arial, sans-serif;
        font-size: 11px;
        padding: 20px 15px 80px 15px; 
        line-height: 1.4;
        border-top: 3px solid #FFDF1B; /* Yellow Top Border for contrast */
    }

    .footer-container {
        max-width: 100%;
        margin: 0 auto;
    }

    /* --- Titles --- */
    .ft-title {
        color: #FFDF1B; /* Yellow Titles */
        font-weight: 700;
        font-size: 13px;
        margin-bottom: 8px;
        display: block;
    }

    /* --- Common Images --- */
    img { max-width: 100%; height: auto; }
    
    /* --- Payment Icons --- */
    .pay-icons {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 20px;
    }
    .pay-icons img {
        height: 18px; 
        opacity: 0.9; /* Increased opacity for green bg */
    }

    /* --- 2 Column Grid (Responsible + Community) --- */
    .ft-grid-2 {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        margin-bottom: 10px;
    }
    
    .ft-icons-row { display: flex; gap: 8px; align-items: center; }
    .ft-icons-row img { height: 25px; opacity: 0.9; }
    
    .social-icons a {
        color: #a4d6c7; /* Light Green/Grey */
        font-size: 20px;
        margin-right: 12px;
        transition: 0.3s;
    }
    .social-icons a:hover { color: #FFDF1B; /* Yellow Hover */ }

    /* --- Separator Line --- */
    .ft-separator {
        border-bottom: 1px solid #0e5640; /* Darker Green line */
        margin: 15px 0;
    }

    /* --- Link Grid (3 Columns) --- */
    .ft-links-grid {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 10px;
    }
    .ft-link-col {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .ft-link-item {
        border-left: 2px solid #FFDF1B; /* Yellow Accent Bar */
        padding-left: 8px;
        line-height: 1.2;
    }
    .ft-link-item a {
        color: #ffffff; /* White Text */
        text-decoration: none;
        font-size: 11px;
        font-weight: 500;
        display: block;
        transition: color 0.2s;
    }
    .ft-link-item a:hover {
        color: #FFDF1B; /* Yellow Hover */
    }
    
    /* --- Gaming License --- */
    .license-container {
        margin-top: 15px;
        margin-bottom: 15px;
    }
    .license-row {
        display: flex;      
        align-items: center;
        gap: 12px;          
        flex-wrap: nowrap;  
    }
    .license-row img {
        height: 30px;       
        width: auto;         
        display: block;
    }

    /* --- Partner & App (Grid) --- */
    .partner-app-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        align-items: end;
        margin-top: 5px;
    }
    .app-btn img {
        height: 35px;
        border: 1px solid #0e5640;
        border-radius: 4px;
    }

    /* --- Brand Footer --- */
    .ft-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 20px;
    }
    .bb-logo {
        background: white;
        color: #126E51; /* Green Text */
        font-weight: 900;
        font-style: italic;
        padding: 2px 5px;
        border-radius: 3px;
        font-size: 16px;
    }
    .brand-text h4 {
        color: #FFDF1B; /* Yellow Text */
        font-size: 12px;
        font-weight: bold;
        margin: 0;
    }
    .brand-text p {
        font-size: 10px;
        color: #a4d6c7; /* Light Greenish Grey */
        margin: 0;
    }

    /* --- SEO Text --- */
    .seo-content h3 {
        color: #FFDF1B; /* Yellow Heading */
        font-size: 14px;
        font-weight: bold;
        margin-bottom: 10px;
        margin-top: 20px;
    }
    .seo-content p {
        margin-bottom: 10px;
        text-align: justify;
        color: #e5e7eb; /* Light Grey for readability on Green */
    }
</style>

<div class="footer-section">
    <div class="footer-container">

        <div>
            <span class="ft-title">Payment Methods</span>
            <div class="pay-icons">
                <img src="../assets/img/bank.png" alt="Bank">
                <img src="../assets/img/bkash.png" alt="Bkash">
                <img src="../assets/img/nagad.png" alt="Nagad">
                <img src="../assets/img/rocket.png" alt="Rocket">
                <img src="../assets/img/crypto.png" alt="Crypto">
                <img src="../assets/img/upay.png" alt="Upay">
                <img src="../assets/img/wallet.png" alt="Wallet">
                <img src="../assets/img/surecash.png" alt="SureCash">
                <img src="../assets/img/tap.png" alt="Tap">
            </div>
        </div>

        <div class="ft-grid-2">
            <div>
                <span class="ft-title">Responsible Gaming</span>
                <div class="ft-icons-row">
                    <img src="../assets/img/gc_gray.png" alt="GC">
                    <img src="../assets/img/18plus.png" alt="18+">
                    <img src="../assets/img/gamcare.png" alt="Hand">
                </div>
            </div>
            <div>
                <span class="ft-title">Community Websites</span>
                <div class="social-icons">
                    <a href="<?php echo $fb_link; ?>"><i class="fab fa-facebook-f"></i></a>
                    <a href="<?php echo $ins_link; ?>"><i class="fab fa-instagram"></i></a>
                    <a href="<?php echo $tg_link; ?>"><i class="fab fa-telegram-plane"></i></a>
                </div>
            </div>
        </div>

        <div class="ft-separator"></div>

        <div class="ft-links-grid">
            <div class="ft-link-col">
                <div class="ft-link-item"><a href="affiliates.php">Affiliates<br>Program</a></div>
                <div class="ft-link-item"><a href="security.php">Security</a></div>
            </div>
            <div class="ft-link-col">
                <div class="ft-link-item"><a href="responsible.php">Responsible<br>Gaming</a></div>
                <div class="ft-link-item"><a href="privacy.php">Privacy Policy</a></div>
            </div>
            <div class="ft-link-col">
                <div class="ft-link-item"><a href="about.php">About Us</a></div>
                <div class="ft-link-item"><a href="faq.php">Frequently<br>Asked Questions</a></div>
            </div>
        </div>

        <div class="ft-separator"></div>

        <div class="license-container">
            <span class="ft-title">Gaming License</span>
            <div class="license-row">
                <img src="../assets/img/license_gc.png" alt="Gaming Curacao">
                <img src="../assets/img/license_anjouan.png" alt="Anjouan">
            </div>
        </div>

        <div class="partner-app-grid">
            <div>
                <span class="ft-title">Official Brand Partner</span>
                <img src="../assets/img/partner_newcity.png" style="height: 25px;" alt="New City">
            </div>
            <div>
                <span class="ft-title">APP Download</span>
                <a href="download.php" class="app-btn">
                    <img src="../assets/img/android_dl.png" alt="Download Android">
                </a>
            </div>
        </div>

        <div class="ft-separator"></div>

        <div class="ft-brand">
            <div class="bb-logo">RP</div>
            <div class="brand-text">
                <h4>Best Quality Platform</h4>
                <p>© <?php echo $currentYear; ?> RP Copyrights. All Rights Reserved</p>
            </div>
        </div>

        <div class="seo-content">
            <h3><?php echo $footer_site_name; ?> Bangladesh - Top Cricket Betting & Casino App</h3>
            
            <p>Casino brands like <?php echo $footer_site_name; ?>, offering cricket betting nowadays are continuously growing in number. Some use various marketing strategies to draw patrons to their turf, such as inviting huge bonuses, daily rewards, and promotions.</p>

            <p>Out of all the casinos out there, Mega Casino World, <?php echo $footer_site_name; ?>, FancyWin, Baji Live, and Jeetbuzz are some of the biggest and most trusted names in Bangladesh.</p>

            <p>In addition, as scams and malicious cyber-attacks are becoming prevalent these days, one must-have for a casino is its preventive measures. <?php echo $footer_site_name; ?> is the top choice in terms of security protocols.</p>
            
            <p>Payment method is also an important factor. Without playing favorites, most of the casinos nowadays, if not all, accept at least one of the well-known payment options in the country, namely Rocket, Nagad, OKWallet, CryptoCurrency, and BKash.</p>
            
            <p>Join <?php echo $footer_site_name; ?> and Try your luck now!</p>
        </div>

    </div>
</div>