<?php
/**
 * SMM Paket Satış Scripti - İletişim Sayfası
 * Telegram Bildirim Destekli
 * @version 1.0.5
 */

require_once __DIR__ . '/config.php';

// Telegram bildirim fonksiyonlarını dahil et
require_once __DIR__ . '/includes/telegram.php';

// CSRF Token
if (!isset($_SESSION['csrf_token'])) {
    $_SESSION['csrf_token'] = bin2hex(random_bytes(32));
}
$csrfToken = $_SESSION['csrf_token'];

// İletişim bilgilerini al
$contactEmail = $settings->get('contact_email', '');
$contactPhone = $settings->get('contact_phone', '');
$contactAddress = $settings->get('contact_address', '');
$whatsappNumber = $settings->get('whatsapp_number', '');
$instagramUsername = $settings->get('instagram_username', '');
$telegramUsername = $settings->get('telegram_username', '');
$twitterUsername = $settings->get('twitter_username', '');

// Admin e-postasını al
$adminEmail = '';
try {
    $adminEmail = $db->query("SELECT email FROM users WHERE role = 'admin' AND status = 'active' ORDER BY id ASC LIMIT 1")->fetchColumn();
} catch (PDOException $e) {
    $adminEmail = '';
}

/**
 * Ayar değerini veritabanından direkt al
 */
function getSmtpSetting($db, $key, $default = '') {
    try {
        $stmt = $db->prepare("SELECT setting_value FROM settings WHERE setting_key = ?");
        $stmt->execute([$key]);
        $value = $stmt->fetchColumn();
        return $value !== false ? $value : $default;
    } catch (PDOException $e) {
        return $default;
    }
}

/**
 * İletişim formu e-posta şablonu
 */
function getContactEmailTemplate($name, $email, $subject, $message, $siteName) {
    return '<!DOCTYPE html>
<html>
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
<body style="margin:0;padding:0;background:#0f172a;font-family:Arial,Helvetica,sans-serif;">
<div style="max-width:600px;margin:0 auto;padding:40px 20px;">
<div style="background:#1e293b;border-radius:24px;overflow:hidden;border:1px solid #334155;">
<div style="background:linear-gradient(135deg,#6366f1,#8b5cf6);padding:40px 30px;text-align:center;">
<div style="font-size:50px;margin-bottom:15px;">📩</div>
<h1 style="margin:0;color:#fff;font-size:24px;font-weight:700;">Yeni İletişim Mesajı</h1>
<p style="margin:15px 0 0;color:rgba(255,255,255,0.8);font-size:15px;">' . htmlspecialchars($siteName) . '</p>
</div>
<div style="padding:35px 30px;">
<div style="background:#0f172a;border-radius:16px;padding:25px;margin-bottom:25px;border:1px solid #334155;">
<table style="width:100%;border-collapse:collapse;">
<tr><td style="padding:12px 0;border-bottom:1px solid #1e293b;color:#94a3b8;font-size:14px;width:100px;">Gönderen</td><td style="padding:12px 0;border-bottom:1px solid #1e293b;color:#fff;font-size:14px;">' . htmlspecialchars($name) . '</td></tr>
<tr><td style="padding:12px 0;border-bottom:1px solid #1e293b;color:#94a3b8;font-size:14px;">E-posta</td><td style="padding:12px 0;border-bottom:1px solid #1e293b;color:#60a5fa;font-size:14px;"><a href="mailto:' . htmlspecialchars($email) . '" style="color:#60a5fa;">' . htmlspecialchars($email) . '</a></td></tr>
<tr><td style="padding:12px 0;color:#94a3b8;font-size:14px;">Konu</td><td style="padding:12px 0;color:#fff;font-size:14px;font-weight:600;">' . htmlspecialchars($subject) . '</td></tr>
</table>
</div>
<div style="background:#0f172a;border-radius:16px;padding:25px;border:1px solid #334155;">
<h3 style="color:#fff;font-size:14px;margin:0 0 15px;text-transform:uppercase;letter-spacing:1px;"><span style="color:#6366f1;">●</span> Mesaj</h3>
<p style="color:#e2e8f0;font-size:15px;line-height:1.8;margin:0;white-space:pre-wrap;">' . htmlspecialchars($message) . '</p>
</div>
<p style="color:#64748b;font-size:12px;margin:25px 0 0;text-align:center;">Bu mesaj ' . date('d.m.Y H:i') . ' tarihinde gönderildi.</p>
</div>
<div style="background:#0f172a;padding:25px 30px;text-align:center;border-top:1px solid #1e293b;">
<p style="color:#64748b;font-size:13px;margin:0;">© ' . date('Y') . ' ' . htmlspecialchars($siteName) . '</p>
</div>
</div>
</div>
</body>
</html>';
}

/**
 * Mail gönder fonksiyonu - Doğrudan veritabanından SMTP ayarlarını oku
 */
function sendContactMail($db, $toEmail, $name, $email, $subject, $message, $siteName) {
    // SMTP ayarlarını doğrudan veritabanından al
    $smtpEnabled = getSmtpSetting($db, 'smtp_enabled', '0');
    
    // 1, '1', true hepsi geçerli
    if (!$smtpEnabled || $smtpEnabled === '0' || $smtpEnabled === 0) {
        return ['success' => false, 'error' => 'SMTP devre dışı'];
    }
    
    $phpmailerPath = __DIR__ . '/includes/PHPMailer/PHPMailer.php';
    if (!file_exists($phpmailerPath)) {
        return ['success' => false, 'error' => 'PHPMailer bulunamadı'];
    }
    
    require_once __DIR__ . '/includes/PHPMailer/Exception.php';
    require_once __DIR__ . '/includes/PHPMailer/PHPMailer.php';
    require_once __DIR__ . '/includes/PHPMailer/SMTP.php';
    
    // SMTP ayarlarını doğrudan veritabanından al
    $smtpHost = getSmtpSetting($db, 'smtp_host', '');
    $smtpPort = (int)getSmtpSetting($db, 'smtp_port', 587);
    $smtpUsername = getSmtpSetting($db, 'smtp_username', '');
    $smtpPassword = getSmtpSetting($db, 'smtp_password', '');
    $smtpEncryption = getSmtpSetting($db, 'smtp_encryption', 'tls');
    $smtpFromEmail = getSmtpSetting($db, 'smtp_from_email', $smtpUsername);
    $smtpFromName = getSmtpSetting($db, 'smtp_from_name', $siteName);
    
    if (empty($smtpHost) || empty($smtpUsername) || empty($smtpPassword)) {
        return ['success' => false, 'error' => 'SMTP ayarları eksik: Host=' . $smtpHost];
    }
    
    try {
        $mail = new PHPMailer\PHPMailer\PHPMailer(true);
        
        $mail->isSMTP();
        $mail->Host = $smtpHost;
        $mail->Port = $smtpPort;
        $mail->SMTPAuth = true;
        $mail->Username = $smtpUsername;
        $mail->Password = $smtpPassword;
        
        if ($smtpEncryption === 'tls') {
            $mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS;
        } elseif ($smtpEncryption === 'ssl') {
            $mail->SMTPSecure = PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_SMTPS;
        } else {
            $mail->SMTPSecure = false;
            $mail->SMTPAutoTLS = false;
        }
        
        $mail->SMTPOptions = [
            'ssl' => [
                'verify_peer' => false,
                'verify_peer_name' => false,
                'allow_self_signed' => true
            ]
        ];
        
        $mail->CharSet = 'UTF-8';
        $mail->Encoding = 'base64';
        
        $mail->setFrom($smtpFromEmail, $smtpFromName);
        $mail->addReplyTo($email, $name);
        $mail->addAddress($toEmail);
        
        $mail->isHTML(true);
        $mail->Subject = '=?UTF-8?B?' . base64_encode('📩 İletişim Formu: ' . $subject) . '?=';
        $mail->Body = getContactEmailTemplate($name, $email, $subject, $message, $siteName);
        $mail->AltBody = "Gönderen: {$name}\nE-posta: {$email}\nKonu: {$subject}\n\nMesaj:\n{$message}";
        
        $mail->send();
        
        return ['success' => true];
        
    } catch (PHPMailer\PHPMailer\Exception $e) {
        return ['success' => false, 'error' => $mail->ErrorInfo];
    } catch (Exception $e) {
        return ['success' => false, 'error' => $e->getMessage()];
    }
}

// POST işlemi
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (!hash_equals($csrfToken, $_POST['csrf_token'] ?? '')) {
        setFlash('error', 'Güvenlik hatası. Lütfen tekrar deneyin.');
        redirect(SITE_URL . '/iletisim.php');
        exit;
    }
    
    $name = trim($_POST['name'] ?? '');
    $email = trim($_POST['email'] ?? '');
    $subject = trim($_POST['subject'] ?? '');
    $message = trim($_POST['message'] ?? '');
    
    $errors = [];
    
    if (empty($name) || mb_strlen($name, 'UTF-8') < 3) {
        $errors[] = 'Ad Soyad en az 3 karakter olmalıdır.';
    }
    
    if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
        $errors[] = 'Geçerli bir e-posta adresi girin.';
    }
    
    if (empty($subject)) {
        $errors[] = 'Konu seçimi gereklidir.';
    }
    
    if (empty($message) || mb_strlen($message, 'UTF-8') < 10) {
        $errors[] = 'Mesaj en az 10 karakter olmalıdır.';
    }
    
    if (empty($errors)) {
        $mailResult = ['success' => false, 'error' => 'Admin e-postası bulunamadı'];
        
        if (!empty($adminEmail)) {
            $mailResult = sendContactMail($db, $adminEmail, $name, $email, $subject, $message, SITE_NAME);
        }
        
        // Veritabanına kaydet
        try {
            $db->exec("
                CREATE TABLE IF NOT EXISTS contact_messages (
                    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
                    name VARCHAR(100) NOT NULL,
                    email VARCHAR(100) NOT NULL,
                    subject VARCHAR(255) NOT NULL,
                    message TEXT NOT NULL,
                    ip_address VARCHAR(45),
                    mail_sent TINYINT(1) DEFAULT 0,
                    mail_error VARCHAR(500),
                    is_read TINYINT(1) DEFAULT 0,
                    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
                ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
            ");
            
            $stmt = $db->prepare("
                INSERT INTO contact_messages (name, email, subject, message, ip_address, mail_sent, mail_error) 
                VALUES (?, ?, ?, ?, ?, ?, ?)
            ");
            $stmt->execute([
                $name, 
                $email, 
                $subject, 
                $message, 
                $_SERVER['REMOTE_ADDR'] ?? '',
                $mailResult['success'] ? 1 : 0,
                $mailResult['error'] ?? null
            ]);
        } catch (PDOException $e) {
            // Hata olsa bile devam et
        }
        
        // ==================== TELEGRAM BİLDİRİMİ ====================
        try {
            sendContactNotification($name, $email, $subject, $message);
        } catch (Exception $e) {
            // Telegram hatası kullanıcıyı etkilemesin
            error_log('Telegram iletişim bildirimi hatası: ' . $e->getMessage());
        }
        // ==================== TELEGRAM BİLDİRİMİ SON ====================
        
        if ($mailResult['success']) {
            setFlash('success', 'Mesajınız başarıyla gönderildi. En kısa sürede size dönüş yapacağız.');
        } else {
            setFlash('success', 'Mesajınız alındı. En kısa sürede size dönüş yapacağız.');
            error_log("İletişim formu mail hatası: " . ($mailResult['error'] ?? 'Bilinmeyen hata') . " - Admin: " . $adminEmail);
        }
        
        redirect(SITE_URL . '/iletisim.php');
        exit;
        
    } else {
        setFlash('error', implode('<br>', $errors));
        redirect(SITE_URL . '/iletisim.php');
        exit;
    }
}

$pageTitle = 'İletişim';
require_once __DIR__ . '/header.php';
?>

<style>
.contact-section { padding: 40px 0 80px; min-height: calc(100vh - 80px); }
.contact-header { text-align: center; margin-bottom: 50px; }
.contact-header h1 { font-size: 42px; font-weight: 800; margin-bottom: 15px; color: #fff; }
.contact-header p { font-size: 18px; color: rgba(255, 255, 255, 0.6); max-width: 600px; margin: 0 auto; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.contact-info { display: flex; flex-direction: column; gap: 20px; }
.info-card { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 30px; display: flex; align-items: flex-start; gap: 20px; transition: all 0.3s; }
.info-card:hover { border-color: rgba(var(--primary-rgb), 0.3); transform: translateY(-3px); }
.info-icon { width: 60px; height: 60px; background: var(--gradient); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.info-content h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: #fff; }
.info-content p { font-size: 15px; color: rgba(255, 255, 255, 0.6); margin: 0; line-height: 1.6; }
.info-content a { color: var(--primary); }
.info-content a:hover { color: var(--secondary); }
.social-card { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 20px; padding: 30px; }
.social-card h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; color: #fff; display: flex; align-items: center; gap: 10px; }
.social-card h3 i { color: var(--primary); }
.social-links { display: flex; flex-wrap: wrap; gap: 12px; }
.social-link { display: flex; align-items: center; gap: 10px; padding: 14px 20px; background: rgba(15, 23, 42, 0.6); border: 2px solid rgba(255, 255, 255, 0.08); border-radius: 14px; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; transition: all 0.3s; }
.social-link i { font-size: 20px; }
.social-link.whatsapp:hover { background: rgba(37, 211, 102, 0.15); border-color: #25d366; color: #25d366; }
.social-link.instagram:hover { background: rgba(228, 64, 95, 0.15); border-color: #e4405f; color: #e4405f; }
.social-link.telegram:hover { background: rgba(0, 136, 204, 0.15); border-color: #0088cc; color: #0088cc; }
.social-link.twitter:hover { background: rgba(29, 161, 242, 0.15); border-color: #1da1f2; color: #1da1f2; }
.contact-form-card { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 24px; padding: 40px; position: relative; overflow: hidden; }
.contact-form-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: var(--gradient); }
.form-header { margin-bottom: 30px; }
.form-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; color: #fff; display: flex; align-items: center; gap: 12px; }
.form-header h2 i { color: var(--primary); }
.form-header p { font-size: 15px; color: rgba(255, 255, 255, 0.6); margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group { margin-bottom: 22px; }
.form-label { display: block; font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.9); margin-bottom: 10px; }
.form-label i { margin-right: 8px; color: var(--primary); }
.form-label .required { color: #ef4444; margin-left: 3px; }
.form-control { width: 100%; padding: 16px 20px; background: rgba(15, 23, 42, 0.6); border: 2px solid rgba(255, 255, 255, 0.08); border-radius: 14px; color: #fff; font-size: 15px; transition: all 0.3s ease; font-family: inherit; }
.form-control:focus { outline: none; border-color: var(--primary); background: rgba(15, 23, 42, 0.8); box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15); }
.form-control::placeholder { color: rgba(255, 255, 255, 0.35); }
textarea.form-control { min-height: 150px; resize: vertical; }
.btn-submit { width: 100%; padding: 18px 30px; background: var(--gradient); border: none; border-radius: 14px; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: all 0.3s; box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.4); }
.btn-submit:hover { transform: translateY(-3px); box-shadow: 0 15px 40px rgba(var(--primary-rgb), 0.5); }
.faq-section { margin-top: 80px; }
.faq-header { text-align: center; margin-bottom: 40px; }
.faq-header h2 { font-size: 32px; font-weight: 800; margin-bottom: 10px; color: #fff; }
.faq-header p { font-size: 16px; color: rgba(255, 255, 255, 0.6); }
.faq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.faq-item { background: rgba(30, 41, 59, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 25px; transition: all 0.3s; }
.faq-item:hover { border-color: rgba(var(--primary-rgb), 0.3); }
.faq-item h4 { font-size: 16px; font-weight: 700; margin-bottom: 10px; color: #fff; display: flex; align-items: flex-start; gap: 10px; }
.faq-item h4 i { color: var(--primary); margin-top: 3px; }
.faq-item p { font-size: 14px; color: rgba(255, 255, 255, 0.6); margin: 0; line-height: 1.7; padding-left: 26px; }
@media (max-width: 991px) { .contact-grid { grid-template-columns: 1fr; } .contact-header h1 { font-size: 32px; } .faq-grid { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .contact-header h1 { font-size: 28px; } .form-row { grid-template-columns: 1fr; } .contact-form-card { padding: 30px 20px; } .info-card { flex-direction: column; text-align: center; } .social-links { justify-content: center; } }
</style>

<section class="contact-section">
    <div class="container">
        <div class="contact-header" data-aos="fade-up">
            <h1>Bizimle <span class="gradient-text">İletişime</span> Geçin</h1>
            <p>Sorularınız, önerileriniz veya destek talepleriniz için bize ulaşabilirsiniz.</p>
        </div>
        
        <div class="contact-grid">
            <div class="contact-info" data-aos="fade-up" data-aos-delay="100">
                <?php if ($contactEmail): ?>
                <div class="info-card">
                    <div class="info-icon"><i class="fas fa-envelope"></i></div>
                    <div class="info-content">
                        <h3>E-posta</h3>
                        <p><a href="mailto:<?php echo clean($contactEmail); ?>"><?php echo clean($contactEmail); ?></a></p>
                    </div>
                </div>
                <?php endif; ?>
                
                <?php if ($contactPhone): ?>
                <div class="info-card">
                    <div class="info-icon"><i class="fas fa-phone-alt"></i></div>
                    <div class="info-content">
                        <h3>Telefon</h3>
                        <p><a href="tel:<?php echo preg_replace('/[^0-9+]/', '', $contactPhone); ?>"><?php echo clean($contactPhone); ?></a></p>
                    </div>
                </div>
                <?php endif; ?>
                
                <?php if ($contactAddress): ?>
                <div class="info-card">
                    <div class="info-icon"><i class="fas fa-map-marker-alt"></i></div>
                    <div class="info-content">
                        <h3>Adres</h3>
                        <p><?php echo clean($contactAddress); ?></p>
                    </div>
                </div>
                <?php endif; ?>
                
                <div class="info-card">
                    <div class="info-icon"><i class="fas fa-clock"></i></div>
                    <div class="info-content">
                        <h3>Çalışma Saatleri</h3>
                        <p>7/24 Destek<br>Haftanın her günü hizmetinizdeyiz</p>
                    </div>
                </div>
                
                <?php if ($whatsappNumber || $instagramUsername || $telegramUsername || $twitterUsername): ?>
                <div class="social-card">
                    <h3><i class="fas fa-share-alt"></i> Sosyal Medya</h3>
                    <div class="social-links">
                        <?php if ($whatsappNumber): $wpNumber = preg_replace('/[^0-9]/', '', $whatsappNumber); ?>
                        <a href="https://wa.me/<?php echo $wpNumber; ?>" target="_blank" class="social-link whatsapp">
                            <i class="fab fa-whatsapp"></i> WhatsApp
                        </a>
                        <?php endif; ?>
                        <?php if ($instagramUsername): ?>
                        <a href="https://instagram.com/<?php echo clean($instagramUsername); ?>" target="_blank" class="social-link instagram">
                            <i class="fab fa-instagram"></i> Instagram
                        </a>
                        <?php endif; ?>
                        <?php if ($telegramUsername): ?>
                        <a href="https://t.me/<?php echo clean($telegramUsername); ?>" target="_blank" class="social-link telegram">
                            <i class="fab fa-telegram-plane"></i> Telegram
                        </a>
                        <?php endif; ?>
                        <?php if ($twitterUsername): ?>
                        <a href="https://twitter.com/<?php echo clean($twitterUsername); ?>" target="_blank" class="social-link twitter">
                            <i class="fab fa-twitter"></i> Twitter
                        </a>
                        <?php endif; ?>
                    </div>
                </div>
                <?php endif; ?>
            </div>
            
            <div class="contact-form-card" data-aos="fade-up" data-aos-delay="200">
                <div class="form-header">
                    <h2><i class="fas fa-paper-plane"></i> Mesaj Gönderin</h2>
                    <p>Formu doldurarak bize mesaj gönderebilirsiniz</p>
                </div>
                
                <form method="POST" action="" id="contactForm">
                    <input type="hidden" name="csrf_token" value="<?php echo $csrfToken; ?>">
                    
                    <div class="form-row">
                        <div class="form-group">
                            <label class="form-label"><i class="fas fa-user"></i> Ad Soyad<span class="required">*</span></label>
                            <input type="text" name="name" class="form-control" placeholder="Adınız Soyadınız" required
                                   value="<?php echo isLoggedIn() ? clean($_SESSION['user_name'] ?? '') : ''; ?>">
                        </div>
                        <div class="form-group">
                            <label class="form-label"><i class="fas fa-envelope"></i> E-posta<span class="required">*</span></label>
                            <input type="email" name="email" class="form-control" placeholder="ornek@email.com" required
                                   value="<?php echo isLoggedIn() ? clean($_SESSION['user_email'] ?? '') : ''; ?>">
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="form-label"><i class="fas fa-tag"></i> Konu<span class="required">*</span></label>
                        <select name="subject" class="form-control" required>
                            <option value="">Konu seçin...</option>
                            <option value="Genel Bilgi">Genel Bilgi</option>
                            <option value="Sipariş Hakkında">Sipariş Hakkında</option>
                            <option value="Ödeme Sorunu">Ödeme Sorunu</option>
                            <option value="Teknik Destek">Teknik Destek</option>
                            <option value="İade Talebi">İade Talebi</option>
                            <option value="İş Birliği">İş Birliği</option>
                            <option value="Diğer">Diğer</option>
                        </select>
                    </div>
                    
                    <div class="form-group">
                        <label class="form-label"><i class="fas fa-comment-alt"></i> Mesajınız<span class="required">*</span></label>
                        <textarea name="message" class="form-control" placeholder="Mesajınızı buraya yazın..." required></textarea>
                    </div>
                    
                    <button type="submit" class="btn-submit" id="submitBtn">
                        <i class="fas fa-paper-plane"></i> Mesajı Gönder
                    </button>
                </form>
            </div>
        </div>
        
        <div class="faq-section" data-aos="fade-up">
            <div class="faq-header">
                <h2>Sıkça Sorulan Sorular</h2>
                <p>Merak ettiğiniz sorulara hızlı cevaplar</p>
            </div>
            <div class="faq-grid">
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> Siparişim ne kadar sürede tamamlanır?</h4>
                    <p>Paket açıklamasında belirtilen süre içerisinde siparişiniz tamamlanır. Genellikle 0-24 saat arasında değişmektedir.</p>
                </div>
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> Ödeme yaptıktan sonra ne yapmalıyım?</h4>
                    <p>Havale/EFT yaptıktan sonra dekont yüklemeniz yeterlidir. Ödemeniz onaylandıktan sonra siparişiniz otomatik başlar.</p>
                </div>
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> Şifre istiyor musunuz?</h4>
                    <p>Hayır! Hiçbir zaman şifrenizi istemiyoruz. Sadece kullanıcı adınız veya profilinizin linki yeterlidir.</p>
                </div>
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> Garanti var mı?</h4>
                    <p>Evet, tüm paketlerimizde belirtilen süre kadar garanti sunuyoruz. Düşüş olursa ücretsiz telafi yapılır.</p>
                </div>
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> İade yapılıyor mu?</h4>
                    <p>Sipariş başlamadan önce iade talebinde bulunabilirsiniz. Başlamış siparişlerde iade yapılamamaktadır.</p>
                </div>
                <div class="faq-item">
                    <h4><i class="fas fa-question-circle"></i> Hesabım güvende mi?</h4>
                    <p>Evet, tamamen güvenlidir. Hesabınıza herhangi bir zarar gelmez. Binlerce mutlu müşterimiz bulunmaktadır.</p>
                </div>
            </div>
        </div>
    </div>
</section>

<script>
document.getElementById('contactForm').addEventListener('submit', function() {
    var btn = document.getElementById('submitBtn');
    btn.disabled = true;
    btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i> Gönderiliyor...';
});
</script>

<?php require_once __DIR__ . '/footer.php'; ?>