/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
nav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem 0;
}

.nav-menu li {
    margin: 0 0.5rem;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    background-color: #667eea;
    color: white;
}

/* Main content */
main {
    padding: 2rem 0;
}

/* Hero section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.hero p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: #666;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.hero-image {
    margin-top: 2rem;
}

.hero-image img {
    max-width: 300px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Chapters grid */
.chapters-overview {
    margin-bottom: 3rem;
}

.chapters-overview h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #333;
}

.chapters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.chapter-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chapter-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.chapter-card h3 {
    margin-bottom: 0.5rem;
}

.chapter-card h3 a {
    text-decoration: none;
    color: #667eea;
    font-size: 1.1rem;
}

.chapter-card h3 a:hover {
    color: #764ba2;
}

.chapter-card p {
    color: #666;
    font-size: 0.95rem;
}

/* About section */
.about {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.about h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.about h3 {
    font-size: 1.3rem;
    margin: 1.5rem 0 0.5rem 0;
    color: #667eea;
}

.about ul {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.about li {
    margin-bottom: 0.5rem;
    color: #666;
}

/* Chapter page styles */
.chapter-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.chapter-content h1 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 2.2rem;
}

.chapter-content h2 {
    color: #667eea;
    margin: 2rem 0 1rem 0;
    font-size: 1.6rem;
}

.chapter-content h3 {
    color: #333;
    margin: 1.5rem 0 0.5rem 0;
    font-size: 1.3rem;
}

.chapter-content p {
    margin-bottom: 1rem;
    color: #555;
    line-height: 1.7;
}

.chapter-content ul, .chapter-content ol {
    margin: 1rem 0 1rem 2rem;
}

.chapter-content li {
    margin-bottom: 0.5rem;
    color: #555;
}

.chapter-content pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
}

.chapter-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.chapter-content pre code {
    background: none;
    padding: 0;
}

.chapter-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.chapter-content blockquote {
    border-left: 4px solid #667eea;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #666;
}

/* Navigation between chapters */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.chapter-nav a {
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.chapter-nav a:hover {
    background-color: #667eea;
    color: white;
}

.chapter-nav .disabled {
    color: #ccc;
    cursor: not-allowed;
}

/* Footer */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* Responsive design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .chapters-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-menu li {
        margin: 0.2rem 0;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .container {
        padding: 0 15px;
    }
}

@media (max-width: 480px) {
    .chapter-content {
        padding: 1rem;
    }
    
    .about {
        padding: 1rem;
    }
    
    .hero {
        padding: 1rem;
    }
}

