/* ===== CHAPTER DETAIL PAGE STYLES ===== */

/* Chapter Header */
.chapter-header {
    padding: 30px 0;
    border-bottom: 2px solid rgba(244, 175, 179, 0.2);
    margin-bottom: 30px;
}

.chapter-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.chapter-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.story-breadcrumb {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
    color: #6c757d;
}

.story-breadcrumb .story-link {
    color: #f4afb3;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-breadcrumb .story-link:hover {
    color: #f2d0d3;
    transform: translateX(-2px);
}

.story-breadcrumb .story-link i {
    font-size: 1rem;
}

.story-breadcrumb .fa-chevron-right {
    color: #dee2e6;
    font-size: 0.9rem;
}

.chapter-title {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.2rem;
}

.chapter-actions {
    display: flex;
    gap: 15px;
}

.btn-settings,
.btn-fullscreen {
    padding: 10px 20px;
    border: 2px solid #f4afb3;
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    color: #fff;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(244, 175, 179, 0.3);
}

.btn-settings:hover,
.btn-fullscreen:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 175, 179, 0.4);
    border-color: #f2d0d3;
}

.btn-settings i,
.btn-fullscreen i {
    font-size: 1rem;
}

/* Chapter Content */
.chapter-content {
    padding: 0 0 50px 0;
}

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

.content-wrapper {
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(244, 175, 179, 0.1);
}

.chapter-text {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #2c3e50;
}

.chapter-paragraph {
    margin-bottom: 25px;
    text-align: justify;
    text-indent: 20px;
}

.chapter-paragraph:last-child {
    margin-bottom: 0;
}

/* Chapter Navigation */
.chapter-navigation {
    padding: 30px 0;
    border-top: 2px solid rgba(244, 175, 179, 0.2);
    border-bottom: 2px solid rgba(244, 175, 179, 0.2);
    margin-bottom: 50px;
}

.chapter-navigation .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

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

.chapter-dropdown {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.chapter-dropdown:focus {
    outline: none;
    border-color: #f4afb3;
    box-shadow: 0 0 0 3px rgba(244, 175, 179, 0.1);
}

.navigation-buttons {
    display: flex;
    gap: 15px;
}

.btn-nav {
    padding: 12px 20px;
    border: 2px solid #f4afb3;
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    color: #fff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(244, 175, 179, 0.3);
}

.btn-nav:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 175, 179, 0.4);
    color: #fff;
    text-decoration: none;
}

.btn-nav i {
    font-size: 1rem;
}

/* Chapter Comments */
.chapter-comments {
    padding: 50px 0;
}

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

.comments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(244, 175, 179, 0.2);
}

.comments-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.comments-title i {
    color: #f4afb3;
}

.comments-count {
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(244, 175, 179, 0.3);
}

/* Comment Form */
.comment-form {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    padding: 25px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(244, 175, 179, 0.1);
}

.comment-avatar {
    flex-shrink: 0;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    border-radius: 15px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 6px 15px rgba(244, 175, 179, 0.3);
}

.comment-input-wrapper {
    flex: 1;
}

.comment-input {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.comment-input:focus {
    outline: none;
    border-color: #f4afb3;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(244, 175, 179, 0.1);
}

.comment-actions {
    margin-top: 15px;
    text-align: right;
}

.btn-comment {
    padding: 12px 25px;
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(244, 175, 179, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-comment:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(244, 175, 179, 0.4);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.comment-item {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border: 2px solid rgba(244, 175, 179, 0.05);
    transition: all 0.3s ease;
}

.comment-item:hover {
    border-color: rgba(244, 175, 179, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(244, 175, 179, 0.1);
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.comment-author {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
}

.comment-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.comment-text {
    color: #495057;
    line-height: 1.6;
    margin-bottom: 15px;
}

.comment-actions {
    display: flex;
    gap: 15px;
}

.action-btn {
    background: none;
    border: none;
    color: #6c757d;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn:hover {
    background: rgba(244, 175, 179, 0.1);
    color: #f4afb3;
}

.action-btn.liked {
    background: rgba(244, 175, 179, 0.2);
    color: #f4afb3;
}

.action-btn.liked i {
    color: #f4afb3;
}

.action-btn i {
    font-size: 0.9rem;
}

/* Load More Comments */
.load-more-comments {
    text-align: center;
}

.btn-load-more {
    padding: 12px 30px;
    background: linear-gradient(135deg, #80bf8a, #a8d6b1);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 15px rgba(128, 191, 138, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-load-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(128, 191, 138, 0.4);
}

/* Reading Settings Modal */
.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-modal.active {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: #fff;
    border-radius: 25px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(244, 175, 179, 0.2);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(244, 175, 179, 0.1);
}

.modal-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-title i {
    color: #f4afb3;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #f4afb3, #f2d0d3);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: grid;
    place-items: center;
    font-size: 1.1rem;
}

.modal-close:hover {
    transform: rotate(90deg);
    box-shadow: 0 6px 15px rgba(244, 175, 179, 0.4);
}

.modal-body {
    padding: 30px;
}

.setting-group {
    margin-bottom: 25px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 15px;
}

.setting-controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-size,
.btn-spacing,
.btn-font {
    padding: 10px 20px;
    border: 2px solid #e9ecef;
    background: #fff;
    color: #6c757d;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-size:hover,
.btn-spacing:hover,
.btn-font:hover {
    border-color: #f4afb3;
    color: #f4afb3;
}

.btn-size.active,
.btn-spacing.active,
.btn-font.active {
    border-color: #f4afb3;
    background: #f4afb3;
    color: #fff;
}

.btn-color,
.btn-bg {
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-color:hover,
.btn-bg:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-color.active,
.btn-bg.active {
    border-color: #f4afb3;
    box-shadow: 0 0 0 3px rgba(244, 175, 179, 0.3);
}

.btn-color.active::after,
.btn-bg.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-weight: 900;
    font-size: 1.2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-top: 2px solid rgba(244, 175, 179, 0.1);
    gap: 20px;
}

.btn-reset,
.btn-save {
    padding: 12px 25px;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-reset {
    background: linear-gradient(135deg, #6c757d, #adb5bd);
    color: #fff;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #80bf8a, #a8d6b1);
    color: #fff;
    box-shadow: 0 4px 15px rgba(128, 191, 138, 0.3);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(128, 191, 138, 0.4);
}

/* Advertisement Styles */
.advertisement-section {
    margin: 20px 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: 'Inter', sans-serif;
}

/* Header Section */
.ad-header {
    padding: 20px 20px 15px 20px;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.ad-instruction {
    font-size: 14px;
    color: #333;
    line-height: 1.4;
    margin-bottom: 10px;
    font-weight: 400;
    text-align: center;
}

.ad-link {
    margin-bottom: 10px;
}

.ad-link a {
    color: #007bff;
    text-decoration: underline;
    font-size: 14px;
    font-weight: 500;
}

.ad-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.ad-close-btn:hover {
    color: #dc3545;
}

/* Main Content */
.ad-main-content {
    display: flex;
    padding: 20px;
    justify-content: center;
    gap: 20px;
    align-items: flex-start;
}

/* Left Section */
.ad-left-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.ad-product-image {
    text-align: center;
}

.chapter-ad-image {
    height: 500px;
    object-fit: cover;
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    transition: all 0.3s ease;
    cursor: pointer;
}

.chapter-ad-image:hover {
    /* transform: scale(1.02); */
    /* box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); */
    /* filter: brightness(1.05); */
}

.ad-expert-logo {
    text-align: center;
}

.expert-circle {
    width: 80px;
    height: 80px;
    border: 2px solid #007bff;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px;
}

.expert-plus {
    font-size: 20px;
    font-weight: bold;
    color: #007bff;
    margin-bottom: 2px;
}

.expert-text {
    font-size: 8px;
    color: #007bff;
    text-align: center;
    line-height: 1.2;
    font-weight: 600;
}

/* Right Section */
.ad-right-section {
    flex: 1;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    padding: 20px;
    border-radius: 12px;
    color: white;
    position: relative;
}

.ad-top-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.ad-number-logo {
    background: white;
    color: #333;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.ad-expert-recommendation {
    font-size: 12px;
    color: #333;
    line-height: 1.3;
    font-weight: 500;
    flex: 1;
}

.ad-benefits {
    margin-bottom: 20px;
}

.benefit-line {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    color: white;
}

.benefit-line.highlight {
    font-size: 20px;
    margin-bottom: 12px;
}

.ad-volume {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 15px;
}

.ad-origin {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    background: white;
    padding: 8px 12px;
    border-radius: 6px;
    display: inline-block;
}

/* Footer */
.ad-footer {
    padding: 15px 20px;
    text-align: center;
    background: #f8f9fa;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-top: 1px solid #f0f0f0;
}

/* Hidden class for chapter text */
.chapter-text.hidden {
    display: none;
}

/* Responsive design for advertisement */
@media (max-width: 768px) {
    .ad-main-content {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .ad-left-section {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }

    .chapter-ad-image {
        height: 300px;
        transition: all 0.3s ease;
    }

    .chapter-ad-image:hover {
        transform: scale(1.02);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
        filter: brightness(1.05);
    }

    .expert-circle {
        width: 70px;
        height: 70px;
    }

    .expert-text {
        font-size: 7px;
    }

    .ad-header {
        padding: 15px;
    }

    .ad-main-content {
        padding: 15px;
    }

    .ad-footer {
        padding: 12px 15px;
    }

    .ad-instruction {
        text-align: center;
        font-size: 13px;
        padding-right: 40px;
    }

    .benefit-line {
        font-size: 14px;
    }

    .benefit-line.highlight {
        font-size: 18px;
    }

    .content-wrapper {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .ad-left-section {
        flex-direction: column;
        gap: 15px;
    }

    .ad-top-info {
        flex-direction: column;
        gap: 10px;
    }

    .ad-expert-recommendation {
        font-size: 11px;
    }
}

/* Compact Advertisement Styles (After Clicked) */
.compact-advertisement {
    margin: 15px 0;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.compact-ad-image {
    display: inline-block;
}

.compact-ad-img {
    height: 190px;
    width: 100% !important;
    width: auto;
    /* max-width: 200px; */
    object-fit: cover;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
}

.compact-ad-img:hover {
    /* transform: scale(1.05); */
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); */
    /* filter: brightness(1.1); */
}

/* Responsive design for compact advertisement */
@media (max-width: 768px) {
    .compact-advertisement {
        margin: 10px 0;
        padding: 8px;
    }
    
    .compact-ad-img {
        height: 100px;
        /* max-width: 150px; */
    }
}

@media (max-width: 480px) {
    .compact-ad-img {
        height: inherit;
        width: 100%;
        /* max-width: 120px; */
    }
}