/* Main variables and global styles */
:root {
    --sm-background: #000000;
    --sm-card: #0F151C;
    --sm-primary-text: #E0E0E0;
    --sm-secondary-text: #BDBDBD;
    --sm-brand-main: #E68900;
    --sm-secondary-bg: #15212E;
    --sm-error: #B74C65;
    --sm-success: #4CAF50;
    --sm-gold: #C5A562;
    --sm-blue: #72D9FF;
}

html, body {
    margin: 0;
    padding: 0;
    background-color: var(--sm-background); 
    font-family: Arial, sans-serif;
    color: var(--sm-primary-text);
    overflow-x: hidden;
}

.content-container { 
    background-color: var(--sm-background); 
}

a { 
    color: var(--sm-brand-main); 
    text-decoration: none; 
}

a:hover { 
    color: var(--sm-gold); 
}



  /* 
       STORY MANIA HEADER STYLES 
       Mapped from Android XML Colors
    */
    :root {
        --header-bg: rgba(15, 21, 28, 0.95);      /* novel_app_card with opacity */
        --header-border: #333333;                 /* novel_app_secondary_light */
        --input-bg: #15212E;                      /* novel_app_secondary */
        
        /* CHANGED: Orange -> #72D9FF (novel_app_secondary_accent) */
        --brand-accent: #72D9FF;                  
        
        --text-main: #E0E0E0;                     /* novel_app_text */
        --text-dark: #0F151C;                     /* Text color for inside blue buttons */
        --text-secondary: #BDBDBD;                /* novel_app_hint */
    }

    .app-header {
        background: var(--header-bg);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--header-border);
        padding: 0 20px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: sticky;
        top: 0;
        z-index: 1000;
    }
    .app-header-container {
        width: 100%;
        max-width: 1200px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .app-header-left {
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }
    .app-header-logo {
        display: flex;
        align-items: center;
        text-decoration: none;
    }
    .app-header-logo img {
        height: 35px;
        border-radius: 6px;
    }
    .site-name-styled {
        font-size: 20px;
        font-weight: bold;
        margin-left: 10px;
        user-select: none;
    }
    .site-name-part1 {
        color: var(--text-main);
        letter-spacing: -0.5px;
    }
    .site-name-part2 {
        color: var(--brand-accent); /* Blue Accent */
    }

    .app-header-center {
        flex-grow: 1;
        display: flex;
        justify-content: center;
        padding: 0 20px;
        position: relative;
    }
    .search-bar {
        position: relative;
        width: 100%;
        max-width: 450px;
    }
    .search-bar input {
        width: 100%;
        height: 40px;
        border-radius: 20px;
        border: 1px solid var(--header-border);
        background-color: var(--input-bg);
        color: var(--text-main);
        padding: 0 45px 0 20px;
        font-size: 14px;
        transition: all 0.3s ease;
    }
    .search-bar input:focus {
        outline: none;
        border-color: var(--brand-accent);
        /* Blue Glow */
        box-shadow: 0 0 8px rgba(114, 217, 255, 0.4); 
    }
    .search-bar input::placeholder {
        color: var(--text-secondary);
    }
    .search-bar .search-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--text-secondary);
    }
    
    /* Dropdown Styles */
    .search-dropdown-container {
        display: none;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        border: 1px solid var(--header-border);
        z-index: 1001;
        max-height: 400px;
        overflow-y: auto;
    }
    .search-bar.open .search-dropdown-container {
        display: block;
    }
    .search-dropdown-result a {
        display: block;
        padding: 10px 15px;
        color: var(--text-main);
        text-decoration: none;
        transition: background-color 0.2s;
    }
    .search-dropdown-result a:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
    .search-advanced-container a {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 12px 15px;
        font-weight: bold;
        color: var(--brand-accent);
    }

    .app-header-right {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    /* User Menu */
    .user-menu-trigger {
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 8px;
        position: relative;
    }
    .user-menu-trigger img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        border: 2px solid transparent;
        transition: border-color 0.2s;
    }
    .user-menu-trigger:hover img, .user-menu-trigger.active img {
        border-color: var(--brand-accent);
    }
    .user-dropdown {
        display: none;
        position: absolute;
        top: 55px;
        right: 0;
        width: 220px;
        background: var(--header-bg);
        backdrop-filter: blur(10px);
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
        border: 1px solid var(--header-border);
        padding: 8px 0;
        z-index: 1001;
    }
    .user-dropdown.show {
        display: block;
    }
    .dropdown-user-info {
        padding: 10px 15px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid var(--header-border);
    }
    .dropdown-user-info img {
        width: 40px;
        height: 40px;
        border-radius: 50%;
    }
    .dropdown-user-info .user-name {
        font-weight: bold;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .user-dropdown a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 15px;
        color: var(--text-main);
        text-decoration: none;
        font-size: 14px;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }
    .user-dropdown a:hover {
        background-color: var(--brand-accent);
        color: var(--text-dark); /* Dark text on Blue background */
    }
    .user-dropdown hr {
        border: none;
        border-top: 1px solid var(--header-border);
        margin: 8px 0;
    }
    
    /* Auth Buttons */
    .auth-buttons a {
        text-decoration: none;
        color: #fff;
        padding: 8px 16px;
        border-radius: 20px;
        margin-left: 10px;
        font-weight: 500;
        transition: opacity 0.2s;
    }
    .auth-buttons .login-btn {
        background-color: transparent;
        border: 1px solid var(--header-border);
        color: var(--text-main);
    }
    .auth-buttons .register-btn {
        background-color: var(--brand-accent);
        color: var(--text-dark); /* Dark text for contrast */
        font-weight: bold;
    }
    .auth-buttons a:hover {
        opacity: 0.85;
    }

   @media (max-width: 768px) {
    .app-header { padding: 0 10px; }
    .app-header-container { flex-wrap: nowrap; gap: 10px; }
    .app-header-left, .app-header-right { flex-shrink: 0; }
    .app-header-center { flex: 1 1 auto; min-width: 0; padding: 0; overflow: hidden; display: flex; justify-content: center; }
    .search-bar { flex: 1; max-width: none; }
    .search-bar input { width: 100%; padding-left: 15px; padding-right: 40px; box-sizing: border-box; }
    .search-bar .search-icon { right: 12px; }
    .site-name-styled { display: none; }
    }

/* =======================================
          Start from here 
   ======================================= */

.footer-digitent {
  background-color: #0F151C; 
  color: #E0E0E0;           
  padding: 60px 20px 40px;  
  font-family: 'Inter', 'Arial', sans-serif;
  font-size: 15px;
  border-top: 1px solid #333333;
  
 
  position: relative;
  z-index: 10;
  overflow: hidden;
}


.footer-digitent .footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start; 
  flex-wrap: wrap;        
  gap: 40px;
}


.footer-digitent .footer-col {
  flex: 1;
  min-width: 220px;
  display: flex;           
  flex-direction: column; 
  gap: 15px;              
}


.footer-digitent h4 {
  font-size: 1.2em;
  font-weight: 700;
  color: #72D9FF;        
  margin: 0 0 5px 0;      
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
}


.footer-digitent p {
  margin: 0;
  line-height: 1.8;        
  color: #BDBDBD;
  font-size: 0.95em;
  max-width: 300px;      
}


.footer-digitent a {
  color: #E0E0E0;
  text-decoration: none !important;
  border: none !important;         
  display: block;                 
  line-height: 1.6;
  font-size: 0.95em;
  transition: all 0.2s ease;
  width: fit-content;              
}

.footer-digitent a:hover {
  color: #72D9FF;
  transform: translateX(5px);     
}


.footer-digitent .social-icons {
  display: flex;
  flex-direction: row;     
  gap: 12px;
  margin-top: 10px;
}

.footer-digitent .social-icons a {
  background-color: #15212E;
  color: #72D9FF;
  width: 40px;            
  height: 40px;           
  border-radius: 50%;
  display: flex !important;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  border: 1px solid #333 !important;
  text-align: center;
  padding: 0;             
  transform: none;         
}

.footer-digitent .social-icons a:hover {
  background-color: #72D9FF;
  color: #0F151C;
  border-color: #72D9FF !important;
  transform: translateY(-3px); 
}


.footer-digitent .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  margin-top: 50px;
  padding-top: 25px;
  font-size: 0.85em;
  color: #666;
  width: 100%;
}


@media (max-width: 768px) {
  .footer-digitent .footer-inner {
    flex-direction: column;
    gap: 40px;
  }
  
  .footer-digitent .footer-col {
    width: 100%;
    align-items: center; 
    text-align: center;
  }

  .footer-digitent p {
    max-width: 100%;
  }
}

        /*Start from here */


    :root {
        --primary-brand: #4AD0FF;
        --primary-brand-dark: #0288D1;
        --bg-main: #000000;
        --bg-card: #0F151C;
        --bg-secondary: #15212E;
        --text-primary: #FFFFFF;
        --text-secondary: #B0BEC5;
        --gold-star: #FFD700;
        --badge-completed: #00E676; 
        --badge-ongoing: #4AD0FF;   
        --border-color: #1F2933;
    }

    body { background-color: var(--bg-main); font-family: 'Segoe UI', sans-serif; color: var(--text-primary); margin: 0; }
    
    .novel-detail-container {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding-bottom: 50px;
    }

    /* --- IMMERSIVE HEADER (GLASSMORPHISM) --- */
    .novel-header-wrapper {
        position: relative;
        overflow: hidden;
        margin-bottom: 30px;
        border-bottom: 1px solid var(--border-color);
    }

    /* Blurry Background Image */
    .novel-bg-blur {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: url('<?php echo $wo['novel']['image_link']; ?>');
        background-size: cover;
        background-position: center;
        filter: blur(40px) brightness(0.3);
        z-index: 0;
    }

    .novel-hero-content {
        position: relative;
        z-index: 1;
        display: flex;
        gap: 40px;
        padding: 60px 20px;
        max-width: 1100px;
        margin: 0 auto;
    }

    /* Cover Image */
    .novel-cover-wrapper {
        flex-shrink: 0;
        position: relative;
    }
    .novel-cover-img {
        width: 240px;
        height: 360px;
        object-fit: cover;
        border-radius: 12px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.6);
        border: 1px solid rgba(255,255,255,0.1);
    }
    /* Top Pick Badge on Cover */
    .cover-badge {
        position: absolute;
        top: -10px;
        left: -10px;
        background: linear-gradient(45deg, #FFD700, #FFA000);
        color: #000;
        font-weight: bold;
        padding: 5px 12px;
        border-radius: 20px;
        font-size: 0.8em;
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        z-index: 2;
    }

    /* Info Section */
    .novel-info {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .novel-badges {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
    }
    .badge-status {
        font-size: 0.8em;
        text-transform: uppercase;
        font-weight: 700;
        padding: 4px 10px;
        border-radius: 4px;
        letter-spacing: 0.5px;
    }
    .status-completed { background-color: rgba(0, 230, 118, 0.2); color: var(--badge-completed); border: 1px solid var(--badge-completed); }
    .status-ongoing { background-color: rgba(74, 208, 255, 0.2); color: var(--badge-ongoing); border: 1px solid var(--badge-ongoing); }

    .novel-title {
        font-size: 3em;
        font-weight: 800;
        margin: 0 0 10px;
        line-height: 1.1;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }

    /* Rating Block */
    .rating-block {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 20px;
        font-size: 1.1em;
    }
    .stars { color: var(--gold-star); display: flex; }
    .rating-score { font-weight: bold; color: #fff; }
    .rating-count { font-size: 0.85em; color: rgba(255,255,255,0.7); margin-left: 5px; }

    /* Stats Grid */
    .stats-grid {
        display: flex;
        gap: 40px;
        margin-bottom: 25px;
        border-top: 1px solid rgba(255,255,255,0.1);
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding: 15px 0;
    }
    .stat-item { display: flex; flex-direction: column; }
    .stat-val { font-size: 1.4em; font-weight: bold; color: #fff; }
    .stat-label { font-size: 0.85em; color: rgba(255,255,255,0.6); text-transform: uppercase; }

    /* Author Mini Card */
    .author-mini {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 30px;
        background: rgba(255,255,255,0.05);
        padding: 10px 15px;
        border-radius: 50px;
        width: fit-content;
        transition: 0.3s;
        text-decoration: none;
    }
    .author-mini:hover { background: rgba(255,255,255,0.15); }
    .author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
    .author-details { display: flex; flex-direction: column; }
    .author-name { font-weight: 700; font-size: 0.95em; color: #fff; display: flex; align-items: center; gap: 5px; }
    .verified-icon { color: var(--primary-brand); width: 14px; height: 14px; }
    .author-role { font-size: 0.8em; color: var(--text-secondary); }

    /* Read Button */
    .btn-read {
        background: var(--primary-brand);
        color: #000;
        font-weight: 800;
        padding: 16px 45px;
        border-radius: 30px;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 10px;
        font-size: 1.2em;
        transition: 0.3s;
        box-shadow: 0 0 20px rgba(74, 208, 255, 0.4);
    }
    .btn-read:hover {
        transform: scale(1.05);
        box-shadow: 0 0 30px rgba(74, 208, 255, 0.6);
    }

    /* --- TABS & CONTENT --- */
    .content-wrapper { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
    
    .tabs-header { display: flex; gap: 30px; border-bottom: 1px solid var(--border-color); margin-bottom: 30px; }
    .tab-btn {
        padding: 15px 0;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 1.1em;
        font-weight: 600;
        cursor: pointer;
        border-bottom: 3px solid transparent;
        transition: 0.3s;
    }
    .tab-btn.active { color: var(--primary-brand); border-bottom-color: var(--primary-brand); }
    
    .tab-content { display: none; }
    .tab-content.active { display: block; }

    /* Description */
    .synopsis-text {
        font-size: 1.1em;
        line-height: 1.8;
        color: var(--text-secondary);
        white-space: pre-line;
    }

    /* Chapters Grid */
    .chapter-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 15px;
        list-style: none;
        padding: 0;
    }
    .chapter-card {
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        padding: 20px;
        border-radius: 8px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        transition: 0.2s;
    }
    .chapter-card:hover {
        border-color: var(--primary-brand);
        background: var(--bg-secondary);
    }
    .chapter-info h4 { margin: 0 0 5px; font-size: 1em; color: #fff; }
    .chapter-info span { font-size: 0.85em; color: var(--text-secondary); }

    /* Tags */
    .tag-cloud { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
    .tag-chip {
        background: rgba(255,255,255,0.1);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 0.85em;
        color: #fff;
    }
    
    
    
     .load-more-container {
        width: 100%;
        text-align: center;
        margin-top: 30px;
        margin-bottom: 20px;
    }

    .btn-load-more {
        background: transparent;
        color: var(--primary-brand);
        border: 1px solid var(--primary-brand);
        padding: 12px 40px;
        border-radius: 30px;
        font-size: 1em;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s ease;
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }

    .btn-load-more:hover {
        background: rgba(74, 208, 255, 0.1);
        box-shadow: 0 0 15px rgba(74, 208, 255, 0.2);
    }

    /* SPINNER ANIMATION */
    .spinner {
        width: 20px;
        height: 20px;
        border: 2px solid rgba(74, 208, 255, 0.3);
        border-top: 2px solid var(--primary-brand);
        border-radius: 50%;
        animation: spin 1s linear infinite;
        display: none; /* Hidden by default */
    }
    
    
    /* Add this inside your main <style> tag */
.loading-spinner-wrapper {
    width: 100%;
    padding: 50px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

    @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
    }
    
    .hidden { display: none !important; }

    @media (max-width: 768px) {
        .novel-hero-content { flex-direction: column; align-items: center; text-align: center; }
        .novel-cover-img { width: 180px; height: 270px; }
        .novel-title { font-size: 2em; }
        .rating-block, .novel-badges, .stats-grid, .author-mini { justify-content: center; }
        .author-mini { margin: 0 auto 20px; }
        .chapter-grid { grid-template-columns: 1fr; }
    }
    
    
    
        /*Novel Start from here */


    :root {
        /* Colors from your XML */
        --app-bg: #000000;              /* novel_app_background */
        --app-card: #0F151C;            /* novel_app_card */
        --app-secondary: #15212E;       /* novel_app_secondary */
        --app-border: #333333;          /* novel_app_secondary_light */
        --app-text-main: #E0E0E0;       /* novel_app_text */
        --app-text-meta: #BDBDBD;       /* novel_app_hint */
        --app-accent: #4AD0FF;          /* novel_app_secondary_accent_medium (Brand Blue) */
        --app-gold: #C5A562;            /* novel_app_gold_accent */
        --app-btn-orange: #E68900;      /* novel_app_button */
        
        /* Gradients based on your XML theme */
        --app-btn-grad: linear-gradient(135deg, #4AD0FF 0%, #1976D2 100%);
        --app-featured-grad: linear-gradient(135deg, #311B92 0%, #880E4F 100%);
    }

    /* Global Resets */
    body { 
        background-color: var(--app-bg) !important; 
        font-family: 'Inter', 'Arial', sans-serif; 
        color: var(--app-text-main); 
        margin: 0; padding: 0; 
    }
    
    a { text-decoration: none; color: inherit; }
    
    .content-container { 
        background-color: var(--app-bg) !important; 
        padding-top: 0 !important; 
        border: none !important; 
        box-shadow: none !important;
    }
    
    .homepage-container {
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 20px 15px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 35px;
    }

    /* --- 1. TOP BANNER CAROUSEL --- */
    .section-banner-wrapper {
        width: 100%;
        aspect-ratio: 16 / 9;
        max-height: 500px;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--app-border);
        background: var(--app-card);
    }
    .main-banner-carousel { visibility: hidden; width: 100%; height: 100%; }
    .main-banner-carousel.flickity-enabled { visibility: visible; }
    
    .banner-cell { 
        width: 100%; height: 100%; 
        margin-right: 10px; border-radius: 12px; display: block;
    }
    .banner-cell img { width: 100%; height: 100%; object-fit: cover; }

    /* Flickity Buttons */
    .flickity-button { background: rgba(15, 21, 28, 0.7) !important; color: var(--app-accent) !important; }
    .flickity-button:hover { background: var(--app-accent) !important; color: #000 !important; }
    .flickity-page-dots .dot { background: rgba(255, 255, 255, 0.3) !important; opacity: 1; }
    .flickity-page-dots .dot.is-selected { background: var(--app-accent) !important; }

    /* --- 2. MIDDLE BANNER --- */
    .section-middle-banner {
        display: block; /* Make anchor behave like block */
        width: 100%;
        aspect-ratio: 16 / 5;
        border-radius: 12px;
        overflow: hidden;
        border: 1px solid var(--app-border);
        transition: transform 0.3s ease;
    }
    .section-middle-banner:hover img { transform: scale(1.02); }
    .section-middle-banner img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }

    /* --- 3. UNIFIED WRITER CARD --- */
    .writer-unified-card {
        display: flex;
        width: 100%;
        min-height: 260px;
        background: var(--app-card);
        border: 1px solid var(--app-border);
        border-radius: 16px;
        overflow: hidden;
        margin-bottom: 10px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    }

    .writer-profile-pane {
        flex: 0 0 32%;
        position: relative;
        padding: 30px 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        border-right: 1px solid var(--app-border);
        overflow: hidden;
        z-index: 1;
    }
    .writer-bg-layer {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        z-index: -2;
        filter: blur(8px) grayscale(40%);
        opacity: 0.4;
        background-size: cover; background-position: center;
    }
    .writer-overlay-layer {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        z-index: -1;
        background: linear-gradient(to bottom, rgba(15, 21, 28, 0.8), #0F151C);
    }
    .unified-avatar {
        width: 90px; height: 90px;
        border-radius: 50%;
        border: 3px solid var(--app-gold);
        object-fit: cover;
        margin-bottom: 15px;
        box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    }
    .unified-name {
        font-size: 1.4rem; font-weight: 800; color: #fff;
        margin: 0 0 5px 0; line-height: 1.2;
    }
    .unified-badge {
        background: rgba(74, 208, 255, 0.15); color: var(--app-accent);
        border: 1px solid rgba(74, 208, 255, 0.3);
        font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
        padding: 4px 10px; border-radius: 4px; margin-bottom: 20px;
        display: inline-block;
    }
    .unified-btn {
        background: var(--app-btn-grad);
        color: #fff; padding: 10px 25px; border-radius: 25px;
        font-size: 0.85rem; font-weight: 600; text-decoration: none;
        transition: transform 0.2s; white-space: nowrap;
    }
    .unified-btn:hover { transform: scale(1.05); color: #fff; }

    .writer-novels-pane {
        flex: 1;
        min-width: 0;
        display: flex; align-items: center;
        background: var(--app-card);
        padding: 10px;
    }
    .writer-novels-pane .section-list-wrapper { width: 100%; }
    .writer-novels-pane .section-list { padding: 15px 5px; }

    /* --- 4. STANDARD SECTIONS & CARDS --- */
    .section-standard { display: flex; flex-direction: column; gap: 15px; }
    
    .section-header { display: flex; justify-content: space-between; align-items: center; padding: 0 5px; }
    .section-title { 
        font-size: 1.4em; font-weight: 700; color: var(--app-text-main); margin: 0; 
        border-left: 4px solid var(--app-accent); padding-left: 10px;
    }
    .section-see-all { 
        color: var(--app-text-meta); font-size: 0.85em; font-weight: 600; 
        text-decoration: none; transition: color 0.2s; 
    }
    .section-see-all:hover { color: var(--app-accent); }

    .section-list-wrapper { position: relative; }
    .section-list {
        display: flex; overflow-x: auto; gap: 15px; padding: 10px 5px;
        scroll-behavior: smooth; scrollbar-width: none;
    }
    .section-list::-webkit-scrollbar { display: none; }

    .nav-arrow {
        position: absolute; top: 40%; transform: translateY(-50%); z-index: 5;
        width: 35px; height: 35px; border-radius: 50%;
        background: var(--app-card); color: var(--app-accent); 
        border: 1px solid var(--app-border);
        display: flex; align-items: center; justify-content: center;
        cursor: pointer; opacity: 0; transition: all 0.2s ease;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    }
    .section-list-wrapper:hover .nav-arrow { opacity: 1; }
    .nav-arrow:hover { background: var(--app-accent); color: #000; }
    .nav-arrow.prev { left: -10px; }
    .nav-arrow.next { right: -10px; }

    /* Novel Card (Now an Anchor Tag) */
    .novel-card {
        flex: 0 0 130px;
        display: flex; flex-direction: column; 
        cursor: pointer; transition: transform 0.2s ease;
        background: transparent;
        text-decoration: none; /* Removes underline from link */
    }
    .novel-card:hover { transform: translateY(-5px); }

    .novel-cover {
        position: relative; width: 100%; aspect-ratio: 2 / 3;
        border-radius: 8px; overflow: hidden; 
        background-color: var(--app-card);
        border: 1px solid var(--app-border);
        box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    }
    .novel-cover img { width: 100%; height: 100%; object-fit: cover; }

    .rank-badge {
        position: absolute; top: 0; left: 0; 
        width: 28px; height: 28px;
        background: var(--app-accent); color: #000; 
        font-weight: 800; font-size: 13px;
        border-bottom-right-radius: 8px; 
        display: flex; align-items: center; justify-content: center; z-index: 2;
    }

    .novel-details { padding: 10px 0; }
    .novel-title {
        color: var(--app-text-main); 
        font-size: 0.95em; font-weight: 600; margin-bottom: 4px; line-height: 1.3;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .novel-meta { font-size: 0.8em; color: var(--app-text-meta); }
    
    /* Responsive */
    @media (max-width: 768px) {
        .homepage-container { padding: 10px; gap: 25px; }
        .nav-arrow { display: none !important; }
        .section-banner-wrapper { height: auto; aspect-ratio: 16/9; }
        .novel-card { flex: 0 0 115px; }
        
        .writer-unified-card { flex-direction: column; min-height: auto; }
        .writer-profile-pane { 
            flex: none; width: 100%; border-right: none; 
            border-bottom: 1px solid var(--app-border); 
            padding: 25px 15px; box-sizing: border-box;
        }
        .writer-novels-pane { width: 100%; padding: 10px 0; box-sizing: border-box; }
        .writer-novels-pane .section-list { padding-left: 15px; }
    }
    
    
    
    
    /* chapter content start from here */

    
    :root {
--brand-cyan: #4AD0FF;
--brand-cyan-hover: #72D9FF;
--bg-dark: #121212;
--bg-panel: #1e1e1e;
--text-main: #e0e0e0;
--text-muted: #aaaaaa;
--alert-color: #ff4a4a;
}

.content-container { background-color: var(--bg-dark); padding: 0; }
body { background-color: var(--bg-dark); font-family: 'Segoe UI', sans-serif; overflow-x: hidden; }

.reading-page-wrapper {
min-height: 100vh;
transition: background-color 0.3s, color 0.3s;
padding-bottom: 80px;
}

.reading-header {
position: sticky; top: 0; z-index: 1001;
background: rgba(18, 18, 18, 0.9);
backdrop-filter: blur(12px);
border-bottom: 1px solid #333;
height: 60px;
display: flex; align-items: center; justify-content: space-between;
padding: 0 20px; box-sizing: border-box;
}
.header-back-btn, .header-settings-btn {
background: none; border: none; color: var(--text-main);
cursor: pointer; padding: 8px; border-radius: 50%;
display: flex; transition: background-color 0.2s;
}
.header-back-btn:hover, .header-settings-btn:hover { background-color: rgba(255,255,255,0.1); }

.header-novel-title { color: #fff; font-weight: bold; text-align: center; max-width: 70%; }
.header-novel-title span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-novel-title small { display: block; font-weight: normal; color: var(--text-muted); font-size: 0.8em; margin-top: 2px; }

.reading-content { max-width: 800px; margin: 0 auto; padding: 40px 20px; }

.chapter-title-main {
font-size: 2.2em; font-weight: 800; margin: 0 0 10px;
text-align: center; line-height: 1.3; color: var(--brand-cyan);
}
.chapter-meta { text-align: center; color: var(--text-muted); font-size: 0.9em; margin-bottom: 40px; }

.chapter-text {
font-family: 'Georgia', serif;
font-size: 1.1em;
line-height: 1.8;
white-space: normal;
transition: font-size 0.2s;
color: var(--text-main);
-webkit-user-select: none; user-select: none;
}

.chapter-text p { margin-bottom: 16px; margin-top: 0; }

.chapter-inline-ad {
display: block;
text-align: center;
margin: 10px auto 25px auto !important;
clear: both;
line-height: 0;
}

.chapter-navigation-wrapper {
max-width: 800px; margin: 40px auto; padding: 0 20px;
display: flex; flex-direction: column; gap: 30px;
}

.nav-buttons-row {
display: flex; justify-content: space-between; align-items: center; gap: 15px; width: 100%;
}

.nav-btn {
flex: 1;
padding: 12px 20px; border-radius: 30px;
text-decoration: none; font-weight: bold;
transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
border: 1px solid #444;
background-color: transparent; color: var(--text-main);
text-align: center; font-size: 0.95em;
display: flex; align-items: center; justify-content: center; gap: 8px;
}

.reading-page-wrapper .nav-btn.btn-brand {
background-color: var(--brand-cyan) !important;
border-color: var(--brand-cyan) !important;
color: #000000 !important;
box-shadow: 0 4px 15px rgba(74, 208, 255, 0.3);
}
.reading-page-wrapper .nav-btn.btn-brand:hover {
background-color: var(--brand-cyan-hover) !important;
border-color: var(--brand-cyan-hover) !important;
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(74, 208, 255, 0.5);
}
.nav-btn.disabled { opacity: 0.3; pointer-events: none; border-color: #333; }

.full-width-download-section {
width: 100%;
display: block;
clear: both;
margin-top: 10px;
}

.limit-reached-msg {
flex: 1;
color: var(--alert-color);
font-weight: bold;
font-size: 0.9em;
text-align: center;
padding: 10px;
border: 1px dashed var(--alert-color);
border-radius: 12px;
background: rgba(255, 74, 74, 0.05);
}

.engagement-section {
max-width: 800px; margin: 50px auto 20px; padding: 30px 20px;
background: rgba(255,255,255,0.03); border-radius: 12px;
border: 1px solid #333;
text-align: center;
}
.engagement-title { font-size: 1.2em; font-weight: bold; margin-bottom: 20px; color: #fff; }

.star-rating-container { display: flex; justify-content: center; gap: 10px; margin-bottom: 25px; }
.star-icon { width: 32px; height: 32px; cursor: pointer; color: #444; transition: 0.2s; }
.star-icon.active, .star-icon:hover, .star-icon.hovered { color: #FFD700; drop-shadow: 0 0 5px rgba(255, 215, 0, 0.5); }

.comment-box-wrapper { position: relative; margin-top: 20px; }
.comment-input {
width: 100%; height: 100px; background: #1a1a1a; border: 1px solid #444;
border-radius: 8px; color: #fff; padding: 15px; box-sizing: border-box;
resize: none; font-family: inherit;
}
.comment-input:focus { outline: none; border-color: var(--brand-cyan); }

.btn-submit-comment {
margin-top: 15px; background: var(--brand-cyan); color: #000;
border: none; padding: 10px 30px; border-radius: 30px;
font-weight: bold; cursor: pointer; transition: 0.3s;
box-shadow: 0 4px 15px rgba(74, 208, 255, 0.2);
}
.btn-submit-comment:hover {
background: var(--brand-cyan-hover); transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(74, 208, 255, 0.4);
}
.login-prompt { color: var(--text-muted); font-size: 0.95em; }
.login-prompt a { color: var(--brand-cyan); text-decoration: none; }

.reading-settings-panel {
position: fixed; bottom: 0; left: 0; width: 100%;
background-color: var(--bg-panel); border-top: 1px solid #333;
box-shadow: 0 -10px 30px rgba(0,0,0,0.8);
padding: 25px 20px; box-sizing: border-box; z-index: 1002;
transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
display: flex; justify-content: center; gap: 40px;
}
.reading-settings-panel.active { transform: translateY(0); }

.setting-group { display: flex; align-items: center; gap: 15px; }
.setting-group label { color: var(--text-muted); font-size: 0.9em; text-transform: uppercase; letter-spacing: 1px; }
.setting-group button {
background: #333; border: 1px solid #555; color: #fff;
border-radius: 50%; width: 40px; height: 40px;
cursor: pointer; display: flex; align-items: center; justify-content: center;
transition: 0.2s;
}
.setting-group button:hover { border-color: var(--brand-cyan); color: var(--brand-cyan); }

#fontSizeDisplay {
background-color: #000; padding: 8px 15px; border-radius: 20px;
color: var(--brand-cyan); font-weight: bold; min-width: 60px; text-align: center;
border: 1px solid #333;
}

.theme-options { display: flex; gap: 10px; }
.theme-btn { border-radius: 50% !important; border: 2px solid transparent !important; }
.theme-btn[data-theme="theme-dark"] { background: #121212 !important; border-color: #333 !important; }
.theme-btn[data-theme="theme-sepia"] { background: #fbf0d9 !important; }
.theme-btn[data-theme="theme-light"] { background: #ffffff !important; }
.theme-btn.active { border-color: var(--brand-cyan) !important; transform: scale(1.1); box-shadow: 0 0 10px rgba(74, 208, 255, 0.4); }

.reading-page-wrapper.theme-sepia { background-color: #fbf0d9; color: #5b4636; }
.reading-page-wrapper.theme-sepia .reading-header { background: rgba(243, 225, 196, 0.9); border-bottom-color: #d1b895; }
.reading-page-wrapper.theme-sepia .chapter-text { color: #433422; }
.reading-page-wrapper.theme-sepia .header-novel-title { color: #433422; }
.reading-page-wrapper.theme-sepia .header-back-btn, .reading-page-wrapper.theme-sepia .header-settings-btn { color: #433422; }

.reading-page-wrapper.theme-light { background-color: #ffffff; color: #111; }
.reading-page-wrapper.theme-light .reading-header { background: rgba(255, 255, 255, 0.95); border-bottom-color: #eee; }
.reading-page-wrapper.theme-light .chapter-text { color: #000; }
.reading-page-wrapper.theme-light .header-novel-title { color: #000; }
.reading-page-wrapper.theme-light .header-back-btn, .reading-page-wrapper.theme-light .header-settings-btn { color: #000; }

@media (max-width: 768px) {
.reading-header { padding: 0 15px; }
.reading-content { padding: 20px 15px; }
.chapter-title-main { font-size: 1.6em; }
.reading-settings-panel { flex-direction: column; gap: 20px; align-items: center; }
.nav-btn span { display: none; }
.nav-btn { justify-content: center; }
}

.comments-container { margin-top: 30px; border-top: 1px solid #333; padding-top: 20px; }
.comment-item { display: flex; gap: 15px; margin-bottom: 20px; text-align: left; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #333; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; font-size: 0.9em; }
.comment-author { font-weight: bold; color: #fff; }
.comment-time { color: var(--text-muted); font-size: 0.85em; }
.comment-rating { color: #FFD700; font-size: 0.85em; }
.comment-text { color: var(--text-main); font-size: 0.95em; line-height: 1.5; }
.btn-view-comments { width: 100%; padding: 12px; background: transparent; border: 1px solid var(--brand-cyan); color: var(--brand-cyan); border-radius: 30px; font-weight: bold; cursor: pointer; margin-top: 10px; transition: 0.3s; }
.btn-view-comments:hover { background: rgba(74, 208, 255, 0.1); box-shadow: 0 0 15px rgba(74, 208, 255, 0.2); }
.btn-view-comments.hidden { display: none; }






/* Novel List start from here */






   .novel-list-section {
        max-width: 800px;
        margin: 0 auto 40px auto;
        padding: 40px 20px 20px 20px;
        border-top: 1px solid #333;
    }
    .novel-list-section .section-title {
        text-align: center;
        margin: 0 0 25px 0;
        font-size: 1.8em;
        color: var(--text-main, #e0e0e0);
        font-weight: 700;
    }
    .novel-list-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }
    .novel-list-card {
        text-decoration: none;
        color: inherit;
        display: block;
    }
    .novel-list-cover {
        position: relative;
        transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    }
    .novel-list-card:hover .novel-list-cover {
        transform: translateY(-5px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.25);
    }
    .novel-list-cover img {
        width: 100%;
        height: auto;
        aspect-ratio: 2/3;
        object-fit: cover;
        border-radius: 8px;
        display: block;
    }
    .novel-list-details {
        padding: 10px 5px;
    }
    .novel-list-title {
        font-size: 1.05em;
        font-weight: 600;
        margin: 0 0 5px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* --- NEW BADGE STYLES --- */
    .novel-status-badge {
        position: absolute;
        top: 0;
        left: 10px;
        padding: 6px 12px;
        border-radius: 0 0 8px 8px;
        font-size: 0.75em;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        
        /* The "Frosted Glass" Effect */
        background-color: rgba(18, 18, 18, 0.6); /* Dark transparent background */
        -webkit-backdrop-filter: blur(8px); /* Increased blur */
        backdrop-filter: blur(8px);
        border: 1px solid; /* Border color will be set below */
        border-top: none; /* To complete the hanging tag look */
    }
    .novel-status-badge.status-completed {
        color: #1DB954; /* Vibrant Green Text */
        border-color: rgba(29, 185, 84, 0.5); /* Semi-transparent Green Border */
    }
    .novel-status-badge.status-running {
        color: #FFC107; /* Warm Gold Text */
        border-color: rgba(255, 193, 7, 0.5); /* Semi-transparent Gold Border */
    }
    /* --- END BADGE STYLES --- */

    .novel-list-meta {
        font-size: 0.9em;
        color: #888;
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 8px;
    }
    .meta-item {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .meta-item svg {
        flex-shrink: 0;
    }