/* --- KATALOG BUKU --- */
.book-grid {
    display: grid;
    /* Tetap menggunakan Grid agar tidak scroll ke samping */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); 
    gap: 25px;
    margin-top: 20px;
    padding: 10px;
}

.book-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-sizing: border-box;

    /* STROKE & SHADOW */
    border: 1px solid #b8c5d3; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    
    /* Efek Hover Smooth */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2); 
    border-color: #d1d9e2;
}

.book-card img {
    width: 100%;
    height: 300px; 
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.book-info h4 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-info p {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 15px;
}

.status {
    display: inline-block;
    width: 90%;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 auto 15px auto; 
    text-align: center; 
    box-sizing: border-box;
}

.status.tersedia { 
    background-color: #e8f5e9 !important; 
    color: #155724 !important; 
}

.status.dipinjam { 
    background-color: #ffebee !important; 
    color: #721c24 !important; 
}

/* Tombol Detail di Katalog */
.btn-detail {
    display: block;
    background: #3498db;
    color: white;
    padding: 10px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: bold;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.btn-detail:hover {
    background: #2980b9;    
    transform: scale(1.05); 
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* --- DETAIL BUKU --- */
.detail-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

.kolom-gambar {
    flex: 1;
    max-width: 350px;
}

.detail-info {
    flex: 2;
}

.detail-container img {
    width: 100%;
    height: auto;
    max-width: 350px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-back {
    display: inline-block;
    margin-bottom: 15px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: all 0.3s ease; /* Animasi halus 0.3 detik */
    padding: 5px 10px;
    border-radius: 5px;
}

/* Efek saat kursor menyentuh tombol (Hover) */
.btn-back:hover {
    color: #ff0000; /* Berubah menjadi merah */
    transform: translateX(-5px); /* Animasi sedikit bergeser ke kiri */
    background-color: #ffff; /* Background merah sangat muda agar lebih manis */
}

/* Container untuk memusatkan tombol */
.wa-container {
    text-align: left;
    margin-top: 25px;
}

.btn-wa-custom {
    display: inline-flex;
    flex-direction: column; /* Membuat ikon di atas teks */
    align-items: center;
    text-decoration: none;
    gap: 10px;
    transition: all 0.3s ease;
}

/* Lingkaran Ikon WhatsApp */
.wa-icon-circle {
    width: 60px;
    height: 60px;
    background-color: #555; /* Warna abu-abu gelap sesuai gambar awal */
    border-radius: 50%; /* Membuat desain bulat sempurna */
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 31px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Teks di bawah ikon */
.wa-text {
    color: #333;
    font-weight: bold;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

/* --- EFEK SAAT DISENTUH (HOVER) --- */
.btn-wa-custom:hover .wa-icon-circle {
    background-color: #25d366; /* Langsung berubah hijau WhatsApp */
    transform: scale(1.1); /* Sedikit membesar */
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.4);
}

.btn-wa-custom:hover .wa-text {
    color: #25d366; /* Teks juga ikut berubah hijau */
}

@media (max-width: 768px) {
    .detail-container { flex-direction: column; align-items: center; text-align: center; }
}

/* ==========================================================================
   PUBLIC VIEW PAGINATION SYSTEM (KATALOG BUKU)
   ========================================================================== */
.custom-pagination-wrapper {
    margin-top: 50px;
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Mengamankan elemen nav dan membuang list peluru bawaan */
.custom-pagination-wrapper nav,
.custom-pagination-wrapper ul,
.custom-pagination-wrapper li {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: inline-flex !important;
    gap: 6px; /* Jarak manis antar kotak tombol */
}

/* Merapikan kotak angka & tombol Next/Prev */
.custom-pagination-wrapper .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px; /* Sudut melengkung halus, serasi dengan kartu */
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* Efek Hover ketika kursor menyentuh tombol */
.custom-pagination-wrapper .page-item a.page-link:hover {
    background-color: #5F9AEA;
    color: #ffffff !important;
    border-color: #5F9AEA;
    transform: translateY(-2px); /* Efek terangkat sedikit seperti kartu buku */
    box-shadow: 0 4px 12px rgba(95, 154, 234, 0.25);
}

/* Penanda halaman aktif yang sedang dibuka pembaca */
.custom-pagination-wrapper .page-item.active .page-link {
    background-color: #5F9AEA !important;
    border-color: #5F9AEA !important;
    color: #ffffff !important;
    box-shadow: 0 4px 10px rgba(95, 154, 234, 0.2);
    cursor: default;
}

/* Kondisi saat tombol mati (Disabled) seperti tombol Prev di halaman 1 */
.custom-pagination-wrapper .page-item.disabled .page-link {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}