<?php
/* ====================================================
SAFETY TALK SYSTEM - PT CITRA LAMPIA MANDIRI
File        : about.php
Versi       : 1.0 (About Page)
Deskripsi   : Informasi sistem, tim pengembang, dan kredensial
====================================================
*/

// ===== AUTH CHECK (Tambahkan di baris 1 setelah <?php) =====
date_default_timezone_set('Asia/Jakarta');
if(session_status() === PHP_SESSION_NONE) session_start();

// Cek login & session timeout (30 menit inactivity)
if(!isset($_SESSION['user_logged_in']) || $_SESSION['user_logged_in'] !== true) {
    header('Location: login.php');
    exit;
}

// Session timeout: 30 minutes inactivity
if(isset($_SESSION['last_activity']) && (time() - $_SESSION['last_activity'] > 1800)) {
    session_unset();
    session_destroy();
    header('Location: login.php?timeout=1');
    exit;
}
$_SESSION['last_activity'] = time(); // Update last activity

// Role-based access (opsional, contoh untuk admin-only pages)
// if($_SESSION['user_role'] !== 'admin' && basename($_SERVER['PHP_SELF']) === 'admin_panel.php') {
//     header('Location: index.php?access_denied=1');
//     exit;
// }

define('APP_VERSION', '2.5.0');
date_default_timezone_set('Asia/Jakarta');
?>
<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Tentang Sistem | Safety Talk - PT CLM</title>
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <link rel="icon" type="image/x-icon" href="assets/img/clm_logo3.png">
    <style>
        :root {
            --primary: #0f172a; --primary-dark: #1e3a8a; --accent: #2563eb;
            --success: #059669; --warning: #f59e0b; --danger: #dc2626;
            --gray-50: #f8fafc; --gray-100: #f1f5f9; --gray-200: #e2e8f0;
            --gray-300: #cbd5e1; --gray-500: #64748b; --gray-700: #334155; --gray-900: #0f172a;
            --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1); --radius: 8px; --radius-lg: 12px;
            --transition: all 0.2s ease;
        }
        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { font-family: 'Inter', system-ui, sans-serif; background: var(--gray-50); color: var(--gray-900); line-height: 1.6; padding: 24px; }
        .container { max-width: 900px; margin: auto; }
        
        /* Header */
        .page-header { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--primary); }
        .back-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; background: white; color: var(--primary); text-decoration: none; border-radius: var(--radius); font-weight: 600; font-size: 13px; box-shadow: var(--shadow-md); transition: var(--transition); border: 1px solid var(--gray-200); }
        .back-btn:hover { background: var(--primary); color: white; transform: translateX(-2px); }
        .page-title h1 { font-size: 20px; font-weight: 700; color: var(--gray-900); }
        .page-title p { font-size: 12px; color: var(--gray-500); }

        /* Cards */
        .card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--gray-200); box-shadow: var(--shadow-md); margin-bottom: 20px; overflow: hidden; }
        .card-header { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: white; padding: 16px 20px; display: flex; align-items: center; gap: 10px; }
        .card-header i { font-size: 18px; opacity: 0.9; }
        .card-header h2 { font-size: 16px; font-weight: 600; }
        .card-body { padding: 20px; }

        /* Info Grid */
        .info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
        .info-item { display: flex; gap: 12px; padding: 12px; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--gray-200); }
        .info-item i { color: var(--accent); font-size: 16px; margin-top: 2px; }
        .info-label { font-size: 11px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.3px; }
        .info-value { font-size: 14px; font-weight: 500; color: var(--gray-900); }

        /* Features List */
        .features-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
        .features-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px; background: var(--gray-50); border-radius: var(--radius); font-size: 13px; }
        .features-list li i { color: var(--success); margin-top: 3px; }

        /* Team */
        .team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
        .team-card { text-align: center; padding: 16px; background: var(--gray-50); border-radius: var(--radius); border: 1px solid var(--gray-200); }
        .team-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--primary)); margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 18px; }
        .team-name { font-weight: 600; font-size: 13px; color: var(--gray-900); }
        .team-role { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

        /* Footer Actions */
        .footer-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }
        .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; font-size: 13px; text-decoration: none; border: none; cursor: pointer; transition: var(--transition); }
        .btn-primary { background: var(--primary); color: white; }
        .btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
        .btn-outline { background: white; color: var(--primary); border: 1px solid var(--gray-300); }
        .btn-outline:hover { background: var(--gray-100); }

        @media (max-width: 768px) {
            .info-grid, .features-list, .team-grid { grid-template-columns: 1fr; }
            .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
            .footer-actions { flex-direction: column; }
            .btn { width: 100%; justify-content: center; }
        }
        @media print { .no-print { display: none !important; } body { background: white; padding: 0; } }
    </style>
</head>
<body>
<div class="container">
    <!-- Page Header -->
    <div class="page-header no-print">
        <a href="index.php" class="back-btn"><i class="fas fa-chevron-left"></i> Kembali</a>
        <div class="page-title">
            <h1><i class="fas fa-info-circle"></i> Tentang Safety Talk System</h1>
            <p>Informasi sistem, pengembangan, dan kredensial aplikasi</p>
        </div>
    </div>

    <!-- System Info Card -->
    <div class="card">
        <div class="card-header"><i class="fas fa-cube"></i><h2>Informasi Sistem</h2></div>
        <div class="card-body">
            <div class="info-grid">
                <div class="info-item"><i class="fas fa-tag"></i><div><div class="info-label">Versi Aplikasi</div><div class="info-value">v<?= APP_VERSION ?> (Stable Release)</div></div></div>
                <div class="info-item"><i class="fas fa-calendar"></i><div><div class="info-label">Tanggal Rilis</div><div class="info-value"><?= date('d F Y') ?></div></div></div>
                <div class="info-item"><i class="fas fa-building"></i><div><div class="info-label">Perusahaan</div><div class="info-value">PT Citra Lampia Mandiri</div></div></div>
                <div class="info-item"><i class="fas fa-shield-alt"></i><div><div class="info-label">Departemen</div><div class="info-value">QHSEF (Quality, Health, Safety, Environment, Forestry)</div></div></div>
                <div class="info-item"><i class="fas fa-code"></i><div><div class="info-label">Teknologi</div><div class="info-value">PHP 8.3+, CSV Storage, Chart.js, Vanilla JS</div></div></div>
                <div class="info-item"><i class="fas fa-globe"></i><div><div class="info-label">Zona Waktu</div><div class="info-value">Asia/Jakarta (WIB)</div></div></div>
            </div>
        </div>
    </div>

    <!-- Fitur Utama -->
    <div class="card">
        <div class="card-header"><i class="fas fa-star"></i><h2>Fitur Utama</h2></div>
        <div class="card-body">
            <ul class="features-list">
                <li><i class="fas fa-check-circle"></i> Input data safety talk dengan upload foto bukti</li>
                <li><i class="fas fa-check-circle"></i> Dashboard analytics dengan chart interaktif</li>
                <li><i class="fas fa-check-circle"></i> Rekap data dengan filter tanggal, divisi, pencarian</li>
                <li><i class="fas fa-check-circle"></i> Export data ke format CSV untuk laporan eksternal</li>
                <li><i class="fas fa-check-circle"></i> Cetak laporan dengan format print-friendly</li>
                <li><i class="fas fa-check-circle"></i> Edit & hapus data dengan konfirmasi keamanan</li>
                <li><i class="fas fa-check-circle"></i> Responsive design untuk mobile & desktop</li>
                <li><i class="fas fa-check-circle"></i> Sistem autentikasi berbasis role (Admin/Petugas)</li>
            </ul>
        </div>
    </div>

    <!-- Tim Pengembang -->
    <div class="card">
        <div class="card-header"><i class="fas fa-users"></i><h2>Tim Pengembang</h2></div>
        <div class="card-body">
            <div class="team-grid">
                <div class="team-card"><div class="team-avatar">QH</div><div class="team-name">Tim QHSEF</div><div class="team-role">Product Owner</div></div>
                <div class="team-card"><div class="team-avatar">IT</div><div class="team-name">IT Support</div><div class="team-role">Technical Lead</div></div>
                <div class="team-card"><div class="team-avatar">OP</div><div class="team-name">Operator Lapangan</div><div class="team-role">End User & Tester</div></div>
            </div>
        </div>
    </div>

    <!-- Lisensi & Kontak -->
    <div class="card">
        <div class="card-header"><i class="fas fa-file-contract"></i><h2>Lisensi & Kontak</h2></div>
        <div class="card-body">
            <p style="font-size:13px;color:var(--gray-700);margin-bottom:16px;">
                <strong>⚠️ Hak Cipta:</strong> Sistem ini merupakan properti internal PT Citra Lampia Mandiri. 
                Dilarang menggandakan, memodifikasi, atau mendistribusikan tanpa izin tertulis dari manajemen.
            </p>
            <div style="display:grid;gap:12px">
                <div style="display:flex;gap:10px;font-size:13px"><i class="fas fa-envelope" style="color:var(--accent);margin-top:3px"></i><div><strong>Email:</strong><br>aulizar@citralampiamandiri.biz</div></div>
                <div style="display:flex;gap:10px;font-size:13px"><i class="fas fa-phone" style="color:var(--accent);margin-top:3px"></i><div><strong>Telepon:</strong><br>+62 812 7819 8210 (Ext. QHSEF)</div></div>
                <div style="display:flex;gap:10px;font-size:13px"><i class="fas fa-location-dot" style="color:var(--accent);margin-top:3px"></i><div><strong>Alamat:</strong><br>Kantor Pusat PT Citra Lampia Mandiri</div></div>
            </div>
        </div>
    </div>

    <!-- Footer Actions -->
    <div class="footer-actions no-print">
        <a href="index.php" class="btn btn-primary"><i class="fas fa-home"></i> Kembali ke Dashboard</a>
        <a href="help.php" class="btn btn-outline"><i class="fas fa-circle-question"></i> Butuh Bantuan?</a>
    </div>
</div>

<?php include __DIR__ . '/footer.php'; ?>
</body>
</html>