/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #1e293b;
    background-color: #ffffff;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Crimson Pro', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #5a67d8;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

tr:hover {
    background-color: #f9fafb;
}

tr:last-child td {
    border-bottom: none;
}

/* Responsive tables */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    th, td {
        padding: 8px 12px;
    }
}

/* Hero Section Styles for static pages */
.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    min-height: 50vh;
    display: flex;
    align-items: center;
    text-align: center;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle, .hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.highlight {
    background: linear-gradient(120deg, #a78bfa 0%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 60px 0;
        min-height: 40vh;
    }
    
    .hero-container {
        padding: 0 1rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle, .hero-description {
        font-size: 1.1rem;
    }
}

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

.main-content {
    min-height: calc(100vh - 200px);
}

/* Header Styles */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand .brand-link {
    text-decoration: none;
    color: #1e293b;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.brand-accent {
    color: #667eea;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: #667eea;
}

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 350px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.nav-dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #475569;
    text-decoration: none;
    transition: background-color 0.2s ease;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    font-size: 0.95rem;
}

.dropdown-link:hover {
    background-color: #f8fafc;
    color: #667eea;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 3px;
}

.hamburger {
    width: 20px;
    height: 2px;
    background: #475569;
    transition: all 0.3s ease;
}

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: #475569;
    border: 1px solid #d1d5db;
}

.btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
}

.btn-text {
    background: transparent;
    color: #667eea;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    background: #f1f5f9;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Hero Section */
.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.highlight {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

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

/* Section Styles */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #1e293b;
}

.section-subtitle {
    font-size: 1.25rem;
    text-align: center;
    color: #64748b;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

/* Why Section */
.why-section {
    padding: 100px 0;
    background: #f8fafc;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1e293b;
}

.feature-description {
    color: #64748b;
    line-height: 1.6;
}

/* Books Section */
.books-section {
    padding: 100px 0;
}

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

.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.book-cover {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
}

.cover-number {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.cover-text {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 3px;
}

.book-content {
    padding: 1.5rem;
}

.book-title {
    margin-bottom: 1rem;
}

.book-link {
    color: #1e293b;
    text-decoration: none;
    font-weight: 600;
}

.book-link:hover {
    color: #667eea;
}

.book-description {
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.chapter-count {
    font-size: 0.875rem;
    color: #64748b;
}

.book-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: #f1f5f9;
    color: #475569;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.book-actions {
    display: flex;
    gap: 1rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 100px 0;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-description {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Footer */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 4rem 0 2rem 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

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

.footer-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.footer-subtitle {
    color: white;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-description {
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    color: #94a3b8;
    font-size: 1.5rem;
    transition: color 0.2s ease;
}

.social-link:hover {
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-link {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: white;
}

.footer-text {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #374151;
    color: white;
}

.newsletter-input::placeholder {
    color: #9ca3af;
}

.newsletter-button {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.newsletter-button:hover {
    background: #5a67d8;
}

.footer-bottom {
    border-top: 1px solid #374151;
    margin-top: 2rem;
    padding-top: 2rem;
}

.footer-bottom .footer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    grid-template-columns: none;
    gap: 1rem;
}

.copyright {
    font-size: 0.875rem;
}

.generated-info {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #e2e8f0;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .hamburger:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .hamburger:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .hamburger:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-bottom .footer-container {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-5 { margin-top: 1.25rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }

/* Chapter TOC Styles */
.chapter-toc-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.book-nav-section .sidebar-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    line-height: 1.4;
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.toc-link:hover {
    background-color: #f1f5f9;
    color: #475569;
}

.toc-link.active {
    background-color: #eff6ff;
    color: #2563eb;
    border-left-color: #2563eb;
    font-weight: 500;
}

/* Different levels of TOC headings */
.toc-level-h2 .toc-link {
    font-weight: 500;
    font-size: 0.9rem;
}

.toc-level-h3 .toc-link {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

.toc-level-h4 .toc-link {
    padding-left: 2.25rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.toc-level-h5 .toc-link {
    padding-left: 3rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.toc-level-h6 .toc-link {
    padding-left: 3.75rem;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* Focus styles for accessibility */
*:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .chapter-navigation,
    .related-chapters,
    .chapter-sidebar {
        display: none;
    }
    
    .chapter-content {
        max-width: 100%;
    }
} 