/* Typography & Layout for Chapter Reading */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap');

.html,
.body {
  margin: 0;
  background: #f9f9f9;
  color: #333;
  user-select: none;
  -webkit-user-select: none;
}

/* General Styles for Chapter Page */
.chapter-container {
    background: #fff;
    padding:40px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    border-radius: 0;
}
.chapter-content {
    max-width: 860px;
    font-family: 'Noto Serif', serif;
    font-size: 1.125rem;
    line-height: 1.7;
    color: #222;
    margin: auto;
    text-align: justify;
}

/* Chapter Navigation - Enhanced */
.chapter-navigation {
    display: flex;
    width: 100%;
    gap: 15px;
    margin-top: auto;
    padding: 0;
}

.chapter-nav-button {
    flex: 1;
    padding: 12px 20px;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

/* Blockquote Elegant */
blockquote {
  font-family: 'Cormorant Garamond', serif; /* Font klasik yang mudah dibaca */
  font-size: 1.25rem;
  line-height: 1.6;
  background-color: #f8f5f0; /* Warna krem lembut */
  border-left: 4px solid #d1b280; /* Garis vertikal emas tua */
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  color: #333;
  position: relative;
  quotes: "“" "”" "‘" "’"; /* Kutipan elegan */
}

blockquote:before {
  content: open-quote;
  font-size: 4rem;
  color: #d1b280;
  opacity: 0.3;
  position: absolute;
  left: 10px;
  top: -10px;
  font-family: 'Times New Roman', serif;
}

blockquote:after {
  content: close-quote;
  font-size: 4rem;
  color: #d1b280;
  opacity: 0.3;
  position: absolute;
  right: 10px;
  bottom: -30px;
  font-family: 'Times New Roman', serif;
}

blockquote p {
  margin: 0;
  padding-bottom: 1rem;
  font-style: italic;
}

/* Untuk layar kecil */
@media (max-width: 768px) {
  blockquote {
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
  }
}

/* Active Buttons */
.chapter-nav-button:not(.disabled) {
    background-color: #2d6cdf;
    color: white;
    border: 2px solid transparent;
}

.chapter-nav-button:not(.disabled):hover {
    background-color: #1a56bb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.chapter-nav-button.disabled {
    background-color: #f0f0f0;
    color: #aaa;
    border: 2px solid #ddd;
    cursor: not-allowed;
}

/* Arrow Styling */
.prev-button::before {
    content: "← ";
}

.next-button::after {
    content: " →";
}

/* Floating Chapter List */
.chapter-menu {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 9999;
    font-family: 'Book Antiqua', sans-serif;
}

.menu-button {
    background-color: #2d6cdf; /* Match your novel modal button color */
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.menu-button:hover {
    background-color: #1a56bb;
    transform: translateY(-2px);
}

.chapter-list {
    display: none;
    position: fixed;
    bottom: 50px;
    right: 10px;
    width: 280px;
    max-height: 60vh;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px 0 0 8px;
    padding: 15px;
    overflow-y: auto;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.chapter-list.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

.chapter-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chapter-link {
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.chapter-link:hover {
    background: #e9f0ff;
    border-left: 3px solid #2d6cdf;
}

.chapter-link.current {
    background: #e0e9ff;
    border-left: 3px solid #2d6cdf;
    font-weight: bold;
}

.no-chapter {
    color: #666;
    font-style: italic;
    padding: 10px;
    text-align: center;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ad Containers */
.novel-ad-container {
  margin: 1.5em 0;        /* Jarak vertikal yang cukup dari teks */
  text-align: center;     /* Tengahin isi iklan (biasanya banner atau teks) */
  max-width: 100%;        /* Jangan sampai melebar keluar kontainer */
  overflow-wrap: break-word; /* Agar teks iklan bisa wrap kalau panjang */
  font-size: 0.9rem;      /* Ukuran font yang pas, tidak terlalu besar */
}

/* Responsive: agar iklan tetap enak dilihat di mobile */
@media (max-width: 600px) {
  .novel-ad-container {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
}

/* Last Chapter's Related Novels Section */
.related-novels-section {
    margin-top: 40px; /* Only keep vertical spacing */
    padding: 0;       /* Remove padding */
    background: none; /* Remove background */
    border-radius: 0; /* Remove rounded corners */
    max-width: 860px; /* Match chapter container width */
    margin-left: auto;
    margin-right: auto;
}

/* Keep heading styles but adjust spacing */
.related-novels-section h3,
.related-novels-section h4 {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: left; /* Left-align for cleaner look */
    padding-left: 5px; /* Small indent */
}

/* Simplified grid - focus on content */
.related-novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    width: 100%;
}

/* Pure content-focused items */
.related-novel-item {
    transition: transform 0.2s ease;
    list-style: none; /* Remove if using <li> */
}

.related-novel-item:hover {
    transform: scale(1.03);
}

/* Natural image presentation */
.related-novel-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 3px; /* Subtle rounding */
    display: block; /* Remove inline gap */
    loading: lazy; /* Native lazy-load */
}

/* Minimal title styling */
.related-novel-title {
    font-size: 0.8em;
    margin-top: 8px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    text-align: left;
    padding: 0 2px;
}

@media (max-width: 600px) {
    .related-novels-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    .related-novel-title {
        font-size: 0.7em;
    }
}

/* Chapter Donation Box */
.chapter-donation-box {
  background-color: #fff8e1;
  border-left: 4px solid #fbc02d;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  font-size: 0.85rem;
}

.chapter-donation-content {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.chapter-donation-text {
  flex: 1;
  color: #444;
}

.chapter-donation-text p {
  margin: 0.5rem 0;
  line-height: 1.4;
}

.chapter-donation-qr img {
  width: 150px;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
  .chapter-donation-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    font-size: 0.75rem;
  }

  .chapter-donation-qr {
    margin-top: 0.25rem;
  }
}

/* Related-Newest Novel Carousel */
.carousel-section {
  padding-top: 20px;
}

.carousel-wrapper {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0;
  -webkit-overflow-scrolling: touch;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 auto;
  width: 120px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  overflow: hidden;
}

.carousel-item:hover {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.carousel-item img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.carousel-item .novel-title {
  margin-top: 8px;
  font-size: 0.95rem;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.carousel-nav {
  position: absolute;
  top: 35%;
  transform: translateY(-50%);
  background: #007bff;
  color:#fff;
  border: none;
  font-size: 24px;
  padding: 8px;
  cursor: pointer;
  z-index: 2;
}

.carousel-nav.prev {
  left: 0;
}

.carousel-nav.next {
  right: 0;
}

/* Reading Progress Bar */
#reading-progress-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: #f1f1f1;
  z-index: 9998;
}

body.admin-bar #reading-progress-wrapper {
    top: 32px;
}

/* Progress bar fill */
#reading-progress-bar {
  height: 100%;
  width: 0%;
  background-color: #133bbe;
  transition: width 0.2s ease-out;
}

/* Mobile adjustment */
@media (max-width: 768px) {
  #reading-progress-wrapper {
    height: 3px;
    background-color: transparent;
  }

  #reading-progress-bar {
    background: linear-gradient(to right, #133bbe, #f97316);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
}

.access-restricted {
    padding: 20px;
    margin: 20px 0;
    background: #f8f8f8;
    border-left: 4px solid #ff9800;
}

.access-restricted.login_required {
    border-left-color: #2196F3;
}

.access-restricted.quota {
    border-left-color: #f44336;
}

.upgrade-button, .login-button {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 15px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.login-button {
    background: #2196F3;
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .ad-desktop {
        display: none !important;
    }
    
    .ad-mobile {
        display: block !important;
    }
    
    .chapter-content {
        font-size: 14px;
        line-height: 1.5;
        margin: 0;
        text-align: left;
    }
}

@media (min-width: 769px) {
    .chapter-container {
        max-width: 780px;
        margin: 0 auto;
    }
}