@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    --wood: #211710;
    --wood-light: #38271b;
    --burgundy: #702b35;
    --gold: #c9a45c;
    --gold-light: #e6cb91;
    --cream: #f4ead7;
    --paper: #eee2cc;
    --text: #352719;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    background:
        radial-gradient(ellipse at 10% 15%, rgba(201,164,92,.12), transparent 35%),
        radial-gradient(ellipse at 90% 60%, rgba(112,43,53,.09), transparent 35%),
        #e9dfce;
    overflow-x: hidden;
}

/* NAVBAR */
.navbar {
    background: rgba(33,23,16,.97) !important;
    padding: 17px 0;
    border-bottom: 1px solid rgba(201,164,92,.5);
    box-shadow: 0 5px 25px rgba(0,0,0,.25);
}

.navbar-brand {
    color: var(--gold-light) !important;
    font-family: 'Cinzel', serif;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-link {
    color: #eadcc4 !important;
    transition: .3s ease;
}

.nav-link:hover {
    color: var(--gold-light) !important;
    transform: translateY(-2px);
}

.navbar .btn-light {
    background: var(--gold);
    border: 1px solid var(--gold-light);
    color: var(--wood);
    font-weight: 700;
    border-radius: 30px;
    transition: .3s;
}

.navbar .btn-light:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 5px 18px rgba(201,164,92,.3);
}

/* HERO */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: 105px 0 95px;
    color: var(--cream);
    background:
        linear-gradient(110deg, rgba(25,17,12,.98), rgba(62,35,25,.91)),
        var(--wood);
}

.hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    opacity: .22;
    background-image:
        repeating-linear-gradient(
            90deg,
            transparent 0 75px,
            rgba(201,164,92,.15) 76px 78px,
            transparent 79px 150px
        );
    pointer-events: none;
}

.hero::after {
    content: "BOOKS  •  KNOWLEDGE  •  WISDOM";
    position: absolute;
    z-index: -1;
    right: -35px;
    bottom: 20px;
    color: rgba(230,203,145,.08);
    font-family: 'Cinzel', serif;
    font-size: clamp(30px, 6vw, 85px);
    font-weight: 700;
    white-space: nowrap;
    transform: rotate(-7deg);
}

.hero h1 {
    max-width: 850px;
    color: var(--gold-light);
    font-family: 'Playfair Display', serif;
    font-size: clamp(35px, 5vw, 62px);
    font-weight: 700;
    line-height: 1.2;
    text-shadow: 0 5px 20px rgba(0,0,0,.4);
    animation: riseIn .9s ease both;
}

.hero .lead {
    max-width: 650px;
    color: #e3d4bd;
    line-height: 1.8;
    animation: riseIn 1.1s ease both;
}

/* SEARCH */
.hero .form-control {
    min-height: 55px;
    padding-left: 20px;
    border: 1px solid rgba(230,203,145,.5);
    border-radius: 12px;
    background: #fffaf0;
    box-shadow: 0 8px 25px rgba(0,0,0,.2);
}

.hero .btn-warning {
    min-height: 55px;
    border: 1px solid var(--gold-light);
    border-radius: 12px;
    background: var(--gold);
    color: var(--wood);
    font-weight: 700;
    transition: .3s ease;
}

.hero .btn-warning:hover {
    background: var(--gold-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(201,164,92,.3);
}

/* SECTION KATALOG */
main.container {
    position: relative;
    z-index: 1;
}

main h2 {
    color: #422b1c;
    font-family: 'Playfair Display', serif;
    font-size: 35px;
}

main .text-secondary {
    color: #78654f !important;
}

main .form-select {
    border: 1px solid #c9b58f;
    border-radius: 10px;
    background-color: #fffaf0;
}

/* KARTU BUKU */
.book-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid rgba(150,115,66,.22) !important;
    border-radius: 15px;
    background: linear-gradient(145deg, #fffaf0, #eee1cb);
    box-shadow: 0 8px 22px rgba(55,36,20,.10);
    transform-style: preserve-3d;
    transition:
        transform .4s cubic-bezier(.2,.8,.2,1),
        box-shadow .4s ease;
    animation: cardAppear .7s ease both;
}

.book-card:hover {
    transform: perspective(1000px) translateY(-10px) rotateX(2deg) rotateY(-2deg);
    box-shadow: 0 22px 38px rgba(48,29,15,.22);
}

.book-cover,
.cover-placeholder {
    height: 245px;
    width: 100%;
    object-fit: contain;
    padding: 8px;
    background:
        radial-gradient(circle at center, #fffaf0, #e5d6bd);
    transition: transform .5s ease;
}

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

.cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 65px;
}

.book-card .card-body {
    padding: 20px;
}

.category-badge {
    padding: 7px 12px;
    border: 1px solid rgba(201,164,92,.45);
    border-radius: 30px;
    background: #ead9b8;
    color: #62431f;
    font-weight: 600;
}

.book-card .card-title {
    color: #392619;
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    line-height: 1.5;
}

.book-card .small {
    color: #78654f !important;
}

.book-card .btn-outline-primary {
    border-color: #8d6737;
    color: #765329;
    border-radius: 8px;
    transition: .3s;
}

.book-card .btn-outline-primary:hover {
    border-color: var(--wood);
    background: var(--wood);
    color: var(--gold-light);
    transform: translateY(-2px);
}

.book-card .btn-outline-secondary {
    border-radius: 8px;
}

/* PAGINATION */
.pagination {
    gap: 6px;
}

.page-link {
    border: 1px solid #cbb58e;
    border-radius: 8px !important;
    background: #fff8eb;
    color: #614523;
}

.page-item.active .page-link {
    border-color: var(--wood);
    background: var(--wood);
    color: var(--gold-light);
}

/* PESAN KOSONG */
.alert-info {
    border: 1px solid #c9a45c;
    border-radius: 14px;
    background: #f7ecd7;
    color: #614523;
}

/* FOOTER */
footer {
    position: relative;
    overflow: hidden;
    border-top: 2px solid var(--gold);
    background:
        linear-gradient(rgba(33,23,16,.96), rgba(33,23,16,.98)),
        var(--wood);
    color: var(--cream);
}

footer .fw-bold {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    letter-spacing: 1px;
}

/* ANIMASI */
@keyframes riseIn {
    from {
        opacity: 0;
        transform: translateY(25px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .hero {
        padding: 75px 0 65px;
    }

    .hero h1 {
        font-size: 37px;
    }

    .book-cover,
    .cover-placeholder {
        height: 190px;
    }

    .book-card .card-body {
        padding: 13px;
    }

    .book-card .card-title {
        font-size: 15px;
    }

    main h2 {
        font-size: 28px;
    }
}

/* AKSESIBILITAS: HORMATI PENGATURAN REDUKSI ANIMASI */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* TOMBOL DETAIL BUKU - TEMA PERPUSTAKAAN */
.btn-detail-buku {
    background-color: #5B3927;
    color: #F8F0E3;
    border: 1px solid #5B3927;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0.3px;
    padding: 9px 14px;
    transition: all 0.25s ease;
}

.btn-detail-buku:hover {
    background-color: #8B6246;
    border-color: #8B6246;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(64, 39, 25, 0.2);
}

.btn-detail-buku:focus {
    box-shadow: 0 0 0 0.2rem rgba(139, 98, 70, 0.25);
}
