body {
    font-family: 'Poppins', sans-serif;
    background-color: #f4f4f4;
    padding-top: 70px;
    /* For fixed navbar */
}

.navbar-default {
    background-color: #fff;
    border-color: #e7e7e7;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: #333 !important;
}

.main-content {
    min-height: 80vh;
    padding-bottom: 40px;
}

/* Ebook Grid */
.ebook-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.ebook-item {
    width: 20%;
    /* 5 items per row on desktop */
    padding: 10px;
    box-sizing: border-box;
}

.ebook-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ebook-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.ebook-cover {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.ebook-info {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.ebook-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ebook-author {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.ebook-category {
    font-size: 10px;
    background: #eee;
    padding: 2px 6px;
    border-radius: 4px;
    align-self: flex-start;
    margin-top: auto;
}

/* Detail Page */
.detail-header {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
}

.detail-cover {
    width: 350px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.detail-info {
    flex: 1;
}

.detail-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.detail-meta {
    color: #666;
    margin-bottom: 15px;
}

.detail-description {
    margin-top: 20px;
    color: #333;
    line-height: 1.6;
    font-size: 14px;
}

.detail-description p {
    margin-bottom: 10px;
}

.chapter-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 10px;
}

.chapter-item {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
}

.chapter-title {
    font-weight: 500;
    color: #333;
}

.chapter-date {
    font-size: 12px;
    color: #999;
}

/* Reading Page */
.reading-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

.reading-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.reading-nav {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 992px) {
    .ebook-item {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .ebook-item {
        width: 33.33%;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-cover {
        width: 350px;
        margin-bottom: 15px;
    }

    .ebook-category {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .ebook-item {
        width: 50%;
    }
}

/* History Styles */
.history-item {
    display: block;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: #333;
}

.history-item-read {
    background-color: #f5f5f5 !important;
}

.history-item-read .chapter-title {
    color: #999;
}

.history-item-read::after {
    content: 'Read';
    font-size: 10px;
    background: #ccc;
    color: #fff;
    padding: 2px 6px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
}

.chapter-title {
    font-weight: 500;
    color: #333;
}

.chapter-date {
    font-size: 12px;
    color: #999;
}

/* Reading Page */
.reading-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

.reading-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.reading-nav {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 992px) {
    .ebook-item {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .ebook-item {
        width: 33.33%;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-cover {
        width: 350px;
        margin-bottom: 15px;
    }

    .ebook-category {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .ebook-item {
        width: 50%;
    }
}

/* History Styles */
.history-item {
    display: block;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: #333;
}

.history-item-read {
    background-color: #f5f5f5 !important;
}

.history-item-read .chapter-title {
    color: #999;
}

.history-item-read::after {
    content: 'Read';
    font-size: 10px;
    background: #ccc;
    color: #fff;
    padding: 2px 6px;
    margin: 0 auto;
}

.reading-nav {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 992px) {
    .ebook-item {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .ebook-item {
        width: 33.33%;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-cover {
        width: 350px;
        margin-bottom: 15px;
    }

    .ebook-category {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .ebook-item {
        width: 50%;
    }
}

/* History Styles */
.history-item {
    display: block;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: #333;
}

.history-item-read {
    background-color: #f5f5f5 !important;
}

.history-item-read .chapter-title {
    color: #999;
}

.history-item-read::after {
    content: 'Read';
    font-size: 10px;
    background: #ccc;
    color: #fff;
    padding: 2px 6px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.chapter-item:last-child {
    border-bottom: none;
}

.chapter-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: inherit;
}

.chapter-title {
    font-weight: 500;
    color: #333;
}

.chapter-date {
    font-size: 12px;
    color: #999;
}

/* Reading Page */
.reading-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    min-height: 100vh;
}

.reading-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.reading-nav {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    background: #f8f8f8;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Responsive */
@media (max-width: 992px) {
    .ebook-item {
        width: 25%;
    }
}

@media (max-width: 768px) {
    .ebook-item {
        width: 33.33%;
    }

    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-cover {
        width: 350px;
        margin-bottom: 15px;
    }

    .ebook-category {
        align-self: center;
    }
}

@media (max-width: 480px) {
    .ebook-item {
        width: 50%;
    }
}

/* History Styles */
.history-item {
    display: block;
    padding: 15px;
    background: #fff;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.history-item:hover {
    background: #f9f9f9;
    text-decoration: none;
    color: #333;
}

.history-item-read {
    background-color: #f5f5f5 !important;
}

.history-item-read .chapter-title {
    color: #999;
}

.history-item-read::after {
    content: 'Read';
    font-size: 10px;
    background: #ccc;
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 10px;
}


/* Category Page Grid */
.category-page-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.category-page-item {
    width: 33.33%;
    padding: 10px;
    box-sizing: border-box;
}

.category-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.2s;
    display: block;
    color: #333;
    text-decoration: none;
}

.category-card:hover {
    transform: translateY(-5px);
    text-decoration: none;
    color: #333;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.category-card h4 {
    margin: 0;
    font-weight: 600;
}

@media (max-width: 768px) {
    .category-page-item {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .category-page-item {
        width: 100%;
    }
}