<style>
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

  :root {
    --primary: #0d6efd;
    --primary-dark: #0046af;
    --bg-light: #f8f9fa;
    --text-dark: #2d3748;
    --text-muted: #a0aec0;
  }



  body { 
    background-color: var(--bg-light); 
    font-family: 'Inter', sans-serif; 
    /* Ubah overflow dari hidden menjadi auto agar Pull-to-Refresh browser aktif */
    overflow-x: hidden; 
    overflow-y: auto; 
    margin: 0; 
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
    /* overscroll-behavior-y: contain; <-- HAPUS atau KOMENTARI INI jika ingin reload browser aktif */
    height: 100%;
}

#list-buku-home {
  padding-bottom: 80px; /* Memberi ruang agar buku paling bawah tidak tertutup navigasi */
}

  /* --- HEADER & SEARCH --- */
.app-header { 
background: linear-gradient(135deg, #0d6efd 0%, #0046af 100%);
    color: white;
    position: sticky; 
    top: 0;
    z-index: 100; /* Level dasar header */
    padding: 20px 20px 50px 20px; /* Padding bawah lebih besar untuk ruang widget */
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
  

.section-title {
    padding: 0 25px; /* Kunci agar teks judul tidak mepet pinggir */
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-container {
padding: 10px 20px 100px 20px;
    position: relative;
    z-index: 1;
}

  .search-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 8px 15px;
    display: flex; align-items: center;
    margin-top: 12px;
    border: 1px solid rgba(255,255,255,0.2);
  }
  .search-container input {
    border: none; background: none; outline: none; width: 100%; 
    font-size: 13px; margin-left: 10px; color: white;
  }
  .search-container input::placeholder { color: rgba(255,255,255,0.6); }

  /* --- WIDGET INFORMASI --- */
    .info-widget {
background: white;
    position: sticky; 
    /* Sesuaikan top ini agar widget berhenti tepat di bawah search bar saat scroll */
    top: 220px; 
    z-index: 110; /* HARUS lebih tinggi dari z-index header agar melayang di atasnya */
    
    /* Menarik widget ke atas agar menumpuk di area biru */
    margin: -35px 20px 20px 20px; 
    
    padding: 15px 5px;
    border-radius: 20px;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}


  .info-item { text-align: center; flex: 1; border-right: 1px solid #f2f2f2; }
  .info-item:last-child { border-right: none; }
  .info-value {
    display: block;
    font-weight: bold;
    font-size: 16px;
    color: #333;
}
 .info-label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
}

  /* --- SWIPER AREA (PERBAIKAN UTAMA) --- */
  .swiper { 
    width: 100%;
    /* Tinggi dinamis: Layar - Header - Navigasi */
    height: calc(120vh - 180px); 
    z-index: 1;
  }

.swiper-slide { 
    overflow-y: auto; 
    padding: 0px 0px 120px 0px;
    /* Hilangkan tinggi statis agar scroll lancar */
    height: 100%;
}
.swiper-slide::-webkit-scrollbar { display: none; }

  /* --- GRID KATEGORI --- */
  .category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
  }


  
  .cat-card { 
    background: white; 
    border-radius: 12px; 
    padding: 8px 2px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02); 
    text-align: center;
    border: 1px solid #f8f9fa;
    min-height: 55px;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
  }
  .cat-card span { font-size: 16px !important; }
  .cat-label { font-size: 7.5px !important; margin-top: 4px; font-weight: 700; color: #4a5568; }

  /* --- BOOK CARD --- */
  /* Container Buku yang Seragam */
.book-card {
    background: white;
    border-radius: 16px;
    padding: 12px 15px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    width: 100%;
}

/* Icon Buku agar Ukuran Sama Semua */
.book-icon {
    width: 45px;
    height: 45px;
    background: #f0f4ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0; /* Mencegah icon gepeng */
    font-size: 20px;
}

/* Info Buku */
.book-info {
    flex-grow: 1;
    overflow: hidden; /* Penting untuk teks panjang */
}

/* Judul Maksimal 1 Baris */
.book-info h6 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Muncul titik-titik (...) jika kepanjangan */
    transition: all 0.3s ease;
}

/* Munculkan Judul Lengkap saat Hover (Desktop) atau Klik (Mobile) */
.book-card:active h6, .book-card:hover h6 {
    white-space: normal;
    overflow: visible;
}

/* Sub-Judul (Kategori) */
.book-info small {
    font-size: 11px;
    color: #a0aec0;
    display: block;
}

/* Action Buttons (Favorit & Baca) */
.book-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Container Tombol Favorit */
.btn-fav {
    border: none;
    background: #f8f9fa; /* Background bulat tipis */
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #adb5bd; /* Abu-abu halus */
    font-size: 18px;
}

/* Saat di-klik (efek membal) */
.btn-fav:active {
    transform: scale(0.8);
}

/* Keadaan AKTIF (Sudah Favorit) */
.btn-fav.active {
    background: #fff3cd; /* Background kuning pucat */
    color: #ffc107; /* Kuning emas */
}

/* Efek khusus untuk ikon di dalamnya */
.btn-fav i {
    line-height: 0;
}

/* Container List */
.fav-list-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 120px;
}

/* Card Favorit 1 Kolom */
.fav-card-list {
    background: white;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    border: 1px solid #f1f3f5;
    position: relative;
    overflow: hidden;
}

/* Icon Buku dengan warna Emas */
.fav-img-box {
    width: 50px;
    height: 50px;
    background: #fff3cd; /* Kuning pucat */
    color: #ffc107;      /* Kuning emas */
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.fav-info-box {
    flex-grow: 1;
    overflow: hidden;
}

.fav-info-box h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Judul tetap 1 baris rapi */
}

.fav-info-box small {
    font-size: 11px;
    color: #a0aec0;
}

/* Tombol Baca di kanan */
.btn-fav-read {
    background: #0d6efd;
    color: white;
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

/* Tombol Hapus Cepat */
.btn-unfav {
    position: absolute;
    top: 5px;
    right: 5px;
    border: none;
    background: none;
    color: #cbd5e0;
    font-size: 16px;
    padding: 0 5px;
}

/* Header Favorit Style Baru */
.header-fav-new {
    position: relative;
    background: #1a202c; /* Warna gelap elegan */
    padding: 50px 30px 80px 30px;
    border-radius: 0 0 50px 0; /* Lengkungan asimetris agar beda */
    overflow: hidden;
}

.fav-overlay {
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,193,7,0.15) 0%, rgba(255,255,255,0) 70%);
    border-radius: 50%;
}

.brand-tag {
    font-size: 10px;
    font-weight: 800;
    color: #ffc107;
    letter-spacing: 2px;
    border: 1px solid rgba(255,193,7,0.3);
    padding: 4px 12px;
    border-radius: 50px;
}

.fav-icon-badge {
    color: white;
    font-size: 24px;
}

/* Statistik Row */
.fav-stats-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 22px;
    font-weight: 800;
    color: white;
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    color: #a0aec0;
    font-weight: 600;
    margin-top: 5px;
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.1);
}

/* Item List Favorit */
.fav-exclusive-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.btn-read {
    background: #0d6efd;
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}
  /* --- BOTTOM NAV & INDICATOR --- */
  /* --- BOTTOM NAV DENGAN ICON ORANGE TUA --- */
.bottom-nav { 
  position: fixed; bottom: 0; width: 100%; height: 75px; 
  background: white; display: flex; justify-content: space-around; 
  align-items: center; border-top-left-radius: 25px; border-top-right-radius: 25px;
  box-shadow: 0 -10px 30px rgba(0,0,0,0.05); 
  z-index: 2000;
  padding: 0 10px;
}

.nav-item { 
  color: #94a3b8; /* Teks abu-abu saat tidak aktif */
  font-size: 10px; flex: 1; border: none; background: none; 
  text-align: center; display: flex; flex-direction: column; 
  align-items: center; position: relative; z-index: 10;
  transition: all 0.3s ease;
  position: relative; 
  z-index: 10; /* Pastikan lebih tinggi dari indicator */
  cursor: pointer;
}

.nav-item i { 
  font-size: 20px; margin-bottom: 4px; 
  filter: grayscale(100%) opacity(0.6); /* Ikon abu-abu saat pasif */
  transition: 0.3s ease;
  display: block;
}

/* --- STATE AKTIF --- */
.nav-item.active { 
  color: var(--primary); /* Teks Label TETAP BIRU */
  font-weight: 700; 
}

.nav-item.active i { 
  transform: translateY(-22px); /* Icon naik ke dalam lingkaran float */
  
  /* --- TEKNIK MEMAKSA WARNA EMOJI MENJADI ORANGE TUA --- */
  color: #E67E22 !important; /* Warna Orange Tua */
  
  /* Menghilangkan warna asli emoji dan menggantinya dengan warna pilihan kita */
  filter: sepia(100%) saturate(500%) hue-rotate(350deg) brightness(90%) !important;
  
  /* Efek Glow agar icon terlihat jelas di atas background biru */
  text-shadow: 0px 0px 5px rgba(230, 126, 34, 0.5);
  opacity: 1 !important;
  display: block;
}

#navIndicator {
    position: absolute;
    top: -18px; 
    width: 50px; /* Lebar tetap agar perhitungan center mudah */
    height: 50px;
    background: #0d6efd;
    border-radius: 50%;
    border: 4px solid white; 
    box-shadow: 0 8px 15px rgba(13, 110, 253, 0.25);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1;
    pointer-events: none; /* Tetap supaya bisa diklik tembus */
    left: 0; /* Penting: start dari 0 agar translateX akurat */
}

/* Hapus bagian ::before jika sebelumnya Anda menggunakannya, 
   karena sekarang kita langsung pakai #navIndicator-nya */



  /* --- OVERLAY --- */
  #page-list-buku {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Full layar */
    background-color: #f8f9fa; /* Pastikan tidak transparan */
    z-index: 5000; /* Harus di atas segalanya */
    padding: 20px;
    overflow-y: auto;
}

/* Beri jarak agar judul kategori tidak mepet ke atas */
#page-list-buku h5 {
    margin-top: 50px; 
    margin-bottom: 20px;
    padding-left: 10px;
}

/* Tombol kembali yang lebih jelas */
.btn-back {
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 5100;
    background: white;
    padding: 5px 10px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
}

.auth-modal {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 9999; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.auth-content {
  background: white; width: 100%; max-width: 400px;
  padding: 25px; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.bi-trash3, .bi-x-circle {
    display: inline-block !important;
    visibility: visible !important;
    min-width: 15px;
    min-height: 15px;
}

.fav-exclusive-list {
    margin-top: 10px;
    padding-bottom: 80px; /* Agar tidak tertutup nav bawah */
}

.header-fav-new {
    position: relative;
    padding: 40px 20px 60px 20px;
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1507842217343-583bb7270b66?q=80&w=1000') no-repeat center;
    background-size: cover;
    border-radius: 0 0 30px 30px;
}

/* Pastikan ID circle-feed bisa memanjang tanpa batas */
#circle-feed {
    display: block !important;
    height: auto !important;
    min-height: 100% !important;
    overflow: visible !important;
}

/* Pastikan container pembungkus slide Circle tidak mengunci tinggi */
.swiper-slide:nth-child(3) { /* Jika Circle adalah slide ke-3 */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* --- CONTAINER POSTINGAN --- */
.post-card-custom {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid #f1f5f9; /* Border sangat tipis */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); /* Bayangan halus */
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

/* --- USERNAME TAG --- */
.username-tag {
    background: #f8fafc;
    padding: 3px 10px;
    border-radius: 8px;
    color: #475569;
    font-weight: 700;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

/* --- TOMBOL LIKE CUSTOM (SOFT) --- */
.btn-like-custom {
    background: #f1f5f9; /* Background abu-abu pucat */
    border: none;
    padding: 6px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Keadaan DEFAULT: Hati Putih Bersih */
.btn-like-custom i {
    color: #ffffff; /* Warna putih */
    /* Stroke halus agar bentuk hati terlihat di bg terang */
    -webkit-text-stroke: 1.2px #94a3b8; 
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-like-custom span {
    color: #64748b;
    font-size: 12px;
}

/* Keadaan ACTIVE (Sudah di-Like): Hati Merah */
.btn-like-custom.active {
    background: #fff1f2; /* Merah muda sangat pucat */
}

.btn-like-custom.active i {
    color: #f43f5e; /* Merah Rose */
    -webkit-text-stroke: 0;
    filter: drop-shadow(0 0 5px rgba(244, 63, 94, 0.3));
    transform: scale(1.1);
}

.btn-like-custom.active span {
    color: #be123c;
}

/* --- TOMBOL KOMENTAR SOFT --- */
.text-primary.fw-bold {
    color: #64748b !important; /* Ubah biru terang jadi abu-abu slate */
    background: #f0f9ff;
    padding: 6px 12px;
    border-radius: 12px;
    transition: 0.2s;
}

.text-primary.fw-bold:hover {
    background: #e0f2fe;
    color: #0ea5e9 !important;
}

/* --- UI CIRCLE INDEX PREMIUM (SOFT) --- */

/* 1. Header & Quota Badge */
h5.fw-bold {
    color: #ffffff !important; /* Slate Dark */
    font-size: 1.25rem;
}

h5.fw-bold2 {
    color: #090b67 !important; /* Slate Dark */
    font-size: 1.25rem;
}

#quota-info {
    background: #ffffff !important;
    color: #0d6efd !important;
    border: 1px solid #e2e8f0 !important;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02) !important;
}

/* 2. Card Input (Glassmorphism Soft) */
.card[style*="border-radius: 24px"] {
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow: 0 10px 25px rgba(148, 163, 184, 0.1) !important;
    transition: 0.3s;
}

/* 3. Textarea Input */
#circleInput {
    color: #334155;
    font-weight: 500;
}

#circleInput::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* 4. Tombol Posting */
button[onclick="kirimPostingan()"] {
    background: #0d6efd !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
    transition: all 0.3s ease;
}

button[onclick="kirimPostingan()"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 110, 253, 0.3);
}

/* 5. Tombol Load More (Premium Minimalist) */
#btn-load-more {
    background: white !important;
    color: #64748b !important;
    border: 1px solid #e2e8f0 !important;
    padding: 10px 35px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) !important;
    transition: all 0.3s ease;
}

#btn-load-more:hover {
    background: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #cbd5e1 !important;
    transform: translateY(-1px);
}

/* 6. Background Avatar di Input */
.rounded-circle.bg-light {
    background-color: #f1f5f9 !important; /* Soft Slate */
    color: #94a3b8 !important;
}

/* Menghapus spasi bawaan swiper agar header berwarna bisa penuh ke pinggir */
.mt-n3 { margin-top: -1rem !important; }
.mx-n3 { margin-left: -1rem !important; margin-right: -1rem !important; }

/* Sedikit efek glow pada badge agar terlihat premium */
#quota-info {
    box-shadow: 0 2px 8px rgba(148, 163, 184, 0.08) !important;
}

/* Menghapus celah putih di paling atas slide */
.swiper-slide {
    padding-top: 0 !important;
}

/* Pengaturan warna Header Pastel */
.sticky-top {
    background: #0d6efd !important; /* Warna Biru Pastel Terang */
    box-shadow: 0 4px 12px rgba(92, 103, 163, 0.05); /* Bayangan biru sangat tipis */
}

/* Memastikan margin negatif presisi ke tepi */
.mt-n4 { 
    margin-top: -1rem !important; 
}
.mx-n3 { 
    margin-left: -1rem !important; 
    margin-right: -1rem !important; 
}

.settings-item {
        cursor: pointer;
        transition: background 0.2s;
    }
    .settings-item:active {
        background-color: #f1f5f9;
    }
    .settings-icon {
        width: 35px;
        height: 35px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: bold;
    }


    /* Efek Blur di belakang modal (Glassmorphism) */
    .modal-backdrop.show {
        backdrop-filter: blur(4px);
        background-color: rgba(0, 0, 0, 0.4);
    }

    /* Animasi Modal Muncul dari Bawah (Smooth) */
    .modal.fade .modal-dialog {
        transform: translateY(20px);
        transition: transform 0.3s ease-out;
    }
    .modal.show .modal-dialog {
        transform: translateY(0);
    }

    /* Kustomisasi Input di dalam Modal jika ada form */
    .modal-body input {
        border-radius: 12px;
        padding: 12px;
        border: 1px solid #e2e8f0;
        font-size: 14px;
        transition: all 0.2s;
    }
    .modal-body input:focus {
        border-color: #3b82f6;
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }



</style>