/* ========== CSS VARIABLES LIGHT & DARK ========== */
:root {
    --merah: #e63946;
    --kuning: #ffd166;
    --hijau: #2a9d8f;
    --biru: #1d3557;
    --biru-muda: #a8dadc;
    --abu-soft: #f8f6f0;
    --teks: #2d3e4e;
    --bg-body: #fcfaf7;
    --card-bg: #ffffff;
    --navbar-bg: rgba(255,255,255,0.92);
    --footer-bg: var(--biru);
    --border-color: #f0ebe3;
    --shadow: 0 8px 30px rgba(0,0,0,0.04);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.08);
    --filter-border: #dce4e8;
    --filter-bg: #ffffff;
    --synopsis-color: #4a5a6a;
    --hero-text: white;
    --hero-gradient: linear-gradient(135deg, var(--biru) 0%, var(--biru-muda) 100%);
}

/* Dark mode override */
[data-theme="dark"], #darkmode-toggle:checked ~ .page-wrapper {
    --merah: #ff6b6b;
    --kuning: #ffd166;
    --hijau: #4ecdc4;
    --biru: #6c9bcf;
    --biru-muda: #7fa9b9;
    --abu-soft: #2a2a2a;
    --teks: #f0f3f8;
    --bg-body: #121212;
    --card-bg: #1e1e1e;
    --navbar-bg: rgba(30,30,30,0.95);
    --footer-bg: #1a1a2e;
    --border-color: #404040;
    --shadow: 0 8px 30px rgba(0,0,0,0.3);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.5);
    --filter-border: #404040;
    --filter-bg: #2d2d2d;
    --synopsis-color: #b0b0b0;
    --hero-text: #f0f3f8;
    --hero-gradient: linear-gradient(135deg, #1a3a3a 0%, #2a5a5a 100%);
}

/* Hero */
.hero-ebook {
    background: var(--hero-gradient);
    color: var(--hero-text);
    padding: 5rem 0 3.5rem;
    margin-top: 76px;
    text-align: center;
    border-radius: 0 0 3rem 3rem;
    transition: background 0.3s, color 0.3s;
}
.hero-ebook h1 {
    font-weight: 800;
    font-size: 2.8rem;
    font-family: 'Playfair Display', serif;
}
.hero-ebook p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter / kategori sederhana */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
    margin: 2rem 0 1.5rem;
}
.filter-btn {
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    border: 1px solid var(--filter-border);
    background: var(--filter-bg);
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    color: var(--teks);
    text-decoration: none;
}
.filter-btn:hover {
    border-color: var(--hijau);
    background: rgba(42,157,143,0.05);
    color: var(--hijau);
}
.filter-btn.active {
    background: var(--hijau);
    border-color: var(--hijau);
    color: white;
}

/* Book Cards */
.book-card {
    background: var(--card-bg);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}
.book-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--biru-muda);
}
.book-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: #f0ece4;
    transition: background 0.3s;
}
.book-body {
    padding: 1.2rem 1.2rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.book-title {
    height: 2rem;
    overflow: hidden;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--biru);
    margin-bottom: 0.2rem;
    line-height: 1.3;
    transition: color 0.3s;
}
.book-author {
    font-size: 0.85rem;
    color: #8a9ba8;
    margin-bottom: 0.5rem;
}
.book-synopsis {
    text-align: justify;
    height: 4rem;
    font-size: 0.9rem;
    color: var(--synopsis-color);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}
.book-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--hijau);
    margin-top: 0.8rem;
    transition: color 0.3s;
}
.book-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}
.btn-buy, .btn-edit {
    background: var(--hijau);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.btn-delete {
    background: var(--merah);
    color: white;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    flex: 1;
    justify-content: center;
}

.btn-buy:hover {
    background: #21867a;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(42,157,143,0.25);
    color: white;
}
.btn-detail {
    background: transparent;
    border: 1px solid var(--filter-border);
    color: var(--teks);
    padding: 0.5rem 1.2rem;
    border-radius: 40px;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-detail:hover {
    border-color: var(--biru);
    background: rgba(29,53,87,0.04);
}
.badge-category {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--biru-muda);
    color: var(--biru);
    margin-bottom: 0.5rem;
    align-self: flex-start;
    transition: background 0.3s, color 0.3s;
}

/* Style untuk pagination [citation:6] */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 20px 0;
    gap: 5px;
}

.pagination li {
    display: inline-block;
}

.pagination a {
    display: block;
    padding: 8px 15px;
    text-decoration: none;
    border: 1px solid #ddd;
    color: #007bff;
    border-radius: 5px;
    transition: all 0.3s;
}

.pagination a:hover:not(.active) {
    background-color: #e9ecef;
}

.pagination .active a {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.pagination .disabled a {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
}

.page-info {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
}

/* Animasi */
@keyframes gentleFade {
    0% { opacity: 0; transform: translateY(18px); }
    100% { opacity: 1; transform: translateY(0); }
}
.fade-up {
    animation: gentleFade 0.5s ease forwards;
}
.delay-1 { animation-delay: 0.05s; opacity: 0; }
.delay-2 { animation-delay: 0.1s; opacity: 0; }
.delay-3 { animation-delay: 0.15s; opacity: 0; }
.delay-4 { animation-delay: 0.2s; opacity: 0; }

/* Responsif */
@media (max-width: 768px) {
    .hero-ebook h1 { font-size: 2rem; }
    .hero-ebook { padding: 3.5rem 0 2.5rem; }
    .book-cover { aspect-ratio: 4/5; }
    .darkmode-switch span { display: none; }
    .darkmode-switch { padding: 0.4rem; }
}
@media (max-width: 576px) {
    .hero-ebook h1 { font-size: 1.6rem; }
    .hero-ebook p { font-size: 1rem; }
    .book-actions { flex-direction: column; }
    .btn-buy, .btn-detail { width: 100%; justify-content: center; }
}