/* ==========================================================================
   Drama Online — Redesigned Episodes Archive (/episodes/) v2.0
   Luxury Dark Cinema Aesthetic (#0b0f19 + #f5c16c Gold) — RTL Native
   ========================================================================== */

.do-ep-archive {
  --do-gold: #f5c16c;
  --do-gold-2: #e5a94c;
  --do-gold-soft: rgba(245, 193, 108, 0.14);
  --do-gold-border: rgba(245, 193, 108, 0.34);
  --do-gold-glow: rgba(245, 193, 108, 0.28);
  --do-surface: rgba(16, 22, 36, 0.82);
  --do-card-bg: #111827;
  --do-border: rgba(255, 255, 255, 0.08);
  --do-text: #f8fafc;
  --do-muted: #94a3b8;
  --do-green: #10b981;
  --do-rose: #f43f5e;
  direction: rtl;
  padding: 4px calc(var(--bs-gutter-x, 1.5rem) * 0.5) 56px;
}

/* ---------- Hero Header Banner ---------- */
.do-ep-hero {
  position: relative;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 22px;
  background:
    radial-gradient(640px 240px at 8% 0%, rgba(245, 193, 108, 0.16), transparent 65%),
    radial-gradient(520px 260px at 95% 100%, rgba(99, 102, 241, 0.14), transparent 65%),
    linear-gradient(135deg, #101727 0%, #0b101d 100%);
  border: 1px solid rgba(245, 193, 108, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.35);
}

.do-ep-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--do-muted);
  margin-bottom: 14px;
}
.do-ep-breadcrumb a {
  color: var(--do-muted);
  text-decoration: none;
  transition: color 0.18s;
}
.do-ep-breadcrumb a:hover { color: var(--do-gold); }
.do-ep-breadcrumb .sep { opacity: 0.45; }
.do-ep-breadcrumb .current { color: var(--do-gold); font-weight: 600; }

.do-ep-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.do-ep-hero-title-wrap { min-width: 0; }

.do-ep-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.do-ep-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: doPulseDot 2s infinite;
}
@keyframes doPulseDot {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.65); }
  70% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.do-ep-hero h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.do-ep-hero h1 span {
  background: linear-gradient(120deg, #fff 35%, var(--do-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.do-ep-hero-sub {
  margin: 7px 0 0;
  font-size: 14px;
  color: var(--do-muted);
}

.do-ep-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.do-ep-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--do-border);
  min-width: 108px;
}
.do-ep-stat strong {
  font-size: 17px;
  font-weight: 800;
  color: var(--do-gold);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.do-ep-stat span {
  font-size: 11.5px;
  color: var(--do-muted);
  margin-top: 2px;
}

/* ---------- Filter & Search Toolbar ---------- */
.do-ep-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 22px;
  border-radius: 14px;
  background: var(--do-surface);
  border: 1px solid var(--do-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.do-ep-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}
.do-ep-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--do-border);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.do-ep-chip:hover {
  border-color: var(--do-gold-border);
  color: #fff;
  background: rgba(245, 193, 108, 0.1);
}
.do-ep-chip.active {
  background: linear-gradient(135deg, var(--do-gold-2), var(--do-gold));
  border-color: transparent;
  color: #0b0f19;
  font-weight: 800;
  box-shadow: 0 4px 14px var(--do-gold-glow);
}
.do-ep-chip .cnt {
  font-size: 11px;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.do-ep-tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.do-ep-archive .do-ep-search {
  position: relative;
  width: 240px;
}
.do-ep-archive .do-ep-search svg {
  position: absolute;
  right: 12px;
  left: auto;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 2;
}
.do-ep-archive .do-ep-search input[type="search"] {
  width: 100% !important;
  height: 38px !important;
  padding: 0 38px 0 12px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(7, 10, 18, 0.78) !important;
  color: #f8fafc !important;
  font-size: 13px !important;
  line-height: 36px !important;
  box-shadow: none !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.do-ep-search input::placeholder { color: #64748b; }
.do-ep-search input:focus {
  border-color: var(--do-gold-border);
  box-shadow: 0 0 0 3px rgba(245, 193, 108, 0.12);
}

.do-ep-archive .do-ep-view-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(7, 10, 18, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  height: 38px;
}
.do-ep-archive .do-ep-view-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 30px !important;
  min-width: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 7px !important;
  border: none !important;
  background: transparent !important;
  color: #94a3b8 !important;
  cursor: pointer;
  transition: all 0.16s;
}
.do-ep-archive .do-ep-view-btn svg { width: 16px !important; height: 16px !important; display: block !important; stroke: currentColor !important; }
.do-ep-archive .do-ep-view-btn:hover { color: #fff !important; background: rgba(255, 255, 255, 0.08) !important; }
.do-ep-archive .do-ep-view-btn.active {
  background: rgba(245, 193, 108, 0.18) !important;
  color: #f5c16c !important;
}

/* ---------- Grid Layout (24 cards -> balanced 6 / 4 / 3 / 2 cols) ---------- */
.do-ep-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1320px) { .do-ep-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .do-ep-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (max-width: 560px)  { .do-ep-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; } }

/* ---------- Episode Card (Grid View) ---------- */
.do-ep-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--do-card-bg);
  border: 1px solid var(--do-border);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(.22,.61,.36,1), border-color 0.25s, box-shadow 0.25s;
}
.do-ep-card:hover {
  transform: translateY(-5px);
  border-color: var(--do-gold-border);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(245, 193, 108, 0.15);
}
.do-ep-card.is-hidden { display: none !important; }

.do-ep-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none !important;
  color: inherit !important;
}

.do-ep-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #1a2234;
  overflow: hidden;
}
.do-ep-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s cubic-bezier(.22,.61,.36,1), filter 0.3s;
}
.do-ep-card:hover .do-ep-poster img {
  transform: scale(1.06);
  filter: brightness(0.82);
}

.do-ep-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(9, 13, 24, 0.94) 0%,
    rgba(9, 13, 24, 0.35) 36%,
    rgba(9, 13, 24, 0.08) 65%,
    rgba(9, 13, 24, 0.42) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Badges on Poster */
.do-ep-badge-ep {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: linear-gradient(135deg, #e5a94c, #f5c16c);
  color: #0b0f19;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}
.do-ep-badge-ep .new-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dc2626;
  box-shadow: 0 0 6px #dc2626;
}

.do-ep-badge-qual {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(11, 15, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: #f8fafc;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

/* Hover Center Play */
.do-ep-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  z-index: 3;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(11, 15, 25, 0.76);
  border: 2px solid var(--do-gold);
  color: var(--do-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.do-ep-play svg { width: 22px; height: 22px; margin-right: -2px; }
.do-ep-card:hover .do-ep-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Bottom Strip Inside Poster */
.do-ep-poster-meta {
  position: absolute;
  bottom: 8px;
  left: 9px;
  right: 9px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: #e2e8f0;
}
.do-ep-country {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(11, 15, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 68%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.do-ep-year {
  font-weight: 700;
  color: var(--do-gold);
  font-variant-numeric: tabular-nums;
}

/* Card Info Footer */
.do-ep-body {
  padding: 11px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}
.do-ep-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--do-text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.18s;
}
.do-ep-card:hover .do-ep-title { color: var(--do-gold); }

.do-ep-ar {
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 17px;
}

.do-ep-foot {
  margin-top: auto;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11.5px;
  color: #94a3b8;
}
.do-ep-time, .do-ep-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.do-ep-time svg, .do-ep-views svg { width: 12px; height: 12px; opacity: 0.8; }
.do-ep-watch-cta { display: none; }

/* ---------- Compact List View Mode ---------- */
.do-ep-grid.view-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 820px) { .do-ep-grid.view-list { grid-template-columns: 1fr; } }

.do-ep-grid.view-list .do-ep-card:hover { transform: translateY(-2px); }
.do-ep-grid.view-list .do-ep-card-link {
  flex-direction: row;
  align-items: center;
  padding: 10px;
  gap: 14px;
}
.do-ep-grid.view-list .do-ep-poster {
  width: 68px;
  min-width: 68px;
  border-radius: 10px;
  aspect-ratio: 2 / 3;
}
.do-ep-grid.view-list .do-ep-poster::after,
.do-ep-grid.view-list .do-ep-poster-meta,
.do-ep-grid.view-list .do-ep-badge-qual,
.do-ep-grid.view-list .do-ep-play { display: none; }
.do-ep-grid.view-list .do-ep-badge-ep {
  top: 4px; right: 4px; padding: 2px 6px; font-size: 10px; border-radius: 5px;
}
.do-ep-grid.view-list .do-ep-body {
  padding: 2px 0;
  min-width: 0;
}
.do-ep-grid.view-list .do-ep-title { font-size: 14.5px; }
.do-ep-grid.view-list .do-ep-foot {
  border-top: none;
  padding-top: 4px;
  justify-content: flex-start;
  gap: 14px;
}
.do-ep-grid.view-list .do-ep-watch-cta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-right: auto;
  padding: 7px 14px;
  border-radius: 9px;
  background: var(--do-gold-soft);
  border: 1px solid var(--do-gold-border);
  color: var(--do-gold);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}
.do-ep-grid.view-list .do-ep-card:hover .do-ep-watch-cta {
  background: var(--do-gold);
  color: #0b0f19;
}

/* ---------- Empty Filter State ---------- */
.do-ep-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 46px 20px;
  border-radius: 16px;
  background: var(--do-surface);
  border: 1px dashed var(--do-border);
  text-align: center;
  color: var(--do-muted);
}
.do-ep-empty.show { display: flex; }
.do-ep-empty button {
  padding: 8px 18px;
  border-radius: 10px;
  border: 1px solid var(--do-gold-border);
  background: var(--do-gold-soft);
  color: var(--do-gold);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- Premium Pagination Styling ---------- */
.do-ep-pagination {
  margin-top: 38px;
  display: flex;
  justify-content: center;
}
.do-ep-pagination .wp-pagenavi {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--do-surface);
  border: 1px solid var(--do-border);
}
.do-ep-pagination .wp-pagenavi .pages {
  font-size: 12.5px;
  color: var(--do-muted);
  margin-left: 8px;
  padding: 0 6px;
  background: transparent !important;
  border: none !important;
}
.do-ep-pagination .wp-pagenavi a,
.do-ep-pagination .wp-pagenavi span.current,
.do-ep-pagination .wp-pagenavi span.prev,
.do-ep-pagination .wp-pagenavi span.next {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px !important;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  border: 1px solid var(--do-border) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #cbd5e1 !important;
  transition: all 0.18s ease;
}
.do-ep-pagination .wp-pagenavi a:hover {
  border-color: var(--do-gold-border) !important;
  background: var(--do-gold-soft) !important;
  color: var(--do-gold) !important;
  transform: translateY(-2px);
}
.do-ep-pagination .wp-pagenavi span.current {
  background: linear-gradient(135deg, var(--do-gold-2), var(--do-gold)) !important;
  border-color: transparent !important;
  color: #0b0f19 !important;
  box-shadow: 0 4px 14px var(--do-gold-glow);
}
.do-ep-pagination .wp-pagenavi span.disabled {
  display: none !important;
}
.do-ep-pagination .wp-pagenavi span.dots {
  color: var(--do-muted);
  padding: 0 4px;
  border: none !important;
  background: transparent !important;
}

@media (max-width: 640px) {
  .do-ep-archive { padding: 14px 0 40px; }
  .do-ep-hero { padding: 18px 16px; border-radius: 14px; }
  .do-ep-stats { width: 100%; }
  .do-ep-stat { flex: 1 1 0; min-width: 0; padding: 8px 10px; }
  .do-ep-toolbar { padding: 10px; gap: 10px; }
  .do-ep-tools-right { width: 100%; }
  .do-ep-search { flex: 1 1 auto; width: auto; }
  .do-ep-body { padding: 9px 9px 10px; }
  .do-ep-title { font-size: 12.5px; }
  .do-ep-ar { font-size: 11px; }
  .do-ep-badge-ep { padding: 3px 8px; font-size: 11px; top: 7px; right: 7px; }
  .do-ep-badge-qual { top: 7px; left: 7px; font-size: 9.5px; }
  .do-ep-pagination .wp-pagenavi .pages { width: 100%; text-align: center; margin: 0 0 4px; }
}


/* Unified Header-Hero Integration v2.1 */
.post-type-archive-episodes .site-content.mt-4 {
  margin-top: 1.15rem !important;
}

@media (max-width: 767.98px) {
  .do-ep-archive {
    padding: 4px 12px 44px;
  }
  .do-ep-hero {
    padding: 18px 16px;
    border-radius: 14px;
    margin-bottom: 16px;
  }
  .do-ep-hero-row {
    align-items: stretch;
    gap: 14px;
  }
  .do-ep-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    width: 100%;
    gap: 8px;
  }
  .do-ep-stat {
    min-width: 0;
    padding: 9px 10px;
    align-items: center;
    text-align: center;
  }
  .do-ep-stat strong {
    font-size: 15px;
  }
  .do-ep-stat span {
    font-size: 11px;
  }
}
