/* Hero Section */
.novel-hero {
    background: var(--bg-secondary);
    padding: 2rem 0;
    position: relative;
    overflow: hidden;
}

.novel-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(45deg, var(--primary-xx-light), transparent);
    opacity: 0.5;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
    position: relative;
}

.book-cover {
    position: relative;
    width: 280px;
    height:400px;
    flex-shrink: 0;
    transition: transform 0.3s ease;


    /* background-image: url("../img/book_covers/default.png");
    background-size: cover;
    background-position: center; */
}

.book-cover:hover {
    transform: translateY(-5px);
}

.book-cover img {
    width: 100%;
    min-width:100%;
    height: auto;
    height:100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-2);

    background-image: url("../img/book_covers/default.png");
    background-size: cover;
    background-position: center;
}

.book-status {
    position: absolute;
    top: 1rem;
    right: -1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size:0.8em;
    /* opacity:0.9; */
}

.status-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    /* font-size: 0.875rem; */
    box-shadow: var(--shadow);
}

.rating {
    background: var(--surface);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: var(--shadow);
}

.novel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.novel-info h1 {
    font-size: 2.5rem;
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
    text-transform:capitalize;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    /* background: var(--surface); */
    padding: 0.75rem;
    /* border-radius: var(--border-radius); */
    /* box-shadow: var(--shadow); */
    border-top:1px solid var(--border-color);
}

.author-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.follow-btn {
    color: var(--primary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.follow-btn:hover {
    color: var(--primary-dark);
}

.follow-btn.following {
    color: var(--success);
}

.novel-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    /* background: var(--surface); */
    padding: 1rem;
    border-radius: var(--border-radius);
    /* box-shadow: var(--shadow); */
}

.novel-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size:0.9em;
}

.novel-meta span .fa {
    color: var(--primary);
    min-width:0.5em;
}

.tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--primary-xx-light);
    color: var(--primary);
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border:1px solid var(--primary-light);
    text-transform:capitalize;
}

.tag:hover {
    background: var(--primary-x-light);
    transform: translateY(-2px);
}

.actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    font-size:0.8em;
}

/* Navigation */
.novel-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 2;
    /* box-shadow: var(--shadow); */
    font-size: 0.9em;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 2rem;
    padding: 0 1rem;
    scrollbar-width:none;
}

.novel-nav a {
    padding: 1rem 0;
    color: var(--text-secondary);
    text-decoration: none;
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
}

.novel-nav a:hover {
    color: var(--primary);
}

.novel-nav a.active {
    color: var(--primary);
}

.novel-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    box-shadow: var(--shadow);
}

/* Content Sections */
/* Overview section */
.novel-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

#overview .synopsis{
    text-align:justify;
    font-size:0.9em;
}

.novel-stats{
    display:flex;
    flex-direction:column;
    align-items: end;
    gap:0.5em;
    font-size:0.9em;
}

.stat-card{
    display:flex;
    /* flex-direction:row-reverse; */
    gap:0.5em;
    align-items:center;
}

.stat-card .fa{
    color:var(--primary);
}



.content-section {
    margin-bottom: 3rem;
    background: var(--surface);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.section-header {
    display: flex;
    flex-direction:column;
    justify-content: space-between;
    /* align-items: center; */
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}


.chapter-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.chapter-list .chapter{
    display:flex;
    align-items:center;
    justify-content:space-between;
    font-size:0.9em;
}

.chapter-list .chapter .ch-details{
    flex:4;
}


.chapter-list .chapter .ch-number{
    color: var(--primary);
    font-weight:700;
}

.chapter-list .chapter .ch-extra{
    gap:0.5em;
}

.chapter-list .chapter .ch-extra .read-arrow{
    color: var(--grey);
    color: var(--primary);
    opacity:0.2;
    flex:1;
}

.chapter-list .chapter .ch-cost{
    font-weight: 700;
    /* flex:1; */
    text-align:right;

    /* display:none; */
}

.chapter-list .chapter .ch-cost small{
    font-size:0.7em;
}

.chapter-list .chapter .ch-cost .fa{
    color: var(--primary);
}


/* .section-header .head{
    font-weight:1000;
}

.section-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
} */

/* Chapters Section */
.chapter-filters {
    /* display: flex; */
    gap: 0.5rem;
}

.search-input, .sort-select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-2);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-input:focus, .sort-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-xx-light);
}

/* .chapters-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.chapter-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.chapter-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.chapter-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chapter-number {
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 600;
}

.chapter-info h3 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 600;
}

.chapter-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.chapter-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
} */

.read-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Reviews Section */
.reviews-summary {
    background: var(--surface);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.overall-rating {
    display: flex;
    align-items: center;
    flex-direction:column;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-2);
    border-radius: var(--border-radius);
}

.rating-circle {
    min-width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-2);
    transition: transform 0.3s ease;
}

.rating-circle:hover {
    transform: scale(1.05);
}

.rating-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.rating-max {
    font-size: 1rem;
    opacity: 0.8;
}

.rating-stars {
    color: var(--primary);
    font-size: 1.75rem;
    display: flex;
    gap: 0.25rem;
}

.total-reviews {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Comments Section Layout */
.comments-section {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}


/* Author and Comment Avatars */
.author-avatar, .comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-xx-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

.comment-author{
    font-weight:bold;
    color: var(--primary-dark);
}

.comment-date{
    font-size:0.7em;
    /* font-style:italic; */
    margin-top:-0.5em;
    /* font-family:var(--font-header); */
}

.comment-content{
    margin-top:0.5em;
    font-size:0.8em;
}

.author-avatar {
    width: 48px;
    height: 48px;
    font-size: 1.5rem;
}

@media (min-width: 1024px) {
    .comments-section {
        grid-template-columns: 350px 1fr;
    }
}

.comment-form {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    height: fit-content;
}

.comment-input {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--surface-2);
    color: var(--text-primary);
    margin-bottom: 1rem;
    resize: vertical;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 800px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.comments-list::-webkit-scrollbar {
    width: 6px;
}

.comments-list::-webkit-scrollbar-track {
    background: var(--surface-2);
    border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.comment-item {
    background: var(--surface);
    padding: 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.comment-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.comment-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.4rem 0.75rem;
    border-radius: 20px;
    background: var(--surface-2);
}

.comment-action:hover {
    color: var(--primary);
    background: var(--primary-xx-light);
    transform: translateY(-1px);
}

.write-review-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.write-review-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

/* Reading Progress */
.reading-progress {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    padding: 1rem;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .chapter-item {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .chapter-stats {
        justify-content: flex-start;
    }

    .read-btn {
        width: 100%;
    }

    .hero-content {
        flex-direction: column;
    }

    .book-cover {
        width: 100%;
        max-width: 250px;
        height:380px;
        margin: 0 auto;
    }

    .novel-info h1 {
        font-size: 2rem;
    }

    .nav-content {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }
    #reviews{
        padding-inline:1em;
    }
}


@media (max-width: 480px) {
    .novel-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .actions {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    /* .chapter-filters {
        flex-direction: column;
    } */

    .search-input, .sort-select {
        width: 100%;
    }
} 



.rating-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;
}

.rating-modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.stars-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    justify-content: center;
}

.star {
    font-size: 1.5rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star.active {
    color: var(--primary);
}

.rating-comment {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    resize: vertical;
}

.submit-rating {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    /* font-size: 1rem; */
    cursor: pointer;
    transition: background 0.2s;
}

.submit-rating:hover {
    background: var(--primary-dark);
}