<?php
/* FILE: tag/up-police-constable-apply-online-2026.php 
   UPDATED: Google Discover Ready, Social Share, Advanced Schema, High Performance
*/

// --- 1. YOUR CUSTOM LINKS (Update These) ---
$custom_links = [
    "apply_target"  => "https://sarkarimocktest.com/news/?category=Govt%20Job", 
    "admit_target"  => "https://sarkarimocktest.com/news/?category=Admit%20Card", 
    "result_target" => "https://sarkarimocktest.com/news/?category=Result",
    "syllabus_pdf"  => "https://sarkarimocktest.com/up-police-mock-test-2026.php" 
];

// --- 2. GLOBAL CONFIGURATION ---
$exam_name_base = "UP Police Constable 2026";
$site_url = "https://sarkarimocktest.com";
$official_website = "https://uppbpb.gov.in/";

// Author Details (E-E-A-T)
$author_name = "Shubham Kumar Sah";
$author_url = "https://sarkarimocktest.com/author/shubham-kumar-sah.php";
$author_img = "https://sarkarimocktest.com/images/author/shubham-kumar-sah.webp";

// Publisher Logo (Must be distinct for Schema)
$publisher_logo = "https://sarkarimocktest.com/images/logo/publisher-logo-600x60.png"; // Ensure this exists & size is correct

// Feature Image Logic (High Res for Discover)
// Note: Upload a 1200x675px image and put link here.
$hero_image = "https://sarkarimocktest.com/uploads/up-police-constable-apply-online-2026.webp"; 

// --- 3. SMART LOGIC & SCHEMA ---
$current_file = basename(__FILE__, '.php');
$current_url = $site_url . "/tag/" . basename(__FILE__);

// Date Logic (Manually set or fetch from DB in real scenario)
// IMPORTANT: Do NOT use date('c') for published date. Set a real date.
$published_date = "2025-10-28T09:00:00+05:30"; 
$modified_date  = date("c"); // Update on file change

// Variables Init
$page_title = ""; $page_desc = ""; $hero_badge = ""; $active_tab = "";
$schema_type = "Article"; 
$faq_items = [];

// A. ADMIT CARD (NewsArticle)
if (strpos($current_file, 'admit-card') !== false) {
    $page_title = "UP Police constable Admit Card 2026: Download Hall Ticket Direct Link";
    $page_desc = "Breaking: Direct link to download UP Police Constable Admit Card 2026. Check Physical (PET/PST) exam date, exam city release date and center list.";
    $hero_badge = "Hall Ticket Update";
    $active_tab = "admit";
    $schema_type = "NewsArticle";
    
    $faq_items = [
        ["q" => "When will UP Police constable Admit Card 2026 be released?", "a" => "The admit card is expected to be released 10-15 days before the written exam date on uppbpb.gov.in."],
        ["q" => "How to download UP Police constable Hall Ticket?", "a" => "Visit the official website, click on the Admit Card link, and enter your Registration Number and DOB."]
    ];
} 
// B. RESULT PAGE (NewsArticle)
elseif (strpos($current_file, 'result') !== false) {
    $page_title = "UP Police constable Result 2026 Declared: Merit List PDF & Cut Off";
    $page_desc = "Live Updates: Check UP Police Constable Result 2026. Download Merit List PDF district-wise, check final cut off marks for Gen/OBC/SC/ST category.";
    $hero_badge = "Result Declared";
    $active_tab = "result";
    $schema_type = "NewsArticle";

    $faq_items = [
        ["q" => "How to check UP Police constable Result 2026?", "a" => "Candidates can check their result by downloading the PDF merit list from the official website using their Roll Number."],
        ["q" => "What is the expected Cut Off?", "a" => "For General category, the expected cutoff is around 200-210 marks out of 300."]
    ];
}
// C. APPLY ONLINE (NewsArticle)
elseif (strpos($current_file, 'apply') !== false) {
    $page_title = "UP Police constable Apply Online 2026: Registration Link & Fees";
    $page_desc = "UP Police constable Vacancy 2026 Apply Online form. Check eligibility, age limit, fees, last date, and direct registration link for Constable posts.";
    $hero_badge = "Applications Open";
    $active_tab = "apply";
    $schema_type = "NewsArticle";

    $faq_items = [
        ["q" => "What is the age limit for UP Police Constable?", "a" => "General Male: 18-25 Years. General Female: 18-28 Years. OBC/SC/ST get 5 years relaxation."],
        ["q" => "What is the application fee?", "a" => "The application fee is ₹400 for all categories."]
    ];
}
// D. GUIDE/SYLLABUS (Article)
else {
    $page_title = "UP Police Constable 2026 Complete Guide: Syllabus & Pattern";
    $page_desc = "Complete details about UP Police Constable 2026. Check Syllabus, Exam Pattern, Physical Eligibility and Selection Process.";
    $hero_badge = "Complete Guide";
    $active_tab = "syllabus";
    $schema_type = "Article"; 

    $faq_items = [
        ["q" => "What is the syllabus for UP Police constable 2026?", "a" => "The syllabus includes General Hindi, General Knowledge, Numerical Ability, and Mental Aptitude."],
        ["q" => "Is there negative marking?", "a" => "Yes, 0.5 marks will be deducted for every wrong answer."]
    ];
}

// --- 4. CARDS DATA ---
$cards = [
    "apply" => ["title" => "Apply Online", "icon" => "bi-pencil-square", "status" => "Registration", "link" => $custom_links['apply_target'], "btn" => "Apply Now"],
    "admit" => ["title" => "Admit Card", "icon" => "bi-person-badge", "status" => "Download", "link" => $custom_links['admit_target'], "btn" => "Download"],
    "result" => ["title" => "Result / Merit", "icon" => "bi-trophy", "status" => "Check Status", "link" => $custom_links['result_target'], "btn" => "View Result"],
    "syllabus" => ["title" => "Mock & Syllabus", "icon" => "bi-book", "status" => "Preparation", "link" => $custom_links['syllabus_pdf'], "btn" => "Start Test"]
];
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php echo $page_title; ?></title>
    <meta name="description" content="<?php echo $page_desc; ?>">
    <meta name="author" content="<?php echo $author_name; ?>">
    <meta name="robots" content="index, follow, max-image-preview:large">
    <link rel="canonical" href="<?php echo $current_url; ?>">
    
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
    <link rel="preload" as="image" href="<?php echo $author_img; ?>">
    
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">

    <meta property="og:type" content="article">
    <meta property="og:title" content="<?php echo $page_title; ?>">
    <meta property="og:description" content="<?php echo $page_desc; ?>">
    <meta property="og:url" content="<?php echo $current_url; ?>">
    <meta property="og:image" content="<?php echo $hero_image; ?>">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="675">
    <meta property="article:published_time" content="<?php echo $published_date; ?>">
    <meta property="article:modified_time" content="<?php echo $modified_date; ?>">
    <meta property="article:author" content="<?php echo $author_url; ?>">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:image" content="<?php echo $hero_image; ?>">

    <script type="application/ld+json">
    [
      {
        "@context": "https://schema.org",
        "@type": "<?php echo $schema_type; ?>",
        "headline": "<?php echo $page_title; ?>",
        "description": "<?php echo $page_desc; ?>",
        "image": [
            "<?php echo $hero_image; ?>"
        ],
        "datePublished": "<?php echo $published_date; ?>",
        "dateModified": "<?php echo $modified_date; ?>",
        "author": { "@type": "Person", "name": "<?php echo $author_name; ?>", "url": "<?php echo $author_url; ?>" },
        "publisher": { 
            "@type": "Organization", 
            "name": "Sarkari Mock Test", 
            "logo": { "@type": "ImageObject", "url": "<?php echo $publisher_logo; ?>", "width": 600, "height": 60 } 
        },
        "mainEntityOfPage": { "@type": "WebPage", "@id": "<?php echo $current_url; ?>" },
        "isAccessibleForFree": true
      },
      {
        "@context": "https://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement": [
          { "@type": "ListItem", "position": 1, "name": "Home", "item": "<?php echo $site_url; ?>" },
          { "@type": "ListItem", "position": 2, "name": "UP Police", "item": "<?php echo $site_url; ?>/up-police-constable-2026-mock-test.php" },
          { "@type": "ListItem", "position": 3, "name": "<?php echo $hero_badge; ?>", "item": "<?php echo $current_url; ?>" }
        ]
      },
      {
        "@context": "https://schema.org",
        "@type": "FAQPage",
        "mainEntity": [
          <?php 
          $schema_faqs = [];
          foreach($faq_items as $faq) {
              $schema_faqs[] = '{ "@type": "Question", "name": "'.$faq['q'].'", "acceptedAnswer": { "@type": "Answer", "text": "'.$faq['a'].'" } }';
          }
          echo implode(",", $schema_faqs);
          ?>
        ]
      }
    ]
    </script>
    
    <style>
        :root { --primary-gradient: linear-gradient(135deg, #002D62 0%, #0052cc 100%); --accent: #C41E3A; --dark: #1f2937; --bg-light: #f8f9fa; }
        body { font-family: 'Segoe UI', sans-serif; background-color: var(--bg-light); color: var(--dark); }
        
        .hero { background: var(--primary-gradient); color: white; padding: 60px 20px 80px 20px; text-align: center; border-radius: 0 0 40px 40px; position: relative; }
        .hero-meta { font-size: 0.85rem; opacity: 0.9; margin-bottom: 15px; }
        .badge-hero { background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); padding: 6px 16px; border-radius: 30px; font-size: 0.85rem; letter-spacing: 0.5px; }
        
        .nav-cards-container { margin-top: -50px; position: relative; z-index: 10; }
        .nav-card { background: white; border-radius: 16px; padding: 25px 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; transition: transform 0.3s ease; text-align: center; height: 100%; }
        .nav-card:hover { transform: translateY(-5px); border-color: #0052cc; }
        .nav-card.active { border: 2px solid var(--accent); background: #fff5f5; }
        .card-icon { font-size: 2.5rem; margin-bottom: 10px; color: #0052cc; }
        
        .content-box { background: white; border-radius: 16px; padding: 30px; margin-top: 40px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05); border-left: 5px solid #0052cc; }
        
        .author-strip { display: inline-flex; align-items: center; background: rgba(255,255,255,0.1); padding: 5px 15px; border-radius: 50px; margin-top: 20px; border: 1px solid rgba(255,255,255,0.2); }
        .author-thumb { width: 30px; height: 30px; border-radius: 50%; margin-right: 10px; border: 1px solid white; }
        
        /* Social Share Buttons */
        .share-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: white; text-decoration: none; transition: 0.3s; margin: 0 5px; }
        .share-btn:hover { transform: scale(1.1); color: white; }
        .bg-wa { background: #25D366; } .bg-fb { background: #1877F2; } .bg-x { background: #000; } .bg-tg { background: #0088cc; }
    </style>
</head>
<body>

    <header class="hero">
        <div class="container">
            <span class="badge-hero mb-3 text-uppercase">🚀 <?php echo $hero_badge; ?></span>
            <h1 class="display-5 fw-bold mb-3"><?php echo $page_title; ?></h1>
            
            <div class="hero-meta">
                <span class="me-3"><i class="bi bi-calendar-check me-1"></i> Published: <?php echo date("d M Y", strtotime($published_date)); ?></span>
                <span><i class="bi bi-arrow-repeat me-1"></i> Updated: <?php echo date("d M Y"); ?></span>
            </div>
            
            <p class="opacity-75 mb-4" style="max-width: 700px; margin: 0 auto;"><?php echo $page_desc; ?></p>
            
            <div class="author-strip">
                <img src="<?php echo $author_img; ?>" alt="<?php echo $author_name; ?>" class="author-thumb">
                <span class="small text-white opacity-90 me-1">By</span>
                <a href="<?php echo $author_url; ?>" class="fw-bold text-warning text-decoration-none small"><?php echo $author_name; ?> <i class="bi bi-patch-check-fill"></i></a>
            </div>
        </div>
    </header>

    <div class="container pb-5">
        <div class="row g-4 nav-cards-container justify-content-center">
            <?php foreach($cards as $key => $card): ?>
            <div class="col-md-6 col-lg-3">
                <div class="nav-card <?php echo ($active_tab == $key) ? 'active' : ''; ?>">
                    <div class="card-icon"><i class="bi <?php echo $card['icon']; ?>"></i></div>
                    <h5 class="fw-bold text-dark mb-1"><?php echo $card['title']; ?></h5>
                    <p class="small text-muted mb-0 text-uppercase fw-bold"><?php echo $card['status']; ?></p>
                    <a href="<?php echo $card['link']; ?>" class="btn btn-outline-primary w-100 rounded-pill mt-3 fw-bold">
                        <?php echo $card['btn']; ?> <i class="bi bi-box-arrow-up-right ms-1"></i>
                    </a>
                </div>
            </div>
            <?php endforeach; ?>
        </div>

        <div class="row">
            <div class="col-lg-10 mx-auto">
                
                <div class="text-center my-4">
                    <p class="small text-muted mb-2 fw-bold text-uppercase">Share this update</p>
                    <a href="whatsapp://send?text=<?php echo urlencode($page_title . ' - ' . $current_url); ?>" class="share-btn bg-wa"><i class="bi bi-whatsapp"></i></a>
                    <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($current_url); ?>" target="_blank" class="share-btn bg-fb"><i class="bi bi-facebook"></i></a>
                    <a href="https://twitter.com/intent/tweet?text=<?php echo urlencode($page_title); ?>&url=<?php echo urlencode($current_url); ?>" target="_blank" class="share-btn bg-x"><i class="bi bi-twitter-x"></i></a>
                    <a href="https://t.me/share/url?url=<?php echo urlencode($current_url); ?>&text=<?php echo urlencode($page_title); ?>" target="_blank" class="share-btn bg-tg"><i class="bi bi-telegram"></i></a>
                </div>

                <div class="content-box">
                    <h2 class="h4 fw-bold mb-4">ℹ️ Detailed Information</h2>
                    
                    <?php if($active_tab == 'admit'): ?>
                        <p><strong>Download Process:</strong> Use your Registration Number and DOB to access the dashboard. Print two copies.</p>
                        <p><strong>Note:</strong> Electronic gadgets are strictly prohibited inside the exam hall.</p>
                    <?php elseif($active_tab == 'result'): ?>
                        <p><strong>Selection List:</strong> The merit list will contain Roll Numbers of qualified candidates. Cut-off marks will be released separately.</p>
                    <?php elseif($active_tab == 'apply'): ?>
                        <p><strong>Documents Required:</strong> Aadhar Card, 10th/12th Marksheet, Caste Certificate (if applicable), Scanned Photo & Signature.</p>
                    <?php else: ?>
                        <p><strong>Preparation Strategy:</strong> Focus on Hindi and Reasoning as they are high-scoring subjects. Practice daily mock tests.</p>
                    <?php endif; ?>

                    <hr class="my-4">
                    
                    <h3 class="h5 fw-bold mb-3">Frequently Asked Questions</h3>
                    <div class="accordion" id="faqSchema">
                        <?php foreach($faq_items as $index => $faq): ?>
                        <div class="accordion-item">
                            <h2 class="accordion-header">
                                <button class="accordion-button <?php echo $index > 0 ? 'collapsed' : ''; ?>" type="button" data-bs-toggle="collapse" data-bs-target="#faq<?php echo $index; ?>">
                                    <?php echo $faq['q']; ?>
                                </button>
                            </h2>
                            <div id="faq<?php echo $index; ?>" class="accordion-collapse collapse <?php echo $index === 0 ? 'show' : ''; ?>" data-bs-parent="#faqSchema">
                                <div class="accordion-body text-muted small"><?php echo $faq['a']; ?></div>
                            </div>
                        </div>
                        <?php endforeach; ?>
                    </div>
                </div>

                <div class="text-center mt-5">
                    <div class="p-4 bg-white border rounded-4 d-inline-block shadow-sm">
                        <h4 class="fw-bold mb-2">🔥 More Govt Jobs?</h4>
                        <p class="text-muted small mb-3">Check latest Railway, SSC & Banking notifications.</p>
                        <a href="https://sarkarimocktest.com/news" class="btn btn-dark rounded-pill px-4"><i class="bi bi-bell me-2"></i>View All Vacancies</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer class="text-center py-4 border-top bg-white mt-auto small text-muted">
        &copy; 2026 Sarkari Mock Test. Source: <a href="<?php echo $official_website; ?>" rel="nofollow" class="text-decoration-none">Official Website</a>.
    </footer>
    
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>