

<?php $__env->startSection('meta_title', 'Sınav & Mülakat Hazırlık - Askeri Platform'); ?>
<?php $__env->startSection('meta_description', 'KPSS, MSÜ, Astsubay, Jandarma ve diğer askeri sınavlar için online testler çöz, sınav geçmişini takip et.'); ?>

<?php $__env->startSection('content'); ?>
<style>
    /* ── Hero ─────────────────────────────────────────── */
    .exam-hero {
        background: linear-gradient(135deg, #0f2448 0%, #1e3a5f 50%, #2563eb 100%);
        color: white;
        padding: 56px 40px;
        border-radius: 20px;
        margin-bottom: 40px;
        box-shadow: 0 16px 48px rgba(30, 58, 95, 0.35);
        position: relative;
        overflow: hidden;
    }
    .exam-hero::before {
        content: '';
        position: absolute;
        top: -60px; right: -60px;
        width: 240px; height: 240px;
        border-radius: 50%;
        background: rgba(255,255,255,0.05);
    }
    .exam-hero::after {
        content: '';
        position: absolute;
        bottom: -80px; left: 30%;
        width: 320px; height: 320px;
        border-radius: 50%;
        background: rgba(255,255,255,0.03);
    }
    .exam-hero-inner { position: relative; z-index: 1; }
    .exam-hero h1 { font-size: 32px; font-weight: 800; margin-bottom: 12px; }
    .exam-hero p { font-size: 16px; opacity: 0.85; margin-bottom: 28px; max-width: 520px; line-height: 1.6; }
    .hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 28px; }
    .hero-badge {
        background: rgba(255,255,255,0.15);
        backdrop-filter: blur(4px);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 13px;
        font-weight: 600;
        border: 1px solid rgba(255,255,255,0.2);
    }
    .hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
    .hero-btn-primary {
        background: white;
        color: #1e3a5f;
        padding: 12px 24px;
        border-radius: 10px;
        font-weight: 700;
        font-size: 14px;
        text-decoration: none;
        transition: all 0.2s;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    .hero-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
    .hero-btn-secondary {
        background: rgba(255,255,255,0.15);
        color: white;
        padding: 12px 24px;
        border-radius: 10px;
        font-weight: 600;
        font-size: 14px;
        text-decoration: none;
        border: 1px solid rgba(255,255,255,0.3);
        transition: all 0.2s;
    }
    .hero-btn-secondary:hover { background: rgba(255,255,255,0.25); }

    /* ── Stats Strip ──────────────────────────────────── */
    .stats-strip {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 20px;
        margin-bottom: 48px;
    }
    .stat-pill {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
        padding: 22px 24px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        transition: box-shadow 0.2s;
    }
    .stat-pill:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
    .stat-pill-num { font-size: 28px; font-weight: 800; color: #2563eb; }
    .stat-pill-label { font-size: 13px; color: #6b7280; font-weight: 600; margin-top: 4px; }

    /* ── Section Title ────────────────────────────────── */
    .section-title {
        font-size: 22px;
        font-weight: 800;
        color: #111827;
        margin-bottom: 24px;
        display: flex;
        align-items: center;
        gap: 12px;
    }
    .section-title-badge {
        background: #eff6ff;
        color: #2563eb;
        font-size: 13px;
        font-weight: 700;
        padding: 4px 12px;
        border-radius: 20px;
    }

    /* ── Category Cards ───────────────────────────────── */
    .cat-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 24px;
        margin-bottom: 48px;
    }
    .cat-card {
        background: white;
        border: 2px solid #e5e7eb;
        border-radius: 18px;
        padding: 28px;
        text-decoration: none;
        color: inherit;
        transition: all 0.25s;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        display: block;
        position: relative;
        overflow: hidden;
    }
    .cat-card::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0;
        height: 4px;
        background: linear-gradient(90deg, #2563eb, #7c3aed);
        transform: scaleX(0);
        transform-origin: left;
        transition: transform 0.3s;
    }
    .cat-card:hover {
        border-color: #2563eb;
        box-shadow: 0 8px 28px rgba(37, 99, 235, 0.14);
        transform: translateY(-4px);
    }
    .cat-card:hover::before { transform: scaleX(1); }
    .cat-icon { font-size: 42px; margin-bottom: 16px; display: block; }
    .cat-name { font-size: 17px; font-weight: 800; color: #111827; margin-bottom: 8px; }
    .cat-desc { font-size: 14px; color: #6b7280; margin-bottom: 20px; min-height: 42px; line-height: 1.5; }
    .cat-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 16px;
        border-top: 1px solid #f3f4f6;
    }
    .cat-stats { font-size: 14px; color: #6b7280; }
    .cat-stats strong { color: #2563eb; font-weight: 700; }
    .cat-btn {
        padding: 8px 16px;
        background: linear-gradient(135deg, #eff6ff, #dbeafe);
        color: #2563eb;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 700;
        transition: all 0.2s;
    }
    .cat-card:hover .cat-btn {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: white;
    }
    .my-score {
        background: linear-gradient(135deg, #f0fdf4, #dcfce7);
        border: 1px solid #bbf7d0;
        border-radius: 10px;
        padding: 10px 14px;
        font-size: 13px;
        color: #065f46;
        margin-top: 16px;
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
    }

    /* ── Info Cards Row ───────────────────────────────── */
    .info-cards-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 24px;
        margin-bottom: 48px;
    }
    .info-card {
        background: white;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        padding: 24px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    .info-card-title {
        font-size: 16px;
        font-weight: 800;
        color: #111827;
        margin-bottom: 18px;
        display: flex;
        align-items: center;
        gap: 10px;
        padding-bottom: 14px;
        border-bottom: 2px solid #f3f4f6;
    }

    /* ── Leaderboard Mini ──────────────────────────────── */
    .lb-item {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 12px 0;
        border-bottom: 1px solid #f3f4f6;
    }
    .lb-item:last-child { border-bottom: none; }
    .lb-rank {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 800;
        flex-shrink: 0;
    }
    .lb-rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: white; }
    .lb-rank-2 { background: linear-gradient(135deg, #9ca3af, #6b7280); color: white; }
    .lb-rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
    .lb-rank-other { background: #f3f4f6; color: #6b7280; }
    .lb-avatar {
        width: 38px; height: 38px;
        border-radius: 50%;
        background: linear-gradient(135deg, #2563eb, #7c3aed);
        display: flex; align-items: center; justify-content: center;
        font-size: 15px; font-weight: 700; color: white;
        flex-shrink: 0;
    }
    .lb-info { flex: 1; min-width: 0; }
    .lb-name { font-size: 14px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .lb-attempts { font-size: 12px; color: #9ca3af; margin-top: 2px; }
    .lb-score {
        font-size: 16px;
        font-weight: 800;
        color: #2563eb;
        flex-shrink: 0;
    }
    .lb-score-pct { font-size: 11px; color: #9ca3af; font-weight: 600; }

    .lb-empty {
        text-align: center;
        padding: 28px;
        color: #9ca3af;
        font-size: 14px;
    }

    /* ── My Stats Card ────────────────────────────────── */
    .my-stats-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
        margin-bottom: 18px;
    }
    @media (max-width: 600px) {
        .my-stats-grid { grid-template-columns: repeat(2, 1fr); }
    }
    .my-stat-item {
        background: #f9fafb;
        border-radius: 12px;
        padding: 14px;
        text-align: center;
    }
    .my-stat-num { font-size: 22px; font-weight: 800; color: #2563eb; }
    .my-stat-label { font-size: 12px; color: #6b7280; font-weight: 600; margin-top: 4px; }
    .info-card-link {
        display: block;
        text-align: center;
        padding: 12px;
        background: #eff6ff;
        color: #2563eb;
        border-radius: 12px;
        font-weight: 700;
        font-size: 14px;
        text-decoration: none;
        transition: all 0.2s;
    }
    .info-card-link:hover { background: #2563eb; color: white; }

    /* ── Tips Card ────────────────────────────────────── */
    .tip-item {
        display: flex;
        gap: 12px;
        margin-bottom: 16px;
        font-size: 14px;
        color: #374151;
        line-height: 1.6;
    }
    .tip-item:last-child { margin-bottom: 0; }
    .tip-icon { font-size: 18px; flex-shrink: 0; }
    .tip-text strong { color: #111827; }
</style>


<div class="exam-hero">
    <div class="exam-hero-inner">
        <h1>🎯 Sınav Hazırlık Merkezi</h1>
        <p>KPSS, MSÜ, Astsubay, Jandarma ve diğer askeri sınavlar için online testler çöz, sınav geçmişini takip et.</p>
        <div class="hero-badges">
            <span class="hero-badge">🎖️ MSÜ Sınavı</span>
            <span class="hero-badge">⭐ KPSS</span>
            <span class="hero-badge">🪖 Astsubay</span>
            <span class="hero-badge">🏅 Jandarma</span>
        </div>
        <div class="hero-btns">
            <?php if(auth()->check()): ?>
                <a href="<?php echo e(route('interview.my_attempts')); ?>" class="hero-btn-primary">📊 Sınav Geçmişim</a>
                <a href="#categories" class="hero-btn-secondary">🚀 Sınava Gir</a>
            <?php else: ?>
                <a href="<?php echo e(route('login')); ?>" class="hero-btn-primary">🔐 Giriş Yap</a>
                <a href="#categories" class="hero-btn-secondary">👁️ Sınavlara Bak</a>
            <?php endif; ?>
        </div>
    </div>
</div>


<div class="stats-strip">
    <div class="stat-pill">
        <div class="stat-pill-num"><?php echo e($categories->count()); ?></div>
        <div class="stat-pill-label">📚 Kategori</div>
    </div>
    <div class="stat-pill">
        <div class="stat-pill-num"><?php echo e($categories->sum('questions_count')); ?></div>
        <div class="stat-pill-label">❓ Toplam Soru</div>
    </div>
    <?php if(auth()->check() && isset($userStats) && count($userStats) > 0): ?>
    <div class="stat-pill">
        <div class="stat-pill-num"><?php echo e(collect($userStats)->sum('attempt_count')); ?></div>
        <div class="stat-pill-label">🎯 Denemem</div>
    </div>
    <div class="stat-pill">
        <div class="stat-pill-num">%<?php echo e(round(collect($userStats)->avg('best_score') ?? 0)); ?></div>
        <div class="stat-pill-label">🏆 Ort. Puanım</div>
    </div>
    <?php else: ?>
    <div class="stat-pill">
        <div class="stat-pill-num"><?php echo e($leaderboard->count()); ?></div>
        <div class="stat-pill-label">🏆 Lider Sayısı</div>
    </div>
    <div class="stat-pill">
        <div class="stat-pill-num"><?php echo e($leaderboard->first() ? '%'.$leaderboard->first()->best_score : '-'); ?></div>
        <div class="stat-pill-label">🥇 En Yüksek Puan</div>
    </div>
    <?php endif; ?>
</div>


<?php if(auth()->check() && isset($userStats) && count($userStats) > 0): ?>
<div class="info-card" style="margin-bottom: 48px;">
    <div class="info-card-title">📊 Sınav İstatistiklerim</div>
    <div class="my-stats-grid">
        <div class="my-stat-item">
            <div class="my-stat-num"><?php echo e(collect($userStats)->sum('attempt_count')); ?></div>
            <div class="my-stat-label">Toplam Deneme</div>
        </div>
        <div class="my-stat-item">
            <div class="my-stat-num">%<?php echo e(round(collect($userStats)->avg('best_score') ?? 0)); ?></div>
            <div class="my-stat-label">Ort. En İyi</div>
        </div>
        <div class="my-stat-item">
            <div class="my-stat-num"><?php echo e(collect($userStats)->max('best_score') ?? 0); ?>%</div>
            <div class="my-stat-label">En Yüksek</div>
        </div>
        <div class="my-stat-item">
            <div class="my-stat-num"><?php echo e($userStats->count()); ?></div>
            <div class="my-stat-label">Kategori</div>
        </div>
    </div>
    <a href="<?php echo e(route('interview.my_attempts')); ?>" class="info-card-link">Tüm Denemelerimi Gör →</a>
</div>
<?php endif; ?>


<h2 class="section-title" id="categories">
    📚 Sınav Kategorileri
    <span class="section-title-badge"><?php echo e($categories->count()); ?> kategori</span>
</h2>
<div class="cat-grid">
    <?php $__empty_1 = true; $__currentLoopData = $categories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $category): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <a href="<?php echo e(route('interview.category', $category)); ?>" class="cat-card">
            <span class="cat-icon"><?php echo e($category->icon ?? '📝'); ?></span>
            <div class="cat-name"><?php echo e($category->name); ?></div>
            <div class="cat-desc"><?php echo e($category->description ?? 'Askeri sınav hazırlık soruları'); ?></div>
            <div class="cat-footer">
                <div class="cat-stats">
                    <strong><?php echo e($category->questions_count); ?></strong> soru
                    <?php if($category->time_limit): ?>
                        &bull; ⏱️ <?php echo e($category->time_limit); ?> dk
                    <?php endif; ?>
                </div>
                <span class="cat-btn">Sınava Gir →</span>
            </div>
            <?php if(auth()->check() && isset($userStats[$category->id])): ?>
                <div class="my-score">
                    🏆 En iyi: <strong>%<?php echo e(round($userStats[$category->id]->best_score)); ?></strong>
                    &bull; <?php echo e($userStats[$category->id]->attempt_count); ?> deneme
                </div>
            <?php endif; ?>
        </a>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div style="grid-column:1/-1;text-align:center;padding:80px 40px;color:#6b7280;background:white;border-radius:18px;border:2px dashed #e5e7eb;">
            <div style="font-size:56px;margin-bottom:16px;">📝</div>
            <div style="font-weight:700;font-size:18px;margin-bottom:8px;">Henüz sınav kategorisi yok</div>
            <div style="font-size:14px;">Yakında yeni kategoriler eklenecek.</div>
        </div>
    <?php endif; ?>
</div>


<div class="info-cards-row">

    
    <div class="info-card">
        <div class="info-card-title">🏆 Liderlik Tablosu</div>
        <?php if($leaderboard->count() > 0): ?>
            <?php $__currentLoopData = $leaderboard; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <div class="lb-item">
                <div class="lb-rank <?php echo e($index === 0 ? 'lb-rank-1' : ($index === 1 ? 'lb-rank-2' : ($index === 2 ? 'lb-rank-3' : 'lb-rank-other'))); ?>">
                    <?php echo e($index === 0 ? '🥇' : ($index === 1 ? '🥈' : ($index === 2 ? '🥉' : $index + 1))); ?>

                </div>
                <div class="lb-avatar">
                    <?php echo e(mb_strtoupper(mb_substr($user->name, 0, 1))); ?>

                </div>
                <div class="lb-info">
                    <div class="lb-name"><?php echo e($user->name); ?></div>
                    <div class="lb-attempts"><?php echo e($user->total_attempts); ?> deneme</div>
                </div>
                <div style="text-align:right;">
                    <div class="lb-score">%<?php echo e($user->best_score); ?></div>
                    <div class="lb-score-pct">en iyi</div>
                </div>
            </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <a href="<?php echo e(route('interview.leaderboard')); ?>" class="info-card-link" style="margin-top:18px;">Tüm Tabloyu Gör →</a>
        <?php else: ?>
            <div class="lb-empty">
                <div style="font-size:40px;margin-bottom:12px;">🏆</div>
                Henüz sınav sonucu yok.<br>İlk sırada sen ol!
            </div>
        <?php endif; ?>
    </div>

    
    <div class="info-card">
        <div class="info-card-title">💡 Sınav İpuçları</div>
        <div class="tip-item">
            <span class="tip-icon">🕐</span>
            <span class="tip-text"><strong>Süreyi takip et</strong> — Her soruda ortalama 1-2 dakika harca.</span>
        </div>
        <div class="tip-item">
            <span class="tip-icon">📖</span>
            <span class="tip-text"><strong>Düzenli çalış</strong> — Her gün en az 1 sınav çöz.</span>
        </div>
        <div class="tip-item">
            <span class="tip-icon">🔄</span>
            <span class="tip-text"><strong>Tekrar yap</strong> — Yanlış soruları tekrar çöz.</span>
        </div>
        <div class="tip-item">
            <span class="tip-icon">🎯</span>
            <span class="tip-text"><strong>Hedef koy</strong> — %70 üzeri başarı hedefle.</span>
        </div>
        <div class="tip-item">
            <span class="tip-icon">🧠</span>
            <span class="tip-text"><strong>Sakin ol</strong> — Stres yapma, odaklan.</span>
        </div>
    </div>

</div>

<?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\index.blade.php ENDPATH**/ ?>