:root {
    --bg: #ffffff;
    --soft: #f4fbff;
    --line: #d8eef9;
    --text: #10202a;
    --muted: #5d7482;
    --sky: #15b7e8;
    --blue: #147fc2;
    --deep: #0d4d78;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Tajawal", Tahoma, Arial, sans-serif;
    line-height: 1.8;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { width: min(1220px, calc(100% - 32px)); margin: 0 auto; }
.topbar { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px); }
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 28px; font-weight: 800; color: var(--deep); }
.brand-mark { width: 38px; height: 38px; border-radius: 10px; background: linear-gradient(135deg, var(--sky), var(--blue)); display: grid; place-items: center; color: #fff; }
.links { display: flex; align-items: center; gap: 18px; color: var(--muted); font-weight: 700; }
.search-box { display: flex; gap: 8px; min-width: 290px; }
.input, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; color: var(--text); background: #fff; font-family: inherit; }
.btn { border: 0; border-radius: 10px; padding: 12px 18px; background: linear-gradient(135deg, var(--sky), var(--blue)); color: #fff; font-weight: 800; cursor: pointer; font-family: inherit; }
.btn.secondary { background: var(--soft); color: var(--deep); border: 1px solid var(--line); }
.hero { padding: 56px 0 34px; background: linear-gradient(180deg, var(--soft), #fff); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 28px; align-items: center; }
.hero h1 { margin: 0 0 12px; font-size: clamp(34px, 5vw, 62px); line-height: 1.15; color: var(--deep); font-weight: 800; }
.hero p { margin: 0 0 24px; color: var(--muted); font-size: 18px; }
.hero-panel { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 16px 50px rgba(13, 77, 120, .08); }
.section { padding: 34px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section h2 { margin: 0; color: var(--deep); font-size: 28px; font-weight: 800; }
.series-hero { display: grid; grid-template-columns: 520px 1fr; gap: 34px; align-items: center; }
.series-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.series-info h1 { margin: 0 0 12px; color: var(--deep); font-size: 38px; font-weight: 800; }
.episode-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; }
.muted { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.episodes-grid { grid-template-columns: repeat(3, 1fr); }
.card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(13, 77, 120, .10); }
.poster { aspect-ratio: 16 / 10; background: var(--soft); object-fit: cover; width: 100%; }
.card-body { padding: 14px; }
.card h3 { margin: 0 0 8px; font-size: 18px; color: var(--deep); font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1px solid var(--line); background: var(--soft); color: var(--deep); padding: 4px 10px; border-radius: 999px; font-size: 13px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr auto; gap: 10px; margin-bottom: 20px; }
.watch-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #07131c; border-radius: 12px; overflow: hidden; }
.watch-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.content { max-width: 820px; font-size: 18px; }
.article-cover {
    margin: 18px 0 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
}
.article-content h2 {
    margin: 34px 0 12px;
    color: var(--deep);
    font-size: 26px;
    font-weight: 800;
}
.article-content h3 {
    margin: 24px 0 8px;
    color: var(--blue);
    font-size: 21px;
    font-weight: 800;
}
.article-content p { margin: 0 0 16px; }
.article-content ul {
    margin: 0 0 18px;
    padding-inline-start: 24px;
}
.article-content li { margin-bottom: 6px; }
.article-content table {
    width: 100%;
    margin: 14px 0 22px;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
}
.article-content th,
.article-content td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: start;
    vertical-align: top;
}
.article-content th {
    width: 34%;
    color: var(--deep);
    background: var(--soft);
}
.article-content tr:last-child th,
.article-content tr:last-child td { border-bottom: 0; }
.article-content .article-summary {
    margin: 24px 0;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--soft);
}
.footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); background: var(--soft); }
.pagination { margin-top: 24px; }
.pagination nav { display: grid; gap: 12px; justify-items: center; }
.pagination nav > div { display: grid; gap: 12px; justify-items: center; color: var(--muted); }
.pagination p { margin: 0; color: var(--muted); font-size: 14px; }
.pagination ul,
ul.pagination {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.pagination li,
.page-item { margin: 0; padding: 0; }
.pagination a,
.pagination span,
.page-link {
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    line-height: 1;
}
.pagination a:hover,
.page-link:hover { background: var(--soft); border-color: var(--sky); color: var(--blue); }
.pagination .active span,
.page-item.active .page-link { background: linear-gradient(135deg, var(--sky), var(--blue)); border-color: var(--blue); color: #fff; }
.pagination .disabled span,
.page-item.disabled .page-link { color: #a8b7c1; background: #f7fbfd; cursor: not-allowed; }
.pagination svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
    .nav, .links { flex-wrap: wrap; }
    .search-box { min-width: 100%; }
    .hero-grid, .grid, .filters, .episodes-grid, .series-hero { grid-template-columns: 1fr; }
    .episode-nav { flex-direction: column; }
}
