/* Reader Mode Styles */

/* Reader Mode Button */
#readerModeBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

#readerModeBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#readerModeBtn i {
    font-size: 16px;
}

/* ===== READER MODE SECTION ===== */
.reader-section {
    background: var(--card-background, white);
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e5e7eb);
    min-height: 80vh;
    display: flex;
    flex-direction: column;
}

.reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    background: var(--background-secondary, #f9fafb);
    border-radius: 12px 12px 0 0;
}

.reader-title-area {
    flex: 1;
}

.reader-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0 0 0.25rem 0;
    line-height: 1.2;
}

.reader-author {
    font-size: 1rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
    margin: 0;
}

.reader-controls {
    display: flex;
    gap: 0.5rem;
}

.bookmark-controls {
    display: flex;
    align-items: center;
}

.bookmarks-btn {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bookmarks-btn:hover {
    background: #138496;
    transform: translateY(-1px);
}

.reader-control-btn {
    background: var(--background-primary, white);
    border: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-primary, #111827);
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.reader-control-btn:hover {
    background: var(--primary-color, #3b82f6);
    color: white;
    transform: translateY(-1px);
}

.bookmark-btn {
    background: #ffc107;
    color: #212529;
}

.bookmark-btn:hover {
    background: #e0a800;
}

.bookmark-btn.bookmarked {
    background: #dc3545;
    color: white;
}

.bookmark-btn.bookmarked:hover {
    background: #c82333;
}

.exit-reader-btn:hover {
    background: var(--error-color, #ef4444);
}

.reader-progress-container {
    padding: 1rem 2rem;
    background: var(--background-secondary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.reader-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color, #e5e7eb);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.reader-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, #3b82f6), var(--accent-color, #8b5cf6));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.reader-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
}

.reader-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--background-secondary, #f9fafb);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    gap: 1rem;
}

.nav-btn {
    background: var(--primary-color, #3b82f6);
    color: white;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    justify-content: center;
}

.nav-btn:hover {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background: var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6b7280);
    cursor: not-allowed;
    transform: none;
}

.chapter-selector-container {
    flex: 1;
    max-width: 300px;
}

.chapter-selector {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--card-background, white);
    color: var(--text-primary, #111827);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chapter-selector:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.reader-content-container {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--card-background, white);
}

.reader-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-primary, #111827);
    font-family: 'Georgia', 'Times New Roman', serif;
}

.reader-content h1,
.reader-content h2,
.reader-content h3,
.reader-content h4,
.reader-content h5,
.reader-content h6 {
    color: var(--text-primary, #111827);
    margin: 2rem 0 1rem 0;
    font-weight: 700;
}

.reader-content h1 {
    font-size: 2.2rem;
    border-bottom: 3px solid var(--primary-color, #3b82f6);
    padding-bottom: 0.5rem;
}

.reader-content h2 {
    font-size: 1.8rem;
}

.reader-content h3 {
    font-size: 1.5rem;
}

.reader-content p {
    margin: 1.5rem 0;
    text-align: justify;
}

.reader-content ul,
.reader-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.reader-content li {
    margin: 0.5rem 0;
}

.reader-footer-nav {
    display: flex;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--background-secondary, #f9fafb);
    border-top: 1px solid var(--border-color, #e5e7eb);
    border-radius: 0 0 12px 12px;
}

.footer-nav-btn {
    background: var(--secondary-color, #6b7280);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-nav-btn:hover {
    background: var(--secondary-hover, #4b5563);
    transform: translateY(-1px);
}

.footer-nav-btn:disabled {
    background: var(--border-color, #e5e7eb);
    color: var(--text-secondary, #6b7280);
    cursor: not-allowed;
    transform: none;
}

/* ===== READER SETTINGS MODAL ===== */
.reader-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.reader-settings-content {
    background: var(--card-background, white);
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e5e7eb);
}

.reader-settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
    background: var(--background-secondary, #f9fafb);
    border-radius: 12px 12px 0 0;
}

.reader-settings-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.close-settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary, #6b7280);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.close-settings-btn:hover {
    color: var(--error-color, #ef4444);
    background: var(--background-primary, white);
}

.reader-settings-body {
    padding: 2rem;
}

.setting-group {
    margin-bottom: 2rem;
}

.setting-group label {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.setting-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color, #e5e7eb);
    outline: none;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.setting-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color, #3b82f6);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.setting-value {
    display: inline-block;
    background: var(--background-secondary, #f9fafb);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
}

.setting-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    background: var(--card-background, white);
    color: var(--text-primary, #111827);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.setting-select:focus {
    outline: none;
    border-color: var(--primary-color, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ===== READER THEMES ===== */
.reader-content.theme-dark {
    background: #1a1a1a;
    color: #e0e0e0;
}

.reader-content.theme-sepia {
    background: #f4f1ea;
    color: #5c4b37;
}

.reader-content.theme-sepia h1,
.reader-content.theme-sepia h2,
.reader-content.theme-sepia h3,
.reader-content.theme-sepia h4,
.reader-content.theme-sepia h5,
.reader-content.theme-sepia h6 {
    color: #3d2f1f;
}

/* Bookmarks Modal */
.bookmarks-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.bookmarks-modal.hidden {
    display: none;
}

.bookmarks-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.bookmarks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.bookmarks-header h3 {
    margin: 0;
    font-size: 20px;
    color: #2c3e50;
}

.close-bookmarks-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-bookmarks-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.bookmarks-list {
    max-height: 400px;
    overflow-y: auto;
}

.no-bookmarks {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-bookmarks i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-bookmarks p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bookmark-item:hover {
    background: #e9ecef;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bookmark-info {
    flex: 1;
}

.bookmark-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 16px;
}

.bookmark-meta {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.bookmark-actions {
    display: flex;
    gap: 10px;
}

.bookmark-action-btn {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
}

.bookmark-action-btn:hover {
    background: #dee2e6;
    color: #495057;
}

.bookmark-action-btn.delete:hover {
    background: #f8d7da;
    color: #721c24;
}

/* ===== RESPONSIVE DESIGN FOR READER ===== */
@media (max-width: 768px) {
    .reader-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .reader-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-btn {
        width: 100%;
        min-width: auto;
    }
    
    .chapter-selector-container {
        max-width: none;
        width: 100%;
    }
    
    .reader-footer-nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .reader-content {
        font-size: 16px;
        line-height: 1.6;
    }
    
    .reader-content-container {
        padding: 1rem;
    }
    
    .bookmarks-content {
        padding: 20px;
        margin: 20px;
    }
    
    .bookmark-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .bookmark-actions {
        justify-content: center;
    }
}