

<?php $__env->startSection('meta_title', 'Sınav Geçmişim - Askeri Platform'); ?>

<?php $__env->startSection('content'); ?>
<style>
    .page-header {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 32px;
        margin-bottom: 24px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .page-title { font-size: 24px; font-weight: 800; color: #111827; margin-bottom: 8px; }
    .page-sub { font-size: 15px; color: #6b7280; }

    .stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        margin-bottom: 28px;
    }
    @media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
    .stat-card {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 20px;
        text-align: center;
    }
    .stat-val { font-size: 28px; font-weight: 800; color: #111827; display: block; }
    .stat-lbl { font-size: 13px; color: #6b7280; }

    .attempts-list { display: flex; flex-direction: column; gap: 12px; }
    .attempt-row {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 20px 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        transition: all 0.2s;
        text-decoration: none;
        color: inherit;
    }
    .attempt-row:hover {
        border-color: #2563eb;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    }
    .attempt-left { flex: 1; min-width: 0; }
    .attempt-cat { font-size: 15px; font-weight: 700; color: #111827; margin-bottom: 4px; }
    .attempt-meta { font-size: 13px; color: #6b7280; }
    .attempt-right { text-align: right; }
    .attempt-score {
        font-size: 28px;
        font-weight: 800;
        color: var(--score-color);
        line-height: 1;
    }
    .attempt-badge {
        font-size: 12px;
        font-weight: 600;
        padding: 4px 10px;
        border-radius: 20px;
        margin-top: 4px;
        display: inline-block;
    }
    .badge-pass { background: #dcfce7; color: #166534; }
    .badge-fail { background: #fee2e2; color: #991b1b; }

    .empty-state {
        text-align: center;
        padding: 60px 24px;
        background: white;
        border: 1px dashed #e5e7eb;
        border-radius: 12px;
    }
    .empty-icon { font-size: 48px; margin-bottom: 16px; }
    .empty-text { font-size: 16px; color: #6b7280; margin-bottom: 24px; }
</style>


<div class="page-header">
    <div class="page-title">📊 Sınav Geçmişim</div>
    <div class="page-sub">Tüm sınav denemeleriniz ve sonuçlarınız</div>
</div>


<div class="stats-grid">
    <div class="stat-card">
        <span class="stat-val"><?php echo e($stats['total_attempts']); ?></span>
        <span class="stat-lbl">Toplam Deneme</span>
    </div>
    <div class="stat-card">
        <span class="stat-val">%<?php echo e(round($stats['average_score'])); ?></span>
        <span class="stat-lbl">Ortalama</span>
    </div>
    <div class="stat-card">
        <span class="stat-val">%<?php echo e($stats['best_score']); ?></span>
        <span class="stat-lbl">En İyi Puan</span>
    </div>
    <div class="stat-card">
        <span class="stat-val"><?php echo e($stats['passed_attempts']); ?></span>
        <span class="stat-lbl">Geçen Sınav</span>
    </div>
</div>


<?php if($attempts->count() > 0): ?>
    <div class="attempts-list">
        <?php $__currentLoopData = $attempts; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $attempt): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php
                $pct = $attempt->total_questions > 0 ? round($attempt->correct_answers / $attempt->total_questions * 100) : 0;
                $color = $pct >= 70 ? '#16a34a' : ($pct >= 50 ? '#d97706' : '#dc2626');
            ?>
            <a href="<?php echo e(route('interview.result', [$attempt->category, $attempt])); ?>" class="attempt-row">
                <div class="attempt-left">
                    <div class="attempt-cat"><?php echo e($attempt->category->name); ?></div>
                    <div class="attempt-meta">
                        <?php echo e($attempt->created_at->format('d.m.Y H:i')); ?> •
                        <?php echo e($attempt->correct_answers); ?>/<?php echo e($attempt->total_questions); ?> doğru •
                        ⏱️ <?php echo e(floor($attempt->time_spent / 60)); ?>dk <?php echo e($attempt->time_spent % 60); ?>sn
                    </div>
                </div>
                <div class="attempt-right">
                    <div class="attempt-score" style="--score-color:<?php echo e($color); ?>">%<?php echo e($pct); ?></div>
                    <?php if($pct >= 70): ?>
                        <span class="attempt-badge badge-pass">✅ Geçti</span>
                    <?php else: ?>
                        <span class="attempt-badge badge-fail">❌ Kaldı</span>
                    <?php endif; ?>
                </div>
            </a>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>

    
    <?php if($attempts->hasPages()): ?>
        <div style="margin-top:32px;display:flex;justify-content:center;">
            <?php echo e($attempts->links()); ?>

        </div>
    <?php endif; ?>
<?php else: ?>
    <div class="empty-state">
        <div class="empty-icon">📋</div>
        <div class="empty-text">Henüz sınav denemesi yapmadınız.</div>
        <a href="<?php echo e(route('interview.index')); ?>" class="btn btn-primary">İlk Sınava Başla →</a>
    </div>
<?php endif; ?>

<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.public', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\askeribilgiler\resources\views\interview\my-attempts.blade.php ENDPATH**/ ?>