/* Book Styles for The Alchemy of Transformation */

/* Base Styles */
body {
    font-family: 'Georgia', serif;
    line-height: 1.8;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
    transition: all 0.3s ease;
}

/* Dark Theme Base */
body.dark-theme {
    background-color: #1a202c;
    color: #e2e8f0;
}

/* Progress Bar */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    z-index: 100;
}

body.dark-theme .progress-container {
    background: #2d3748;
}

.progress-bar {
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
}

/* Settings Button */
.reader-settings-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 99;
    transition: transform 0.3s ease;
}

.reader-settings-btn:hover {
    transform: scale(1.1);
}

/* Settings Panel */
.settings-panel {
    position: fixed;
    bottom: 90px;
    right: 30px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 98;
    display: none;
    min-width: 250px;
}

.settings-panel.active {
    display: block;
}

body.dark-theme .settings-panel {
    background: #2d3748;
    color: #e2e8f0;
}

.settings-panel h3 {
    margin-top: 0;
    color: #5a67d8;
    font-size: 1.2em;
    margin-bottom: 15px;
}

body.dark-theme .settings-panel h3 {
    color: #90cdf4;
}

.settings-group {
    margin-bottom: 20px;
}

.settings-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: bold;
}

.font-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.font-controls button {
    padding: 8px 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

body.dark-theme .font-controls button {
    background: #4a5568;
    color: #e2e8f0;
}

.font-controls button:hover {
    background: #e0e0e0;
}

body.dark-theme .font-controls button:hover {
    background: #718096;
}

.theme-toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #667eea;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* Header Styles */
.book-header {
    text-align: center;
    padding: 40px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: -20px -20px 40px -20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body.dark-theme .book-header {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.book-header h1 {
    font-size: 2.5em;
    margin: 0;
    font-weight: 300;
}

.book-header p {
    font-size: 1.2em;
    margin-top: 10px;
    opacity: 0.9;
}

/* Chapter Titles and Headings */
.chapter-title {
    color: #5a67d8;
    font-size: 2.2em;
    text-align: center;
    margin: 40px 0;
    font-weight: 300;
}

body.dark-theme .chapter-title {
    color: #90cdf4;
}

.chapter-subtitle {
    text-align: center;
    color: #764ba2;
    font-size: 1.3em;
    margin: -20px 0 40px 0;
    font-style: italic;
}

body.dark-theme .chapter-subtitle {
    color: #cbd5e0;
}

h2 {
    color: #5a67d8;
    margin-top: 40px;
    font-size: 1.8em;
    font-weight: 400;
}

h3 {
    color: #764ba2;
    margin-top: 30px;
    font-size: 1.4em;
    font-weight: 400;
}

body.dark-theme h2,
body.dark-theme h3 {
    color: #90cdf4;
}

/* Paragraph and Text Styles */
p {
    margin-bottom: 20px;
    text-align: justify;
}

ul {
    line-height: 2;
}

/* Quote Styles */
.opening-quote {
    font-style: italic;
    text-align: center;
    color: #666;
    margin: 30px 10%;
    font-size: 1.1em;
    border-left: 3px solid #667eea;
    padding-left: 20px;
}

body.dark-theme .opening-quote {
    color: #cbd5e0;
    border-left-color: #4a5568;
}

/* Box Styles */
.highlight-box {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 25px;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

body.dark-theme .highlight-box {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
}

.highlight-box h3 {
    margin-top: 0;
    color: #5a67d8;
}

body.dark-theme .highlight-box h3 {
    color: #90cdf4;
}

.practice-box {
    background: #fff;
    border: 2px solid #e9d8fd;
    padding: 25px;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

body.dark-theme .practice-box {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.practice-box h3 {
    color: #764ba2;
    margin-top: 0;
    display: flex;
    align-items: center;
}

body.dark-theme .practice-box h3 {
    color: #e9d8fd;
}

.practice-box h3::before {
    content: "✨";
    margin-right: 10px;
    font-size: 1.2em;
}

.wisdom-box {
    background: #fef5e7;
    border-left: 5px solid #f39c12;
    padding: 20px;
    margin: 30px 0;
    font-style: italic;
}

body.dark-theme .wisdom-box {
    background: #2d3748;
    border-left-color: #667eea;
    color: #e2e8f0;
}

.research-box {
    background: white;
    padding: 25px;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body.dark-theme .research-box {
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.research-box h4 {
    color: #5a67d8;
    margin-top: 0;
    display: flex;
    align-items: center;
}

body.dark-theme .research-box h4 {
    color: #90cdf4;
}

.research-box h4::before {
    content: "🔬";
    margin-right: 10px;
}

/* Statistics and Cards */
.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.statistic {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

body.dark-theme .statistic {
    background: #374151;
    color: #e2e8f0;
}

.statistic:hover {
    transform: translateY(-5px);
}

.statistic .number {
    font-size: 2.5em;
    color: #667eea;
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

body.dark-theme .statistic .number {
    color: #90cdf4;
}

.statistic .label {
    font-size: 1em;
    color: #666;
}

body.dark-theme .statistic .label {
    color: #cbd5e0;
}

/* Trend Cards */
.trend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.trend-card {
    background: #fff;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

body.dark-theme .trend-card {
    background: #374151;
    color: #e2e8f0;
    border-color: #4a5568;
}

.trend-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.trend-card h4 {
    color: #5a67d8;
    margin-top: 0;
    margin-bottom: 15px;
}

body.dark-theme .trend-card h4 {
    color: #90cdf4;
}

/* Navigation Links */
.nav-links {
    display: flex;
    justify-content: space-between;
    margin: 50px 0;
    padding-top: 30px;
    border-top: 2px solid #e9d8fd;
}

.nav-links a {
    color: #5a67d8;
    text-decoration: none;
    padding: 10px 20px;
    background: #f5f7fa;
    border-radius: 5px;
    transition: all 0.3s ease;
}

body.dark-theme .nav-links a {
    background: #2d3748;
    color: #90cdf4;
}

.nav-links a:hover {
    background: #667eea;
    color: white;
}

body.dark-theme .nav-links a:hover {
    background: #4a5568;
    color: white;
}

/* Footer Styles - Matching the attached example */
.book-footer {
    background: #f5f7fa;
    margin: 60px -20px -20px -20px;
    padding: 40px 20px;
    text-align: center;
}

body.dark-theme .book-footer {
    background: #2d3748;
}

.footer-nav {
    margin-bottom: 20px;
    font-size: 0.95em;
}

.footer-nav a {
    color: #5a67d8;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.3s ease;
}

body.dark-theme .footer-nav a {
    color: #90cdf4;
}

.footer-nav a:hover {
    color: #764ba2;
}

body.dark-theme .footer-nav a:hover {
    color: #e9d8fd;
}

.footer-nav a:not(:last-child)::after {
    content: " |";
    color: #cbd5e0;
    margin-left: 10px;
}

.copyright {
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

body.dark-theme .copyright {
    color: #cbd5e0;
}

/* Journey Map Box */
.journey-map {
    background: #fff;
    padding: 30px;
    margin: 40px 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

body.dark-theme .journey-map {
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.journey-map h3 {
    text-align: center;
    color: #5a67d8;
    margin-bottom: 25px;
}

body.dark-theme .journey-map h3 {
    color: #90cdf4;
}

body.dark-theme .journey-map strong {
    color: #cbd5e0;
}

/* Closing Blessing Box */
.closing-blessing {
    text-align: center;
    font-style: italic;
    color: #764ba2;
    margin: 50px 10%;
    padding: 30px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    border-radius: 10px;
}

body.dark-theme .closing-blessing {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 90%;
    max-width: 600px;
}

.modal-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #667eea;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

.feature-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

body.dark-theme .feature-card {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
}

.feature-card h4 {
    color: #5a67d8;
    margin-top: 0;
}

body.dark-theme .feature-card h4 {
    color: #90cdf4;
}

/* TOC Styles */
.toc-section {
    background: white;
    padding: 40px;
    margin: 40px 0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body.dark-theme .toc-section {
    background: #2d3748;
}

.toc-section h2 {
    color: #5a67d8;
    text-align: center;
    font-size: 2em;
    margin-bottom: 40px;
}

body.dark-theme .toc-section h2 {
    color: #90cdf4;
}

.toc-part {
    margin: 30px 0;
}

.toc-part h3 {
    color: #764ba2;
    font-size: 1.3em;
    margin-bottom: 15px;
    padding: 10px;
    background: linear-gradient(to right, #f5f7fa 0%, transparent 100%);
    border-left: 4px solid #667eea;
}

body.dark-theme .toc-part h3 {
    color: #e9d8fd;
    background: linear-gradient(to right, #374151 0%, transparent 100%);
    border-left-color: #764ba2;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 10px 0;
    padding-left: 30px;
    position: relative;
}

.toc-list li:before {
    content: "✨";
    position: absolute;
    left: 0;
}

.toc-list a {
    color: #5a67d8;
    text-decoration: none;
    transition: color 0.3s ease;
    display: block;
    padding: 5px 0;
}

body.dark-theme .toc-list a {
    color: #90cdf4;
}

.toc-list a:hover {
    color: #764ba2;
    padding-left: 10px;
}

body.dark-theme .toc-list a:hover {
    color: #e9d8fd;
}

/* Start Button */
.start-reading {
    text-align: center;
    margin: 50px 0;
}

.start-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-size: 1.2em;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Media Queries */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .book-header {
        padding: 30px 10px;
    }
    
    .book-header h1 {
        font-size: 2em;
    }
    
    .chapter-title {
        font-size: 1.8em;
    }
    
    .statistics-grid,
    .trend-grid,
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-links a {
        text-align: center;
    }
}