/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #8b7355;
    --light-accent: #f4f2f0;
    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --text-muted: #7f8c8d;
    --background: #fefcfa;
    --sidebar-bg: #f8f6f3;
    --border-color: #e8e6e3;
    --shadow: rgba(44, 62, 80, 0.1);
    
    --font-primary: 'Crimson Text', serif;
    --font-secondary: 'Inter', sans-serif;
    
    --sidebar-width: 320px;
    --content-max-width: 800px;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 18px;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 2rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.nav-header {
    padding: 0 2rem 2rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.book-title {
    font-family: var(--font-primary);
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-subtitle {
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 300;
}

.nav-content {
    padding: 0 1rem;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-family: var(--font-secondary);
    font-weight: 400;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-item:hover .nav-link,
.nav-item.active .nav-link {
    background-color: var(--light-accent);
    color: var(--primary-color);
}

.nav-item.active .nav-link {
    font-weight: 500;
}

.nav-sublist {
    list-style: none;
    margin-top: 0.5rem;
    margin-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.nav-subitem {
    padding: 0.4rem 0 0.4rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    font-family: var(--font-secondary);
}

.nav-subitem:hover,
.nav-subitem.active {
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem;
}

.content-wrapper {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

#content-area {
    background-color: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
    margin-bottom: 2rem;
    min-height: 500px;
}

/* Typography */
#content-area h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    line-height: 1.3;
    font-weight: 600;
}

#content-area h2 {
    font-size: 2rem;
    color: var(--secondary-color);
    margin: 2.5rem 0 1.5rem;
    line-height: 1.4;
    font-weight: 600;
}

#content-area h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 2rem 0 1rem;
    font-weight: 600;
}

#content-area p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

#content-area blockquote {
    background-color: var(--light-accent);
    border-left: 4px solid var(--accent-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

#content-area blockquote p {
    margin-bottom: 0.5rem;
}

#content-area blockquote p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: right;
}

#content-area ul, #content-area ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

#content-area li {
    margin-bottom: 0.5rem;
}

#content-area em {
    font-style: italic;
    color: var(--accent-color);
}

#content-area strong {
    font-weight: 600;
    color: var(--primary-color);
}

#content-area hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 3rem 0;
}

#content-area a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

#content-area a:hover {
    border-bottom-color: var(--accent-color);
}

/* Content Navigation */
.content-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(254, 252, 250, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 280px;
    }
    
    .main-content {
        padding: 2rem;
    }
    
    #content-area {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        padding: 1rem 0;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    #content-area {
        padding: 1.5rem;
    }
    
    .nav-header {
        text-align: center;
        padding: 1rem;
    }
    
    .book-title {
        font-size: 1.5rem;
    }
    
    #content-area h1 {
        font-size: 2rem;
    }
    
    #content-area h2 {
        font-size: 1.5rem;
    }
}

/* Special styling for scripture quotes */
.scripture {
    text-align: center;
    font-style: italic;
    color: var(--accent-color);
    margin: 2rem 0;
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* Table of contents styling */
.toc {
    background: var(--light-accent);
    padding: 2rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.toc h2 {
    margin-top: 0;
    color: var(--primary-color);
}

.toc ul {
    margin-left: 1rem;
}

.toc a {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Addendums Section */
.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 1rem;
}

.addendums-section {
    padding: 0 1rem;
    margin-top: 1rem;
}

.addendums-title {
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.addendum-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.08), rgba(139, 115, 85, 0.15));
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 0.75rem;
}

.addendum-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(139, 115, 85, 0.2);
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.12), rgba(139, 115, 85, 0.2));
}

.addendum-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.addendum-text {
    flex: 1;
}

.addendum-text strong {
    display: block;
    color: var(--primary-color);
    font-family: var(--font-secondary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.addendum-text p {
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

/* Fade-in animation for content loading */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} 