<?php
// Astra.AI - Horoscope App - Account Deletion Request Page

// File to save email addresses
$file = "deletion_requests.txt";

// Initialize message variable
$message = "";

// Process form submission
if(isset($_POST['submit'])) {
    $email = $_POST['email'];
    
    // Simple validation
    if(!empty($email)) {
        // Add timestamp and email to file
        $data = date("Y-m-d H:i:s") . " - " . $email . "\n";
        
        // Write to file
        if(file_put_contents($file, $data, FILE_APPEND)) {
            $message = "Your request has been submitted successfully.";
            // Clear input by resetting the email variable
            $email = "";
        } else {
            $message = "Error saving your request. Please try again.";
        }
    } else {
        $message = "Please enter your email address.";
    }
}
?>

<!DOCTYPE html>
<html>
<head>
    <title>Astra.AI - Account Deletion Request</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600&display=swap" rel="stylesheet">
    <style>
        body {
            font-family: 'Montserrat', sans-serif;
            margin: 0;
            padding: 0;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            color: #fff;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }
        
        .container {
            width: 90%;
            max-width: 500px;
            padding: 30px;
            background-color: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(10px);
            border-radius: 20px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            margin: 20px;
        }
        
        .stars {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
        }
        
        .star {
            position: absolute;
            background-color: #fff;
            border-radius: 50%;
            animation: twinkle 4s infinite;
        }
        
        @keyframes twinkle {
            0% { opacity: 0; }
            50% { opacity: 1; }
            100% { opacity: 0; }
        }
        
        h1 {
            text-align: center;
            margin-bottom: 30px;
            color: #e94560;
            font-size: 2.2em;
            text-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
        }
        
        .logo {
            text-align: center;
            margin-bottom: 20px;
        }
        
        .logo span {
            font-size: 2.5em;
            color: #e94560;
        }
        
        p {
            margin-bottom: 20px;
            line-height: 1.6;
            text-align: center;
        }
        
        form {
            display: flex;
            flex-direction: column;
        }
        
        input[type=email] {
            padding: 15px;
            margin-bottom: 20px;
            border: none;
            background-color: rgba(255, 255, 255, 0.1);
            border-radius: 10px;
            color: #fff;
            font-size: 16px;
            transition: all 0.3s ease;
        }
        
        input[type=email]::placeholder {
            color: rgba(255, 255, 255, 0.7);
        }
        
        input[type=email]:focus {
            outline: none;
            box-shadow: 0 0 15px rgba(233, 69, 96, 0.5);
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        input[type=submit] {
            padding: 15px;
            background: linear-gradient(45deg, #e94560, #c83666);
            border: none;
            border-radius: 10px;
            color: white;
            font-weight: 600;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
        }
        
        input[type=submit]:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 14px rgba(233, 69, 96, 0.4);
        }
        
        .message {
            margin-top: 20px;
            padding: 15px;
            border-radius: 10px;
            text-align: center;
            font-weight: 600;
            animation: fadeIn 0.5s;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        
        .success {
            background-color: rgba(72, 187, 120, 0.2);
            color: #48bb78;
        }
        
        .error {
            background-color: rgba(245, 101, 101, 0.2);
            color: #f56565;
        }
        
        .footer {
            margin-top: 40px;
            text-align: center;
            font-size: 0.9em;
            opacity: 0.7;
        }
        
        /* Zodiac symbols in the background */
        .zodiac-symbols {
            position: absolute;
            font-size: 50px;
            opacity: 0.1;
            z-index: -1;
        }
        
        .zodiac-1 { top: 10%; left: 10%; }
        .zodiac-2 { top: 20%; right: 15%; }
        .zodiac-3 { bottom: 15%; left: 20%; }
        .zodiac-4 { bottom: 25%; right: 10%; }
    </style>
    <script>
        // Create stars on load
        window.onload = function() {
            const starsContainer = document.querySelector('.stars');
            const starCount = 100;
            
            for (let i = 0; i < starCount; i++) {
                const star = document.createElement('div');
                star.classList.add('star');
                
                // Random position
                const posX = Math.random() * 100;
                const posY = Math.random() * 100;
                
                // Random size
                const size = Math.random() * 3;
                
                // Random animation delay
                const delay = Math.random() * 4;
                
                star.style.left = posX + '%';
                star.style.top = posY + '%';
                star.style.width = size + 'px';
                star.style.height = size + 'px';
                star.style.animationDelay = delay + 's';
                
                starsContainer.appendChild(star);
            }
        }
    </script>
</head>
<body>
    <div class="stars"></div>
    
    <div class="zodiac-symbols zodiac-1">♈︎</div>
    <div class="zodiac-symbols zodiac-2">♉︎</div>
    <div class="zodiac-symbols zodiac-3">♊︎</div>
    <div class="zodiac-symbols zodiac-4">♓︎</div>
    
    <div class="container">
        <div class="logo">
            <span>✨</span>
            <h1>Astra.AI</h1>
        </div>
        
        <p>To request deletion of your account and all associated data, please enter your email address below:</p>
        
        <?php if(!empty($message)): ?>
            <div class="message <?php echo strpos($message, 'successfully') !== false ? 'success' : 'error'; ?>">
                <?php echo $message; ?>
            </div>
        <?php endif; ?>
        
        <form method="post" action="">
            <input type="email" name="email" placeholder="Your email address" value="<?php echo isset($email) ? $email : ''; ?>">
            <input type="submit" name="submit" value="Submit Request">
        </form>
        
        <div class="footer">
            &copy; 2025 Astra.AI - Your Personal Horoscope Guide
        </div>
    </div>
</body>
</html>