/* Books Grid Layout */
.books-grid {
    display: grid;
    grid-gap: 25px;
    margin-bottom: 30px;
}

.books-columns-1 {
    grid-template-columns: 1fr;
}

.books-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.books-columns-3 {
    grid-template-columns: repeat(2, 1fr);
    /* Force 2 columns for better card display */
}

.books-columns-4 {
    grid-template-columns: repeat(2, 1fr);
    /* Force 2 columns for better card display */
}

/* List Layout */
.books-layout-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.books-layout-list .book-item {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.books-layout-list .book-cover {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
}

.books-layout-list .book-details {
    width: 100%;
    text-align: center;
}

/* Book Item Styling - Horizontal Card Layout */
.book-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    min-height: 220px;
}

.book-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* Book Cover - Left Side */
.book-cover {
    flex: 0 0 180px;
    width: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border-right: 1px solid #e0e0e0;
}

.book-cover img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* Book Details - Right Side */
.book-details {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.book-title {
    margin: 0 0 12px 0;
    font-size: 1.25em;
    font-weight: 600;
    line-height: 1.4;
    color: #2c3e50;
}

.book-meta-category {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-bottom: 10px;
    font-weight: 500;
}

.book-short-description {
    font-size: 0.92em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-short-description p {
    margin: 0;
}

.book-license {
    font-size: 0.82em;
    color: #95a5a6;
    margin-bottom: 12px;
    font-style: italic;
}

.book-actions {
    margin-top: auto;
}

.book-download-link {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.92em;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.book-download-link:hover {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
    transform: translateY(-1px);
}

/* Pagination */
.books-pagination {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.books-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #555;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.books-pagination .page-numbers:hover {
    background-color: #f8f9fa;
    border-color: #27ae60;
    color: #27ae60;
}

.books-pagination .page-numbers.current {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: #fff;
    border-color: #27ae60;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .book-item {
        flex-direction: column;
        min-height: auto;
    }

    .book-cover {
        flex: 0 0 auto;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        padding: 20px;
    }

    .book-cover img {
        max-width: 200px;
        margin: 0 auto;
    }

    .book-details {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-gap: 20px;
    }

    .book-details {
        padding: 15px;
    }

    .book-title {
        font-size: 1.1em;
    }

    .book-download-link {
        width: 100%;
        text-align: center;
    }
}