:root {
    --primary-blue: #3b82f6;
    --dark-bg: #111827;
    --nav-bg: #152035;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #fafafa;
    --star-color: #fbbf24;
}

/* --- RESET & DASAR --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* --- NAVBAR --- */
.navbar {
    background-color: var(--nav-bg);
    color: white;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left { display: flex; align-items: center; gap: 2rem; }
.logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; white-space: nowrap;}
.nav-links { display: flex; gap: 1.5rem; font-size: 0.9rem; }
.nav-links a:hover { color: #9ca3af; }

.search-bar {
    background-color: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    width: 400px;
    max-width: 100%;
}
.search-bar input { background: transparent; border: none; color: white; margin-left: 10px; width: 100%; outline: none; }
.search-bar input::placeholder { color: #9ca3af; }

.nav-right { display: flex; align-items: center; gap: 1.5rem; }
.user-avatar { width: 35px; height: 35px; background: var(--primary-blue); border-radius: 50%; display: flex; justify-content: center; align-items: center; flex-shrink: 0;}

/* --- CONTAINER UTAMA --- */
.container { flex-grow: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 5%; }

/* --- IKLAN --- */
.ad-banner { width: 100%; margin: 0 auto 3rem; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.ad-desktop { display: block; text-align: center; width: 100%; overflow: hidden;}
.ad-mobile { display: none; text-align: center; width: 100%; overflow: hidden;}
.ad-container-side { margin-bottom: 2rem; width: 100%; overflow: hidden; display: flex; justify-content: center;}

/* --- LAYOUT BUKU --- */
.book-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 4rem;
    margin-bottom: 4rem;
}

/* Kolom Kiri */
.book-cover { width: 100%; max-width: 300px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15); margin: 0 auto 1.5rem; }

.action-buttons { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2rem; width: 100%; max-width: 300px; margin-left: auto; margin-right: auto;}

.btn { padding: 1rem; border-radius: 12px; font-weight: 600; text-align: center; cursor: pointer; display: flex; justify-content: center; align-items: center; gap: 10px; transition: 0.2s; border: none; width: 100%;}
.btn-read-group { display: flex; width: 100%; border-radius: 12px; overflow: hidden; }
.btn-primary { background-color: var(--primary-blue); color: white; flex-grow: 1; padding: 1rem; display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: 600; border: none; cursor: pointer;}
.btn-primary:hover { background-color: #2563eb; }
.btn-dropdown { background-color: #2563eb; color: white; border: none; padding: 0 1rem; cursor: pointer; border-left: 1px solid rgba(255,255,255,0.2); }
.btn-dark { background-color: var(--dark-bg); color: white; }
.btn-dark:hover { background-color: #000; }
.secondary-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; width: 100%;}
.btn-outline { border: 1px solid var(--border-color); background: white; color: var(--text-main); width: 100%;}
.btn-outline:hover { background: #f3f4f6; }

/* Kolom Kanan */
.right-col { width: 100%; }
.book-title { font-family: 'Playfair Display', serif; font-size: clamp(2rem, 5vw, 3.5rem); color: #111827; margin-bottom: 0.5rem; line-height: 1.1; word-wrap: break-word;}
.book-subtitle { font-size: clamp(1.2rem, 3vw, 1.5rem); color: var(--text-muted); margin-bottom: 1.5rem; word-wrap: break-word;}

.author-info { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin-bottom: 1.5rem; flex-wrap: wrap;}
.author-img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.author-name { color: var(--primary-blue); font-weight: 600; }

.ratings-wrap { display: flex; align-items: center; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;}
.stars { color: var(--star-color); font-size: 1.2rem; display: flex; gap: 3px;}
.rating-score { font-size: 1.5rem; font-weight: 700;}
.rating-stats { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.05em; font-weight: 600;}

/* Update pada bagian .description */
.description p {
    margin-top: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.description p.expanded {
    display: block;
    -webkit-line-clamp: unset;
}

.show-more {
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 5px;
}

.show-more.hidden {
    display: none;
}

.genres { margin-bottom: 3rem; }
.genre-title { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 1rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.tag { padding: 0.4rem 1rem; border-radius: 20px; background-color: #eff6ff; color: var(--primary-blue); font-size: 0.85rem; font-weight: 500; border: 1px solid #bfdbfe; cursor: pointer;}

.details-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.5rem;
    padding-top: 2rem; border-top: 1px solid var(--border-color); margin-bottom: 2rem; width: 100%;
}
.detail-item p:first-child { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.detail-item p:last-child { font-weight: 600; font-size: 0.95rem; word-break: break-word; }

/* --- SLIDER --- */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; margin-top: 2rem; }
.section-title { font-family: 'Playfair Display', serif; font-size: clamp(1.5rem, 4vw, 1.8rem); }
.see-all { color: var(--primary-blue); font-weight: 600; font-size: 0.9rem; white-space: nowrap;}

.slider-wrapper { position: relative; width: 100%; max-width: 100vw; overflow: hidden; padding: 10px 0 2rem 0;}
.swiper { width: 100%; overflow: visible; padding-bottom: 10px; }

.swiper-slide { 
    width: 160px;
    height: auto; 
    display: flex; 
}

.book-card { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
}

.book-card img { 
    width: 100%; 
    height: 240px; 
    object-fit: cover; 
    border-radius: 8px; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    margin-bottom: 0.8rem; 
    transition: transform 0.2s;
}

.book-card img:hover {
    transform: translateY(-5px);
}

.book-card h4 { 
    font-size: 0.9rem; 
    line-height: 1.3; 
    margin-bottom: 0.2rem; 
    color: var(--text-main); 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
    flex-grow: 1;
}

/* --- FOOTER --- */
.footer-ad-container { width: 100%; overflow: hidden; text-align: center; background-color: var(--bg-light); padding-top: 2rem; }
.site-footer { background-color: var(--bg-light); padding: 3rem 5% 2rem; width: 100%; border-top: 1px solid var(--border-color); margin-top: auto;}
.footer-inner { max-width: 1200px; margin: 0 auto; width: 100%;}
.footer-title { font-size: 1.2rem; font-weight: 700; color: #1f2937; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.footer-disclaimer-text { font-size: 0.95rem; color: #9ca3af; font-style: italic; line-height: 1.6; margin-bottom: 2rem; font-weight: 400; text-align: justify;}
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; border-top: 1px solid #f3f4f6; padding-top: 1.5rem;}
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; }
.footer-links a { color: #9ca3af; font-size: 0.9rem; font-weight: 400; transition: color 0.2s; }
.footer-links a:hover { color: #4b5563; }
.footer-copyright { color: #9ca3af; font-size: 0.9rem; font-weight: 400; }

/* --- WIDGET --- */
.floating-badge {
    position: fixed; bottom: 20px; right: 20px; background-color: #113627; color: white;
    padding: 8px 16px; border-radius: 30px; display: flex; align-items: center; gap: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2); z-index: 999;
}
.live-dot { width: 10px; height: 10px; background-color: #10b981; border-radius: 50%; animation: pulse 2s infinite; flex-shrink: 0;}
.live-stats { display: flex; flex-direction: column; }
.live-count { font-size: 1rem; font-weight: 800; line-height: 1; display: flex; align-items: center; gap: 6px;}
.live-label { font-size: 0.6rem; font-weight: 700; color: #6ee7b7; letter-spacing: 0.05em; margin-top: 2px;}
.badge-live { background: #059669; font-size: 0.6rem; padding: 2px 4px; border-radius: 4px; }
.live-avatars { display: flex; }
.live-avatars img { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #113627; margin-left: -8px; }
.live-avatars img:first-child { margin-left: 0; }

/* --- MEDIA QUERIES --- */
@media (max-width: 900px) {
    .book-layout { grid-template-columns: 1fr; gap: 2rem; }
    .book-cover { margin: 0 auto 1.5rem; }
    .action-buttons { margin: 0 auto 2rem; }
    .search-bar { display: none; }
    .nav-links { display: none; }
    .ad-desktop { display: none; }
    .ad-mobile { display: block; }
    .ratings-wrap { justify-content: center; }
    .author-info { justify-content: center; }
    .book-title, .book-subtitle { text-align: center; }
    .floating-badge { transform: scale(0.9); transform-origin: bottom right; }
}

@media (max-width: 640px) {
    .container { padding: 1.5rem 5%; }
    .swiper-button-next, .swiper-button-prev { display: none !important; }
    .footer-bottom { flex-direction: column; align-items: flex-start; text-align: left;}
    .footer-links { gap: 1rem; }
    .details-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 400px) {
    .details-grid { grid-template-columns: 1fr; }
}