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

/* CSS Variables for theming */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --warning-color: #43e97b;
    --danger-color: #fa709a;
    --text-color: #1a202c;
    --text-light: #4a5568;
    --bg-color: #ffffff;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --code-bg: #f7fafc;
    --code-color: #d63384;
    --header-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --nav-bg: #f8fafc;
    --modal-bg: #ffffff;
    --modal-text: #1a202c;
    --modal-border: #e2e8f0;
    --title-color: #2d3748;
    --subtitle-color: #4a5568;
}

[data-theme="dark"] {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #4facfe;
    --warning-color: #43e97b;
    --danger-color: #fa709a;
    --text-color: #f7fafc;
    --text-light: #e2e8f0;
    --bg-color: #1a202c;
    --card-bg: #2d3748;
    --border-color: #4a5568;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --code-bg: #4a5568;
    --code-color: #fbbf24;
    --header-bg: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    --nav-bg: #2d3748;
    --modal-bg: #2d3748;
    --modal-text: #f7fafc;
    --modal-border: #4a5568;
    --title-color: #f7fafc;
    --subtitle-color: #e2e8f0;
}

/* Apply theme variables */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    transition: all 0.3s ease;
}

/* RTL Support */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .container {
    direction: rtl;
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: var(--text-color);
}

/* Header */
.header {
    text-align: center;
    padding: 60px 0;
    background: var(--header-bg);
    color: white;
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    z-index: 1;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.95;
    position: relative;
    z-index: 2;
    color: white;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--nav-bg);
    border-radius: 15px;
    box-shadow: 0 4px 6px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.nav h2 {
    color: var(--title-color);
    margin: 0;
    font-weight: 600;
}

.nav-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 0;
    background: var(--header-bg);
    color: white;
    border-radius: 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.logo {
    margin-bottom: 20px;
}

.logo-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.title {
    font-size: 3rem;
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 800;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.95;
    color: white;
    margin-bottom: 30px;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
}

.stat {
    text-align: center;
    color: white;
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Content Sections */
.content {
    color: var(--text-color);
}

.parts-section h2,
.features-section h2 {
    color: var(--title-color);
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 700;
}

/* Parts Grid */
.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Part Cards with better theming */
.part-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.part-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.part-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.part-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--title-color);
    font-weight: 700;
}

.part-card p {
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 1rem;
}

.part-chapters {
    color: var(--primary-color);
    font-weight: 600;
}

/* Dark mode specific overrides for part cards */
[data-theme="dark"] .part-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .part-card h3 {
    color: #f7fafc;
}

[data-theme="dark"] .part-card p {
    color: #cbd5e0;
}

/* Light mode specific overrides for part cards */
[data-theme="light"] .part-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .part-card h3 {
    color: #2d3748;
}

[data-theme="light"] .part-card p {
    color: #4a5568;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 6px var(--shadow-color);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.feature h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--title-color);
    font-weight: 600;
}

.feature p {
    color: var(--text-light);
    line-height: 1.6;
    font-size: 0.95rem;
}

/* Dark mode specific overrides for better visibility */
[data-theme="dark"] .feature {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .feature h3 {
    color: #f7fafc;
}

[data-theme="dark"] .feature p {
    color: #cbd5e0;
}

/* Light mode specific overrides for better contrast */
[data-theme="light"] .feature {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .feature h3 {
    color: #2d3748;
}

[data-theme="light"] .feature p {
    color: #4a5568;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px 0;
    color: white;
    opacity: 0.8;
}

/* Chapter Page Styles */
.chapter-page {
    background: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    padding: 40px 0;
}

.chapter-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.chapter-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 20px;
    margin-bottom: 40px;
}

.chapter-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.chapter-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.chapter-meta span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* Enhanced Chapter Content Styles */
.chapter-text {
    line-height: 1.8;
    font-size: 1.1rem;
    margin-bottom: 30px;
    color: var(--text-color);
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-text h1 {
    color: var(--primary-color);
    margin: 40px 0 25px 0;
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    background: var(--header-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInFromTop 0.8s ease-out;
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-text h2 {
    color: var(--primary-color);
    margin: 35px 0 20px 0;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    position: relative;
    animation: slideInFromLeft 0.6s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.chapter-text h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
    animation: expandWidth 0.8s ease-out 0.3s both;
}

@keyframes expandWidth {
    from {
        width: 0;
    }
    to {
        width: 50px;
    }
}

.chapter-text h3 {
    color: var(--primary-color);
    margin: 30px 0 15px 0;
    font-size: 1.2rem;
    font-weight: 600;
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    position: relative;
    animation: slideInFromLeft 0.6s ease-out 0.2s both;
}

.chapter-text h3::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    animation: expandHeight 0.6s ease-out 0.4s both;
}

@keyframes expandHeight {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

.chapter-text p {
    margin-bottom: 20px;
    text-align: justify;
    line-height: 1.8;
    color: var(--text-color);
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.chapter-text ul, .chapter-text ol {
    margin: 20px 0;
    padding-left: 30px;
    animation: slideInFromRight 0.6s ease-out 0.2s both;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

[dir="rtl"] .chapter-text ul, [dir="rtl"] .chapter-text ol {
    padding-left: 0;
    padding-right: 30px;
}

.chapter-text li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.chapter-text li:hover {
    transform: translateX(5px);
    color: var(--primary-color);
}

.chapter-text li::marker {
    color: var(--primary-color);
}

/* Enhanced Code Blocks with animations */
.code-block {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
    animation: scaleIn 0.6s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.code-block:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px var(--shadow-color);
}

.code-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 12px 12px 0 0;
    animation: expandWidth 0.8s ease-out;
}

.code-block pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-color);
    direction: ltr;
    text-align: left;
}

.code-block code {
    color: var(--code-color);
    font-weight: bold;
}

/* Inline Code with hover effects */
.chapter-text code {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.chapter-text code:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* Enhanced Text Formatting with animations */
.chapter-text strong {
    font-weight: 700;
    color: var(--text-color);
    background: linear-gradient(120deg, transparent 0%, rgba(102, 126, 234, 0.1) 100%);
    padding: 2px 4px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.chapter-text strong:hover {
    background: linear-gradient(120deg, transparent 0%, rgba(102, 126, 234, 0.2) 100%);
    transform: translateY(-1px);
}

.chapter-text em {
    font-style: italic;
    color: var(--text-color);
    border-bottom: 1px solid var(--accent-color);
    transition: all 0.3s ease;
}

.chapter-text em:hover {
    color: var(--accent-color);
    border-bottom-color: var(--primary-color);
}

/* Blockquotes with animations */
.chapter-text blockquote {
    border-left: 4px solid var(--primary-color);
    margin: 20px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-light);
    animation: slideInFromLeft 0.6s ease-out 0.3s both;
    transition: all 0.3s ease;
}

.chapter-text blockquote:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transform: translateX(5px);
}

/* Tables with animations */
.chapter-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px var(--shadow-color);
    animation: slideInFromBottom 0.6s ease-out;
}

@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chapter-text th {
    background: var(--primary-color);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    transition: all 0.3s ease;
}

.chapter-text th:hover {
    background: var(--secondary-color);
}

.chapter-text td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
    transition: all 0.3s ease;
}

.chapter-text tr:nth-child(even) {
    background: rgba(102, 126, 234, 0.05);
}

.chapter-text tr:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

/* Staggered animations for list items */
.chapter-text li {
    animation: fadeInUp 0.6s ease-out;
}

.chapter-text li:nth-child(1) { animation-delay: 0.1s; }
.chapter-text li:nth-child(2) { animation-delay: 0.2s; }
.chapter-text li:nth-child(3) { animation-delay: 0.3s; }
.chapter-text li:nth-child(4) { animation-delay: 0.4s; }
.chapter-text li:nth-child(5) { animation-delay: 0.5s; }
.chapter-text li:nth-child(6) { animation-delay: 0.6s; }
.chapter-text li:nth-child(7) { animation-delay: 0.7s; }
.chapter-text li:nth-child(8) { animation-delay: 0.8s; }
.chapter-text li:nth-child(9) { animation-delay: 0.9s; }
.chapter-text li:nth-child(10) { animation-delay: 1.0s; }

/* Navigation */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.nav-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .stats {
        gap: 20px;
    }
    
    .stat {
        min-width: 100px;
        padding: 15px;
    }
    
    .parts-grid {
        grid-template-columns: 1fr;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .chapter-title {
        font-size: 2rem;
    }
    
    .chapter-nav {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .chapter-text h1 {
        font-size: 1.8rem;
    }
    
    .chapter-text h2 {
        font-size: 1.5rem;
    }
    
    .chapter-text h3 {
        font-size: 1.2rem;
    }
    
    .chapter-text {
        font-size: 1rem;
    }
    
    .code-block {
        padding: 15px;
        font-size: 0.8rem;
    }
}

/* Animation for cards */
.part-card, .feature {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for cards */
.part-card:nth-child(1) { animation-delay: 0.1s; }
.part-card:nth-child(2) { animation-delay: 0.2s; }
.part-card:nth-child(3) { animation-delay: 0.3s; }

.feature:nth-child(1) { animation-delay: 0.1s; }
.feature:nth-child(2) { animation-delay: 0.2s; }
.feature:nth-child(3) { animation-delay: 0.3s; }
.feature:nth-child(4) { animation-delay: 0.4s; } 

/* Chapter content dark theme styles */
.chapter-text h1, .chapter-text h2, .chapter-text h3, .chapter-text h4, .chapter-text h5, .chapter-text h6 {
    color: var(--text-color);
}

.chapter-text p {
    color: var(--text-color);
}

.chapter-text ul, .chapter-text ol {
    color: var(--text-color);
}

.chapter-text li {
    color: var(--text-color);
}

.chapter-text strong {
    color: var(--text-color);
}

.chapter-text em {
    color: var(--text-color);
}

.chapter-text code {
    background: var(--code-bg);
    color: var(--code-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.chapter-text pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.chapter-text pre code {
    background: none;
    padding: 0;
    color: var(--code-text);
}

/* Code block styling for dark theme */
.dark-theme .chapter-text pre {
    background: #2d3748;
    border: 1px solid #4a5568;
}

.dark-theme .chapter-text code {
    background: #4a5568;
    color: #e2e8f0;
}

/* Main content area dark theme */
.dark-theme .container {
    background: var(--bg-color);
}

.dark-theme .part-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.dark-theme .part-card:hover {
    background: #4a5568;
    transform: translateY(-10px);
}

.dark-theme .feature {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.dark-theme .stat {
    background: var(--card-bg);
    color: var(--text-color);
}

.dark-theme .stat:hover {
    background: #4a5568;
}

/* Navigation dark theme */
.dark-theme nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
}

.dark-theme .nav-btn {
    background: var(--primary-color);
    color: white;
}

.dark-theme .nav-btn:hover {
    background: #5a6fd8;
}

/* Header dark theme */
.dark-theme .hero {
    background: var(--header-bg);
}

.dark-theme .hero h1,
.dark-theme .hero p {
    color: white;
}

/* Footer dark theme */
.dark-theme footer {
    background: var(--card-bg);
    color: var(--text-color);
    border-top: 1px solid var(--border-color);
}

/* Modal dark theme */
.dark-theme #modal .modal-content {
    background: var(--card-bg);
    color: var(--text-color);
}

.dark-theme #modal .modal-header {
    background: var(--header-bg);
    color: white;
}

/* Button dark theme */
.dark-theme .btn {
    background: var(--primary-color);
    color: white;
}

.dark-theme .btn:hover {
    background: #5a6fd8;
}

/* Text colors for dark theme */
.dark-theme h1, .dark-theme h2, .dark-theme h3, .dark-theme h4, .dark-theme h5, .dark-theme h6 {
    color: var(--text-color);
}

.dark-theme p {
    color: var(--text-color);
}

.dark-theme a {
    color: var(--primary-color);
}

.dark-theme a:hover {
    color: #5a6fd8;
} 

/* Dark mode specific overrides for chapter content */
[data-theme="dark"] .chapter-text h1 {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: none;
}

[data-theme="dark"] .chapter-text h2 {
    color: #ffffff;
    border-bottom-color: #fbbf24;
}

[data-theme="dark"] .chapter-text h3 {
    color: #fbbf24;
    border-left-color: #fbbf24;
}

[data-theme="dark"] .chapter-text p {
    color: #e2e8f0;
}

[data-theme="dark"] .chapter-text strong {
    color: #fbbf24;
}

[data-theme="dark"] .chapter-text em {
    color: #fbbf24;
}

/* Light mode specific overrides for chapter content */
[data-theme="light"] .chapter-text h1 {
    color: #667eea;
    -webkit-text-fill-color: #667eea;
    background: none;
}

[data-theme="light"] .chapter-text h2 {
    color: #667eea;
    border-bottom-color: #667eea;
}

[data-theme="light"] .chapter-text h3 {
    color: #667eea;
    border-left-color: #667eea;
}

[data-theme="light"] .chapter-text p {
    color: #2d3748;
}

[data-theme="light"] .chapter-text strong {
    color: #2d3748;
}

[data-theme="light"] .chapter-text em {
    color: #2d3748;
} 