/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    margin-bottom: 0.5em;
    color: #333;
}

a {
    text-decoration: none;
    color: #3498db;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* Comments Section Styles */
.comments-section {
    margin-top: 3rem;
    padding: 2rem;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.comments-section h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-primary {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.existing-comments {
    margin-top: 2rem;
}

.existing-comments h4 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.comment {
    background-color: #f8f9fa;
    border-left: 4px solid #3498db;
    padding: 1.5rem;
    margin-bottom: 1rem;
    border-radius: 0 4px 4px 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: #2c3e50;
}

.comment-date {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.comment-text {
    color: #555;
    line-height: 1.6;
}

.comment-text p {
    margin: 0;
}

/* Chapter Image Styles */
.chapter-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Header styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.title-container {
    text-align: center;
    margin-bottom: 1rem;
}

.title-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.2rem;
}

.title-container h2 {
    font-size: 1.5rem;
    font-weight: 400;
    color: #666;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

nav ul li a {
    padding: 0.5rem 1rem;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
}

nav ul li a:hover, nav ul li a.active {
    color: #3498db;
    border-bottom: 2px solid #3498db;
}

/* Main content styles */
main {
    min-height: 70vh;
}

.hero {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.book-cover {
    flex: 1;
    max-width: 300px;
}

.hero-text {
    flex: 2;
}

.hero-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #f8f9fa;
    color: #3498db;
    border: 1px solid #3498db;
}

.btn-secondary:hover {
    background-color: #e9ecef;
}

/* Featured chapters section */
.featured-chapters {
    margin-bottom: 3rem;
}

.featured-chapters h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.chapter-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.chapter-card:hover {
    transform: translateY(-5px);
}

.chapter-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.chapter-card h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.2rem;
}

.chapter-card p {
    padding: 0 1rem;
    margin-bottom: 1rem;
    color: #666;
    height: 100px;
    overflow: hidden;
}

.chapter-card .btn-secondary {
    margin: 0 1rem 1rem;
}

/* Discussion groups section */
.discussion-groups {
    text-align: center;
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 3rem;
}

.discussion-groups h2 {
    margin-bottom: 1rem;
}

.discussion-groups p {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

.group-images {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.group-images img {
    width: 250px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

/* Footer styles */
footer {
    background-color: #333;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}

/* Chapter page specific styles */
.chapter-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.chapter-image {
    flex: 1;
    max-width: 400px;
}

.chapter-image img {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chapter-title {
    flex: 2;
}

.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.nav-buttons {
    display: flex;
    gap: 1rem;
}

.nav-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: white;
}

.nav-button.disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.back-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.chapter-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.chapter-section {
    margin-bottom: 2rem;
}

.chapter-section h3 {
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.chapter-section p, .chapter-section ul {
    font-size: 18px;
}

.chapter-section ul {
    padding-left: 1.5rem;
}

.chapter-section ul li {
    margin-bottom: 0.5rem;
    list-style-type: disc;
}

/* Comments section styles */
.comments-section {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.comments-section h3 {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.comment {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    color: #888;
    font-size: 0.9rem;
}

.comment-text {
    line-height: 1.5;
}

/* Comment form */
.comment-form {
    margin-top: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 150px;
}

/* Chapters list page */
.chapters-list {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 3rem;
}

.chapters-list h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.chapter-list-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid #eee;
}

.chapter-list-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

.chapter-list-item-content h3 {
    margin-bottom: 0.5rem;
}

.chapter-list-item-content p {
    color: #666;
    margin-bottom: 1rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .hero {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        order: 2;
    }
    
    .book-cover {
        order: 1;
    }
    
    .chapter-header {
        flex-direction: column;
        text-align: center;
    }
    
    .group-images {
        flex-direction: column;
        align-items: center;
    }
    
    .chapter-list-item {
        flex-direction: column;
        text-align: center;
    }
}