<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="../accpdbk.ico" type="image/x-icon">
    <title>Hasil dan Rekomendasi Kepekaan Sosial PDBK</title>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap" rel="stylesheet">
    <style>
        /* Reset some default styles */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        /* Body styling */
        body {
            font-family: 'Roboto', sans-serif;
            line-height: 1.6;
            background-color: #f9f9f9;
            color: #333;
            overflow-x: hidden;
        }

        /* Container */
        .container {
            max-width: 800px;
            margin: 40px auto;
            background: white;
            padding: 30px;
            border-radius: 12px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            animation: fadeIn 1.5s ease-out;
        }

        h1 {
            text-align: center;
            color: #4682B4;
            font-size: 2em;
            margin-bottom: 20px;
        }

        p {
            font-size: 1.1em;
            margin: 10px 0;
        }

        /* Category Result Styling */
        .result {
            text-align: center;
            padding: 20px;
            background-color: #e7f4f7;
            border: 2px solid #4682B4;
            border-radius: 10px;
            margin-top: 30px;
        }

        .category {
            font-size: 1.8em;
            font-weight: bold;
            color: #fff;
            padding: 15px;
            border-radius: 8px;
            background-color: <?= $categoryColor ?>;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .recommendation {
            margin-top: 20px;
            font-size: 1.1em;
            color: #4682B4;
        }

        /* Button Styling */
        .button {
            display: block;
            width: 100%;
            text-align: center;
            padding: 12px 20px;
            margin-top: 30px;
            background-color: #4682B4;
            color: white;
            text-decoration: none;
            border-radius: 8px;
            font-weight: bold;
            transition: background-color 0.3s;
        }

        .button:hover {
            background-color: #87CEEB;
        }

        .button:active {
            background-color: #5B8CB4;
        }

        /* Progress Bar Styling */
        .progress-bar {
            width: 100%;
            height: 20px;
            background-color: #e0e0e0;
            border-radius: 10px;
            margin-top: 20px;
        }

        .progress-bar div {
            height: 100%;
            border-radius: 10px;
            background-color: <?= $categoryColor ?>;
            width: <?= (($score - $minScore) / ($maxScore - $minScore)) * 100 ?>%;
        }

        /* Animations */
        @keyframes fadeIn {
            0% { opacity: 0; }
            100% { opacity: 1; }
        }

        @media screen and (max-width: 600px) {
            .container {
                padding: 20px;
            }

            h1 {
                font-size: 1.5em;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>Hasil Tes Kepekaan Sosial PDBK</h1>
        <p><strong>Nama:</strong> <?= $name ?></p>
        <p><strong>Usia:</strong> <?= $age ?> tahun</p>
        <p><strong>Jenis Kelamin:</strong> <?= $gender ?></p>
        <p><strong>Kelas:</strong> <?= $class ?></p>

        <div class="result">
            <p hidden>Skor Anda: <strong><?= $score ?></strong> dari <strong><?= $maxScore ?></strong></p>
            <p class="category"><?= $category ?></p>

            <div class="progress-bar">
                <div></div>
            </div>
        </div>

        <div class="recommendation">
            <p><strong>Rekomendasi:</strong></p>
            <p><?= $recommendation ?></p>
        </div>

        <a href="../" class="button">Kembali ke Halaman Utama</a>
    </div>
</body>
</html>