<?php
/* ============================================================================
 *  staff/coming_soon.php — friendly placeholder for features not built yet.
 *  Shows the feature name + a back arrow to the company page.
 *  Usage: coming_soon.php?f=salary
 * ==========================================================================*/
session_start();
if (!isset($_SESSION["user_id"])) { header("Location: ../auth/login.php"); exit; }

$titles = [
    'salary'     => ['💵','My Salary','ເງິນເດືອນຂ້ອຍ'],
    'attendance' => ['🕐','My Attendance','ການມາວຽກຂອງຂ້ອຍ'],
    'allowances' => ['🎁','My Allowances','ເບ້ຍຂອງຂ້ອຍ'],
    'payslips'   => ['🧾','My Payslips','ໃບເງິນເດືອນ'],
];
$f = $_GET['f'] ?? '';
$t = $titles[$f] ?? ['🚧','Coming soon','ກຳລັງພັດທະນາ'];
$back = '../customer/company_home.php';
?>
<!DOCTYPE html>
<html lang="lo">
<head>
    <?php $pwaTheme='#0f766e'; include __DIR__.'/../config/pwa_head.php'; ?>
    <title><?= htmlspecialchars($t[1]) ?></title>
    <link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet">
    <script src="../assets/lang.js" defer></script>
    <style>
        *,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
        :root{--primary:#0f766e;--surface:#fff;--bg:#f0f4f8;--border:#e2e8f0;--text:#0f172a;--muted:#64748b;}
        body{font-family:"Noto Sans Lao","Inter",Arial,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;}
        .top-bar{background:var(--surface);border-bottom:1px solid var(--border);
            padding:calc(12px + env(safe-area-inset-top,0px)) 18px 12px;display:flex;justify-content:space-between;
            align-items:center;gap:12px;position:sticky;top:0;z-index:100;box-shadow:0 1px 6px rgba(15,23,42,.06);}
        .back-link{background:#f1f5f9;color:var(--text);border:1.5px solid var(--border);padding:7px 13px;border-radius:8px;text-decoration:none;font-size:13px;font-weight:700;}
        .lang-bar{display:flex;gap:7px;}
        .lang-btn{padding:4px 11px;border-radius:999px;border:1.5px solid var(--border);background:var(--surface);font-size:11px;font-weight:700;color:var(--muted);cursor:pointer;font-family:inherit;}
        .lang-btn.active{background:var(--primary);border-color:var(--primary);color:#fff;}
        .wrap{max-width:480px;margin:auto;padding:40px 20px;text-align:center;}
        .card{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:42px 26px;box-shadow:0 2px 14px rgba(15,23,42,.09);margin-top:30px;}
        .ic{font-size:60px;margin-bottom:14px;}
        .ft{font-size:20px;font-weight:800;margin-bottom:8px;}
        .cs{display:inline-block;background:#fef3c7;color:#92400e;font-weight:800;font-size:13px;padding:5px 14px;border-radius:999px;margin-bottom:14px;}
        .msg{font-size:14px;color:var(--muted);line-height:1.6;margin-bottom:22px;}
        .btn{display:inline-flex;align-items:center;gap:8px;background:var(--primary);color:#fff;text-decoration:none;
            padding:13px 22px;border-radius:12px;font-weight:800;font-size:15px;}
    </style>
</head>
<body>

<div class="top-bar">
    <a class="back-link" href="<?= htmlspecialchars($back) ?>">← <span data-lo="ກັບຄືນ" data-en="Back">Back</span></a>
    <div class="lang-bar">
        <button class="lang-btn" id="btn-lo" onclick="setLang('lo')">🇱🇦 ລາວ</button>
        <button class="lang-btn" id="btn-en" onclick="setLang('en')">🇬🇧 EN</button>
    </div>
</div>

<div class="wrap">
    <div class="card">
        <div class="ic"><?= $t[0] ?></div>
        <div class="ft" data-lo="<?= htmlspecialchars($t[2]) ?>" data-en="<?= htmlspecialchars($t[1]) ?>"><?= htmlspecialchars($t[1]) ?></div>
        <div class="cs" data-lo="🚧 ກຳລັງພັດທະນາ" data-en="🚧 Coming soon">🚧 Coming soon</div>
        <div class="msg" data-lo="ໜ້ານີ້ກຳລັງຖືກພັດທະນາ ແລະ ຈະພ້ອມໃຫ້ໃຊ້ໃນໄວໆນີ້." data-en="This page is being built and will be available soon.">This page is being built and will be available soon.</div>
        <a class="btn" href="<?= htmlspecialchars($back) ?>">← <span data-lo="ກັບໄປໜ້າບໍລິສັດ" data-en="Back to company">Back to company</span></a>
    </div>
</div>

<?php require __DIR__ . '/../config/auto_update.php'; ?>
</body>
</html>
