/* ============================================================
   info.css — Trang thông tin phim (chỉ nạp ở info.movie.php)
   Hero nền poster mờ, nút Xem tiếp / Tập mới nhất, lịch chiếu,
   chip chuyên mục, danh sách tập (đã xem / Mới / nhảy tập), mô tả.
   ============================================================ */

/* ── Hero: poster làm nền mờ (1 lớp, không đổi bố cục) ── */
.aim-hero__backdrop {
  filter: blur(26px) brightness(.55) saturate(1.35);
  transform: scale(1.18);
  background-position: center 20%;
}
.aim-hero__gradient {
  background:
    linear-gradient(90deg, rgba(12, 12, 20, .88) 0%, rgba(12, 12, 20, .55) 45%, rgba(12, 12, 20, .35) 100%),
    linear-gradient(to bottom, rgba(12, 12, 20, .15) 0%, rgba(12, 12, 20, .35) 55%, rgba(12, 12, 20, .98) 100%);
}
@media (max-width: 768px) {
  .aim-hero__gradient {
    background: linear-gradient(to bottom, rgba(12, 12, 20, .45) 0%, rgba(12, 12, 20, .75) 55%, rgba(12, 12, 20, .98) 100%);
  }
}

/* ── Chip chuyên mục (cùng màu với thẻ phim) ── */
.aim-sec-chip {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 800; letter-spacing: .3px; color: #fff; text-decoration: none;
  background: rgba(255, 59, 92, .9);
}
.aim-sec-chip--hoat-hinh-trung-quoc { background: rgba(217, 119, 6, .92); }
.aim-sec-chip--phim-ai { background: rgba(8, 145, 178, .92); }
.aim-sec-chip--the-loai-khac { background: rgba(100, 116, 139, .92); }
.aim-sec-chip:hover { filter: brightness(1.12); }
.aim-sec-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Nút xem ── */
.aim-btn-watch { min-width: 190px; justify-content: center; }
.aim-btn-watch__text { white-space: nowrap; }
.aim-btn-watch--continue { box-shadow: 0 0 0 2px rgba(255, 255, 255, .15), 0 6px 18px rgba(255, 59, 92, .35); }
.aim-btn-first {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; border-radius: var(--ah-radius-sm, 8px);
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: var(--ah-text);
  font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background var(--ah-fast), border-color var(--ah-fast);
}
.aim-btn-first .material-icons-round { font-size: 19px; }
.aim-btn-first:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.aim-btn-first:focus-visible, .aim-btn-watch:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ── Khối tập + nội dung: không kéo giãn cho bằng nhau (bớt khoảng trống) ── */
.aim-body { align-items: start; }

/* ── Danh sách tập ── */
.aim-ep-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.aim-ep-head .aim-section-title { margin: 0; }
.aim-ep-jump { display: inline-flex; align-items: center; gap: 6px; }
.aim-ep-jump__label { font-size: 12px; color: var(--ah-text-muted); white-space: nowrap; }
.aim-ep-jump input {
  width: 74px; padding: 6px 8px; border-radius: 7px; border: 1px solid var(--ah-border);
  background: var(--ah-surface-2); color: var(--ah-text); font: inherit; font-size: 13px;
}
.aim-ep-jump input:focus { outline: none; border-color: var(--ah-accent); }
.aim-ep-jump button {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--ah-border); background: var(--ah-surface-2); color: var(--ah-text); cursor: pointer;
}
.aim-ep-jump button:hover { border-color: var(--ah-accent); color: var(--ah-accent); }
.aim-ep-jump button .material-icons-round { font-size: 18px; }

.aim-ep-btn { position: relative; }
.aim-ep-btn:focus-visible { outline: 2px solid var(--ah-accent); outline-offset: 2px; }
/* Tập mới nhất: nhãn "Mới" */
.aim-ep-badge {
  position: absolute; top: -7px; right: -5px; padding: 0 4px; border-radius: 4px;
  font-style: normal; font-size: 9px; font-weight: 800; line-height: 14px; letter-spacing: .2px;
  background: #fbbf24; color: #1a1a1a; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); pointer-events: none;
}
/* Tập đang xem (lịch sử trên máy này) + các tập trước đó */
.aim-ep-btn--current { border-color: #38bdf8 !important; color: #e0f2fe; background: rgba(56, 189, 248, .16); }
.aim-ep-btn--current::after {
  content: '✓'; position: absolute; bottom: -6px; right: -5px; width: 15px; height: 15px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800;
  background: #38bdf8; color: #0b1220;
}
.aim-ep-btn--seen { opacity: .5; }
.aim-ep-btn--seen:hover { opacity: 1; }
.aim-ep-btn--flash { animation: aim-ep-flash 1.4s ease; }
@keyframes aim-ep-flash { 0%, 60% { box-shadow: 0 0 0 3px #fbbf24; } 100% { box-shadow: none; } }

/* ── Mô tả: văn bản thuần giữ xuống dòng; link dài không tràn ── */
.aim-desc--plain { white-space: pre-line; }
.aim-desc__content a { color: #7dd3fc; word-break: break-all; }
.aim-desc__toggle[hidden] { display: none; }

@media (max-width: 480px) {
  .aim-hero__actions { gap: 8px; }
  .aim-btn-watch { min-width: 0; flex: 1 1 100%; }
  .aim-btn-first { flex: 1 1 auto; justify-content: center; }
  .aim-ep-jump__label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .aim-ep-btn--flash { animation: none; outline: 3px solid #fbbf24; }
}

/* ============================================================
   Bố cục v3 — phương án B "ưu tiên xem" (info.movie.php, lớp .ib-*):
   đầu trang gọn → khối Xem tiếp → các phần → tập phim (rộng) → Giới thiệu | Thông tin → Bình luận | Thảo luận
   ============================================================ */
.ib-page { padding: 0 20px 24px; }
.ib-page > * + * { margin-top: 14px; }

/* Đầu trang */
.ib-hero { position: relative; overflow: hidden; border-radius: 0 0 var(--ah-radius) var(--ah-radius); margin: 0 -20px; }
.ib-hero__bg { position: absolute; inset: -30px; background: center / cover no-repeat; filter: blur(26px) brightness(.42) saturate(1.2); transform: scale(1.08); }
.ib-hero__fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 11, 18, .1) 0%, rgba(11, 11, 18, .55) 60%, var(--ah-bg) 100%); }
.ib-hero__body { position: relative; display: flex; align-items: flex-end; gap: 20px; padding: 26px 20px 18px; }
.ib-poster { width: 150px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; flex-shrink: 0; background: var(--ah-surface-2);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .08); }
.ib-hero__info { flex: 1 1 auto; min-width: 0; }
.ib-title { margin: 0 0 4px; font-size: 28px; font-weight: 900; line-height: 1.2; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .5); }
.ib-alt { font-size: 13px; color: rgba(255, 255, 255, .7); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; align-items: center; }
.ib-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #e5e7eb; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); white-space: nowrap; }
.ib-chip small { font-weight: 500; opacity: .75; }
.ib-chip--live { color: #fda4af; background: rgba(255, 59, 92, .16); border-color: rgba(255, 59, 92, .45); }
.ib-chip--done { color: #86efac; background: rgba(34, 197, 94, .12); border-color: rgba(34, 197, 94, .4); }
.ib-chip--score { color: var(--ah-gold); border-color: rgba(245, 200, 66, .4); background: rgba(245, 200, 66, .1); }
.ib-chips--tags { margin-top: 8px; }
.ib-chip-more { font-weight: 700; }
.ib-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.ib-tags a { padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none;
  color: var(--ah-text); background: var(--ah-surface-2); border: 1px solid var(--ah-border); }
.ib-tags a:hover { border-color: var(--ah-accent); color: var(--ah-accent); }
#ib-info { scroll-margin-top: 80px; }
.ib-chip--soft { min-height: 24px; font-size: 11.5px; color: var(--ah-text-muted); background: var(--ah-surface-2); border-color: var(--ah-border); }
.ib-hero__acts { display: flex; gap: 8px; flex-shrink: 0; }
.ib-hero__acts .aim-btn-follow, .ib-hero__acts .aim-btn-rate { white-space: nowrap; }
.ib-rating { position: relative; margin: 0 20px 12px; }

/* Khối Xem tiếp */
.ib-next { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--ah-radius);
  background: linear-gradient(90deg, rgba(255, 59, 92, .18), rgba(255, 59, 92, .04)); border: 1px solid rgba(255, 59, 92, .35); }
.ib-next__ic { font-size: 38px !important; color: var(--ah-accent); flex-shrink: 0; }
.ib-next__txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ib-next__txt b { font-size: 16px; color: var(--ah-text); }
.ib-next__txt small { font-size: 12.5px; color: var(--ah-text-muted); }
.ib-next__acts { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.ib-next .aim-btn-watch { min-width: 0; }
.ib-next--empty { background: var(--ah-surface); border-color: var(--ah-border); }
.ib-next--empty .ib-next__ic { color: var(--ah-text-dim); }

/* Các phần cùng series: khung riêng, thẻ nhỏ có poster (vuốt ngang khi nhiều phần) */
.ib-parts { padding: 12px 14px; border-radius: var(--ah-radius); }
.ib-parts__head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 14px; color: var(--ah-text); }
.ib-parts__head .material-icons-round { font-size: 18px; color: var(--ah-accent); }
.ib-parts__count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--ah-text-muted); }
.ib-parts__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 240px); gap: 8px; overflow-x: auto;
  scrollbar-width: thin; padding-bottom: 4px; scroll-snap-type: x proximity; }
.ib-part { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; text-decoration: none; scroll-snap-align: start;
  background: var(--ah-surface-2); border: 1px solid var(--ah-border); transition: border-color var(--ah-fast), background var(--ah-fast); min-width: 0; }
.ib-part:hover { border-color: rgba(255, 255, 255, .25); }
.ib-part.is-active { border-color: var(--ah-accent); background: var(--ah-accent-soft); }
.ib-part__img { width: 42px; height: 58px; flex-shrink: 0; object-fit: cover; border-radius: 6px; background: var(--ah-surface-3); }
.ib-part__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ib-part__name { font-size: 13px; font-weight: 700; color: var(--ah-text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ib-part.is-active .ib-part__name { color: #fff; }
.ib-part__sub { font-size: 11.5px; color: var(--ah-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-part__sub em { font-style: normal; font-weight: 700; color: var(--ah-accent); margin-right: 6px; }

/* Tập phim (rộng hết khung) */
.ib-page .aim-episodes { margin: 0; }
.ib-page .aim-ep-head { gap: 8px 10px; }
.ib-page .aim-ep-head .aim-ep-jump { margin-left: auto; }

/* Giới thiệu | Thông tin ; Bình luận | Thảo luận */
.ib-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.ib-grid > .aim-desc { margin: 0; }
.ib-info { padding: 18px; border-radius: var(--ah-radius); }
.ib-kv { width: 100%; border-collapse: collapse; font-size: 13px; }
.ib-kv th { text-align: left; font-weight: 500; color: var(--ah-text-muted); padding: 6px 10px 6px 0; width: 104px; vertical-align: top; white-space: nowrap; }
.ib-kv td { padding: 6px 0; color: var(--ah-text); font-weight: 600; line-height: 1.45; }
.ib-kv tr + tr th, .ib-kv tr + tr td { border-top: 1px solid rgba(255, 255, 255, .05); }
.ib-main { min-width: 0; }
.ib-main .wp-comments { margin: 0; }
.ib-forum { margin: 0 !important; }

@media (max-width: 900px) {
  .ib-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  /* Mobile gọn: thông tin chính = 1 dòng chữ, thể loại = 1 hàng vuốt ngang, nút thấp */
  .ib-page { padding: 0 10px 20px; }
  .ib-page > * + * { margin-top: 10px; }
  .ib-hero { margin: 0 -10px; }
  .ib-hero__body { flex-wrap: wrap; gap: 10px 12px; padding: 14px 12px 10px; align-items: flex-start; }
  .ib-poster { width: 84px; border-radius: 10px; }
  .ib-hero__info { flex-basis: calc(100% - 96px); }
  .ib-title { font-size: 18px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .ib-alt { font-size: 11.5px; -webkit-line-clamp: 1; }
  /* Hàng 1 (trạng thái · số tập · năm · điểm): chữ thường ngăn cách bằng " · " thay cho chip */
  .ib-chips:not(.ib-chips--tags) { gap: 0; margin-top: 6px; row-gap: 2px; }
  .ib-chips:not(.ib-chips--tags) .ib-chip { min-height: 0; padding: 0; border: 0; background: none; font-size: 12.5px; font-weight: 600; color: var(--ah-text-muted); }
  .ib-chips:not(.ib-chips--tags) .ib-chip + .ib-chip::before { content: '·'; margin: 0 6px; color: var(--ah-text-dim); }
  .ib-chips:not(.ib-chips--tags) .ib-chip--live { color: #fb7185; }
  .ib-chips:not(.ib-chips--tags) .ib-chip--done { color: #4ade80; }
  .ib-chips:not(.ib-chips--tags) .ib-chip--score { color: var(--ah-gold); }
  /* Hàng 2 (chuyên mục + thể loại): 1 hàng nhỏ, vuốt ngang */
  .ib-chips--tags { gap: 5px; margin-top: 8px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .ib-chips--tags::-webkit-scrollbar { display: none; }
  .ib-chips--tags > * { flex-shrink: 0; font-size: 11.5px !important; padding: 3px 9px !important; min-height: 0 !important; line-height: 1.4; }
  /* Theo dõi / Đánh giá: 1 hàng thấp */
  .ib-hero__acts { width: 100%; gap: 8px; }
  .ib-rating { margin: 0 10px 10px; }
  /* Khối Xem tiếp: chữ 1 hàng + hàng nút thấp (Xem tiếp 2/3, Tập 1 1/3) */
  .ib-next { flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px; }
  .ib-next__ic { font-size: 26px !important; }
  .ib-next__txt { flex-basis: calc(100% - 36px); }
  .ib-next__txt b { font-size: 15px; }
  .ib-next__txt small { font-size: 12px; }
  .ib-next__acts { width: 100%; gap: 8px; }
  .ib-page .ib-next__acts .aim-btn-watch { flex: 2 1 0 !important; order: -1; }
  .ib-hide-xs { display: none; }
  /* mobile.css ép các nút thành ô vuông chỉ có icon (font-size:0) — ở đây cần icon + chữ, thấp gọn */
  .ib-page .aim-btn-watch, .ib-page .aim-btn-follow, .ib-page .aim-btn-rate, .ib-page .aim-btn-first {
    font-size: 13.5px !important; width: auto !important; min-width: 0 !important; height: 40px !important; min-height: 40px !important;
    padding: 0 12px !important; gap: 6px !important; flex: 1 1 0 !important; border-radius: 10px !important; justify-content: center !important;
    white-space: nowrap; box-shadow: none !important; }
  .ib-page .aim-btn-watch .material-icons-round, .ib-page .aim-btn-follow .material-icons-round,
  .ib-page .aim-btn-rate .material-icons-round, .ib-page .aim-btn-first .material-icons-round { font-size: 18px !important; }
  .ib-parts { padding: 10px 12px; }
  .ib-parts__list { grid-auto-columns: minmax(180px, 72%); }
}
