/* ============================================
   CHAPTER PAGE STYLES
   ============================================ */

:root {
    --c-text: #333;
    --c-heading: #1e293b;
    --c-btn-text: #000;
    --c-border: #e2e8f0;
}

.theme-light {
    --c-text: #333;
    --c-heading: #1e293b;
    --c-btn-text: #000;
    --c-border: #e2e8f0;
}

.theme-dark {
    --c-text: #E9EEF3;
    --c-heading: #FFFFFF;
    --c-btn-text: #FFFFFF;
    --c-border: rgba(255, 255, 255, 0.6);
}

.chapter-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #fff;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-lg);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Options Button */
.options-btn {
    background: #f1f5f9;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.options-btn:hover {
    background: #e2e8f0;
    color: var(--text-main);
    transform: translateY(-2px);
}

/* Options Modal */
.chapter-options-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.options-content {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.options-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.options-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.close-options {
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.close-options:hover {
    color: #333;
}

.options-body {
    padding: 20px;
}

.option-row {
    margin-bottom: 20px;
}

.option-row label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.option-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.range-wrap {
    display: flex;
    align-items: center;
    gap: 15px;
}

.range-wrap input[type="range"] {
    flex: 1;
}

.range-wrap span {
    font-size: 0.9rem;
    color: #666;
    width: 40px;
    text-align: right;
}

.options-footer {
    text-align: center;
    margin-top: 10px;
}

.btn-reset {
    background: #f1f5f9;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.btn-reset:hover {
    background: #e2e8f0;
    color: #333;
}

/* Background Themes */
body.nv-bg-sepia .chapter-container {
    background: #f4ecd8;
    color: #5b4636;
}

body.nv-bg-sepia .chapter-content {
    color: #5b4636;
}

body.nv-bg-dark .chapter-container {
    background: #1e293b;
    color: #e2e8f0;
}

body.nv-bg-dark .chapter-content {
    color: #e2e8f0;
}

body.nv-bg-black .chapter-container {
    background: #000;
    color: #ccc;
}

body.nv-bg-black .chapter-content {
    color: #ccc;
}

/* Navigation */
.chapter-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 30px 0;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: #000000;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    min-width: 100px;
}

.btn-nav:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    color: #fff;
}

.btn-nav.disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-nav i {
    margin: 0 5px;
}

.chapter-select {
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    max-width: 300px;
}

.chapter-select:focus {
    border-color: var(--primary-color);
}

/* Content */
.chapter-content {
    font-size: var(--chapter-size, 1.15rem);
    line-height: var(--chapter-height, 1.8);
    font-family: var(--chapter-font, inherit);
    color: #333;
    margin: 40px 0;
}

.chapter-content p {
    margin-bottom: 24px;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
}

/* Dark Mode Overrides */
.theme-dark .chapter-content,
.theme-dark .chapter-content p {
    color: var(--c-text) !important;
}

.theme-dark .chapter-content h1,
.theme-dark .chapter-content h2,
.theme-dark .chapter-content h3,
.theme-dark .footer-novel-title,
.theme-dark .options-header h3 {
    color: var(--c-heading) !important;
}

.theme-dark .btn-nav,
.theme-dark .options-btn,
.theme-dark .close-options,
.theme-dark .option-row label {
    color: var(--c-btn-text) !important;
    border-color: var(--c-border) !important;
}

.theme-dark .options-btn i,
.theme-dark .btn-nav i {
    color: var(--c-btn-text) !important;
}

.theme-dark .options-content {
    background-color: #1e293b;
    color: var(--c-text);
}

.theme-dark .option-row select,
.theme-dark #opt-reset {
    background-color: #0f172a;
    color: var(--c-text);
    border-color: var(--c-border);
}

/* Novel Footer - Detailed Card */
.chapter-novel-footer {
    display: flex;
    gap: 30px;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    margin-top: 60px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.footer-novel-cover {
    width: 140px;
    flex-shrink: 0;
}

.footer-novel-cover img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    aspect-ratio: 2/3;
    object-fit: cover;
}

.footer-novel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.footer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.footer-novel-title {
    font-size: 1.5rem;
    margin: 0;
    font-weight: 700;
    line-height: 1.3;
    color: var(--primary-color);
}

.footer-novel-title a {
    text-decoration: none;
    color: inherit;
}

.footer-novel-rating-badge {
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #eee;
}

.score-label {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 2px;
}

.footer-novel-rating-badge .stars {
    color: #ffc107;
    font-size: 0.9rem;
}

.footer-native-name {
    font-size: 1rem;
    color: #666;
    margin-bottom: 15px;
}

.footer-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-meta-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
    margin-bottom: 8px;
}

.meta-label-square {
    width: 8px;
    height: 8px;
    background: #d1d5db;
    /* Default gray */
    margin-right: 10px;
    border-radius: 2px;
    display: inline-block;
}

/* Specific colors for labels */
.footer-meta-col:first-child .footer-meta-item:nth-child(1) .meta-label-square {
    background: #a855f7;
}

/* Status - Purple */
.footer-meta-col:first-child .footer-meta-item:nth-child(2) .meta-label-square {
    background: #ef4444;
}

/* Author - Red */
.footer-meta-col:first-child .footer-meta-item:nth-child(3) .meta-label-square {
    background: #3b82f6;
}

/* Lang - Blue */

.footer-meta-col:last-child .footer-meta-item:nth-child(1) .meta-label-square {
    background: #a855f7;
}

/* Type - Purple */
.footer-meta-col:last-child .footer-meta-item:nth-child(2) .meta-label-square {
    background: #a855f7;
}

/* Released - Purple */

.meta-key {
    font-weight: 700;
    color: #333;
    margin-right: 5px;
}

.meta-val {
    color: #555;
}

.meta-val.author-link {
    color: #a855f7;
}

.meta-val.type-link {
    color: #a855f7;
}

.footer-genres {
    margin-bottom: 20px;
}

.footer-genre-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #a855f7;
    color: #a855f7;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 8px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.footer-genre-tag:hover {
    background: #a855f7;
    color: #fff;
}

.footer-synopsis {
    text-align: center;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.synopsis-heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    font-style: italic;
}

.synopsis-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.synopsis-more-bar {
    background: #f3f4f6;
    padding: 5px;
    text-align: center;
    border-radius: 4px;
}

.synopsis-more-bar a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .chapter-novel-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 20px;
    }

    .footer-novel-cover {
        width: 120px;
        margin: 0 auto;
    }

    .footer-header {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .footer-meta-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: left;
    }

    .footer-meta-item {
        justify-content: center;
    }
}

/* ============================================
   DARK MODE - Novel Footer Card
   ============================================ */

/* Dark Mode (nv-bg-dark) */
body.nv-bg-dark .chapter-novel-footer {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.nv-bg-dark .footer-novel-title,
body.nv-bg-dark .footer-novel-title a {
    color: #a855f7;
}

body.nv-bg-dark .footer-native-name {
    color: #94a3b8;
}

body.nv-bg-dark .footer-novel-rating-badge {
    background: #0f172a;
    border-color: #334155;
}

body.nv-bg-dark .score-label {
    color: #94a3b8;
}

body.nv-bg-dark .meta-key {
    color: #e2e8f0;
}

body.nv-bg-dark .meta-val {
    color: #94a3b8;
}

body.nv-bg-dark .footer-genre-tag {
    border-color: #a855f7;
    color: #a855f7;
}

body.nv-bg-dark .footer-genre-tag:hover {
    background: #a855f7;
    color: #fff;
}

body.nv-bg-dark .footer-synopsis {
    border-top-color: #334155;
}

body.nv-bg-dark .synopsis-heading {
    color: #e2e8f0;
}

body.nv-bg-dark .synopsis-content {
    color: #94a3b8;
}

body.nv-bg-dark .synopsis-more-bar {
    background: #0f172a;
}

body.nv-bg-dark .synopsis-more-bar a {
    color: #a855f7;
}

/* Black Mode (nv-bg-black) */
body.nv-bg-black .chapter-novel-footer {
    background: #111111;
    border-color: #333333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

body.nv-bg-black .footer-novel-title,
body.nv-bg-black .footer-novel-title a {
    color: #a855f7;
}

body.nv-bg-black .footer-native-name {
    color: #888888;
}

body.nv-bg-black .footer-novel-rating-badge {
    background: #1a1a1a;
    border-color: #333333;
}

body.nv-bg-black .score-label {
    color: #888888;
}

body.nv-bg-black .meta-key {
    color: #cccccc;
}

body.nv-bg-black .meta-val {
    color: #888888;
}

body.nv-bg-black .footer-genre-tag {
    border-color: #a855f7;
    color: #a855f7;
}

body.nv-bg-black .footer-genre-tag:hover {
    background: #a855f7;
    color: #fff;
}

body.nv-bg-black .footer-synopsis {
    border-top-color: #333333;
}

body.nv-bg-black .synopsis-heading {
    color: #cccccc;
}

body.nv-bg-black .synopsis-content {
    color: #888888;
}

body.nv-bg-black .synopsis-more-bar {
    background: #1a1a1a;
}

body.nv-bg-black .synopsis-more-bar a {
    color: #a855f7;
}

/* Sepia Mode - Footer Card */
body.nv-bg-sepia .chapter-novel-footer {
    background: #f4ecd8;
    border-color: #d4c4a8;
    box-shadow: 0 4px 20px rgba(91, 70, 54, 0.1);
}

body.nv-bg-sepia .footer-novel-title,
body.nv-bg-sepia .footer-novel-title a {
    color: #8b5a2b;
}

body.nv-bg-sepia .footer-native-name,
body.nv-bg-sepia .meta-val,
body.nv-bg-sepia .synopsis-content {
    color: #6b4423;
}

body.nv-bg-sepia .meta-key,
body.nv-bg-sepia .synopsis-heading {
    color: #5b4636;
}

body.nv-bg-sepia .footer-novel-rating-badge {
    background: #ebe3d1;
    border-color: #d4c4a8;
}

body.nv-bg-sepia .score-label {
    color: #7a5d3a;
}

body.nv-bg-sepia .footer-synopsis {
    border-top-color: #d4c4a8;
}

body.nv-bg-sepia .synopsis-more-bar {
    background: #ebe3d1;
}

body.nv-bg-sepia .synopsis-more-bar a {
    color: #8b5a2b;
}