/* =========  BOOK DETAIL FIXES (centered layout)  ========= */

/* Container chuẩn: canh giữa, giới hạn bề rộng */
.container{
  width: min(1100px, 92%);
  margin: 0 auto;
}

/* Breadcrumbs gọn gàng, bỏ chấm đầu dòng */
.breadcrumbs{
  list-style: none;
  padding: 12px 0 8px;
  margin: 0 0 6px;
  display: flex;
  gap: 8px;
  font-size: 14px;
  color: #666;
}
.breadcrumbs li{display:flex; align-items:center}
.breadcrumbs li+li::before{content:"/"; margin:0 6px; color:#bbb}

/* Khung chính 2 cột: nội dung + sidebar (giống trang mẫu) */
.main-wrapper{
  display: grid;
  grid-template-columns: 1fr 300px; /* trái: nội dung, phải: sidebar */
  gap: 24px;
}
@media (max-width: 980px){
  .main-wrapper{ grid-template-columns: 1fr; }
}

/* Hộp “THÔNG TIN TRUYỆN” */
.bg-wrap{
  background:#fff;
  border:1px solid #eee;
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 3px 10px rgba(0,0,0,.03);
}

/* Nhãn góc trên như mẫu */
.book-label{ margin: -6px 0 12px; }
.book-label span{
  display:inline-block;
  background:#f3f5f7;
  border:1px solid #e7eaee;
  color:#444;
  padding:6px 10px;
  border-radius:6px;
  font-weight:600;
}

/* Bố cục info: ảnh 260px + phần text */
.book-info{
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 680px){
  .book-info{ grid-template-columns: 1fr; }
}

/* Ảnh bìa */
.book-info-pic {
	 display: flex;
  justify-content: center;   /* canh ngang */
}
.book-info-pic img{
  width: 220px;
  height: 330px;
  display:block;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,.07);
}

/* Cột phải: các dòng meta */
.mRightCol .meta-rows{
  list-style:none;
  padding:0;
  margin:0 0 6px;
}
.mRightCol .meta-rows li{
  padding:6px 0;
  border-bottom: 1px dashed #eee;
}
.mRightCol .meta-rows li:last-child{ border-bottom:0; }
.mRightCol b{font-weight:700}

/* Tag trạng thái */
.label-status{
  display:inline-block;
  background:#d4edda;
  color:#155724;
  border:1px solid #c3e6cb;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  margin-left:6px;
}
.label-ongoing{
  background:#fff3cd;
  color:#725b15;
  border-color:#ffe08a;
}

/* Nút công cụ */
.book-tools{ display:flex; gap:10px; flex-wrap:wrap }
.btn{
  display:inline-block;
  border:1px solid #ddd;
  background:#fff;
  padding:8px 14px;
  border-radius:8px;
  text-decoration:none;
  color:#222;
}
.btn.primary{
  background:#c0392b;
  border-color:#b33427;
  color:#fff;
}

/* Tiêu đề lớn ở dưới hộp info */
.book-title{
  font-size: 22px;
  font-weight: 800;
  margin: 18px 0 8px;
}

/* Tiêu đề section */
.section-title{
  font-size:18px;
  font-weight:700;
  border-bottom:2px solid #f0f0f0;
  padding-bottom:6px;
  margin:16px 0 10px;
}

/* Form đi tới chương */
.frm-goto .form-inner{
  display:flex;
  gap:8px;
  align-items:center;
}
.frm-goto input{
  flex:1;
  border:1px solid #ddd;
  border-radius:8px;
  padding:8px 10px;
}
.frm-goto button{
  border:1px solid #ddd;
  background:#fff;
  border-radius:8px;
  padding:8px 12px;
  cursor:pointer;
}

/* Danh sách chương */
.chapter-list ul{
  list-style:none;
  padding:0;
  margin:0;
}
.chapter-list li{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
  border-bottom:1px dashed #eee;
}
.chapter-meta{ color:#888; font-size:13px }

/* Sidebar demo (tùy bạn giữ/ẩn) */
.sidebar .widget{ background:#fff; border:1px solid #eee; border-radius:8px; padding:12px }


/* --- FORM TÌM CHƯƠNG --- */
.frm-goto {
  margin: 15px auto 8px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.frm-goto .form-inner {
  display: flex;
  gap: 8px;
  width: 100%;
}

.frm-goto input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.frm-goto button {
  background: #2ecc71;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 6px 12px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
}

.frm-goto button:hover {
  background: #b22;
}

/* --- NÚT CHƯƠNG 1 / CHƯƠNG CUỐI --- */
.book-tools {
  margin: 14px auto 20px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.book-tools .btn {
  padding: 8px 18px;
  border-radius: 6px;
  font-weight: 600;
  text-align: center;
  border: 1px solid #ccc;
  background: #f8f8f8;
  transition: 0.25s;
}

.book-tools .btn.primary {
  background: #2ecc71;
  color: #fff;
  border-color: #2ecc71;
}

.book-tools .btn.primary:hover {
  background: #2ecc71;
}

.book-tools .btn:hover {
  background: #eee;
}

.container{
	padding-right: 0px !important;
	padding-left: 0px !important;
}



/* Pagination – clean, centered */
/* Wrapper căn giữa */
.pager.pager--buttons{
  display:flex; align-items:center; justify-content:center;
  gap:10px; margin:16px 0 8px; flex-wrap:wrap;
}

/* Nút chung */
.pg-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:38px; padding:0 14px;
  border:1px solid #e5e7eb; border-radius:10px;
  background:#fff; color:#111827; font-weight:600;
  line-height:1; cursor:pointer;
  box-shadow:0 1px 2px rgba(0,0,0,.04);
  transition:border-color .2s, box-shadow .2s, transform .06s, background .2s;
}
.pg-btn:hover{ border-color:#cbd5e1; box-shadow:0 2px 6px rgba(0,0,0,.06); }
.pg-btn:active{ transform: translateY(1px); }
.pg-btn:focus-visible{ outline:2px solid #60a5fa; outline-offset:2px; }

/* Nút chính (Sau) */
.pg-btn--primary{
  background:#16a34a; color:#fff; border-color:#16a34a;
}
.pg-btn--primary:hover{ box-shadow:0 4px 10px rgba(22,163,74,.25); }
.pg-btn--primary:disabled{ background:#a7f3d0; border-color:#a7f3d0; color:#fff; }

/* Disabled chung */
.pg-btn:disabled{
  color:#9ca3af; background:#f8fafc; border-color:#e5e7eb;
  cursor:not-allowed; box-shadow:none; transform:none;
}

/* Nhãn giữa */
.pg-indicator{
  padding:6px 10px; border-radius:999px;
  background:#f3f4f6; color:#374151; font-weight:600;
  border:1px solid #e5e7eb;
}

/* Mobile gọn hơn */
@media (max-width:420px){
  .pg-btn{ height:36px; padding:0 12px; border-radius:8px; }
  .pg-indicator{ font-size:14px; }
}


/* Form search chương */
.chapter-search-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .chapter-input {
    padding: 10px 14px;
    width: 260px;
    font-size: 15px;
    border: 1px solid #ccc;
    border-radius: 8px;
    outline: none;
    transition: all 0.2s ease;
  }

  .chapter-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
  }

  .chapter-btn {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.2s ease, transform 0.1s ease;
  }

  .chapter-btn:hover {
    background-color: #0069d9;
  }

  .chapter-btn:active {
    transform: scale(0.97);
  }

  /* 👇 Responsive fix cho màn hình nhỏ */
  @media (max-width: 600px) {
    .chapter-input {
      width: 180px;
      padding: 8px 10px;
      font-size: 14px;
    }

    .chapter-btn {
      padding: 8px 12px;
      font-size: 14px;
    }
  }

  @media (max-width: 400px) {
    .chapter-input {
      width: 150px;
    }
  }
  
.loading {
  text-align: center;
  padding: 20px;
  color: #666;
}

.chapter-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity .2s ease;
  z-index: 10;
}
.loader {
  border: 3px solid #eee;
  border-top-color: #666;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* container giữ nguyên inline */
.genres { display: inline; }

/* underline dạng “viên thuốc” màu đơn */
.genre-tag{
  display: inline-block;
  padding: 0 .5em .18em;      /* chừa chỗ cho nền phía dưới */
  line-height: 1.25;
  border-radius: 9999px;
  white-space: nowrap;
  /* dùng biến --u để set màu underline */
  --u: #eaf3ff;               /* mặc định: xanh nhạt (solid) */
  box-shadow: 0 -.95em 0 var(--u) inset;  /* nền bên dưới, màu solid */
}

/* nếu muốn 5 màu SOLID khác nhau cho 5 tag đầu */
.genre-tag:nth-child(1){ --u:#E6F3FF; }  /* xanh dương nhạt */
.genre-tag:nth-child(2){ --u:#FFF2E6; }  /* cam nhạt */
.genre-tag:nth-child(3){ --u:#EAF8E6; }  /* xanh lá nhạt */
.genre-tag:nth-child(4){ --u:#F3E8FF; }  /* tím nhạt */
.genre-tag:nth-child(5){ --u:#FFE8EF; }  /* hồng nhạt */

/* hover (tùy chọn, vẫn solid) */
.genre-tag:hover{ box-shadow: 0 -1.05em 0 var(--u) inset; }


