

<?php $__env->startSection('title', 'Bildirimler'); ?>

<?php $__env->startSection('styles'); ?>
<style>
.notif-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 16px;
}
.notif-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}
.notif-page-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.notif-page-subtitle {
    color: #6b7280;
    font-size: 14px;
    margin: 4px 0 0;
}
.notif-mark-all-btn {
    background: #f3f4f6;
    color: #374151;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.notif-mark-all-btn:hover { background: #e5e7eb; }

.notif-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.notif-list {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}
.notif-item {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: #f0f9ff; }

.notif-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    background: #e5e7eb;
}
.notif-item.unread .notif-icon {
    background: #1d4ed8;
}

.notif-body {
    flex: 1;
    min-width: 0;
}
.notif-body-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.notif-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px;
}
.notif-item.unread .notif-title { font-weight: 700; }
.notif-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #1d4ed8;
    border-radius: 50%;
    margin-left: 6px;
    vertical-align: middle;
}
.notif-message {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}
.notif-meta {
    text-align: right;
    flex-shrink: 0;
}
.notif-time {
    font-size: 12px;
    color: #9ca3af;
    margin: 0 0 8px;
}
.notif-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
.notif-btn {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    font-weight: 600;
    padding: 0;
    transition: color 0.15s;
}
.notif-btn-read { color: #1d4ed8; }
.notif-btn-read:hover { color: #1e3a8a; }
.notif-btn-delete { color: #dc2626; }
.notif-btn-delete:hover { color: #b91c1c; }

.notif-link {
    color: #1d4ed8;
    font-size: 13px;
    text-decoration: none;
    margin-top: 6px;
    display: inline-block;
    font-weight: 600;
    transition: color 0.15s;
}
.notif-link:hover { color: #1e3a8a; }

.notif-empty {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.notif-empty-icon { font-size: 64px; margin-bottom: 16px; }
.notif-empty-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}
.notif-empty-text { color: #6b7280; font-size: 14px; }

.notif-pagination {
    margin-top: 24px;
    display: flex;
    justify-content: center;
}

@media (max-width: 640px) {
    .notif-page { padding: 24px 12px; }
    .notif-page-title { font-size: 22px; }
    .notif-body-top { flex-direction: column; gap: 8px; }
    .notif-meta { text-align: left; }
    .notif-actions { justify-content: flex-start; }
}
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
<div class="notif-page">

    <div class="notif-page-header">
        <div>
            <h1 class="notif-page-title">🔔 Bildirimler</h1>
            <p class="notif-page-subtitle">Tüm bildirimlerinizi buradan yönetin</p>
        </div>
        <?php if($notifications->total() > 0): ?>
            <form action="<?php echo e(route('notifications.mark_all_read')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <button type="submit" class="notif-mark-all-btn">Tümünü Okundu İşaretle</button>
            </form>
        <?php endif; ?>
    </div>

    <?php if(session('success')): ?>
        <div class="notif-success"><?php echo e(session('success')); ?></div>
    <?php endif; ?>

    <?php if($notifications->count()): ?>
        <div class="notif-list">
            <?php $__currentLoopData = $notifications; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $notification): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <?php
                    $icons = [
                        'welcome'      => '👋',
                        'comment'      => '💬',
                        'forum_reply'  => '📝',
                        'system'       => '⚙️',
                        'announcement' => '📢',
                        'achievement'  => '🏆',
                    ];
                    $icon = $icons[$notification->type] ?? '🔔';
                ?>

                <div class="notif-item <?php echo e(!$notification->is_read ? 'unread' : ''); ?>">

                    <div class="notif-icon"><?php echo e($icon); ?></div>

                    <div class="notif-body">
                        <div class="notif-body-top">
                            <div>
                                <h4 class="notif-title">
                                    <?php echo e($notification->title); ?>

                                    <?php if(!$notification->is_read): ?>
                                        <span class="notif-dot"></span>
                                    <?php endif; ?>
                                </h4>
                                <p class="notif-message"><?php echo e($notification->message); ?></p>
                            </div>
                            <div class="notif-meta">
                                <p class="notif-time"><?php echo e($notification->created_at->diffForHumans()); ?></p>
                                <div class="notif-actions">
                                    <?php if(!$notification->is_read): ?>
                                        <form action="<?php echo e(route('notifications.read', $notification)); ?>" method="POST">
                                            <?php echo csrf_field(); ?>
                                            <button type="submit" class="notif-btn notif-btn-read">Okundu</button>
                                        </form>
                                    <?php endif; ?>
                                    <form action="<?php echo e(route('notifications.destroy', $notification)); ?>" method="POST">
                                        <?php echo csrf_field(); ?>
                                        <?php echo method_field('DELETE'); ?>
                                        <button type="submit" class="notif-btn notif-btn-delete">Sil</button>
                                    </form>
                                </div>
                            </div>
                        </div>
                        <?php if($notification->link): ?>
                            <a href="<?php echo e($notification->link); ?>" class="notif-link">Görüntüle →</a>
                        <?php endif; ?>
                    </div>

                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </div>

        <?php if($notifications->hasPages()): ?>
            <div class="notif-pagination">
                <?php echo e($notifications->links()); ?>

            </div>
        <?php endif; ?>
    <?php else: ?>
        <div class="notif-empty">
            <div class="notif-empty-icon">🔔</div>
            <h3 class="notif-empty-title">Bildirim yok</h3>
            <p class="notif-empty-text">Şu an için herhangi bir bildiriminiz bulunmuyor.</p>
        </div>
    <?php endif; ?>

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