:root {
    --book-border-radius: 2px 8px 8px 2px;
    --spine-width: 8px;
}
/* ตกแต่งปุ่มให้เหมือนปกหนังสือ */
.book-btn {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border: none;
    border-radius: var(--book-border-radius);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-align: left;
    color: white;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* เอฟเฟกต์สันหนังสือ */
.book-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--spine-width);
    background: linear-gradient(to right, 
        rgba(0,0,0,0.4) 0%, 
        rgba(0,0,0,0.1) 15%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(0,0,0,0.1) 85%, 
        rgba(0,0,0,0.3) 100%);
    z-index: 5;
}

/* แสงเงาความมันเงาบนหน้าปก */
.book-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg, 
        rgba(255,255,255,0.2) 0%, 
        rgba(255,255,255,0) 30%, 
        rgba(0,0,0,0.05) 60%, 
        rgba(0,0,0,0.2) 100%);
    z-index: 2;
}

.book-content {
    position: relative;
    z-index: 10;
    padding: 15px 10px 10px calc(var(--spine-width) + 8px);
    background: linear-gradient(to top, 
        rgba(0,0,0,0.9) 0%, 
        rgba(0,0,0,0.6) 50%, 
        transparent 100%);
    width: 100%;
}

.book-title {
    font-weight: 700;
    font-size: 0.85rem; /* ลดขนาดชื่อเรื่อง */
    margin-bottom: 2px;
    line-height: 1.2;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 0.65rem; /* ลดขนาดชื่อผู้เขียน */
    opacity: 0.85;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-btn:hover {
    transform: translateY(-8px) scale(1.03) rotate(-1deg);
    box-shadow: 10px 15px 25px rgba(0, 0, 0, 0.2);
    color: white;
}

/* Modal Styling */
.modal-content {
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
}

#pdfViewer {
    width: 100%;
    height: 80vh; /* ความสูงของตัวอ่าน PDF */
    border: none;
}