<?php
require_once __DIR__ . '/../includes/lang.php';
session_start();
if (isset($_SESSION['user_id'])) { header('Location: ../dashboard.php'); exit; }
$dir  = t('dir');
$code = t('lang_code');

$activities = [
    ['key'=>'restaurant', 'icon'=>'🍽️', 'label'=>t('act_restaurant')],
    ['key'=>'hotel',      'icon'=>'🏨', 'label'=>t('act_hotel')],
    ['key'=>'guide',      'icon'=>'🗺️', 'label'=>t('act_guide')],
    ['key'=>'craft',      'icon'=>'🛍️', 'label'=>t('act_craft')],
    ['key'=>'agency',     'icon'=>'✈️', 'label'=>t('act_agency')],
    ['key'=>'transport',  'icon'=>'🚲', 'label'=>t('act_transport')],
];
?>
<!DOCTYPE html>
<html lang="<?= htmlspecialchars($code) ?>" dir="<?= htmlspecialchars($dir) ?>">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title><?= htmlspecialchars(t('choose_activity')) ?> — <?= htmlspecialchars(t('site_name')) ?></title>
  <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🌴</text></svg>">
  <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap" rel="stylesheet">
  <link rel="stylesheet" href="../css/style.css">
  <style>
    body { background: var(--cream); }
    .auth-card { animation: fadeUp .45s ease both; max-width: 520px; }
    @keyframes fadeUp { from { opacity:0; transform:translateY(24px); } to { opacity:1; transform:none; } }
  </style>
</head>
<body>

<div class="auth-wrap">
  <div class="auth-card">

    <h1 class="auth-title"><?= htmlspecialchars(t('choose_activity')) ?></h1>

    <div class="activity-grid">
      <?php foreach ($activities as $act): ?>
      <a href="register_provider.php?activity=<?= urlencode($act['key']) ?><?= $code!=='ar'?'&lang='.$code:'' ?>"
         class="activity-card" style="text-decoration:none">
        <span class="act-icon"><?= $act['icon'] ?></span>
        <span class="act-label"><?= htmlspecialchars($act['label']) ?></span>
      </a>
      <?php endforeach; ?>
    </div>

    <div style="text-align:center;margin-top:8px">
      <a href="register.php<?= $code!=='ar'?'?lang='.$code:'' ?>" class="btn-ghost" style="font-size:.88rem;color:var(--muted);font-family:var(--font)">
        ← <?= htmlspecialchars(t('back')) ?>
      </a>
    </div>

  </div>
</div>

</body>
</html>
