/*
 * PustakaKu frontend styles.
 * Bootstrap 5 dan Bootstrap Icons dimuat dari layout Blade, bukan dari file ini.
 */

:root {
    --library-blue: #1463f3;
    --library-navy: #09275b;
    --library-ink: #15254a;
    --library-muted: #77829a;
    --library-line: #e8edf6;
    --library-sidebar-width: 244px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--library-ink);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    background: #edf2fa;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    min-height: 70vh;
}

.pagination-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}
.pagination-wrapper nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.custom-pagination {
    gap: 8px;
}

.custom-pagination .page-item .page-link {
    min-width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    color: #15254a;
    background: #f4f6fb;
    transition: 0.2s;
}

.custom-pagination .page-item .page-link:hover {
    background: #e5edff;
}

.custom-pagination .page-item.active .page-link {
    background: #1463f3;
    color: #fff;
}

.custom-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}
/* rekomendasi grid */
.recommended-grid {
    display: grid;
    grid-template-columns: repeat(4, 200px);
    gap: 24px;
    justify-content: space-between;
}

.recommended-card {
    width: 200px;
}

.recommended-card .book-cover {
    width: 200px;
    height: 250px; /* sesuaikan kalau mau lebih pendek */
    border-radius: 12px;
    overflow: hidden;
}

.recommended-card .book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recommended-card .book-info {
    padding: 12px 6px;
}

.library-shell a {
    text-decoration: none;
}

/* Shell, sidebar, and top navigation */
.library-shell {
    min-height: 100vh;
    padding-left: var(--library-sidebar-width);
    background: linear-gradient(140deg, #f8faff 0%, #edf2fa 100%);
}

.library-sidebar {
    position: fixed;
    z-index: 1045;
    top: 0;
    bottom: 0;
    left: 0;
    width: var(--library-sidebar-width) !important;
    border: 0;
    color: var(--library-ink);
    background: #fff;
    box-shadow: 3px 0 20px rgba(23, 42, 78, 0.04);
}

.library-sidebar-content {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 34px 22px 20px;
}

.library-sidebar .brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--library-ink);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -1.1px;
}

.library-sidebar .brand i,
.library-sidebar .brand span {
    color: var(--library-blue);
}

.library-sidebar .menu-nav {
    margin-top: 50px;
}

.library-sidebar .menu-caption,
.library-shell .eyebrow {
    margin: 0;
    color: #9aa6bb;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
}

.library-sidebar .menu-link {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 5px 0;
    padding: 11px 13px;
    border-radius: 10px;
    color: #69758b;
    font-size: 14px;
    font-weight: 600;
    transition:
        background-color 0.2s,
        color 0.2s;
}

.library-sidebar .menu-link i {
    width: 18px;
    font-size: 18px;
    text-align: center;
}

.library-sidebar .menu-link:hover,
.library-sidebar .menu-link.active {
    color: var(--library-blue);
    background: #eaf1ff;
}

.library-sidebar-bottom {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid var(--library-line);
}

.library-topbar {
    position: fixed;
    z-index: 1030;
    top: 0;
    right: 0;
    left: var(--library-sidebar-width);
    height: 78px;
    border-bottom: 1px solid var(--library-line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(15px);
}

.library-shell .search-box {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    max-width: 540px;
    height: 42px;
    padding: 0 15px;
    border-radius: 10px;
    color: #8995aa;
    background: #f3f6fc;
}

.library-shell .search-box input {
    width: 100%;
    border: 0;
    outline: 0;
    color: var(--library-ink);
    font-size: 14px;
    background: transparent;
}

.library-shell .notification-btn {
    position: relative;
    border: 0;
    color: var(--library-ink);
    font-size: 20px;
    background: transparent;
}

.library-shell .notification-btn span {
    position: absolute;
    top: -5px;
    right: -7px;
    min-width: 16px;
    height: 16px;
    padding: 1px;
    border-radius: 50%;
    color: #fff;
    font-size: 9px;
    background: #fa4f57;
}

.library-shell .profile-button {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 0;
    color: var(--library-ink);
    font-size: 14px;
    font-weight: 700;
    background: transparent;
}

.library-shell .avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    color: var(--library-blue);
    font-size: 12px;
    font-weight: 800;
    background: #dce8ff;
}

/* Main two-column dashboard */
.library-main {
    min-height: 100vh;
    padding: 102px 32px 32px;
    padding-right: clamp(16px, 2vw, 40px);
    padding-left: clamp(16px, 2vw, 32px);
}

.katalog-buku {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    width: min(100%, 1440px);
    margin: 0 auto;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) clamp(280px, 18vw, 320px);
    gap: clamp(16px, 1.5vw, 24px);
}

.page-content {
    min-width: 0;
}

.welcome-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 145px;
    margin-bottom: 22px;
    padding: 25px 34px;
    overflow: hidden;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(115deg, #0755ea, #2a80ff);
    box-shadow: 0 12px 30px rgba(20, 99, 243, 0.18);
}

.welcome-banner h1 {
    margin: 4px 0 7px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -0.6px;
}

.welcome-banner p:not(.eyebrow) {
    margin: 0;
    font-size: 13px;
    opacity: 0.86;
}

.welcome-banner .eyebrow {
    color: #b9d4ff;
}

.welcome-banner > i {
    margin-right: 20px;
    font-size: 62px;
    opacity: 0.25;
    transform: rotate(-15deg);
}

.content-card {
    margin-bottom: 22px;
    padding: 23px;
    border: 1px solid rgba(224, 230, 241, 0.8);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 24px rgba(40, 64, 113, 0.04);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 19px;
}

.section-heading h2 {
    margin: 4px 0 0;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.link-primary {
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--library-blue);
    font-size: 12px;
    font-weight: 800;
    background: #edf4ff;
}

.btn-icon {
    width: 35px;
    height: 35px;
    border: 0;
    border-radius: 9px;
    color: var(--library-blue);
    background: #edf4ff;
}

/* Book cards */
.book-card {
    height: 100%;
    width: 100%;
    overflow: hidden;
    border: 1px solid #edf0f5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 6px 14px rgba(29, 42, 67, 0.05);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

.book-card:hover {
    box-shadow: 0 11px 22px rgba(29, 42, 67, 0.11);
    transform: translateY(-4px);
}

.book-cover {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: #e9edf3;
}

.book-cover img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.book-info {
    padding: 12px 13px 14px;
}

.book-info h3 {
    margin: 2px 0 5px;
    overflow: hidden;
    color: #26354e;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.book-info p {
    margin: 0;
    overflow: hidden;
    color: var(--library-muted);
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.book-info .book-category {
    color: var(--library-blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.category-pills {
    display: flex;
    gap: 9px;
    padding-bottom: 3px;
    overflow-x: auto;
}

.category-pills button {
    flex: none;
    padding: 7px 14px;
    border: 0;
    border-radius: 8px;
    color: #375078;
    font-size: 13px;
    font-weight: 700;
    background: #edf3fc;
}

.category-pills button.active {
    color: #fff;
    background: var(--library-blue);
}

.collection-card {
    border: 0;
    box-shadow: none;
    width: 200px;
    margin: auto;
}

.collection-card .book-cover {
    width: 100%;
    max-width: 200px;
    height: 250px;
    margin: 0 auto;
}

.collection-card .book-info {
    padding: 10px 1px;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
    text-align: center;
}

.favorite {
    position: absolute;
    top: 9px;
    right: 9px;
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #f65260;
    background: #fff;
    box-shadow: 0 3px 7px #0002;
}

.favorite.active i {
    font-weight: 700;
}

.empty-result {
    margin: 30px 0 5px;
    color: var(--library-muted);
    text-align: center;
}

/* Right-hand book detail */
.book-detail {
    position: sticky;
    top: 102px;
    width: 100%;
    padding: 28px;
    overflow: hidden;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(160deg, #0c3476, #061d48);
    box-shadow: 0 14px 28px rgba(4, 27, 70, 0.17);
}

.detail-cover {
    display: block;
    width: min(100%, 186px);
    height: 248px;
    margin: 0 auto 20px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 12px 25px #00123777;
}

.detail-category {
    margin: 0 0 7px;
    color: #82a7e9;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.book-detail h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
}

.detail-author {
    margin: 4px 0 15px;
    color: #b6c9ee;
    font-size: 13px;
}

.rating {
    font-size: 12px;
}
.rating span {
    color: #ffc62c;
    letter-spacing: 1px;
}

.book-stats {
    display: flex;
    justify-content: space-between;
    margin: 25px 0;
    padding: 16px 0;
    border-block: 1px solid #ffffff2b;
}

.book-stats div {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    padding: 0 6px;
    border-right: 1px solid #ffffff24;
}

.book-stats div:last-child {
    border: 0;
}
.book-stats strong {
    font-size: 14px;
}
.book-stats span {
    margin-top: 3px;
    color: #a9bce0;
    font-size: 10px;
}

.detail-description {
    color: #b8c9e7;
    font-size: 12px;
    line-height: 1.75;
}

.btn-read {
    width: 100%;
    margin-top: 14px;
    padding: 13px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    background: var(--library-blue);
}

.btn-read i {
    margin-right: 7px;
}

.detail-close {
    position: absolute;
    top: 17px;
    right: 18px;
    border: 0;
    color: #fff;
    background: transparent;
}

.library-mobile-footer {
    display: none;
}

/* Responsive */
@media (min-width: 992px) {
    .library-sidebar {
        visibility: visible !important;
        transform: none !important;
    }
}

@media (max-width: 1199.98px) {
    .library-main {
        padding-right: 32px;
    }
    .katalog-buku {
        grid-template-columns: minmax(0, 1fr);
    }
    .book-detail {
        display: none;
    }
    .collection-card .book-cover {
        max-width: 180px;
        height: 225px;
    }
}

@media (max-width: 991.98px) {
    .library-shell {
        padding-bottom: 69px;
        padding-left: 0;
    }

    .library-sidebar {
        width: 280px !important;
    }
    .library-sidebar-content {
        min-height: auto;
    }
    .library-topbar {
        left: 0;
        height: 68px;
    }
    .library-main {
        padding: 89px 16px 22px;
    }

    .library-mobile-footer {
        position: fixed;
        z-index: 1030;
        right: 0;
        bottom: 0;
        left: 0;
        display: flex;
        justify-content: space-around;
        padding: 8px 4px;
        border-top: 1px solid var(--library-line);
        background: #fff;
    }

    .library-mobile-footer a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        color: #8390a7;
        font-size: 10px;
    }

    .library-mobile-footer i {
        font-size: 18px;
    }
    .library-mobile-footer .active {
        color: var(--library-blue);
    }
    .book-cover {
        height: 230px;
    }
}

@media (max-width: 575.98px) {
    .custom-pagination {
        gap: 4px;
        flex-wrap: nowrap;
    }

    .custom-pagination .page-item .page-link {
        min-width: 34px;
        width: 34px;
        height: 38px;
        padding: 4px;
        font-size: 12px;
        border-radius: 8px;
    }

    .library-topbar .container-fluid {
        gap: 10px !important;
    }
    .library-shell .search-box {
        height: 39px;
        padding: 0 10px;
    }
    .library-shell .search-box input {
        font-size: 12px;
    }
    .library-shell .profile-button {
        gap: 0;
    }
    .welcome-banner {
        min-height: 130px;
        padding: 22px;
    }
    .welcome-banner h1 {
        font-size: 21px;
    }
    .welcome-banner > i {
        display: none;
    }
    .content-card {
        padding: 17px;
        border-radius: 14px;
    }
    .section-heading h2 {
        font-size: 19px;
    }
    .book-cover {
        height: 194px;
    }
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .collection-card {
        width: 120px;
    }

    .collection-card .book-cover {
        max-width: 120px;
        height: 160px;
    }

    .collection-card .book-info {
        max-width: 120px;
    }

    .collection-card .book-info {
        max-width: 150px;
    }
}

.library-topbar .container-fluid {
    width: 100%;
}

.library-shell .search-box {
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    margin-left: auto;
}

@media (max-width: 575.98px) {
    .topbar-actions {
        gap: 8px;
    }
}
