/**
 * DS Premium Episode Page — Black & White Theme
 * Works in both dark mode and light mode.
 * All accent: white (dark) / black (light). No purple/blue.
 */

/* ── CSS Variables ── */
/* :root covers default state; body.darkmode is explicit dark */
:root, body.darkmode {
    --ds-accent:     #ffffff;
    --ds-accent-bg:  rgba(255,255,255,0.10);
    --ds-accent-brd: rgba(255,255,255,0.25);
    --ds-txt:        #e5e7eb;
    --ds-txt-muted:  #9ca3af;
    --ds-bg-card:    #0d0d0d;
    --ds-bg-inner:   #161616;
    --ds-border:     rgba(255,255,255,0.08);
}
/* Theme uses body.darkmode / body.lightmode classes (NOT prefers-color-scheme) */
body.lightmode {
    --ds-accent:     #000000;
    --ds-accent-bg:  rgba(0,0,0,0.08);
    --ds-accent-brd: rgba(0,0,0,0.30);
    --ds-txt:        #111111;
    --ds-txt-muted:  #6b7280;
    --ds-bg-card:    #f5f5f5;
    --ds-bg-inner:   #ffffff;
    --ds-border:     rgba(0,0,0,0.12);
}

/* ── Lights off ── */
body.ds-lights-off::before {
    content: '';position:fixed;inset:0;background:rgba(0,0,0,.9);z-index:998;pointer-events:none;
}
body.ds-lights-off .ds-ep-wrap { position:relative;z-index:999; }

/* ── Player wrapper ── */
.ds-ep-wrap {
    background: var(--ds-bg-card);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--ds-border);
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

/* ── Server buttons ── */
.ds-srv-btn {
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid var(--ds-border);
    background: transparent;
    color: var(--ds-txt-muted);
    font-size: 12px;
    cursor: pointer;
    transition: .15s;
    white-space: nowrap;
    font-family: inherit;
}
.ds-srv-btn:hover  { border-color: var(--ds-accent-brd); color: var(--ds-txt); }
.ds-srv-btn.active {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: var(--ds-bg-card);
    font-weight: 600;
}

/* ── Episode compact boxes (player page) ── */
.ds-ep-box {
    position: relative;
    width: 52px; height: 52px;
    border-radius: 8px;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    text-decoration: none;
    font-size: 14px; font-weight: 700;
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-inner);
    color: var(--ds-txt-muted);
    transition: .15s;
    overflow: hidden;
}
.ds-ep-box:hover {
    border-color: var(--ds-accent-brd);
    color: var(--ds-txt);
    background: var(--ds-accent-bg);
}
.ds-ep-box.active {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: var(--ds-bg-card);
    font-weight: 800;
    transform: scale(1.06);
    box-shadow: 0 0 0 3px var(--ds-accent-bg);
}
.ds-ep-box .ep-sub-tag {
    position: absolute; top: 2px; right: 2px;
    font-size: 8px; background: rgba(0,0,0,.6); color: #fff;
    padding: 1px 3px; border-radius: 3px;
}

/* ── Episode list rows (series page) ── */
.ds-ep-section {
    background: var(--ds-bg-card);
    border: 1px solid var(--ds-border);
    border-radius: 14px; overflow: hidden; margin-bottom: 20px;
}
.ds-ep-section-head {
    padding: 14px 18px;
    background: var(--ds-bg-inner);
    border-bottom: 1px solid var(--ds-border);
    display: flex; align-items: center;
    justify-content: space-between; flex-wrap: wrap;
}
.ds-ep-section-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ds-txt); flex: 1; }
.ds-eps-count {
    background: var(--ds-accent-bg);
    border: 1px solid var(--ds-accent-brd);
    color: var(--ds-txt); font-size: 11px;
    padding: 2px 9px; border-radius: 20px; font-weight: 600;
}
.ds-ep-list-body {
    max-height: 600px; overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--ds-accent-brd) transparent;
}
.ds-ep-list-body::-webkit-scrollbar { width: 4px; }
.ds-ep-list-body::-webkit-scrollbar-track { background: transparent; }
.ds-ep-list-body::-webkit-scrollbar-thumb { background: var(--ds-accent-brd); border-radius: 4px; }
.ds-ep-row-item { border-bottom: 1px solid var(--ds-border); }
.ds-ep-row-item:last-child { border-bottom: none; }
.ds-ep-link-full {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; text-decoration: none;
    transition: background .15s; color: inherit;
}
.ds-ep-link-full:hover { background: var(--ds-accent-bg); }
.ds-ep-link-full:hover .ds-epl-num {
    background: var(--ds-accent);
    border-color: var(--ds-accent);
    color: var(--ds-bg-card);
}
.ds-epl-num {
    width: 38px; height: 38px; border-radius: 8px;
    border: 1px solid var(--ds-border);
    background: var(--ds-bg-inner);
    color: var(--ds-txt); font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: .15s;
}
.ds-epl-title { flex: 1; font-size: 13px; color: var(--ds-txt-muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-epl-meta  { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.ds-sub-pill  { font-size: 10px; padding: 2px 8px; border-radius: 12px; background: var(--ds-accent-bg); border: 1px solid var(--ds-accent-brd); color: var(--ds-txt); font-weight: 600; }
.ds-epl-date  { font-size: 11px; color: var(--ds-txt-muted); }
.ds-ep-nosrc .ds-epl-num   { opacity: .4; }
.ds-ep-nosrc .ds-epl-title { color: var(--ds-txt-muted); opacity: .6; }

/* ── Jump links ── */
.ds-ep-jump { display: flex; gap: 10px; padding: 10px 16px; background: var(--ds-bg-card); border-bottom: 1px solid var(--ds-border); }
.ds-ep-jump a { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--ds-border); background: var(--ds-bg-inner); text-decoration: none; transition: .2s; gap: 3px; }
.ds-ep-jump a:hover { border-color: var(--ds-accent-brd); background: var(--ds-accent-bg); }
.ds-ep-jump a .jump-label { font-size: 11px; color: var(--ds-txt-muted); }
.ds-ep-jump a .jump-ep    { font-size: 13px; font-weight: 700; color: var(--ds-txt); }

/* ── Schedule ── */
.ds-sched-head  { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; font-size: 13px; font-weight: 600; color: var(--ds-txt); border-top: 1px solid var(--ds-border); }
.ds-sched-grid  { display: flex; flex-direction: column; gap: 6px; }
.ds-sched-ep    { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; background: var(--ds-bg-inner); border-radius: 8px; border: 1px solid var(--ds-border); }
.ds-sched-ep-lbl       { font-size: 13px; color: var(--ds-txt); font-weight: 600; }
.ds-sched-ep-countdown { font-size: 11px; color: var(--ds-txt-muted); margin-top: 2px; }
.ds-sched-ep-date      { font-size: 12px; color: var(--ds-txt-muted); display: flex; align-items: center; gap: 5px; }

/* ── Nav buttons ── */
.ds-ep-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; padding: 10px 14px; background: var(--ds-bg-inner); border-top: 1px solid var(--ds-border); }
.ds-nav-prev,.ds-nav-next,.ds-nav-list { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600; transition: .15s; border: 1px solid var(--ds-border); color: var(--ds-txt-muted); background: transparent; }
.ds-nav-prev:hover,.ds-nav-next:hover  { border-color: var(--ds-accent-brd); color: var(--ds-txt); background: var(--ds-accent-bg); }
.ds-nav-list { border-color: var(--ds-accent-brd); color: var(--ds-txt); background: var(--ds-accent-bg); }
.ds-nav-list:hover { background: var(--ds-accent); color: var(--ds-bg-card); }
.ds-nav-disabled { opacity: .3; cursor: not-allowed; pointer-events: none; }

/* ── Responsive ── */
@media (max-width: 600px) {
    .ds-ep-nav { grid-template-columns: 1fr 1fr; }
    .ds-nav-list { display: none; }
    .ds-ep-box  { width: 44px; height: 44px; font-size: 13px; }
    .ds-ep-jump { flex-direction: column; }
}
