/* Qissa Ishq - original red/white RTL theme. Mobile-first. */
:root {
  --red: #C8102E;
  --red-dark: #9E0C24;
  --red-grad-a: #B72424;
  --red-grad-b: #BE3030;
  --red-soft: #FDEEF0;
  --green: #1E9E4A;
  --ink: #1C1C22;
  --muted: #6B6B76;
  --line: #EDEDEF;
  --bg: #FFFFFF;
  --bg-soft: #F7F7F9;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(28, 28, 34, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Tajawal', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5em; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 20px; padding-bottom: 40px; min-height: 60vh; }

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--red-grad-a), var(--red-grad-b) 55%, var(--red));
  color: #fff;
  box-shadow: 0 2px 12px rgba(158, 12, 36, .35);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-in {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; }
.logo:hover { text-decoration: none; }
.logo-mark svg { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.logo-text { font-size: 26px; font-weight: 900; letter-spacing: 0; white-space: nowrap; }
.main-nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.main-nav > a, .nav-drop-btn {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.main-nav > a:hover, .nav-drop-btn:hover { background: rgba(255,255,255,.16); text-decoration: none; }
.nav-drop { position: relative; }
.nav-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 6px;
  z-index: 60;
}
.nav-drop-menu a { display: block; padding: 9px 12px; border-radius: 7px; color: var(--ink); font-weight: 500; }
.nav-drop-menu a:hover { background: var(--red-soft); color: var(--red); text-decoration: none; }
.nav-drop.open .nav-drop-menu { display: block; }
.caret { font-size: 11px; }
.header-search {
  display: flex;
  margin-inline-start: auto;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px;
  overflow: hidden;
  flex: 1 1 220px;
  max-width: 340px;
}
.header-search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 15px;
  outline: none;
  min-width: 0;
}
.header-search input::placeholder { color: rgba(255,255,255,.75); }
.header-search button {
  border: 0;
  background: rgba(0,0,0,.18);
  padding: 0 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.header-search button:hover { background: rgba(0,0,0,.3); }
.nav-toggle {
  display: none;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 8px;
  width: 42px;
  height: 38px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.nav-toggle span { display: block; width: 20px; height: 2px; background: #fff; border-radius: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--red-dark);
  color: #fff;
  margin-bottom: 28px;
}
.hero-img { width: 100%; height: 280px; object-fit: cover; display: block; }
.hero-body {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(20,0,4,.88) 0%, rgba(20,0,4,.45) 55%, rgba(20,0,4,.05) 100%);
}
.hero h1 { font-size: 30px; font-weight: 900; margin-bottom: 6px; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hero p { margin: 0 0 14px; max-width: 720px; font-size: 16px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.hero-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hero-stats .stat {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 10px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 14px;
}
.hero-stats .stat b { font-size: 18px; margin-inline-end: 4px; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-weight: 800;
  padding: 10px 22px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
}
.btn:hover { background: var(--red-dark); text-decoration: none; }
.btn.ghost { background: #fff; color: var(--red); }
.btn.ghost:hover { background: var(--red-soft); }
.btn.outline { background: transparent; color: var(--red); border: 2px solid var(--red); }
.btn.outline:hover { background: var(--red-soft); }

/* ---------- sections ---------- */
.section { margin-bottom: 34px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 800;
  margin: 0;
  padding-inline-start: 12px;
  border-inline-start: 4px solid var(--red);
}
.view-all {
  color: var(--red);
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  border: 1px solid var(--red);
  border-radius: 999px;
  padding: 4px 14px;
}
.view-all:hover { background: var(--red); color: #fff; text-decoration: none; }

/* ---------- poster grid (7 columns desktop, collapsing) ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
}
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(28,28,34,.14); }
.card a { color: inherit; display: block; }
.card a:hover { text-decoration: none; }
.card-poster { position: relative; aspect-ratio: 2 / 3; background: var(--red-soft); overflow: hidden; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; }
.card-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(158,12,36,0);
  transition: background .15s ease;
}
.card-play span {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(200,16,46,.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.8); transition: opacity .15s ease, transform .15s ease;
}
.card-play svg { width: 22px; height: 22px; fill: #fff; margin-inline-start: 2px; }
.card:hover .card-play { background: rgba(158,12,36,.25); }
.card:hover .card-play span { opacity: 1; transform: scale(1); }
.card-body { padding: 10px 12px 12px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-meta { font-size: 13px; color: var(--muted); }
.dot { color: #C9C9D2; }
.badge {
  position: absolute;
  top: 8px;
  inset-inline-start: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.badge.finale-badge { background: var(--green); inset-inline-start: auto; inset-inline-end: 8px; }
.badge.kind-badge { top: auto; bottom: 8px; inset-inline-start: 8px; background: rgba(28,28,34,.85); }
.badge.ep-badge + .badge.finale-badge { top: 34px; inset-inline-end: 8px; }

/* ---------- genre chips ---------- */
.genre-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.genre-chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 10px;
  color: var(--ink);
  font-weight: 800;
  font-size: 17px;
}
.genre-chip:hover { background: var(--red); color: #fff; border-color: var(--red); text-decoration: none; }
.genre-chip small { font-weight: 500; font-size: 13px; color: var(--muted); }
.genre-chip:hover small { color: rgba(255,255,255,.85); }
.genre-count { font-size: 12px; color: var(--muted); }

/* ---------- prose / SEO content ---------- */
.seo-content, .prose { max-width: 860px; }
.seo-content h2, .prose h2 { font-size: 21px; font-weight: 800; margin-top: 26px; padding-inline-start: 12px; border-inline-start: 4px solid var(--red); }
.seo-content h3, .prose h3 { font-size: 17px; font-weight: 800; margin-top: 20px; }
.seo-content ul, .seo-content ol, .prose ul, .prose ol { padding-inline-start: 22px; }
.seo-content li, .prose li { margin-bottom: 6px; }
.about-figure { margin: 18px 0; border-radius: 14px; overflow: hidden; }
.about-figure img { width: 100%; height: 240px; object-fit: cover; }
.about-figure figcaption { font-size: 13px; color: var(--muted); text-align: center; padding: 8px; background: var(--bg-soft); }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 900; margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.page-hero-img { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; margin-bottom: 18px; }

/* ---------- FAQ ---------- */
.faq-item { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.faq-item h3 { font-size: 16px; font-weight: 800; margin: 0 0 6px; color: var(--red-dark); }
.faq-item p { margin: 0; }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--red); }
.breadcrumb .sep { margin: 0 6px; color: #C9C9D2; }

/* ---------- filter bar ---------- */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.filter-bar select, .filter-bar input[type="search"] {
  font-family: inherit; font-size: 15px; padding: 9px 12px;
  border: 1px solid #D8D8DE; border-radius: 9px; background: #fff; color: var(--ink);
}
.filter-bar label { font-weight: 700; font-size: 14px; }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  border: 1px solid #D8D8DE; color: var(--ink); font-size: 14px; font-weight: 700;
  background: #fff;
}
.chip:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.chip.active { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 22px; }
.pagination a { border: 1px solid var(--red); color: var(--red); border-radius: 999px; padding: 6px 18px; font-weight: 700; }
.pagination a:hover { background: var(--red); color: #fff; text-decoration: none; }
.pagination .cur { font-weight: 800; color: var(--muted); }

/* ---------- player / episode page ---------- */
.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.server-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.server-bar .srv-label { font-weight: 800; font-size: 14px; }
.server-btn {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 7px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid #D8D8DE; background: #fff; color: var(--ink);
}
.server-btn:hover { border-color: var(--red); color: var(--red); }
.server-btn.active { background: var(--red); border-color: var(--red); color: #fff; }
.now-playing { font-size: 15px; margin-bottom: 18px; }
.now-playing .np-label { font-weight: 800; color: var(--red-dark); }
.ep-nav { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 22px; }
.ep-nav a { flex: 1; text-align: center; }
.ep-nav a.disabled { visibility: hidden; }
.details-card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 28px; }
.details-grid { display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.details-poster { width: 100%; border-radius: 10px; box-shadow: var(--shadow); }
.show-title { font-size: 24px; font-weight: 900; }
.meta-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 700; }
.pill.q { background: var(--red-soft); color: var(--red-dark); border-color: #F3C2CB; }
.desc { margin-bottom: 14px; }
.meta-list .meta-item { margin-bottom: 6px; font-size: 15px; }
.meta-list .meta-item strong { color: var(--red-dark); }
.tag { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; margin: 2px; font-size: 13px; color: var(--ink); }
.tag:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.ep-list a {
  display: block; text-align: center; padding: 9px 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  color: var(--ink); font-weight: 700; font-size: 14px;
}
.ep-list a:hover { border-color: var(--red); color: var(--red); text-decoration: none; }
.ep-list a.current { background: var(--red); border-color: var(--red); color: #fff; }
.empty-msg { background: var(--red-soft); border: 1px solid #F3C2CB; color: var(--red-dark); border-radius: 10px; padding: 16px 18px; text-align: center; font-weight: 700; }
.notice { background: #FFF7E6; border: 1px solid #F0D9A0; color: #7A5A00; border-radius: 10px; padding: 14px 18px; margin-bottom: 18px; }

/* ---------- footer ---------- */
.site-footer { background: #17171B; color: #C9C9D2; margin-top: 20px; }
.site-footer .container { padding-top: 34px; padding-bottom: 24px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin-bottom: 22px; }
.footer-brand .logo-text { color: #fff; font-size: 24px; }
.footer-brand p { font-size: 14px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 10px; }
.footer-col a { display: block; color: #C9C9D2; font-size: 14px; padding: 3px 0; }
.footer-col a:hover { color: #fff; }
.footer-note { font-size: 13px; border-top: 1px solid #2A2A30; padding-top: 16px; }
.footer-note a { color: #fff; }
.footer-copy { font-size: 13px; text-align: center; margin: 14px 0 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
  .genre-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .details-grid { grid-template-columns: 140px 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding-bottom: 6px;
  }
  .main-nav.open { display: flex; }
  .main-nav > a, .nav-drop-btn { text-align: start; width: 100%; }
  .nav-drop-menu { position: static; box-shadow: none; background: rgba(255,255,255,.1); }
  .nav-drop-menu a { color: #fff; }
  .nav-drop-menu a:hover { background: rgba(255,255,255,.16); color: #fff; }
  .header-search { flex-basis: 100%; max-width: none; order: 5; }
  .hero-img { height: 220px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 14px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .genre-grid { grid-template-columns: repeat(2, 1fr); }
  .details-grid { grid-template-columns: 1fr; }
  .details-poster { max-width: 200px; }
  .section-head h2 { font-size: 19px; }
}
@media (max-width: 460px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .card-title { font-size: 13px; }
  .logo-text { font-size: 22px; }
}
