<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Download Successful</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }

        .success-container {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 20px;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
            padding: 40px;
            text-align: center;
            max-width: 500px;
            width: 100%;
            animation: fadeIn 0.8s ease-out;
            position: relative;
            overflow: hidden;
        }

        .success-container::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 5px;
            background: linear-gradient(90deg, #6a11cb, #2575fc);
        }

        .success-icon {
            width: 100px;
            height: 100px;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0 auto 25px;
            animation: bounce 0.8s ease-out;
        }

        .success-icon svg {
            width: 50px;
            height: 50px;
            fill: white;
        }

        h1 {
            color: #2c3e50;
            margin-bottom: 15px;
            font-weight: 600;
        }

        p {
            color: #7f8c8d;
            margin-bottom: 25px;
            line-height: 1.6;
        }

        .redirect-info {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 15px;
            margin: 25px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .redirect-info svg {
            width: 20px;
            height: 20px;
            fill: #3498db;
            margin-right: 10px;
        }

        .countdown {
            font-weight: 600;
            color: #3498db;
        }

        .progress-bar {
            height: 5px;
            background: #ecf0f1;
            border-radius: 5px;
            margin: 20px 0;
            overflow: hidden;
        }

        .progress {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #6a11cb, #2575fc);
            border-radius: 5px;
            animation: progress 1s linear forwards;
        }

        .btn {
            display: inline-block;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: white;
            padding: 12px 30px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: transform 0.3s, box-shadow 0.3s;
            box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
            margin-top: 10px;
        }

        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(106, 17, 203, 0.4);
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes bounce {
            0% {
                transform: scale(0.5);
                opacity: 0;
            }

            50% {
                transform: scale(1.1);
            }

            70% {
                transform: scale(0.9);
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        @keyframes progress {
            from {
                width: 0%;
            }

            to {
                width: 100%;
            }
        }

        @media (max-width: 480px) {
            .success-container {
                padding: 30px 20px;
            }

            .success-icon {
                width: 80px;
                height: 80px;
            }

            .success-icon svg {
                width: 40px;
                height: 40px;
            }
        }
    </style>
</head>

<body>
    <div class="success-container">
        <div class="success-icon">
            <svg viewBox="0 0 24 24">
                <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" />
            </svg>
        </div>

        <h1>Download Successful!</h1>
        <p>Your file has been downloaded successfully. You will be redirected to the results page in a moment.</p>

        <div class="redirect-info">
            <svg viewBox="0 0 24 24">
                <path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />
            </svg>
            <span>Redirecting to <strong>result.php</strong> in <span class="countdown" id="countdown">1</span> second</span>
        </div>

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

        <a href="result.php" class="btn">Go to Results Now</a>
    </div>

    <script>
        // Countdown timer
        let countdownElement = document.getElementById('countdown');
        let seconds = 1;

        let countdown = setInterval(function() {
            seconds--;
            if (seconds < 0) {
                clearInterval(countdown);
            } else {
                countdownElement.textContent = seconds;
            }
        }, 1000);

        // Redirect after 1 second
        setTimeout(function() {
            window.location.href = 'result.php';
        }, 1000);
    </script>
</body>

</html>