/* ============================================================
   watching.css v3 — clean BEM for watching page
   ============================================================ */

/* ── Page wrapper ── */
.wp-page {
  padding: 0 14px 48px;
}

/* ── Breadcrumb ── */
.wp-bc {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 14px;
  font-size: 12.5px;
  color: var(--ah-text-muted);
  flex-wrap: wrap;
}

.wp-bc a {
  color: var(--ah-text-muted);
  text-decoration: none;
  transition: color .14s;
}

.wp-bc a:hover {
  color: var(--ah-accent);
}

.wp-bc span {
  opacity: .4;
}

.wp-bc__cur {
  opacity: 1;
  color: var(--ah-text);
  font-weight: 600;
}

/* ── 2-column grid ── */
.wp-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
  transition: grid-template-columns .28s ease;
}

@media (max-width: 960px) {
  .wp-grid {
    grid-template-columns: 1fr;
  }
}

/* Theater mode */
.wp-grid--theater {
  grid-template-columns: 1fr !important;
}

.wp-grid--theater .wp-col-side {
  position: static !important;
  max-height: none !important;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.wp-grid--theater .wp-col-side .wp-card {
  grid-column: 1;
}

.wp-grid--theater .wp-col-side .wp-nav-row {
  grid-column: 2;
  align-self: center;
}

.wp-grid--theater .wp-col-side .wp-eplist {
  grid-column: 1 / -1;
  max-height: 180px;
}

.wp-grid--theater .wp-col-side .wp-eplist__wrap {
  max-height: 130px;
}

/* ── Columns ── */
.wp-col-main {
  min-width: 0;
}

.wp-col-side {
  position: sticky;
  top: calc(var(--navbar-h, 60px) + 8px);
  max-height: calc(100vh - var(--navbar-h, 60px) - 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

@media (max-width: 960px) {
  .wp-col-side {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

/* ── Player ── */
.wp-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .6);
}

.wp-player iframe,
.wp-player>div {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Cinema mode */
.wp-player--cinema {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 96vw !important;
  max-width: 1400px !important;
  aspect-ratio: 16/9 !important;
  z-index: 9999 !important;
  border-radius: 10px !important;
  box-shadow: 0 0 80px rgba(0, 0, 0, .9) !important;
}

.wp-cinema-bd {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .94);
  z-index: 9990;
  cursor: pointer;
  animation: wp-fade .2s ease;
}

.wp-cinema-close {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 10000;
  background: rgba(30, 30, 40, .92);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 8px;
  color: #fff;
  font-family: var(--ah-font);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  animation: wp-fade .2s ease;
}

.wp-cinema-close:hover {
  background: rgba(200, 40, 40, .7);
}

@keyframes wp-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ── Server tabs ── */
.wp-svtabs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.wp-svtabs__lbl {
  font-size: 11px;
  color: var(--ah-text-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-right: 2px;
}

.wp-svtab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
  border: 1.5px solid rgba(255, 255, 255, .09);
  color: var(--ah-text-muted);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--ah-font);
  cursor: pointer;
  transition: all .14s;
}

.wp-svtab:hover {
  border-color: rgba(255, 255, 255, .2);
  color: var(--ah-text);
}

.wp-svtab.active {
  background: var(--ah-accent);
  border-color: var(--ah-accent);
  color: #fff;
  box-shadow: 0 4px 16px rgba(200, 40, 40, .3);
}

.wp-svtab__badge {
  font-size: 9px;
  font-weight: 700;
  background: rgba(255, 255, 255, .18);
  border-radius: 3px;
  padding: 1px 5px;
  letter-spacing: .04em;
}

/* ── Controls row — sticky ── */
.wp-ctrl {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  margin: 4px -14px 6px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 400;
  background: rgba(10, 10, 18, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

/* ── Buttons ── */
.wp-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--ah-text-muted);
  font-size: 12.5px;
  font-family: var(--ah-font);
  cursor: pointer;
  text-decoration: none;
  transition: all .14s;
  white-space: nowrap;
}

.wp-btn:hover {
  color: var(--ah-text);
  border-color: rgba(255, 255, 255, .2);
}

.wp-btn .material-icons-round {
  font-size: 16px;
}

.wp-btn--nav {
  gap: 3px;
}

.wp-btn--accent {
  background: rgba(200, 40, 40, .12);
  border-color: var(--ah-accent);
  color: var(--ah-accent);
}

.wp-btn--accent:hover {
  background: var(--ah-accent);
  color: #fff;
}

.wp-btn--dim {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}

.wp-btn--expand {}

.wp-btn--expand.theater {
  color: #60a5fa;
  border-color: #60a5fa;
  background: rgba(96, 165, 250, .1);
}

.wp-btn--expand.cinema {
  color: #a78bfa;
  border-color: #a78bfa;
  background: rgba(167, 139, 250, .1);
}

.wp-btn.active {
  color: #fbbf24;
  border-color: #fbbf24;
  background: rgba(251, 191, 36, .08);
}

/* ── Report panel ── */
.wp-report-panel {
  display: none;
  background: rgba(18, 18, 28, .98);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 10px;
  animation: wp-fade .16s ease;
}

.wp-report-panel.open {
  display: block;
}

.wp-report-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ah-text);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.wp-report-panel__reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.wp-report-reason {
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  color: var(--ah-text-muted);
  font-size: 12px;
  font-family: var(--ah-font);
  cursor: pointer;
  transition: all .12s;
}

.wp-report-reason.selected {
  background: rgba(200, 40, 40, .2);
  border-color: var(--ah-accent);
  color: #fff;
}

.wp-report-note {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: var(--ah-text);
  font-family: var(--ah-font);
  font-size: 13px;
  padding: 8px 12px;
  margin-bottom: 10px;
  outline: none;
  resize: vertical;
  transition: border-color .14s;
}

.wp-report-note:focus {
  border-color: var(--ah-accent);
}

/* ── Note box ── */
.wp-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(255, 200, 0, .06);
  border: 1px solid rgba(255, 200, 0, .18);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  color: #fbbf24;
  margin-top: 6px;
}

.wp-note .material-icons-round {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── Night mode overlay ── */
body.wp-night::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  z-index: 1100;
  pointer-events: none;
}

body.wp-night .wp-grid,
body.wp-night .wp-ctrl,
body.wp-night .wp-bc,
body.wp-night .wp-comments,
body.wp-night .wp-player--cinema {
  position: relative;
  z-index: 1101;
}

body.wp-night .wp-cinema-bd {
  z-index: 1100;
}

body.wp-night .wp-cinema-close {
  z-index: 1102;
}

/* ── Sidebar card ── */
.wp-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 13px;
  text-decoration: none;
  transition: border-color .14s;
  flex-shrink: 0;
}

.wp-card:hover {
  border-color: rgba(255, 255, 255, .15);
}

.wp-card__img {
  width: 54px;
  height: 76px;
  object-fit: cover;
  border-radius: 7px;
  background: #1a1a2a;
  flex-shrink: 0;
}

.wp-card__body {
  flex: 1;
  min-width: 0;
}

.wp-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ah-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  margin-bottom: 4px;
}

.wp-card__meta {
  font-size: 11px;
  color: var(--ah-text-muted);
  margin-top: 3px;
}

/* ── Sidebar nav row ── */
.wp-nav-row {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.wp-nav-row .wp-btn {
  font-size: 12px;
  padding: 6px 8px;
}

/* ── Episode list ── */
.wp-eplist {
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.wp-eplist__head {
  padding: 10px 13px 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ah-text);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wp-eplist__search {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  color: var(--ah-text);
  font-family: var(--ah-font);
  font-size: 12px;
  padding: 4px 9px;
  outline: none;
  width: 76px;
  transition: all .14s;
}

.wp-eplist__search:focus {
  border-color: var(--ah-accent);
  width: 96px;
}

.wp-eplist__groups {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  padding: 7px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
  flex-shrink: 0;
}

.wp-eplist__grp {
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--ah-text-muted);
  font-size: 11px;
  font-family: var(--ah-font);
  cursor: pointer;
  transition: all .12s;
}

.wp-eplist__grp.active {
  background: var(--ah-accent);
  border-color: var(--ah-accent);
  color: #fff;
}

.wp-eplist__wrap {
  overflow-y: auto;
  flex: 1;
  padding: 10px 13px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .1) transparent;
}

.wp-eplist__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 5px;
}

.wp-ep {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 33px;
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .09);
  color: var(--ah-text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all .12s;
}

.wp-ep:hover {
  background: rgba(255, 255, 255, .12);
  color: var(--ah-text);
}

.wp-ep.current {
  background: var(--ah-accent);
  border-color: var(--ah-accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(200, 40, 40, .4);
}

/* ── Floating mini-bar ── */
.wp-float {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 7px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
}

.wp-float.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.wp-float__btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(18, 18, 30, .95);
  border: 1px solid rgba(255, 255, 255, .13);
  color: var(--ah-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .5);
  backdrop-filter: blur(8px);
  transition: all .14s;
  text-decoration: none;
  font-family: var(--ah-font);
}

.wp-float__btn:hover {
  background: rgba(40, 40, 60, .98);
  color: var(--ah-text);
}

.wp-float__btn .material-icons-round {
  font-size: 18px;
}

.wp-float__expand {
  border-color: #60a5fa;
  color: #60a5fa;
  background: rgba(96, 165, 250, .1);
}

.wp-float__expand:hover {
  background: #60a5fa;
  color: #fff;
}

.wp-float__expand.theater {
  border-color: #60a5fa;
  color: #60a5fa;
}

.wp-float__expand.cinema {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(167, 139, 250, .1);
}

.wp-float__next {
  border-color: var(--ah-accent);
  color: var(--ah-accent);
  background: rgba(200, 40, 40, .1);
}

.wp-float__next:hover {
  background: var(--ah-accent);
  color: #fff;
}

.wp-float__btn.active {
  border-color: var(--ah-accent);
  color: var(--ah-accent);
  background: rgba(200, 40, 40, .15);
}

body.wp-night .wp-float {
  z-index: 1103;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .wp-svtab {
    padding: 5px 10px;
    font-size: 12px;
  }

  .wp-btn {
    padding: 5px 10px;
    font-size: 12px;
  }

  .wp-ctrl {
    gap: 5px;
  }

  .wp-eplist__grid {
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
    gap: 4px;
  }

  .wp-ep {
    height: 30px;
    font-size: 11px;
  }
}
/* ── Expand theater state: hien thi mau "thu nho" ── */
.wp-btn--expand.theater {
  color: #34d399;
  border-color: #34d399;
  background: rgba(52, 211, 153, .1);
}
.wp-btn--expand.theater:hover {
  background: rgba(52, 211, 153, .2);
}
.wp-float__expand.theater {
  border-color: #34d399;
  color: #34d399;
  background: rgba(52, 211, 153, .1);
}
.wp-float__expand.theater:hover {
  background: #34d399;
  color: #fff;
}
/* ── Cinema button (rieng biet) ── */
.wp-btn--cinema {
  color: #a78bfa;
  border-color: rgba(167,139,250,.4);
  background: rgba(167,139,250,.08);
}
.wp-btn--cinema:hover {
  background: rgba(167,139,250,.18);
  color: #c4b5fd;
}
.wp-btn--cinema.active {
  background: rgba(167,139,250,.2);
  border-color: #a78bfa;
  color: #c4b5fd;
}
.wp-float__cinema {
  border-color: #a78bfa;
  color: #a78bfa;
  background: rgba(167,139,250,.1);
}
.wp-float__cinema:hover {
  background: #a78bfa;
  color: #fff;
}
.wp-float__cinema.active {
  background: rgba(167,139,250,.25);
  border-color: #c4b5fd;
  color: #c4b5fd;
}