/* GENERAL */

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* NAVBAR */

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    height: 70px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 24px;
    color: #002d62; 
    cursor: pointer;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: #555555;
    font-size: 14px;
    font-weight: 500;
    padding-bottom: 6px;
    transition: color 0.3s ease;
}

.nav-links a.active {
    color: #000000;
    font-weight: bold;
    border-bottom: 2px solid #000000;
}

.nav-links a:hover:not(.active) {
    color: #000000;
}

.search-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-container input {
    width: 280px;
    padding: 8px 12px 8px 35px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    outline: none;
    background-color: #ffffff;
}

.search-container input::placeholder {
    color: #999999;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #777777;
    font-size: 14px;
    pointer-events: none;
}

/* HEADER/HERO.MAIN */

.hero-section {
    position: relative;
    width: 100%;
    height: 450px; /* Sesuaikan tinggi banner */
    /* Menggunakan gambar latar belakang perpustakaan (ganti URL jika memakai file lokal) */
    background-image: url('../image/Bg_Library.jpg');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5); 
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero-content {
    max-width: 800px;
    color: #ffffff;
}

.hero-content h1 {
    font-family: 'Georgia', serif;
    font-size: 42px;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.hero-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
    font-weight: 300;
}


.category-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    background-color: #ffffff;
}

.category-btn {
    border: none;
    padding: 8px 24px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px; 
    cursor: pointer;
    background-color: #eef2f3; 
    color: #333333;
    transition: all 0.3s ease;
}

.category-btn.active {
    background-color: #000000;
    color: #ffffff;
}

.category-btn:hover:not(.active) {
    background-color: #dddddd;
}

.popular-collection {
    padding: 20px 60px 60px 60px;
    background-color: #ffffff;
}

/* SECTION / GRID  */

.collection-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 35px;
}

.header-text h2 {
    font-family: 'Georgia', serif;
    font-size: 28px;
    color: #002d62;
    margin-bottom: 6px;
}

.header-text p {
    font-size: 14px;
    color: #666666;
}

.layout-toggles {
    display: flex;
    gap: 8px;
}

.toggle-btn {
    background-color: #ffffff;
    border: 1px solid #dddddd;
    color: #666666;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.toggle-btn.active, .toggle-btn:hover {
    background-color: #f1f5f9;
    color: #000000;
    border-color: #bbbbbb;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 25px;
    row-gap: 40px;
}

.book-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.book-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4; 
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.03); 
}

.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #d97706; 
    color: #ffffff;
    font-size: 10px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.book-info h3 {
    font-family: 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 3px;
    cursor: pointer;
}

.book-info h3:hover {
    color: #002d62;
}

.book-info .author {
    font-size: 13px;
    color: #777777;
    margin-bottom: 6px;
}

.book-info .rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.book-info .stars {
    color: #fbbf24; 
    font-size: 13px;
}

.book-info .rating-count {
    color: #999999;
    font-size: 11px;
}

.book-info .price {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}

.load-more-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    background-color: #ffffff;
    margin-top: 50px;
}

.load-more-btn {
    background-color: #ffffff;
    color: #002d62; 
    border: 2px solid #002d62;
    padding: 12px 35px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 25px; 
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

/* Efek Hover saat tombol didekati mouse */
.load-more-btn:hover {
    background-color: #002d62;
    color: #ffffff; 
    box-shadow: 0 6px 12px rgba(0, 45, 98, 0.2); 
    transform: translateY(-2px); 
}

.load-more-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* ==================== CATEGORY ROW STYLE ==================== */

.category-section {
    padding: 20px 60px;
    background-color: #ffffff;
}

.category-row {
    margin-bottom: 50px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eeeeee;
    padding-bottom: 12px;
    margin-bottom: 25px;
}

.category-header h2 {
    font-family: 'Georgia', serif;
    font-size: 26px;
    color: #111111;
    font-weight: bold;
}

.see-all-btn {
    font-size: 13px;
    color: #555555;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s ease;
}

.see-all-btn i {
    font-size: 10px;
}

.see-all-btn:hover {
    color: #002d62;
}

.book-grid-minimal {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 25px;
}

.book-card-min {
    display: flex;
    flex-direction: column;
}

.book-cover-min {
    width: 100%;
    aspect-ratio: 3 / 4;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
    background-color: #f9f9f9;
}

.book-cover-min img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card-min:hover .book-cover-min img {
    transform: scale(1.02);
}

.book-info-min h3 {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 4px;
    line-height: 1.3;
}

.book-info-min .author {
    font-size: 12px;
    color: #888888;
    margin-bottom: 5px;
}

.book-info-min .price {
    font-size: 13px;
    font-weight: 700;
    color: #000000;
}

/* PAGINATION */

.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 40px 0 60px 0; 
    background-color: #ffffff;
}

.page-num, .page-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    color: #555555;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

.page-num:hover:not(.active), .page-arrow:hover:not(.disabled) {
    background-color: #f5f5f5;
    color: #000000;
    border-color: #bbbbbb;
}

.page-num.active {
    background-color: #000000; 
    color: #ffffff;
    border-color: #000000;
    cursor: default;
}

.page-arrow.disabled {
    color: #cccccc;
    background-color: #fafafa;
    border-color: #eeeeee;
    cursor: not-allowed;
    pointer-events: none; 
}

.page-dots {
    color: #999999;
    font-size: 14px;
    padding: 0 4px;
    letter-spacing: 2px;
}

/* ==================== BOOK DETAIL PAGE STYLE ==================== */

.book-detail-section {
    padding: 30px 60px;
    background-color: #f8f9fa;
    min-height: calc(100vh - 70px);
}

.back-navigation {
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px; 
    text-decoration: none;
    color: #555555;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 6px 0;
}

.back-btn:hover {
    color: #000000;
    transform: translateX(-3px);
}

.back-btn i {
    font-size: 14px;
}

.detail-container {
    display: flex;
    gap: 50px;
    max-width: 1200px;
}

.detail-left {
    flex: 0 0 300px; 
}

.cover-preview-box {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: #dbe0f5;
    border-radius: 6px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.placeholder-icon {
    font-size: 48px;
    color: #9ca3af;
}

.detail-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.title-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.title-header h1 {
    font-family: 'Georgia', serif;
    font-size: 36px;
    color: #111111;
    font-weight: bold;
}

.book-author {
    font-size: 15px;
    color: #555555;
    margin-bottom: 15px;
}

.book-author span {
    font-weight: bold;
    color: #111111;
}

.meta-rating-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #666666;
    margin-bottom: 25px;
}

.divider {
    color: #cccccc;
    margin: 0 4px;
}

.publish-date {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #555555;
}

.book-price-tag {
    font-family: 'Georgia', serif;
    font-size: 38px;
    font-weight: bold;
    color: #111111;
    margin-bottom: 20px;
}

.tags-container {
    display: flex;
    gap: 10px;
    margin-bottom: 80px; 
}

.genre-tag {
    background-color: #e5e7eb;
    color: #4b5563;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 16px;
    border-radius: 15px;
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 600px;
}

.btn-add-collection {
    flex: 1;
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
}

.btn-add-collection:hover {
    background-color: #222222;
}

.btn-read-preview {
    flex: 1;
    background-color: transparent;
    color: #000000;
    border: 1px solid #000000;
    padding: 14px 20px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: background-color 0.2s;
}

.btn-read-preview:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.synopsis-container {
    max-width: 1200px;
    margin-top: 50px; 
    padding-top: 30px;
    border-top: 1px solid #e5e7eb; 
    background-color: transparent;
}

/* Judul Sinopsis */
.synopsis-container h2 {
    font-family: 'Georgia', serif;
    font-size: 24px;
    color: #111111;
    font-weight: bold;
    margin-bottom: 20px;
}

.synopsis-content p {
    font-size: 15px;
    line-height: 1.75; 
    color: #4b5563; 
    margin-bottom: 20px; 
    text-align: justify;
}

.synopsis-content p:last-child {
    margin-bottom: 0;
}

/* ==================== FOOTER STYLE ==================== */

.main-footer {
    width: 100%;
    background-color: #e5e7eb; 
    padding: 30px 60px;
    border-top: 1px solid #d1d5db;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-logo {
    font-family: 'Georgia', serif;
    font-weight: bold;
    font-size: 22px;
    color: #000000;
}

.footer-copyright {
    font-size: 13px;
    color: #555555;
    font-weight: 400;
}

.footer-links {
    display: flex;
    list-style: none;
    gap: 30px; 
}

.footer-links a {
    text-decoration: none;
    color: #555555;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #000000;
}

/* MEDIA QUARY */

@media (max-width: 768px) {
    .synopsis-container {
        margin-top: 35px;
        padding-top: 20px;
    }
    
    .synopsis-container h2 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .synopsis-content p {
        font-size: 14px;
        line-height: 1.65;
    }
}

@media (max-width: 768px) {
    .book-detail-section {
        padding: 20px;
    }
    .detail-container {
        flex-direction: column;
        gap: 30px;
    }
    .detail-left {
        flex: none;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }
    .tags-container {
        margin-bottom: 40px;
    }
    .action-buttons-row {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .main-footer {
        padding: 30px 20px;
    }
    
    .footer-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 25px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 1024px) {
    .book-grid-minimal {
        grid-template-columns: repeat(3, 1fr);
    }
    .book-card-min:last-child {
        display: none; /* Menyembunyikan buku ke-4 di layar tablet */
    }
}

@media (max-width: 768px) {
    .category-section {
        padding: 20px;
    }
    .book-grid-minimal {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 15px;
    }
    .book-card-min:nth-child(3) {
        display: none; /* Menyembunyikan buku ke-3 di layar HP */
    }
}

@media (max-width: 1024px) {
    .book-grid {
        grid-template-columns: repeat(3, 1fr); 
    }
}

@media (max-width: 768px) {
    .popular-collection {
        padding: 20px 20px;
    }
    .book-grid {
        grid-template-columns: repeat(2, 1fr); 
        column-gap: 15px;
    }
}