/*
Theme Name: Anivora
Theme URI: https://anivora.top
Author: Anivora Team
Description: قالب اختصاصی دانلود و پخش آنلاین انیمه برای anivora.top — موبایل‌فرست، اپلیکیشن‌طور، با اسلایدر، دسته‌بندی وضعیت پخش و باکس دانلود چندکیفیتی.
Version: 1.0.0
Text Domain: anivora
*/

:root {
  --bg: #0b0d17;
  --bg-2: #121527;
  --card: #171b30;
  --card-2: #1e2340;
  --stroke: rgba(255, 255, 255, 0.08);
  --txt: #eef0ff;
  --txt-2: #9aa1c7;
  --accent: #7c5cff;
  --accent-2: #ff4d8d;
  --accent-3: #38e1ff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #ff4d8d 100%);
  --grad-neon: linear-gradient(135deg, #38e1ff, #7c5cff 55%, #ff4d8d);
  --radius: 18px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --header-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(700px 400px at 0% 10%, rgba(56, 225, 255, 0.12), transparent 60%),
    var(--bg);
  color: var(--txt);
  min-height: 100vh;
}

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

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 14px; border: 0;
  font: inherit; font-weight: 700; cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 8px 24px rgba(124, 92, 255, 0.35); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost { background: rgba(255,255,255,.06); color: var(--txt); border: 1px solid var(--stroke); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }

/* ---------- هدر ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(11, 13, 23, 0.75);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--stroke);
}
.header-inner { display: flex; align-items: center; gap: 14px; height: 100%; }

.logo { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 900; letter-spacing: .5px; }
.logo .logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: var(--grad-neon); display: grid; place-items: center;
  font-size: 20px; box-shadow: 0 6px 18px rgba(124,92,255,.45);
}
.logo b { background: var(--grad-neon); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-desktop { display: flex; gap: 6px; margin-inline-start: 24px; }
.nav-desktop a {
  padding: 8px 14px; border-radius: 12px; color: var(--txt-2); font-weight: 600; font-size: 14px;
  transition: color .2s, background .2s;
}
.nav-desktop a:hover, .nav-desktop a.active { color: #fff; background: rgba(255,255,255,.08); }

.header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.search-toggle {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255,255,255,.06); border: 1px solid var(--stroke); color: var(--txt);
  cursor: pointer; font-size: 17px;
}

/* ---------- اورلی جستجو ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 9, 18, 0.92); backdrop-filter: blur(14px);
  display: flex; flex-direction: column; align-items: center;
  padding: 90px 16px 30px; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.search-overlay.open { opacity: 1; pointer-events: auto; }
.search-box {
  width: min(680px, 100%); display: flex; gap: 10px;
  background: var(--card); border: 1px solid var(--stroke); border-radius: 18px; padding: 8px;
  box-shadow: var(--shadow);
}
.search-box input {
  flex: 1; background: transparent; border: 0; outline: 0;
  color: var(--txt); font: inherit; font-size: 17px; padding: 10px 14px;
}
.search-results { width: min(680px, 100%); margin-top: 14px; display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.search-item {
  display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--stroke); border-radius: 14px; padding: 10px;
}
.search-item img { width: 46px; height: 64px; object-fit: cover; border-radius: 8px; }
.search-item h4 { margin: 0 0 4px; font-size: 14px; }
.search-item span { font-size: 12px; color: var(--txt-2); }

/* ---------- هیرو / اسلایدر ---------- */
.hero { padding: 24px 0 8px; position: relative; }
.hero-slider { position: relative; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--stroke); }
.hero-slide { display: none; position: relative; min-height: 440px; }
.hero-slide.active { display: block; animation: fadeIn .5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }
.hero-slide img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.5) saturate(1.15); }
.hero-content { position: relative; z-index: 2; padding: 40px 32px; display: flex; gap: 24px; align-items: flex-end; }
.hero-content .poster { width: 170px; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.15); flex-shrink: 0; }
.hero-text h2 { margin: 10px 0 8px; font-size: 30px; font-weight: 900; text-shadow: 0 4px 20px rgba(0,0,0,.6); }
.hero-text p { margin: 0 0 14px; color: #d9ddf5; font-size: 14px; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.badge {
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12); border: 1px solid var(--stroke);
}
.badge.status-airing { background: rgba(56,225,255,.15); color: var(--accent-3); border-color: rgba(56,225,255,.35); }
.badge.status-finished { background: rgba(124,92,255,.15); color: #b3a1ff; }
.badge.score { background: rgba(255,77,141,.15); color: #ff8db4; }
.hero-dots { position: absolute; bottom: 14px; inset-inline-start: 0; width: 100%; display: flex; justify-content: center; gap: 8px; z-index: 3; }
.hero-dots button { width: 9px; height: 9px; border-radius: 99px; background: rgba(255,255,255,.3); border: 0; cursor: pointer; transition: all .3s; }
.hero-dots button.active { width: 28px; background: var(--grad); }

/* ---------- بخش‌ها ---------- */
.section { margin: 36px 0; }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.section-head .icon { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: var(--grad); box-shadow: 0 8px 20px rgba(124,92,255,.35); }
.section-head h3 { margin: 0; font-size: 20px; font-weight: 800; }
.section-head .sub { font-size: 12px; color: var(--txt-2); margin-top: 3px; }
.section-head .more { margin-inline-start: auto; font-size: 13px; color: var(--accent-3); font-weight: 700; }

/* ---------- گرید کارت‌ها ---------- */
.grid-anime { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--stroke); border-radius: var(--radius);
  overflow: hidden; position: relative; transition: transform .25s ease, box-shadow .25s ease, border-color .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(124,92,255,.2); border-color: rgba(124,92,255,.4); }
.card .thumb { position: relative; aspect-ratio: 2/3; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.07); }
.card .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10,12,22,.9), transparent 45%); }
.card .flags { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.flag { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 8px; background: var(--grad); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.flag.finished { background: linear-gradient(135deg, #6b7cff, #9b6bff); }
.flag.new { background: linear-gradient(135deg, #ff4d6d, #ff7a45); }
.card .play-badge {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 2;
  opacity: 0; transition: opacity .25s; background: rgba(10,12,25,.45);
}
.card:hover .play-badge { opacity: 1; }
.card .play-badge span {
  width: 52px; height: 52px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; font-size: 18px; box-shadow: 0 10px 30px rgba(255,77,141,.5);
}
.card .info { padding: 12px 14px 14px; }
.card .info h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt-2); }
.card .meta .rate { color: #ffc86b; font-weight: 700; }

/* ---------- ژانر ---------- */
.genre-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.genre-pills a {
  padding: 10px 22px; border-radius: 999px; font-size: 14px; font-weight: 700;
  background: var(--card); border: 1px solid var(--stroke); transition: all .2s;
}
.genre-pills a:hover { background: var(--grad); border-color: transparent; transform: translateY(-2px); }

/* ---------- صفحه تکی انیمه ---------- */
.single-hero { position: relative; padding: 60px 0 40px; overflow: hidden; }
.single-hero .bg-blur { position: absolute; inset: 0; background-size: cover; background-position: center; filter: blur(40px) brightness(.25); transform: scale(1.4); z-index: 0; }
.single-layout { position: relative; z-index: 1; display: flex; gap: 32px; align-items: flex-start; }
.single-poster { width: 280px; flex-shrink: 0; border-radius: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.6); border: 2px solid rgba(255,255,255,.14); }
.single-info h1 { font-size: 32px; font-weight: 900; margin: 12px 0 6px; }
.single-info .alt-title { color: var(--txt-2); font-size: 14px; margin-bottom: 14px; }
.single-info .story { color: #cdd3f0; line-height: 2; font-size: 15px; margin: 16px 0; }
.meta-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 18px 0; }
.meta-item { background: var(--card); border: 1px solid var(--stroke); border-radius: 14px; padding: 10px 14px; font-size: 13px; }
.meta-item b { display: block; color: var(--txt-2); font-weight: 600; font-size: 11px; margin-bottom: 4px; }
.single-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* ---------- تریلر ---------- */
.trailer-box { border-radius: 20px; overflow: hidden; border: 1px solid var(--stroke); background: #000; position: relative; aspect-ratio: 16/9; }
.trailer-box iframe { width: 100%; height: 100%; border: 0; }

/* ---------- تب‌ها / قسمت‌ها ---------- */
.tabs { display: flex; gap: 8px; margin: 26px 0 18px; border-bottom: 1px solid var(--stroke); overflow-x: auto; }
.tab-btn {
  padding: 12px 22px; border: 0; background: transparent; color: var(--txt-2);
  font: inherit; font-weight: 700; cursor: pointer; border-radius: 12px 12px 0 0; white-space: nowrap;
  border-bottom: 3px solid transparent; transition: all .2s;
}
.tab-btn.active { color: #fff; border-bottom-color: var(--accent); background: rgba(124,92,255,.1); }
.tab-panel { display: none; animation: fadeIn .3s; }
.tab-panel.active { display: block; }

/* ---------- اپیزودها ---------- */
.episode-list { display: grid; gap: 12px; }
.episode {
  background: var(--card); border: 1px solid var(--stroke); border-radius: 16px; overflow: hidden;
}
.episode-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; user-select: none;
}
.episode-head .ep-num {
  width: 44px; height: 44px; border-radius: 12px; background: var(--grad); display: grid; place-items: center;
  font-weight: 900; font-size: 15px; flex-shrink: 0;
}
.episode-head h4 { margin: 0; font-size: 15px; flex: 1; }
.episode-head .chev { transition: transform .3s; color: var(--txt-2); }
.episode.open .chev { transform: rotate(180deg); }
.episode-body { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.episode.open .episode-body { max-height: 900px; }
.episode-body-inner { padding: 4px 16px 16px; }

.quality-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 10px; }
.quality-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--card-2); border: 1px solid var(--stroke); border-radius: 12px;
  transition: all .2s;
}
.quality-item:hover { border-color: var(--accent); transform: translateY(-2px); }
.quality-item .q-tag {
  font-size: 11px; font-weight: 900; padding: 4px 10px; border-radius: 8px;
  background: rgba(56,225,255,.15); color: var(--accent-3);
}
.quality-item .q-tag.q1080 { background: rgba(255,77,141,.15); color: #ff8db4; }
.quality-item .q-tag.q720 { background: rgba(124,92,255,.18); color: #b3a1ff; }
.quality-item .q-tag.q480 { background: rgba(255,194,107,.15); color: #ffc86b; }
.quality-item .q-sub { font-size: 11px; color: var(--txt-2); }

.watch-btn {
  margin-top: 12px; width: 100%; justify-content: center;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364); border: 1px solid rgba(56,225,255,.3);
}

/* ---------- پلیر آنلاین ---------- */
.player-modal {
  position: fixed; inset: 0; z-index: 300; background: rgba(5,6,12,.92);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.player-modal.open { display: flex; }
.player-modal .player-frame { width: min(1000px, 100%); aspect-ratio: 16/9; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--stroke); }
.player-modal .close-player { position: absolute; top: 18px; inset-inline-end: 18px; font-size: 26px; cursor: pointer; background: rgba(255,255,255,.1); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; }

/* ---------- فوتر ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--stroke); background: rgba(10,12,22,.7); padding: 40px 0 90px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer-grid h4 { margin: 0 0 14px; font-size: 15px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--txt-2); font-size: 14px; }
.footer-grid a:hover { color: #fff; }
.footer-desc { color: var(--txt-2); font-size: 14px; line-height: 2; }
.copyright { text-align: center; color: var(--txt-2); font-size: 12px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--stroke); }

/* ---------- منوی پایین موبایل ---------- */
.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 150;
  background: rgba(13,15,28,.9); backdrop-filter: blur(18px);
  border-top: 1px solid var(--stroke);
  display: none; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--txt-2); font-weight: 600; }
.bottom-nav a.active, .bottom-nav a:hover { color: #fff; }
.bottom-nav .bn-icon { font-size: 20px; }
.bottom-nav .center a {
  width: 52px; height: 52px; margin-top: -26px; border-radius: 50%; background: var(--grad);
  color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(124,92,255,.45); font-size: 22px;
}

/* ---------- آرشیو ---------- */
.archive-head { padding: 30px 0 10px; }
.archive-head h1 { margin: 0; font-size: 26px; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1024px) {
  .grid-anime { grid-template-columns: repeat(4, 1fr); }
  .nav-desktop { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .grid-anime { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .hero-slide { min-height: 400px; }
  .hero-content { padding: 22px 16px; flex-direction: column; align-items: flex-start; }
  .hero-content .poster { width: 120px; }
  .hero-text h2 { font-size: 21px; }
  .single-layout { flex-direction: column; }
  .single-poster { width: min(240px, 65%); margin: 0 auto; }
  .single-info { text-align: center; }
  .single-info h1 { font-size: 22px; }
  .single-actions, .hero-meta { justify-content: center; }
  .footer-grid { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; }
  .episode-head h4 { font-size: 13px; }
  .card .info h4 { font-size: 13px; }
}
@media (max-width: 420px) {
  .grid-anime { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- دیدگاه‌ها ---------- */
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { margin-inline-start: 40px; }
.comment-item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--stroke); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.comment-avatar img { border-radius: 50%; }
.comment-body { flex: 1; }
.comment-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 8px; }
.comment-head span { color: var(--txt-2); font-size: 11px; }
.comment-text { font-size: 14px; line-height: 1.9; color: #cdd3f0; }
.comment-reply a { font-size: 12px; color: var(--accent-3); font-weight: 700; }
.comment-respond textarea, .comment-respond input[type="text"], .comment-respond input[type="email"], .comment-respond input[type="url"] {
  width: 100%; background: var(--card); border: 1px solid var(--stroke); border-radius: 12px;
  color: var(--txt); font: inherit; padding: 12px 14px; margin: 6px 0; outline: 0;
}
.comment-respond textarea:focus, .comment-respond input:focus { border-color: var(--accent); }
.comment-form input[type="submit"] { background: var(--grad); border: 0; cursor: pointer; }
.no-episode { text-align: center; color: var(--txt-2); padding: 30px; background: var(--card); border-radius: 16px; border: 1px dashed var(--stroke); }
.screen-reader-text { position: absolute; clip: rect(0,0,0,0); }

/* ---------- اسکرول‌بار و انیمیشن ورود ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 99px; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal { opacity: 0; transform: translateY(26px); }
html.js .reveal.visible { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
