@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-gradient: linear-gradient(135deg, #f8faff 0%, #e2e8f0 100%);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --glass-border: rgba(255, 255, 255, 0.4);
    --font-main: 'Plus Jakarta Sans', sans-serif;
}

[data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.5);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    font-family: var(--font-main);
    color: var(--text-main);
    transition: all 0.5s ease;
    min-height: 100vh;
    margin: 0;
}

/* Typography Weight Helpers */
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.font-800 { font-weight: 800; }

/* Global Scrollbar Removal */
::-webkit-scrollbar { display: none; }
html, body { scrollbar-width: none; -ms-overflow-style: none; overflow-x: hidden; }

/* Enhanced Apple Glassmorphism */
.apple-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
}

.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Animasi Masuk */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.grid > div {
    animation: fadeInUp 0.6s ease backwards;
}

/* Delay Animasi Grid */
.grid > div:nth-child(1) { animation-delay: 0.1s; }
.grid > div:nth-child(2) { animation-delay: 0.2s; }
.grid > div:nth-child(3) { animation-delay: 0.3s; }
.grid > div:nth-child(4) { animation-delay: 0.4s; }

/* Card Menu Ukuran Kecil & Compact */
.menu-card-small {
    padding: 1.25rem !important; /* Padding lebih ramping */
    border-radius: 1.5rem !important; /* Radius lebih kecil agar tidak terlalu membulat */
    min-height: 140px; /* Tinggi minimal lebih pendek */
}

.icon-box-small {
    width: 2.75rem !important; /* Ikon diperkecil */
    height: 2.75rem !important;
    margin-bottom: 1rem !important;
    font-size: 1.1rem !important;
}

.title-small {
    font-size: 0.95rem !important; /* Font judul lebih kecil tapi tetap bold */
    margin-bottom: 0.4rem !important;
}

.desc-small {
    font-size: 0.75rem !important; /* Font deskripsi sangat ringkas */
    line-height: 1.3 !important;
}

<div class="grid grid-cols-3 md:grid-cols-4 lg:grid-cols-6 xl:grid-cols-8 gap-3 md:gap-4">
    <?php
    $menus = get_menus_by_category($active_cat);
    while($m = mysqli_fetch_assoc($menus)):
    ?>
    <div onclick="sweetRedirect('<?= clean($m['title']) ?>', '<?= $m['url'] ?>')" 
         class="group cursor-pointer apple-glass menu-card-small transition-all duration-300 hover:-translate-y-2 active:scale-95 text-center">
        
        <div class="icon-box-small mx-auto rounded-xl flex items-center justify-center 
             bg-blue-600/5 dark:bg-cyan-400/10 text-blue-600 dark:text-cyan-400 transition-all group-hover:bg-blue-600 group-hover:text-white">
            <i class="fas <?= $m['icon'] ?? 'fa-rocket' ?>"></i>
        </div>
        
        <h3 class="title-small font-800 text-slate-800 dark:text-white truncate px-1">
            <?= $m['title'] ?>
        </h3>
        
        <p class="desc-small text-slate-500 dark:text-slate-400 line-clamp-1">
            <?= $m['description'] ?>
        </p>
    </div>
    <?php endwhile; ?>
</div>