/* style.css - V5: Native App Feel & Cinematic Dark */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Palette: Midnight Cyberpunk */
    --bg-main: #020617;       /* Sangat gelap */
    --bg-card: #0f172a;       /* Slate 900 */
    --bg-surface: #1e293b;    /* Slate 800 */
    
    --primary: #3b82f6;       /* Electric Blue */
    --primary-dim: rgba(59, 130, 246, 0.15);
    --accent: #8b5cf6;        /* Violet Neon */
    
    --text-100: #f8fafc;      /* Putih Terang */
    --text-200: #cbd5e1;      /* Abu Terang */
    --text-300: #64748b;      /* Abu Gelap */
    
    --border: rgba(255, 255, 255, 0.08);
    --glass: rgba(15, 23, 42, 0.7);
    --radius-xl: 24px;
    --radius-md: 16px;
    --shadow: 0 10px 40px -10px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.15), transparent 40%),
        radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.1), transparent 40%);
    background-attachment: fixed;
    color: var(--text-100);
    margin: 0; padding: 0;
    padding-bottom: 90px; /* Space untuk Bottom Nav di HP */
    min-height: 100vh;
}

/* --- DESKTOP NAVBAR (Hidden di HP) --- */
.desktop-nav {
    position: sticky; top: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 5%;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.brand { 
    font-size: 1.4rem; font-weight: 800; color: white; text-decoration: none; display: flex; align-items: center; gap: 8px;
}
.brand i { color: var(--primary); font-size: 1.6rem; }

.nav-items { display: flex; gap: 30px; }
.nav-item {
    color: var(--text-200); text-decoration: none; font-weight: 600; font-size: 0.9rem;
    transition: 0.3s; padding: 8px 16px; border-radius: 50px;
}
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--primary); color: white; box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4); }

/* --- MOBILE BOTTOM NAV (Hidden di Desktop) --- */
.mobile-nav {
    display: none; /* Default hidden */
    position: fixed; bottom: 0; left: 0; right: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    padding: 12px 20px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    justify-content: space-around;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.mob-link {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    color: var(--text-300); text-decoration: none; font-size: 0.75rem; font-weight: 500;
    transition: 0.3s;
}
.mob-link i { font-size: 1.5rem; margin-bottom: 2px; transition: 0.3s; }
.mob-link.active { color: var(--primary); }
.mob-link.active i { transform: translateY(-3px); filter: drop-shadow(0 4px 8px rgba(59,130,246,0.5)); }

/* --- LAYOUT & GRID --- */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

.hero {
    text-align: center; padding: 60px 20px 40px;
    background: linear-gradient(180deg, rgba(59,130,246,0.05) 0%, transparent 100%);
    border-bottom: 1px solid var(--border); margin-bottom: 40px;
}
.hero h1 {
    font-size: 2.8rem; margin: 10px 0; letter-spacing: -1px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-300); max-width: 500px; margin: 0 auto 30px; }

/* Search Bar Modern */
.search-box {
    position: relative; max-width: 500px; margin: 0 auto;
}
.search-input {
    width: 100%; padding: 16px 24px; padding-left: 50px;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: 50px; color: white; font-size: 1rem;
    transition: 0.3s; box-shadow: var(--shadow);
}
.search-icon {
    position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
    color: var(--text-300); font-size: 1.2rem;
}
.search-input:focus {
    border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-dim);
    background: var(--bg-card);
}

/* Grid Buku */
.section-title {
    display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
    font-size: 1.25rem; color: white;
}
.section-title i { color: #fbbf24; } /* Warna icon api/bintang */

.book-grid {
    display: grid;
    /* Responsif: Min 150px per kolom (cocok buat HP) */
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden; position: relative;
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column;
}

.book-card:hover {
    transform: translateY(-8px); border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
}

.card-img-wrap {
    aspect-ratio: 2/3; overflow: hidden; position: relative;
}
.card-img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s ease;
}
.book-card:hover .card-img { transform: scale(1.1); }

.card-body { padding: 12px; flex-grow: 1; display: flex; flex-direction: column; }
.card-title {
    font-size: 0.95rem; font-weight: 600; color: white;
    margin-bottom: 4px; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-author { font-size: 0.8rem; color: var(--text-300); margin-bottom: 12px; }

.btn-card {
    margin-top: auto; text-align: center; padding: 8px;
    background: var(--bg-surface); color: var(--primary);
    font-size: 0.8rem; font-weight: 600; border-radius: 8px; text-decoration: none;
    transition: 0.2s; border: 1px solid transparent;
}
.btn-card:hover { background: var(--primary); color: white; }

/* --- ANIMATIONS --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.book-card { animation: fadeIn 0.6s backwards; }
.book-card:nth-child(odd) { animation-delay: 0.1s; }
.book-card:nth-child(even) { animation-delay: 0.2s; }

/* --- MEDIA QUERIES (RESPONSIVE) --- */
@media (max-width: 768px) {
    .desktop-nav { display: none; } /* Hide Top Nav */
    .mobile-nav { display: flex; } /* Show Bottom Nav */
    
    .hero { padding-top: 30px; text-align: left; }
    .hero h1 { font-size: 2rem; }
    .search-box { margin: 0; }
    
    .container { padding: 15px; }
    .book-grid { gap: 15px; grid-template-columns: repeat(2, 1fr); } /* 2 Kolom fix di HP */
    
    /* Typography Adjustment for Mobile */
    .card-title { font-size: 0.85rem; }
    .card-author { font-size: 0.75rem; }
    
    /* Adjust body padding to not hide behind bottom nav */
    body { padding-bottom: 80px; }
}
/* Badge dengan Animasi Pulse */
.live-badge {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 0.8rem; color: var(--text-300);
}

.live-dot {
    width: 8px; height: 8px;
    background-color: #10b981; /* Hijau Active */
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 10px #10b981;
}

.live-dot::after {
    content: ''; position: absolute; inset: -4px;
    border-radius: 50%;
    border: 1px solid #10b981;
    opacity: 0;
    animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

