/* ==========================================================================
   StreamUltras — merged site additions for the TV Series experience.
   Base layout/theme comes from movies.css; this file only adds the series
   season/episode UI and the community launcher used by series.php.
   ========================================================================== */

/* ---------- community launcher (bottom-left bubble + panel) ---------- */
.cwrap {
  position: fixed; left: 16px; z-index: 90;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.cbubble {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
  border: 0; border-radius: 99px; padding: 13px 19px; font-weight: 800; font-size: 0.92rem;
  box-shadow: 0 12px 32px rgba(224, 71, 58, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
  animation: cbubblePulse 2.8s ease-in-out infinite;
}
.cbubble:hover { filter: brightness(1.08); }
.cbubble:active { transform: scale(0.97); }
.cbubble svg { flex: 0 0 auto; }
@keyframes cbubblePulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(224, 71, 58, .45), 0 0 0 0 rgba(255, 122, 69, .45); }
  55% { box-shadow: 0 12px 32px rgba(224, 71, 58, .45), 0 0 0 12px rgba(255, 122, 69, 0); }
}
.cpanel {
  position: absolute; left: 0; bottom: calc(100% + 12px);
  width: min(340px, calc(100vw - 32px));
  max-height: min(66vh, 560px); max-height: min(66dvh, 560px); overflow: auto;
  background: rgba(16, 16, 22, 0.98); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 18px 18px 16px; display: grid; gap: 12px;
  transform-origin: 10% bottom; animation: cpanelIn 0.16s ease-out; overscroll-behavior: contain;
}
@keyframes cpanelIn { from { opacity: 0; transform: translateY(10px) scale(0.96); } }
.cpanel h3 { margin: 0; font-size: 1.06rem; line-height: 1.25; padding-right: 26px; }
.cpanel p { margin: 0; color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.cpanel-x {
  position: absolute; top: 10px; right: 10px; background: none; border: 0;
  color: var(--muted); font-size: 0.95rem; padding: 4px 8px; border-radius: 6px;
}
.cpanel-x:hover { color: #fff; background: var(--chip); }
.cpanel-list { display: grid; gap: 8px; }
.ccta {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-radius: 11px;
  padding: 11px 13px; color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.ccta:hover { border-color: rgba(255, 122, 69, 0.55); background: rgba(255, 122, 69, 0.07); transform: translateX(2px); }
.ccta-body { display: grid; gap: 2px; min-width: 0; }
.ccta-body b { font-size: 0.93rem; }
.ccta-body small { color: var(--muted); font-size: 0.77rem; line-height: 1.35; }
.ccta-arr { color: var(--accent-2); font-size: 1.05rem; flex: 0 0 auto; }

/* ---------- series-only header / cards ---------- */
.nav-switch { display: inline-flex; align-items: center; gap: 6px; }
.badge.tv { background: rgba(224, 71, 58, .92); }
.card.cw .cw-ep {
  position: absolute; top: 6px; left: 6px; z-index: 9; font-size: .6rem; font-weight: 800;
  letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; color: #fff;
  background: rgba(8, 8, 12, .82); backdrop-filter: blur(3px);
}

/* ---------- series detail modal ---------- */
.modal-hero-scrim {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(0deg, var(--bg-2) 3%, rgba(19,19,24,.55) 45%, rgba(19,19,24,.15) 100%),
              linear-gradient(90deg, rgba(10,10,14,.75), transparent 70%);
}
.modal-hero-body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 24px 34px 20px; display: flex; flex-direction: column; gap: 10px;
}
.modal-hero-body .m-kicker {
  font-size: .72rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; color: var(--accent-2);
}
.modal-hero-body .m-title {
  position: static; left: auto; right: auto; bottom: auto;
  font-size: clamp(1.5rem, 3.4vw, 2.6rem); font-weight: 800; margin: 0; line-height: 1.05;
  text-shadow: 0 3px 18px rgba(0,0,0,.75);
}
.m-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: #d2d2da; font-size: .9rem; }
.m-meta .match { color: #4ade80; font-weight: 700; }
.modal-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.modal-actions .btn-play:disabled { opacity: .45; cursor: not-allowed; }
.modal-main { min-width: 0; }
.modal-cols { grid-template-columns: 1fr 280px; }

/* episodes block */
.episodes { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 18px; }
.modal-copies { margin-top: 4px; }
.modal-copies:empty { display: none; }
.copies-h { margin: 0 0 10px; font-size: .9rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.stream-chip.sel { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(224,71,58,.5) inset; }
.stream-chip.sel .schip-ico { background: var(--accent); color: #fff; }
.ep-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.ep-head h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.season-picker { position: relative; }
.season-btn {
  background: #22222c; border: 1px solid var(--line); color: var(--text); font-weight: 700;
  border-radius: 9px; padding: 9px 16px; font-size: .92rem; display: inline-flex; align-items: center; gap: 9px;
}
.season-btn:hover { border-color: rgba(255,255,255,.4); }
.season-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 12; width: 250px; max-height: 320px; overflow: auto;
  background: rgba(18,18,24,.99); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px;
}
.season-menu button {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%;
  background: none; border: 0; color: #d8d8de; padding: 10px 12px; border-radius: 8px; font-size: .9rem; text-align: left;
}
.season-menu button:hover, .season-menu button.sel { background: var(--chip); color: #fff; }
.season-menu button.sel { box-shadow: inset 3px 0 0 var(--accent); }
.season-menu .ep-cnt { color: var(--muted); font-size: .76rem; }

.ep-list { display: flex; flex-direction: column; gap: 8px; }
.ep-row {
  display: grid; grid-template-columns: 34px 168px 1fr; align-items: center; gap: 16px; width: 100%;
  background: rgba(255,255,255,.025); border: 1px solid transparent; border-radius: 12px; padding: 10px 12px;
  text-align: left; color: var(--text); transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.ep-row:hover { background: rgba(255,255,255,.07); border-color: var(--line); }
.ep-row.current { background: rgba(224,71,58,.1); border-color: rgba(224,71,58,.45); }
.ep-num { font-size: 1.15rem; font-weight: 700; color: var(--muted); text-align: center; }
.ep-row.current .ep-num { color: var(--accent-2); }
.ep-thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #202028;
  display: grid; place-items: center;
}
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ep-thumb .ep-play {
  position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.9); color: #111; padding-left: 3px; opacity: 0; transition: opacity .15s ease;
}
.ep-row:hover .ep-thumb .ep-play { opacity: 1; }
.ep-tag {
  position: absolute; z-index: 3; left: 6px; top: 6px; font-size: .58rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px; background: var(--accent); color: #fff;
}
.ep-tag.next { background: #1d4ed8; }
.ep-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ep-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.ep-top b { font-size: .96rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-dur { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.ep-plot {
  color: #b7b7c2; font-size: .84rem; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

@media (max-width: 900px) {
  .modal-hero-body { padding: 18px 20px 16px; }
  .modal-cols { grid-template-columns: 1fr; }
  .ep-row { grid-template-columns: 26px 120px 1fr; gap: 12px; padding: 8px; }
  .ep-num { font-size: 1rem; }
}
@media (max-width: 560px) {
  .cwrap { left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .cbubble { padding: 11px 15px; font-size: 0.85rem; }
  .cpanel { width: calc(100vw - 24px); }
  .ep-row { grid-template-columns: 22px 1fr; grid-template-areas: "num thumb" "info info"; row-gap: 8px; }
  .ep-num { grid-area: num; }
  .ep-thumb { grid-area: thumb; }
  .ep-info { grid-area: info; }
  .ep-plot { -webkit-line-clamp: 3; }
}
