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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --dark: #1a1a2e;
    --light: #1a1a1a;
    --text: #e0e0e0;
    --border: #333;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #0d0d0d;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.header-content h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.header-content .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    flex: 1;
    padding: 3rem 2rem;
    background: #0d0d0d;
    color: #e0e0e0;
}

.chapters-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    animation: fadeIn 0.5s ease-in;
    max-width: 800px;
    margin: 0 auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 1.1rem;
}

.chapter-card {
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid var(--border);
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
}

.chapter-card:hover {
    background: #252525;
    border-color: var(--primary);
    transform: translateX(5px);
}

.chapter-header {
    display: flex;
    align-items: center;
    flex: 1;
}

.chapter-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary);
    margin-right: 1rem;
    min-width: 50px;
}

.chapter-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.chapter-meta {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: #aaa;
}

.chapter-size {
    background: #252525;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.chapter-link {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chapter-card:hover .chapter-link {
    opacity: 1;
    color: var(--secondary);
}

.no-chapters {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 2rem;
    background: #1a1a1a;
    border-radius: 12px;
    border: 2px dashed var(--border);
}

.no-chapters p {
    color: #aaa;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.no-chapters code {
    background: #252525;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: "Courier New", monospace;
    color: var(--primary);
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
}

footer p {
    opacity: 0.8;
}

/* Dark theme for chapter pages */
h1 {
    color: #fff !important;
}

p {
    color: #e0e0e0;
}

em {
    color: #aaa;
}

strong {
    color: #e0e0e0;
}

/* Links in dark mode */
a {
    color: #667eea;
}

a:visited {
    color: #764ba2;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 2rem 1rem;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    main {
        padding: 2rem 1rem;
    }

    .chapters-grid {
        gap: 0.25rem;
    }

    .chapter-card {
        padding: 0.75rem 1rem;
    }

    .chapter-number {
        font-size: 1.1rem;
        min-width: 40px;
    }

    .chapter-title {
        font-size: 1rem;
    }
}