h2 {
    margin: 20px;
}

.pagination {
    display: flex;
    flex-wrap: wrap; /* Allows wrapping to the next line */
    justify-content: center; /* Centers the links */
    text-align: center;
    margin-top: 20px;
}

.pagination a {
    margin: 5px 5px;
    padding: 8px 16px;
    text-decoration: none;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination a.active {
    background-color: #8576FF;
    color: white;
    border-color: #8576FF;
}

.pagination a:hover {
    background-color: #ddd;
    border-color: #ccc;
}


.book-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start; /* Aligns items to the start (left) */
}

@media (max-width: 390px) {
    .book-container {
        justify-content: center;
    }
}

.book-card {
    flex: 0 1 18%; /* Default for 5 cards per row */
    box-sizing: border-box;
    margin-bottom: 20px; /* Adjust spacing between rows */
}

@media (max-width: 434px) {
    .book-card {
        margin: 5px;
        margin-bottom: 20px;
    }

}

@media (max-width: 434px) {
    .details-button, .star-rating {
        font-size: 20px;
    }
}
@media (max-width: 339px) {
    .details-button, .star-rating {
        font-size: 10px;
    }
}

@media (min-width: 560px) and (max-width: 766px) {
    .back button.details-button {
        font-size: large;
    }
    .back p {
        margin-bottom: 5px;
    }
    .back .book-details h3 {
        font-size: 1.5rem;
        margin: 5px;
    }
}


/* Adjustments for smaller screens */
@media (max-width: 1200px) {
    .book-card {
        flex: 0 1 23%; /* Adjust to 4 per row */
    }
}

@media (max-width: 992px) {
    .book-card {
        flex: 0 1 30%; /* Adjust to 3 per row */
    }
}

@media (max-width: 768px) {
    .book-card {
        flex: 0 1 45%; /* Adjust to 2 per row */
    }
}

/* Ensure 2 cards per row on very small screens */
@media (max-width: 576px) {
    .book-card {
        flex: 0 1 45%; /* 2 cards per row */
    }
}

@media (max-width: 232px) {
    .book-card {
        flex: 0 1 100%; /* 1 card per row */
    }
    .book-details {
        display: flex;
       flex-direction: column;
    }
}

