/* Basic reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica', Arial, sans-serif; /* Updated font */
    background-color: #fff;
    color: #333;
    padding-top: 80px;
    padding-bottom: 60px;
}

/* Remove font-family from specific elements */
.navbar,
.category-button,
.book-card,
.footer {
    font-family: inherit; /* Inherits Helvetica from body */
}

/* Fixed Top Navbar Styling */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #313158;
    padding: 8px;
    z-index: 1000;
    box-shadow: 0 4px 0px rgba(0, 0, 0, 0.3);
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: auto;
}

.logo img {
    width: 160px; /* Adjust as needed */
    height: auto; /* Maintain aspect ratio */
    margin: 0 16px;
}

/* Search Input in Navbar */
.navbar .search-input {
    background-color: #fff;
    margin: 0 16px;
    width: 100%;
    max-width: 320px;
    padding: 8px 16px;
    font-size: 1rem;
    border-radius: 24px;
    box-shadow: 0 0 0 1px #ddd;
    border: none;
    outline: none;
}

.navbar .search-input:focus,
.navbar .search-input:hover {
    background-color: #fff;
    box-shadow: 0 0 0 1px rgb(55, 71, 90);
}

/* Category Filter */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}

.category-button {
    color: #131A22;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin: 8px;
    white-space: nowrap;
    font-weight: 600;
}

.category-button:hover,
.category-button.active {
    background-color: #313158;
    color: white;
}

.load-more {
    display: block;
    width: 200px;
    margin: 48px auto;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: #313158;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.load-more:hover {
    background-color: #313158;
}

.load-more:disabled {
    background-color: gray;
    cursor: not-allowed;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 105px;
    right: 20px;
    width: 46px;
    height: 46px;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Books Section */
#books {
    padding: 0 20px;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Books Container with Masonry Layout */
.books-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* 5 columns for large screens */
    grid-auto-rows: 1fr;
    gap: 24px;
    margin-top: 24px;
}

/* Individual Book Card Styling */
.book-card {
    padding: 12px; /* Reduced padding for a more compact layout */
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content:space-between;
    box-shadow: 0 0 0 1px #ddd;
}

.book-card:hover {
    box-shadow: 0 0 0 1px #313158;
}

.book-card img {
    width: 100%;
    height: auto;
    max-height: 400px; /* Adjust as per your design */
    object-fit: cover;
}

.book-card h3 {
    margin-top: 8px;
    font-size: 0.9rem; /* Reduced text size */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card p {
    margin: 4px 0 8px 0;
    font-size: 0.8rem; /* Reduced text size */
    color: #888;
    line-height: 1.4;
}

/* Line Clamping for Description */
.book-card p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Amazon Link Styling */
.amazon-link {
    margin-top: auto;
    display: inline-block;
    color: #313158;
    text-decoration: underline;
    font-weight: bold;
    font-size: 0.9rem; /* Reduced text size */
    text-align: center;
    
}

/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #313158;
    color: #fff;
    text-align: center;
    padding: 8px 20px;
    z-index: 1000;
    font-size: 0.875rem;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

/* Styling for Category Pills */
.category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: left;
    margin-top: 8px;
}

.category-pill {
    background-color: #313158;
    color: #fff; /* Text color */
    padding: 3px 6px; /* Smaller padding */
    font-size: 0.8rem; /* Smaller font size */
    text-transform: capitalize;
}

/* Responsive Design */

/* For medium screens (tablets), display 4 columns */
@media (max-width: 1024px) {
    .books-container {
        grid-template-columns: repeat(4, 1fr); /* 3 columns for medium screens */
    }

    .category-button {
        font-size: 0.9rem;
        padding: 8px 16px;
    }

    .book-card h3 {
        font-size: 1rem; /* Smaller title font for medium screens */
    }

    .book-card p {
        font-size: 0.9rem; /* Smaller description font for medium screens */
    }
}

/* For small screens (smartphones), display 2 columns */
@media (max-width: 768px) {
    .books-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for small screens */
    }

    .category-button {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .book-card h3 {
        font-size: 0.9rem; /* Smaller title font for small screens */
    }

    .book-card p {
        font-size: 0.8rem; /* Smaller description font for small screens */
    }
}

/* For very small screens (mobile phones), display 1 column */
@media (max-width: 480px) {
    .books-container {
        grid-template-columns: repeat(2, 1fr); /* 1 column for very small screens */
    }

    .category-button {
        font-size: 0.8rem;
        padding: 8px 16px;
    }

    .book-card h3 {
        font-size: 0.9rem; /* Smaller title font for very small screens */
    }

    .book-card p {
        font-size: 0.8rem; /* Smaller description font for very small screens */
    }
}

/*test*/