<?php $__env->startSection('content'); ?>
<style>
    /* --- HERO CARD (Tetap menggunakan gradasi Biru agar menonjol di kedua mode) --- */
    .hero-card {
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
        border-radius: 24px !important;
        border: none;
        box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3) !important;
    }
    
    /* Memaksa teks di dalam Hero Card agar selalu putih */
    .hero-card h1, .hero-card p, .hero-card i, .hero-card span {
        color: #ffffff !important;
    }

    /* --- MODERN CARD (Mengikuti tema Light/Dark dari app.blade.php) --- */
    .modern-card {
        border-radius: 20px !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: hidden;
    }
    .modern-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
        border-color: var(--primary-color) !important;
    }
    
    /* --- INNER CARD (Kotak di dalam kartu utama) --- */
    .bg-inner-card {
        background-color: var(--hover-bg);
        border: 1px solid var(--border-color);
    }

    /* Tombol Bulat Tambahan */
    .btn-pill {
        border-radius: 50rem !important;
        padding: 0.5rem 1.2rem;
        font-weight: 600;
        transition: all 0.3s ease;
    }
</style>

<div class="container-fluid p-0">
    
    
    <div class="card hero-card mb-5 position-relative">
        
        <div class="position-absolute rounded-circle" style="width: 300px; height: 300px; background: rgba(255,255,255,0.1); top: -100px; right: -50px; filter: blur(20px);"></div>
        <div class="position-absolute rounded-circle" style="width: 150px; height: 150px; background: rgba(255,255,255,0.15); bottom: -50px; right: 200px; filter: blur(15px);"></div>

        <div class="card-body p-4 p-md-5 d-flex align-items-center justify-content-between position-relative z-1">
            <div>
                <h1 class="fw-bold mb-2" style="font-size: 2.4rem; letter-spacing: -1px;">
                    Halo, <span style="opacity: 0.9;"><?php echo e(Auth::user()->name); ?></span>! 👋
                </h1>
                <p class="fs-6 mb-0" style="opacity: 0.85;">
                    Selamat datang kembali di SIS-LAJAR. Berikut ringkasan aktivitas mengajar Anda.
                </p>
            </div>
            <div class="d-none d-md-block" style="opacity: 0.2;">
                <i class="bi bi-journal-richtext" style="font-size: 6rem;"></i>
            </div>
        </div>
    </div>

    
    <div class="mb-5">
        <div class="d-flex align-items-center justify-content-between mb-4">
            <div class="d-flex align-items-center gap-3">
                <div class="bg-primary bg-opacity-10 text-primary rounded-circle d-flex align-items-center justify-content-center" style="width: 45px; height: 45px;">
                    <i class="bi bi-calendar-date fs-5"></i>
                </div>
                <div>
                    <h5 class="fw-bold m-0">Jadwal Mengajar</h5>
                    <small class="text-muted fw-medium"><?php echo e($scheduleDateLabel); ?></small>
                </div>
            </div>
            <a href="<?php echo e(route('jadwal.index')); ?>" class="btn btn-outline-secondary btn-pill shadow-sm">Lihat Kalender</a>
        </div>

        <?php if($displaySchedules->count() > 0): ?>
            <div class="row g-4">
                <?php $__currentLoopData = $displaySchedules; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $schedule): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="<?php echo e($displaySchedules->count() == 1 ? 'col-md-12' : 'col-md-6'); ?>">
                    <div class="card modern-card h-100">
                        <div class="card-body p-4 position-relative">
                            
                            <?php
                                $colors = ['bg-primary', 'bg-success', 'bg-warning', 'bg-info', 'bg-danger'];
                                $randomColor = $colors[$loop->index % count($colors)];
                            ?>
                            <div class="position-absolute top-0 start-0 h-100 <?php echo e($randomColor); ?>" style="width: 6px;"></div>

                            <div class="row align-items-center">
                                <div class="col-auto text-center pe-md-4 border-end" style="min-width: 90px;">
                                    <h2 class="fw-bold mb-0" style="letter-spacing: -1px;">
                                        <?php echo e(\Carbon\Carbon::parse($schedule->tanggal)->format('d')); ?>

                                    </h2>
                                    <small class="text-muted text-uppercase fw-bold" style="font-size: 0.75rem; letter-spacing: 1px;">
                                        <?php echo e(\Carbon\Carbon::parse($schedule->tanggal)->isoFormat('dddd')); ?>

                                    </small>
                                </div>

                                <div class="col ps-md-4">
                                    <h5 class="fw-bold mb-2">
                                        <?php echo e($schedule->subject->name ?? 'Mata Pelajaran'); ?>

                                    </h5>
                                    <div class="d-flex flex-wrap gap-2 small mb-2">
                                        <span class="badge bg-primary bg-opacity-10 text-primary border border-primary-subtle rounded-pill px-3 py-2">
                                            <i class="bi bi-people-fill me-1"></i> <?php echo e($schedule->class ?? '-'); ?>

                                        </span>
                                        <span class="badge bg-secondary bg-opacity-10 text-secondary border border-secondary-subtle rounded-pill px-3 py-2">
                                            <i class="bi bi-calendar3 me-1"></i> Pekan ke-<?php echo e($schedule->pekan_ke ?? '1'); ?>

                                        </span>
                                    </div>
                                </div>
                                
                                <div class="col-auto mt-3 mt-md-0 text-end">
                                    <?php if($scheduleStatus == 'Hari Ini'): ?>
                                        <a href="<?php echo e(route('jurnal.create', ['schedule_id' => $schedule->id])); ?>" class="btn btn-primary btn-pill shadow-sm text-nowrap px-4">
                                            <i class="bi bi-journal-plus me-1"></i> Isi Jurnal
                                        </a>
                                    <?php else: ?>
                                        <button class="btn btn-secondary bg-opacity-10 text-muted btn-pill px-4 border-0" disabled>
                                            <i class="bi bi-lock-fill me-1"></i> <?php echo e(\Carbon\Carbon::parse($schedule->tanggal)->isoFormat('D MMM')); ?>

                                        </button>
                                    <?php endif; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </div>
        <?php else: ?>
            <div class="card border-0 py-5 text-center bg-inner-card" style="border-radius: 20px; border-style: dashed !important;">
                <div class="card-body">
                    <i class="bi bi-calendar-x display-4 text-primary opacity-50 mb-3 d-block"></i>
                    <h5 class="fw-bold">Tidak ada jadwal terdekat</h5>
                    <p class="text-muted mb-0">Nikmati waktu luang Anda atau periksa kembali kalender akademik.</p>
                </div>
            </div>
        <?php endif; ?>
    </div>

    
    <div class="row mb-4">
        <div class="col-12 mb-4 d-flex justify-content-between align-items-center">
            <div class="d-flex align-items-center gap-3">
                <div class="bg-success bg-opacity-10 text-success rounded-circle d-flex align-items-center justify-content-center" style="width: 45px; height: 45px;">
                    <i class="bi bi-clock-history fs-5"></i>
                </div>
                <h5 class="fw-bold m-0">Aktivitas Mengajar Terbaru</h5>
            </div>
            <a href="<?php echo e(route('jurnal.index')); ?>" class="btn btn-outline-secondary btn-pill shadow-sm">Lihat Semua</a>
        </div>

        <?php $__empty_1 = true; $__currentLoopData = $recentJournals; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $j): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
        <div class="col-md-4 mb-4">
            <div class="card modern-card h-100 d-flex flex-column">
                <div class="card-body p-4 d-flex flex-column">
                    <div class="d-flex justify-content-between align-items-start mb-3">
                        <span class="badge bg-primary bg-opacity-10 text-primary border border-primary-subtle rounded-pill px-3 py-2 fw-semibold">
                            <?php echo e($j->date->format('d M Y')); ?>

                        </span>
                        <small class="fw-bold text-muted bg-inner-card px-3 py-2 rounded-pill">Jam <?php echo e($j->period); ?></small>
                    </div>

                    <h5 class="fw-bold mb-1"><?php echo e($j->subject->name); ?></h5>
                    <div class="mb-3">
                        <small class="text-muted fw-medium"><i class="bi bi-people me-1"></i> Kelas <?php echo e($j->class); ?></small>
                    </div>

                    <div class="p-3 rounded-4 mb-3 flex-grow-1 bg-inner-card">
                        <small class="text-muted d-block fw-bold mb-2 text-uppercase" style="font-size: 0.7rem; letter-spacing: 0.5px;">Topik Materi</small>
                        <p class="mb-0 small fw-medium" style="line-height: 1.6;">
                            <?php 
                                $topicsList = [];
                                if(!empty($j->topics)) {
                                    foreach($j->topics as $t) {
                                        if(is_array($t)) {
                                            $topicsList[] = $t['name'] ?? '';
                                        } else {
                                            $topicsList[] = $t;
                                        }
                                    }
                                }
                                $materi = implode(', ', $topicsList);
                                echo Str::limit($materi, 60, '...');
                            ?>
                        </p>
                    </div>

                    <div class="d-flex justify-content-between align-items-center pt-3 mt-auto border-top">
                        <div class="d-flex align-items-center text-success bg-success bg-opacity-10 px-3 py-1 rounded-pill border border-success-subtle" title="Siswa Hadir">
                            <i class="bi bi-check-circle-fill me-2"></i>
                            <span class="fw-bold me-1"><?php echo e(count($j->student_attendance ?? [])); ?></span>
                            <span class="small fw-semibold">Hadir</span>
                        </div>
                        <a href="<?php echo e(route('jurnal.index')); ?>" class="btn btn-sm btn-outline-primary btn-pill px-4">
                            Detail
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
        <div class="col-12">
            <div class="card border-0 py-5 text-center bg-inner-card" style="border-radius: 20px; border-style: dashed !important;">
                <div class="card-body">
                    <div class="mb-3 text-primary opacity-50">
                        <i class="bi bi-journal-x" style="font-size: 4rem;"></i>
                    </div>
                    <h5 class="fw-bold">Belum ada riwayat pengajaran</h5>
                    <p class="text-muted">Jurnal harian yang Anda selesaikan akan muncul di sini.</p>
                    <a href="<?php echo e(route('jurnal.index')); ?>" class="btn btn-primary btn-pill shadow-sm px-4 mt-3">
                        <i class="bi bi-plus-lg me-1"></i> Buat Jurnal Baru
                    </a>
                </div>
            </div>
        </div>
        <?php endif; ?>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /home/vol15_7/infinityfree.com/if0_40829333/sislajar-skansa.gt.tc/htdocs/resources/views/dashboard.blade.php ENDPATH**/ ?>