<?php
session_start();
require_once 'admin-panal/includes/db.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z2X2T395KZ"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-Z2X2T395KZ');
</script>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Privacy Policy — Elegance of India</title>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<?php include 'inc/header.php'; ?>
<?php
$stmt = $pdo->prepare("SELECT * FROM page_sections WHERE page_slug = ? ORDER BY sort_order, id ASC");
$stmt->execute(['privacy']);
$sections = $stmt->fetchAll();
?>
<div class="page-header" style="background: #fdfbf8; padding: 60px 0; text-align: center; border-bottom: 1px solid #eee;">
<div class="container">
<h1 style="font-family: 'Playfair Display', serif; font-size: 3rem; margin-bottom: 10px;">Privacy Policy</h1>
<p style="color: #888; letter-spacing: 2px; text-transform: uppercase; font-size: 0.9rem;">Your Privacy Matters</p>
</div>
</div>
<div class="privacy-section" style="padding: 80px 0; background: #fff;">
<div class="container" style="max-width: 900px; margin: 0 auto; line-height: 1.8; color: #444;">
<?php foreach ($sections as $index => $sec): ?>
<div class="content-block" style="margin-bottom: 60px;">
<h2 style="margin-bottom: 25px; font-weight: 600; font-family: 'Playfair Display', serif; <?= $index > 0 ? 'margin-top: 40px; font-size: 1.5rem;' : 'font-size: 2rem;' ?>">
<?= htmlspecialchars($sec['title']) ?>
</h2>
<div class="section-body">
<?php
$paragraphs = explode("\n\n", str_replace("\r", "", $sec['content'] ?? ''));
foreach ($paragraphs as $para) {
$para = trim($para);
if (empty($para)) continue;
if (preg_match('/^[\-\*]\s/m', $para)) {
echo '<ul style="margin-bottom: 25px; padding-left: 20px; list-style-type: disc;">';
$lines = explode("\n", $para);
foreach ($lines as $line) {
$line = trim($line);
if (preg_match('/^[\-\*]\s*(.*)$/', $line, $matches)) {
echo '<li style="margin-bottom: 10px;">' . htmlspecialchars($matches[1]) . '</li>';
} else if (!empty($line)) {
echo '<p style="margin-bottom: 15px; margin-left: -20px;">' . htmlspecialchars($line) . '</p>';
}
}
echo '</ul>';
} else {
echo '<p style="margin-bottom: 20px;">' . nl2br(htmlspecialchars($para)) . '</p>';
}
}
?>
</div>
</div>
<?php endforeach; ?>
<?php if (empty($sections)): ?>
<p style="text-align:center; color:#888;">Privacy Policy is being updated. Please check back soon.</p>
<?php endif; ?>
<p style="font-size: 0.9rem; color: #888; border-top: 1px solid #eee; padding-top: 20px;">
Last Updated: <?= count($sections) > 0 ? date('F Y', strtotime(max(array_column($sections, 'updated_at')))) : date('F Y') ?>
</p>
</div>
</div>
<?php include 'inc/footer.php'; ?>
</body>
</html>