@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0f1420;
  --bg-card: #171d2b;
  --bg-card-hover: #1e2636;
  --accent: #ff5a5f;
  --accent-2: #4f8cff;
  --text: #e8ebf2;
  --text-dim: #9aa4b8;
  --border: #262f42;
  --input-bg: #10151f;
  --radius: 14px;
}

/* حالت روز */
html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-card: #ffffff;
  --bg-card-hover: #eef1f8;
  --accent: #e6474c;
  --accent-2: #3672e0;
  --text: #1b2130;
  --text-dim: #5c6579;
  --border: #dde2ee;
  --input-bg: #ffffff;
}
html[data-theme="light"] body {
  background: radial-gradient(circle at 20% 0%, #eef1fb 0%, var(--bg) 45%),
              radial-gradient(circle at 90% 30%, #f4eefb 0%, var(--bg) 50%),
              var(--bg);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Vazirmatn', Tahoma, sans-serif;
  background: radial-gradient(circle at 20% 0%, #1a2236 0%, var(--bg) 45%),
              radial-gradient(circle at 90% 30%, #201a36 0%, var(--bg) 50%),
              var(--bg);
  color: var(--text);
  line-height: 1.8;
  min-height: 100vh;
}

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

a { color: inherit; text-decoration: none; }

/* هدر */
.site-header {
  background: rgba(15, 20, 32, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 20px; flex-wrap: wrap;
}
.logo { font-size: 22px; font-weight: 800; color: var(--accent); }
.main-nav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; align-items: center; }
.main-nav a { color: var(--text-dim); font-weight: 500; transition: .2s; }
.main-nav a:hover { color: var(--accent-2); }

/* منوی کشویی ژانرها زیر هر بخش (فیلم/نرم‌افزار/بازی) */
.nav-dropdown { position: relative; display: flex; align-items: center; gap: 2px; }
.nav-caret {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 12px; padding: 4px; line-height: 1;
}
.nav-caret:hover { color: var(--accent-2); }
.nav-dropdown-panel {
  position: absolute; top: 100%; inset-inline-start: 0; z-index: 50;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 10px 10px; margin-top: 0; min-width: 190px; box-shadow: 0 12px 30px rgba(0,0,0,.3);
  display: none; flex-direction: column; gap: 2px;
}
/* یه لایه‌ی نامرئی که فاصله‌ی بین دکمه و پنجره رو پر می‌کنه، تا موس وسط راه از حالت هاور خارج نشه */
.nav-dropdown::before {
  content: ''; position: absolute; top: 100%; inset-inline-start: 0; inset-inline-end: 0;
  height: 14px; display: none;
}
@media (hover: hover) {
  .nav-dropdown:hover::before { display: block; }
}
.nav-dropdown-panel a {
  padding: 8px 10px; border-radius: 8px; font-size: 14px; color: var(--text);
}
.nav-dropdown-panel a:hover { background: var(--bg-card-hover); color: var(--accent-2); }
.nav-dropdown-all { font-weight: 700; border-bottom: 1px solid var(--border); margin-bottom: 4px; padding-bottom: 10px !important; }

/* دسکتاپ: با هاور باز شه */
@media (hover: hover) {
  .nav-dropdown:hover .nav-dropdown-panel { display: flex; }
}
/* موبایل/لمسی: با تپ باز/بسته شه (کلاس open رو جاوااسکریپت اضافه می‌کنه) */
.nav-dropdown.open .nav-dropdown-panel { display: flex; }

.search-box { display: flex; }
.search-box input {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px 0 0 8px; padding: 8px 14px; color: var(--text);
  width: 220px; font-family: inherit;
}
.search-box button {
  background: var(--accent-2); border: none; color: #fff;
  border-radius: 0 8px 8px 0; padding: 0 14px; cursor: pointer;
}

.auth-links { display: flex; align-items: center; gap: 12px; }
.auth-links a {
  background: var(--bg-card); padding: 7px 16px; border-radius: 8px;
  border: 1px solid var(--border); font-size: 14px;
}
.auth-links a:hover { background: var(--bg-card-hover); }

.theme-toggle {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.theme-toggle:hover { background: var(--bg-card-hover); }

/* اسلایدر بنر بالای سایت - مستطیل کوچیک و ثابت، نه خیلی بزرگ */
.top-banner-slider {
  position: relative; max-width: 900px; margin: 16px auto; border-radius: var(--radius);
  overflow: hidden; background: var(--bg-card);
}
.tbs-track { position: relative; width: 100%; height: 100px; }
.tbs-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
.tbs-slide.active { opacity: 1; pointer-events: auto; }
.tbs-slide a { display: block; width: 100%; height: 100%; position: relative; }
.tbs-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-text-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 700; font-size: 18px; padding: 8px;
  text-shadow: 0 1px 6px rgba(0,0,0,.6); background: rgba(0,0,0,.15);
}
.banner-text-only {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  text-align: center; font-weight: 700; font-size: 17px; padding: 8px; line-height: 1.4;
}
.tbs-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  background: rgba(15,20,32,.55); color: #fff; border: none; width: 28px; height: 28px;
  border-radius: 50%; font-size: 16px; cursor: pointer; line-height: 1;
}
.tbs-prev { inset-inline-start: 8px; }
.tbs-next { inset-inline-end: 8px; }
.tbs-nav:hover { background: rgba(15,20,32,.8); }
.tbs-dots { position: absolute; bottom: 6px; inset-inline-start: 0; inset-inline-end: 0; display: flex; justify-content: center; gap: 6px; z-index: 5; }
.tbs-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.5); cursor: pointer; }
.tbs-dot.active { background: #fff; }

@media (max-width: 640px) {
  .tbs-track { height: 70px; }
}

/* چیدمان دو ستونه: محتوای اصلی + بنر کنار صفحه */
.page-layout { display: flex; gap: 24px; align-items: flex-start; }
.page-main { flex: 1; min-width: 0; }
.page-sidebar { width: 200px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.sidebar-banner {
  display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  height: 130px; position: relative;
}
.sidebar-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* بنرهای پایین صفحه - مستطیل کوچیک، نه عکس تمام‌عرض */
.bottom-banners { display: flex; flex-wrap: wrap; gap: 14px; margin: 30px 0 10px; justify-content: center; }
.bottom-banners a {
  flex: 0 1 280px; height: 90px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border);
  position: relative; display: block;
}
.bottom-banners img { width: 100%; height: 100%; object-fit: cover; display: block; }

@media (max-width: 900px) {
  .page-layout { flex-direction: column; }
  .page-sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; position: static; }
  .page-sidebar .sidebar-banner { flex: 1 1 160px; height: 100px; }
}

/* گرید محتوا */
.content-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px; margin: 24px 0;
}

/* فیلتر ژانر */
.genre-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.genre-chip {
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--text-dim); background: var(--bg-card);
}
.genre-chip:hover { background: var(--bg-card-hover); }
.genre-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* بج ژانر روی صفحه محتوا */
.genre-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.genre-badges a {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-card-hover); border: 1px solid var(--border); color: var(--text-dim);
}
.genre-badges a:hover { color: var(--text); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: .25s;
}
.card:hover { transform: translateY(-4px); background: var(--bg-card-hover); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.card img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; }
.card-body { padding: 12px; }
.card-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.card-meta { color: var(--text-dim); font-size: 13px; display: flex; justify-content: space-between; }
.badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 11px; padding: 2px 8px; border-radius: 999px; margin-inline-start: 6px;
}
.badge.free { background: #2ecc71; }
.badge.license { background: var(--accent-2); font-size: 12px; }

/* ردیف افقی پوسترها (شبیه سایت‌های استریم) */
.shelf-row {
  display: flex; gap: 14px; overflow-x: auto; padding: 6px 2px 16px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.shelf-row .card { flex: 0 0 auto; width: 170px; position: relative; }
.shelf-row .card img { aspect-ratio: 2/3; }
.shelf-row::-webkit-scrollbar { height: 8px; }
.shelf-row::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.poster-wrap { position: relative; }
.poster-overlay {
  position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 55%);
  display: flex; align-items: flex-end; padding: 10px; opacity: 1; transition: .2s;
}
.poster-overlay span { color: #fff; font-weight: 600; font-size: 13px; }

.quality-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: rgba(15,20,32,.85); color: var(--text); font-size: 11px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}


.section-title {
  font-size: 20px; font-weight: 700; margin: 0;
  border-inline-start: 4px solid var(--accent); padding-inline-start: 10px;
}

/* بخش‌های جدا برای فیلم/نرم‌افزار/بازی در صفحه اصلی */
.home-hero {
  text-align: center; padding: 46px 16px 20px; position: relative; overflow: hidden;
}
.home-hero::before {
  content: ''; position: absolute; top: -60px; inset-inline-start: 50%;
  transform: translateX(-50%); width: 480px; height: 220px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--accent) 35%, transparent) 0%, transparent 70%);
  filter: blur(10px); pointer-events: none; z-index: 0;
}
.home-hero h1, .home-hero p { position: relative; z-index: 1; }
.home-hero h1 {
  font-size: 32px; margin-bottom: 10px; font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.home-hero p { color: var(--text-dim); font-size: 15px; }

.type-section {
  margin: 30px 0; padding: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, color-mix(in srgb, var(--section-color, var(--accent)) 10%, var(--bg-card)) 0%, var(--bg-card) 55%);
  box-shadow: 0 6px 20px -12px rgba(0,0,0,.4);
}
.type-section-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.type-section .section-title {
  border-inline-start: none; padding-inline-start: 0; margin: 0;
  display: flex; align-items: center; gap: 10px;
}
.type-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px; font-size: 19px;
  background: color-mix(in srgb, var(--section-color, var(--accent)) 22%, transparent);
}
.see-all {
  font-size: 13px; color: var(--section-color, var(--accent-2)); font-weight: 700;
  padding: 7px 14px; border: 1px solid var(--section-color, var(--border)); border-radius: 999px;
  transition: .15s;
}
.see-all:hover { background: var(--section-color, var(--accent-2)); color: #fff; }
.type-section .shelf-row { padding: 16px 20px 20px; margin: 0; }

/* صفحه محتوا */
.content-detail { display: grid; grid-template-columns: 280px 1fr; gap: 30px; margin: 24px 0; }
.content-detail img { width: 100%; border-radius: var(--radius); }
.content-detail h1 { font-size: 26px; margin-bottom: 10px; }
.content-detail .desc { color: var(--text-dim); margin: 14px 0; }
.info-box { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 16px 0; }

.download-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.download-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
}
.btn {
  display: inline-block; background: var(--accent); color: #fff !important;
  padding: 9px 20px; border-radius: 8px; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 14px;
}
.btn:hover { opacity: .9; }
.btn.secondary { background: var(--accent-2); }
.btn.outline { background: transparent; border: 1px solid var(--border); color: var(--text) !important; }
.btn.small { padding: 5px 12px; font-size: 12px; }

/* فرم‌ها */
.form-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; max-width: 440px; margin: 30px auto;
}
.form-box h2 { margin-bottom: 18px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-dim); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: inherit;
}
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert.error { background: rgba(255,90,95,.15); color: #ff8b8f; border: 1px solid rgba(255,90,95,.3); }
.alert.success { background: rgba(46,204,113,.15); color: #6fdb9c; border: 1px solid rgba(46,204,113,.3); }

/* نظرات */
.comment { border-bottom: 1px solid var(--border); padding: 14px 0; }
.comment-header { display: flex; justify-content: space-between; color: var(--text-dim); font-size: 13px; margin-bottom: 6px; }
.admin-reply {
  margin-top: 10px; margin-inline-start: 20px; padding: 10px 14px;
  background: var(--bg-card); border-inline-start: 3px solid var(--accent-2); border-radius: 8px;
}
.admin-reply-header { font-size: 12px; font-weight: 700; color: var(--accent-2); margin-bottom: 4px; }

/* فوتر */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 50px; padding: 24px 0;
  color: var(--text-dim); font-size: 14px;
}
.footer-about { text-align: center; margin-bottom: 14px; flex-basis: 100%; }
.site-footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }

@media (max-width: 768px) {
  .content-detail { grid-template-columns: 1fr; }
  .header-inner { flex-direction: column; align-items: stretch; }
  .search-box input { width: 100%; }
}
