/* =====================================================
   CafeFilm — هویت بصری
   ایده: سالن سینمای نیمه‌تاریک، نور طلایی پروژکتور روی مخمل بنفش‌سرمه‌ای تیره.
   المان امضا: حاشیه‌ی «نوار فیلم» (سوراخ‌های پرفراژ) دور جعبه‌ی جست‌وجو و پوستر فیلم‌ها.
   ===================================================== */

/* =====================================================
   سیستم تم — سه تم: جنگلی (پیش‌فرض)، تیره، نئون (دلخواه)
   با data-theme روی <html> سوییچ میشه، مقدار توی localStorage نگه‌داری میشه.
   ===================================================== */
:root,
[data-theme="forest"] {
  --bg: #0a1710;
  --bg-elevated: #101f17;
  --bg-card: #152a1e;
  --line: #24422f;

  --gold: #dab868;
  --gold-soft: #f1dc9c;
  --velvet: #3f8a55;
  --velvet-soft: #56a86a;

  --text: #eff4ea;
  --text-muted: #a9c4ab;
  --text-faint: #6f8c76;

  --shadow-deep: 0 20px 50px rgba(0,10,5,0.5);
  --glass-tint: 255,255,255;
}

[data-theme="dark"] {
  --bg: #0a0a0c;
  --bg-elevated: #131316;
  --bg-card: #19191d;
  --line: #2b2b31;

  --gold: #d5d5dd;
  --gold-soft: #eeeef1;
  --velvet: #5b7cfa;
  --velvet-soft: #7d97ff;

  --text: #f3f3f5;
  --text-muted: #9a9aa6;
  --text-faint: #5f5f69;

  --shadow-deep: 0 20px 50px rgba(0,0,0,0.55);
  --glass-tint: 255,255,255;
}

[data-theme="neon"] {
  --bg: #0d0620;
  --bg-elevated: #160b34;
  --bg-card: #1d1042;
  --line: #3c2069;

  --gold: #ff74cc;
  --gold-soft: #ffa3dd;
  --velvet: #7c3aed;
  --velvet-soft: #9b62f5;

  --text: #f6ecff;
  --text-muted: #bd9de3;
  --text-faint: #7f5aab;

  --shadow-deep: 0 20px 55px rgba(60,10,90,0.55);
  --glass-tint: 255,255,255;
}

:root {
  /* رنگ ثابت خطر/حذف — مستقل از تم، همیشه قرمز شناخته‌شده */
  --danger: #d6455a;
  --danger-soft: #e8697d;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;

  --font-display: 'Lalezar', 'Vazirmatn', sans-serif;
  --font-body: 'Vazirmatn', Tahoma, sans-serif;
}

/* ---------- ترنزیشن بین صفحات (فقط صفحات اصلی سایت) ---------- */
@keyframes cf-page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cf-page-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}
.cf-page {
  animation: cf-page-in .35s ease both;
}
.cf-page.cf-page-exit {
  animation: cf-page-out .22s ease both;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .cf-page, .cf-page.cf-page-exit { animation: none !important; }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: radial-gradient(ellipse at 20% -10%, var(--bg-elevated) 0%, var(--bg) 45%) fixed;
  color: var(--text);
  font-family: var(--font-body);
  direction: rtl;
  line-height: 1.75;
  min-height: 100vh;
  transition: background-color .3s ease, color .3s ease;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection { background: var(--gold); color: #16121f; }

/* ---------- اسکرول‌بار ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; }

/* ---------- نوار بالای صفحه ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  background: linear-gradient(180deg, rgba(14,11,22,0.96) 0%, rgba(14,11,22,0.85) 70%, transparent 100%);
  backdrop-filter: blur(6px);
}

.brand {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 1px;
  color: var(--gold-soft);
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand .brand-icon {
  font-size: 24px;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.4));
  transform: translateY(-1px);
}
.brand .brand-text {
  background: linear-gradient(95deg, var(--gold-soft) 10%, var(--gold) 55%, var(--gold-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 22px rgba(var(--glass-tint), 0.06);
}
.brand .brand-dot {
  background: linear-gradient(95deg, var(--velvet-soft), var(--velvet));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- گروه دکمه‌های سمت راست هدر (همبرگری + تم) با ظاهر شیشه‌ای iOS ---------- */
.header-left-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-btn,
.theme-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(var(--glass-tint), 0.14);
  background: linear-gradient(160deg, rgba(var(--glass-tint), 0.16), rgba(var(--glass-tint), 0.03));
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(var(--glass-tint), 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  color: var(--gold-soft);
  transition: transform .16s ease, box-shadow .16s ease, background .2s ease;
}
.cart-btn:hover,
.theme-toggle:hover { box-shadow: 0 10px 26px rgba(0,0,0,0.4), inset 0 1px 0 rgba(var(--glass-tint), 0.22); }
.cart-btn:active,
.theme-toggle:active { transform: scale(0.9); }

.cart-btn .cart-icon {
  font-size: 19px;
  line-height: 1;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.cart-btn.open .cart-icon,
.cart-btn:hover .cart-icon { transform: scale(1.12) rotate(-6deg); }

.cart-badge {
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  color: #16121f;
  font-size: 10.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4), 0 0 0 2px var(--bg-elevated);
  animation: cf-badge-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cf-badge-pop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ---------- پاپ‌اور انتخاب تم ---------- */
.theme-popover-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  opacity: 0;
  pointer-events: none;
}
.theme-popover-overlay.open { opacity: 1; pointer-events: all; }

.theme-popover {
  position: fixed;
  top: 72px;
  right: 20px;
  width: min(250px, 80vw);
  background: linear-gradient(165deg, rgba(var(--glass-tint), 0.12), rgba(var(--glass-tint), 0.02)), var(--bg-elevated);
  border: 1px solid rgba(var(--glass-tint), 0.16);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(var(--glass-tint), 0.18);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  z-index: 90;
  opacity: 0;
  transform: translateY(-10px) scale(0.9);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.22,1,.36,1), transform .22s cubic-bezier(.22,1,.36,1);
}
.theme-popover.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
.theme-popover-title {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-faint);
  padding: 0 4px;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  margin-bottom: 5px;
  text-align: right;
  transition: background .15s ease, border-color .15s ease;
}
.theme-option:last-child { margin-bottom: 0; }
.theme-option:hover { background: rgba(var(--glass-tint), 0.07); }
.theme-option.active {
  border-color: var(--gold);
  background: rgba(var(--glass-tint), 0.09);
}
.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(var(--glass-tint), 0.3);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.18);
}
.theme-swatch-forest { background: linear-gradient(135deg, #0a1710, #3f8a55 60%, #dab868); }
.theme-swatch-dark { background: linear-gradient(135deg, #0a0a0c, #2b2b31 55%, #d5d5dd); }
.theme-swatch-neon { background: linear-gradient(135deg, #0d0620, #7c3aed 55%, #ff74cc); }
.theme-option-label {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme-option-sub { font-size: 11px; color: var(--text-faint); font-weight: 400; }
.theme-check { opacity: 0; color: var(--gold-soft); font-weight: 700; transition: opacity .15s ease; }
.theme-option.active .theme-check { opacity: 1; }

/* ---------- کشوی سبد فیلم‌ها ---------- */
.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(360px, 88vw);
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  z-index: 60;
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  padding: 28px 22px;
  box-shadow: var(--shadow-deep);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer h3 {
  font-family: var(--font-display);
  color: var(--gold-soft);
  font-size: 22px;
  margin: 0 0 18px;
  flex-shrink: 0;
}
.cart-empty {
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.9;
  padding: 18px 4px;
  text-align: center;
}
.cart-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--glass-tint), 0.03);
  animation: cf-card-in .32s cubic-bezier(.22,1,.36,1) both;
}
.cart-item img {
  width: 42px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}
.cart-item-title {
  flex: 1;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.5;
}
.cart-item-remove {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(var(--glass-tint), 0.08);
  color: var(--text-faint);
  font-size: 13px;
  transition: background .15s ease, color .15s ease;
}
.cart-item-remove:hover { background: rgba(200,60,60,0.25); color: #ff9d9d; }

.cart-request-movie-btn {
  width: 100%;
  margin-top: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.cart-request-movie-btn:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(230,179,85,0.06);
}

.cart-drawer-footer {
  flex-shrink: 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}
.cart-code-box {
  margin-top: 14px;
  text-align: center;
}
.cart-code-box p {
  font-size: 12.5px;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }

/* ---------- هیرو ---------- */
.hero {
  padding: 60px 28px 40px;
  text-align: center;
  position: relative;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  color: var(--text);
  margin: 0 0 6px;
}
.hero-title .accent { color: var(--gold-soft); }
.hero-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 32px;
}

/* جعبه‌ی جست‌وجو با موتیف نوار فیلم */
.filmstrip-search {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 6px 6px 6px 6px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-deep);
}
.filmstrip-search .sprockets {
  display: flex;
  gap: 6px;
  padding: 0 12px;
}
.filmstrip-search .sprockets span {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.filmstrip-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  padding: 14px 8px;
  outline: none;
}
.filmstrip-search input::placeholder { color: var(--text-faint); }
.filmstrip-search button {
  background: var(--velvet);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 700;
  transition: background .2s ease;
}
.filmstrip-search button:hover { background: var(--velvet-soft); }

/* ---------- بخش‌ها ---------- */
.section {
  padding: 36px 28px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--gold-soft);
  margin: 0;
}
.section-head .eyebrow {
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 1px;
}

/* ---------- ردیف افقی: پیشنهاد محمد ---------- */
.weekly-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x proximity;
}
.weekly-row::-webkit-scrollbar { height: 8px; }

/* ---------- گرید فیلم‌ها ---------- */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}

/* ---------- فیلترها ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.filter-chip {
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  transition: all .2s ease;
}
.filter-chip.active,
.filter-chip:hover {
  border-color: var(--gold);
  color: var(--gold-soft);
  background: rgba(230,179,85,0.08);
}

/* ---------- کارت فیلم ---------- */
.movie-card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  position: relative;
}
.movie-grid .movie-card { flex: unset; }

.movie-card:hover {
  transform: translateY(-6px);
  border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(0,0,0,0.5);
}
.movie-card .poster-wrap {
  position: relative;
  aspect-ratio: 2/3;
  background: var(--bg-elevated);
  overflow: hidden;
}
.movie-card .poster-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.movie-card .rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(14,11,22,0.85);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.movie-card .play-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .25s ease;
}
.movie-card:hover .play-overlay { opacity: 1; }
.movie-card .card-body {
  padding: 10px 12px 14px;
}
.movie-card .card-title {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.movie-card .card-meta {
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ---------- صفحه‌ی جزئیات فیلم ---------- */
.movie-hero {
  padding: 28px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 800px) {
  .movie-hero { grid-template-columns: 1fr; padding: 20px; }
}

.trailer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow-deep);
}
.trailer-frame iframe { width: 100%; height: 100%; border: 0; }

.movie-poster-lg {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 6px solid var(--bg-card);
  outline: 1px solid var(--line);
  box-shadow: var(--shadow-deep);
}

.movie-info h1 {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--text);
  margin: 0 0 6px;
}
.movie-info .meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 14px;
}
.tag {
  border: 1px solid var(--line);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--gold-soft);
  background: rgba(230,179,85,0.06);
}
.rating-lg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--gold-soft);
  font-weight: 700;
}
.movie-info .description {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 60ch;
  margin-bottom: 24px;
}

/* دکمه‌ی درخواست */
.btn-request {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--velvet);
  color: #fff;
  border: none;
  padding: 15px 30px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(181,40,63,0.35);
  transition: background .2s ease, transform .2s ease;
}
.btn-request:hover { background: var(--velvet-soft); transform: translateY(-2px); }

/* مودال کد */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-deep);
}
.modal-box h3 {
  font-family: var(--font-display);
  color: var(--gold-soft);
  font-size: 22px;
  margin: 0 0 10px;
}
.modal-box p { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }
.code-display {
  font-family: 'Courier New', monospace;
  font-size: 40px;
  letter-spacing: 8px;
  color: var(--gold-soft);
  background: var(--bg-card);
  border: 1px dashed var(--gold);
  border-radius: var(--radius-md);
  padding: 18px 10px;
  margin-bottom: 18px;
}
.modal-box .close-btn {
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
}

/* مودال دریافت اسم و شماره قبل از صدور کد */
.buyer-info-box { max-width: 400px; text-align: center; }
.buyer-info-icon {
  width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  box-shadow: var(--shadow-deep);
}
.buyer-info-box form { text-align: right; }
.buyer-info-field { margin-bottom: 14px; }
.buyer-info-field label {
  display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600;
}
.buyer-info-field input {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: 15px; outline: none;
  transition: border-color .15s ease;
  box-sizing: border-box;
}
.buyer-info-field input:focus { border-color: var(--gold); }
.buyer-info-error {
  color: #ff8a8a; background: rgba(181,40,63,0.12); border: 1px solid rgba(181,40,63,0.35);
  border-radius: var(--radius-sm); padding: 8px 12px; font-size: 13px; margin-bottom: 14px; text-align: center;
}
.buyer-info-actions { display: flex; gap: 10px; margin-top: 6px; }
.buyer-info-actions .close-btn { flex: 1; justify-content: center; }
.buyer-info-actions .btn-primary { flex: 1.4; justify-content: center; }
.buyer-info-actions button { display: flex; align-items: center; cursor: pointer; }

/* ---------- نظرات ---------- */
.comments-section { max-width: 1100px; margin: 0 auto; padding: 20px 28px 60px; }
.comment-form {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 26px;
}
.comment-form .row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.comment-form input,
.comment-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.comment-form textarea { min-height: 90px; resize: vertical; }
.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--gold); }

.star-picker { display: flex; gap: 4px; font-size: 22px; direction: ltr; justify-content: flex-end; }
.star-picker span { cursor: pointer; color: var(--line); transition: color .15s ease; }
.star-picker span.active { color: var(--gold); }

.comment-item {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  display: flex;
  gap: 14px;
}
.comment-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--velvet);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.comment-item.is-admin .comment-avatar { background: var(--gold); color: #16121f; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-name { font-weight: 700; font-size: 14px; }
.comment-badge {
  font-size: 10.5px;
  background: rgba(230,179,85,0.15);
  color: var(--gold-soft);
  padding: 2px 8px;
  border-radius: 999px;
}
.comment-stars { color: var(--gold-soft); font-size: 12px; margin-inline-start: auto; }
.comment-text { color: var(--text-muted); font-size: 14px; }
.comment-date { color: var(--text-faint); font-size: 11.5px; margin-top: 4px; }

/* ---------- فوتر ---------- */
.site-footer {
  text-align: center;
  padding: 30px;
  color: var(--text-faint);
  font-size: 12.5px;
  border-top: 1px solid var(--line);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  margin-bottom: 14px;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
  transition: color .15s ease;
}
.footer-links a:hover { color: var(--gold-soft); }

/* ---------- ردیف دکمه‌های صفحه فیلم ---------- */
.movie-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}
.btn-add-cart {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(var(--glass-tint), 0.06);
  border: 1px solid rgba(var(--glass-tint), 0.2);
  color: var(--gold-soft);
  padding: 15px 26px;
  border-radius: var(--radius-md);
  font-size: 14.5px;
  font-weight: 600;
  font-family: var(--font-body);
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.btn-add-cart .icon { font-size: 17px; transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.btn-add-cart:hover { background: rgba(var(--glass-tint), 0.1); border-color: var(--gold); transform: translateY(-2px); }
.btn-add-cart:hover .icon { transform: scale(1.15) rotate(-8deg); }
.btn-add-cart.in-cart { color: var(--gold); border-color: var(--gold); background: rgba(218,184,104,0.1); }
.btn-add-cart.cf-bump { animation: cf-chip-pop .38s cubic-bezier(.34,1.56,.64,1); }

/* ---------- حالت خالی ---------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
}

/* ---------- ادمین ---------- */
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 230px;
  background: var(--bg-elevated);
  border-left: 1px solid var(--line);
  padding: 24px 18px;
  flex-shrink: 0;
}
.admin-sidebar-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 30px; }
.admin-sidebar-top .theme-toggle { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; }
.admin-sidebar .brand { font-size: 22px; margin-bottom: 0; }
.admin-sidebar a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 4px;
}
.admin-sidebar a.active,
.admin-sidebar a:hover { background: rgba(230,179,85,0.08); color: var(--gold-soft); }
.admin-main { flex: 1; padding: 30px 36px; max-width: 980px; }
.admin-main h1 {
  font-family: var(--font-display);
  color: var(--text);
  font-size: 26px;
  margin: 0 0 22px;
}
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 22px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13px; color: var(--text-muted); }
.form-field input,
.form-field select,
.form-field textarea {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.form-field textarea { min-height: 100px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus { border-color: var(--gold); }

.cf-field-filled { animation: cf-field-pulse 1s ease; }
@keyframes cf-field-pulse {
  0% { box-shadow: 0 0 0 0 rgba(218,184,104,0.55); border-color: var(--gold); }
  100% { box-shadow: 0 0 0 10px rgba(218,184,104,0); border-color: var(--line); }
}

/* ---------- ژانرهای کلیکی (پنل ادمین) ---------- */
.genre-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.genre-chip-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.genre-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .15s ease;
  user-select: none;
}
.genre-chip:hover { border-color: var(--gold); color: var(--text); }
.genre-chip:active { transform: scale(.94); }
.genre-chip-checkbox:checked + .genre-chip {
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  border-color: var(--gold);
  color: #16121f;
  font-weight: 700;
}
.genre-chip-checkbox:focus-visible + .genre-chip { outline: 2px solid var(--gold); outline-offset: 2px; }

.genre-add-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
}
.genre-add-inline input {
  flex: 1;
  min-width: 140px;
  padding: 7px 10px;
  font-size: 12.5px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--text);
}
.genre-add-inline button {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.genre-add-inline button:hover { border-color: var(--gold); color: var(--gold-soft); }
.genre-add-msg { font-size: 11.5px; }

.section-flags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.section-flag-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 400;
  transition: border-color .15s ease, background .15s ease;
}
.section-flag-item input { width: auto; margin: 0; }
.section-flag-item:has(input:checked) {
  border-color: var(--gold);
  background: rgba(230,179,85,0.08);
  color: var(--gold-soft);
  font-weight: 700;
}

/* ---------- آپلودگر کوچیک زیر فیلدهای پوستر/تریلر در فرم فیلم ---------- */
.mini-uploader {
  margin-top: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: rgba(var(--glass-tint), 0.025);
}
.mini-uploader .upload-dropzone { margin-top: 10px; padding: 16px; }
.mini-uploader .btn-secondary { margin-top: 12px; width: 100%; justify-content: center; }

.btn-primary {
  background: var(--gold);
  color: #16121f;
  border: none;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 14px;
}
.btn-primary:hover { background: var(--gold-soft); }
.btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger-soft);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.btn-danger:hover { background: rgba(214,69,90,0.1); }
.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td {
  padding: 12px 10px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.admin-table th { color: var(--text-faint); font-weight: 500; font-size: 12px; }
.admin-table img { width: 40px; height: 58px; object-fit: cover; border-radius: 4px; }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-deep);
}
.login-box .brand { justify-content: center; margin-bottom: 22px; font-size: 30px; }
.login-box .form-field { margin-bottom: 14px; }
.login-box .btn-primary { width: 100%; padding: 13px; margin-top: 6px; }
.alert-error {
  background: rgba(214,69,90,0.12);
  border: 1px solid var(--danger);
  color: var(--danger-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success {
  background: rgba(230,179,85,0.1);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.movie-request-success {
  background: rgba(230,179,85,0.1);
  border: 1px solid var(--gold);
  color: var(--gold-soft);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  text-align: center;
}

.movie-requests-list { display: flex; flex-direction: column; gap: 10px; }
.movie-request-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.movie-request-item.is-done { opacity: 0.55; }
.movie-request-title { font-weight: 700; color: var(--text); flex: 1; min-width: 180px; }
.movie-request-time { color: var(--text-muted); font-size: 12.5px; }
.movie-request-actions { display: flex; gap: 8px; }
.btn-danger { border-color: rgba(220,80,80,0.4) !important; color: #ff9d9d !important; }
.btn-danger:hover { background: rgba(220,80,80,0.12) !important; }

.lookup-summary-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.lookup-count-badge {
  background: rgba(218,184,104,0.12);
  color: var(--gold-soft);
  border: 1px solid rgba(218,184,104,0.25);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}
.lookup-status {
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
}
.lookup-status.is-pending { color: var(--velvet-soft); background: rgba(181,40,63,0.12); }
.lookup-status.is-delivered { color: var(--gold-soft); background: rgba(218,184,104,0.12); }

.lookup-movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.lookup-movie-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  transition: border-color .2s ease, transform .2s ease;
}
.lookup-movie-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.lookup-movie-card img { width: 58px; height: 84px; object-fit: cover; border-radius: 7px; flex-shrink: 0; }
.lookup-movie-info { flex: 1; min-width: 0; }
.lookup-movie-title { margin: 0 0 5px; font-weight: 700; font-size: 14.5px; color: var(--text); }
.lookup-movie-title-en { color: var(--text-faint); font-weight: 400; font-size: 12px; }
.lookup-movie-meta { margin: 0 0 8px; color: var(--text-muted); font-size: 12.5px; display: flex; gap: 10px; }
.lookup-movie-genres { display: flex; flex-wrap: wrap; gap: 6px; }
.lookup-movie-genres .tag { font-size: 10.5px; padding: 3px 8px; }

/* ---------- لاگ فروش / تحویل ---------- */
.sales-stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sales-stat-card {
  flex: 1 1 160px;
  background: linear-gradient(160deg, rgba(var(--glass-tint), 0.09), rgba(var(--glass-tint), 0.02)), var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  text-align: center;
  transition: border-color .2s ease, transform .2s ease;
}
.sales-stat-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.sales-stat-number {
  font-family: var(--font-display);
  font-size: 34px;
  color: var(--gold-soft);
  line-height: 1.2;
}
.sales-stat-label { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.sales-log-list { display: flex; flex-direction: column; gap: 12px; }
.sales-log-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: border-color .2s ease;
}
.sales-log-item:hover { border-color: var(--gold); }
.sales-log-avatar {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  color: #16121f; font-weight: 800; font-size: 16px;
}
.sales-log-body { flex: 1; min-width: 0; }
.sales-log-line { font-size: 14.5px; color: var(--text); line-height: 1.9; }
.sales-log-line .buyer-name { color: var(--gold-soft); font-weight: 700; }
.sales-log-line .buyer-phone { direction: ltr; unicode-bidi: embed; font-weight: 600; color: var(--text); }
.sales-log-movies { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sales-log-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.sales-log-time { color: var(--text-faint); font-size: 12px; }
.sales-log-code { color: var(--text-faint); font-size: 12px; font-family: 'Courier New', monospace; letter-spacing: 1px; }

/* ---------- آپلود تریلر ---------- */
.upload-form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.upload-form-row .form-field { flex: 1; min-width: 200px; }

.upload-dropzone {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-md);
  padding: 26px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
  background: var(--bg);
}
.upload-dropzone.drag-over,
.upload-dropzone:hover { border-color: var(--gold); background: rgba(var(--glass-tint), 0.03); }
.upload-dropzone strong { color: var(--gold-soft); }
.upload-dropzone .picked-file { margin-top: 8px; font-size: 12.5px; color: var(--gold-soft); }
.upload-dropzone input[type="file"] { display: none; }

.upload-progress-wrap { margin-top: 14px; display: none; }
.upload-progress-wrap.active { display: block; }
.upload-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.upload-progress-bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--velvet), var(--gold));
  transition: width .15s ease;
}
.upload-progress-text { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.upload-result-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--gold);
  background: rgba(var(--glass-tint), 0.04);
  display: none;
}
.upload-result-box.show { display: block; }
.upload-result-box .link-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.upload-result-box input[type="text"] {
  flex: 1;
  min-width: 180px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--gold-soft);
  font-family: monospace;
  font-size: 12.5px;
  direction: ltr;
  text-align: left;
}

.upload-list { display: flex; flex-direction: column; gap: 10px; }
.upload-list-item {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
}
.upload-list-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
}
.upload-list-item-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(var(--glass-tint), 0.06);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.upload-list-item-title { font-weight: 700; font-size: 14px; margin: 0 0 3px; }
.upload-list-item-meta { font-size: 11.5px; color: var(--text-faint); }
.upload-badge {
  font-size: 10px;
  padding: 2px 9px;
  border-radius: 999px;
  margin-inline-start: auto;
  flex-shrink: 0;
}
.upload-badge.is-admin { background: rgba(var(--glass-tint), 0.08); color: var(--gold-soft); border: 1px solid var(--line); }
.upload-badge.is-public { background: rgba(86,168,106,0.12); color: var(--velvet-soft); border: 1px solid var(--velvet); }
.upload-list-item-body {
  display: none;
  padding: 0 14px 14px;
}
.upload-list-item.open .upload-list-item-body { display: block; }
.upload-list-item.open .upload-list-item-head { border-bottom: 1px solid var(--line); }

.copy-btn {
  background: var(--gold);
  color: #16121f;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--gold-soft); }
.copy-btn.copied { background: var(--velvet); color: #fff; }

.public-upload-note {
  font-size: 12.5px;
  color: var(--text-faint);
  background: rgba(var(--glass-tint), 0.04);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
}

/* ---------- ریسپانسیو پنل ادمین (پایه دسکتاپ، پرداخت‌شده برای موبایل هم) ---------- */
@media (max-width: 860px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    width: 100%;
    border-left: none;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 14px 14px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .admin-sidebar .brand { margin-bottom: 0; margin-inline-end: 10px; font-size: 19px; flex-shrink: 0; }
  .admin-sidebar a { margin-bottom: 0; flex-shrink: 0; }
  .admin-main { padding: 20px 16px; max-width: 100%; }
  .admin-table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .upload-form-row .form-field { min-width: 100%; }
}

/* ---------- کارت ساده برای صفحات سمت سایت اصلی (مثل آپلود عمومی) ---------- */
.page-narrow { max-width: 620px; margin: 0 auto; padding: 28px 20px 60px; }
.page-narrow h1 {
  font-family: var(--font-display);
  color: var(--gold-soft);
  font-size: 26px;
  margin: 10px 0 8px;
}
.page-narrow .page-sub { color: var(--text-muted); font-size: 13.5px; margin-bottom: 22px; }
.simple-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-deep);
}
.simple-card .form-field { margin-bottom: 4px; }
.simple-card label { font-size: 13px; color: var(--text-muted); display:block; margin-bottom:6px; }
.simple-card input[type="text"]:not(.upload-result-link),
.simple-card input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}
.simple-card input:focus { border-color: var(--gold); }

/* =====================================================
   ترنزیشن‌های سراسری بین صفحات (شبیه انیمیشن پوش آی‌فون)
   با View Transitions API — به‌صورت پیش‌رونده: مرورگرهای قدیمی‌تر
   فقط ناوبری معمولی رو انجام می‌دن، بدون هیچ افت یا خطایی.
   (این قانون باید بیرون از هر @media باشه، طبق اسپک مرورگرها)
   ===================================================== */
@view-transition { navigation: auto; }

@media (prefers-reduced-motion: no-preference) {
  ::view-transition-group(root) { animation-duration: .5s; }

  ::view-transition-old(root) {
    animation: cf-page-old-out .42s cubic-bezier(.32,.72,0,1) both;
  }
  ::view-transition-new(root) {
    animation: cf-page-new-in .46s cubic-bezier(.32,.72,0,1) both;
  }
  @keyframes cf-page-old-out {
    to { transform: translateX(16%) scale(.96); opacity: .55; filter: brightness(.6); }
  }
  @keyframes cf-page-new-in {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
  }

  /* موقع مورف پوستر بین کارت و صفحه فیلم، یه سایه نرم و بدون کش‌اومدن عجیب */
  ::view-transition-image-pair(root) { border-radius: var(--radius-lg); }
  ::view-transition-group(*) { animation-timing-function: cubic-bezier(.32,.72,0,1); }
}

/* =====================================================
   افکت فوکوس روی جعبه جست‌وجو
   ===================================================== */
.filmstrip-search {
  transition: box-shadow .35s cubic-bezier(.22,1,.36,1), transform .35s cubic-bezier(.22,1,.36,1), border-color .35s ease;
}
.filmstrip-search:focus-within {
  transform: scale(1.015);
  border-color: var(--gold);
  box-shadow: var(--shadow-deep), 0 0 0 4px rgba(var(--glass-tint),0.05), 0 0 34px rgba(218,184,104,0.28);
}
.filmstrip-search:focus-within .sprockets span {
  animation: cf-sprocket-pulse 1.15s ease-in-out infinite;
  border-color: var(--gold);
}
.filmstrip-search:focus-within .sprockets span:nth-child(2) { animation-delay: .12s; }
.filmstrip-search:focus-within .sprockets span:nth-child(3) { animation-delay: .24s; }
@keyframes cf-sprocket-pulse {
  0%, 100% { background: var(--bg); box-shadow: none; }
  50% { background: var(--gold); box-shadow: 0 0 9px var(--gold); }
}
.filmstrip-search input { transition: letter-spacing .3s ease; }
.filmstrip-search:focus-within input { letter-spacing: .2px; }

/* =====================================================
   افکت انتخاب ژانر
   ===================================================== */
.filter-chip { position: relative; overflow: hidden; }
.filter-chip.cf-pop { animation: cf-chip-pop .38s cubic-bezier(.34,1.56,.64,1); }
@keyframes cf-chip-pop {
  0% { transform: scale(1); }
  35% { transform: scale(.9); box-shadow: 0 0 0 6px rgba(218,184,104,0.12); }
  100% { transform: scale(1); }
}
.movie-grid.cf-filtering [data-movie-card],
.weekly-row.cf-filtering [data-movie-card] {
  animation: cf-card-in .42s cubic-bezier(.22,1,.36,1) both;
}
@keyframes cf-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =====================================================
   لوگوی کافی‌فیلم — نسخه خفن‌تر
   ===================================================== */
.brand { position: relative; }
.brand .brand-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(var(--glass-tint),0.2), rgba(var(--glass-tint),0.03));
  border: 1px solid rgba(var(--glass-tint),0.18);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(var(--glass-tint),0.2);
  color: var(--gold-soft);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1), box-shadow .35s ease;
}
.brand:hover .brand-icon {
  transform: rotate(-10deg) scale(1.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 22px rgba(218,184,104,0.5), inset 0 1px 0 rgba(var(--glass-tint),0.24);
}
.brand-icon-glow {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(218,184,104,0.35), transparent 70%);
  filter: blur(6px);
  opacity: .7;
  animation: cf-icon-breathe 2.6s ease-in-out infinite;
  z-index: -1;
}
@keyframes cf-icon-breathe {
  0%, 100% { opacity: .45; transform: scale(.9); }
  50% { opacity: .85; transform: scale(1.12); }
}
.brand .brand-icon svg {
  width: 19px;
  height: 19px;
  position: relative;
  z-index: 1;
}

.brand .brand-text {
  background: linear-gradient(100deg, var(--gold-soft) 0%, var(--gold) 35%, #fff 48%, var(--gold) 58%, var(--gold-soft) 100%);
  background-size: 260% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: cf-shine 5.5s ease-in-out infinite;
}
@keyframes cf-shine {
  0%, 12% { background-position: 130% 0; }
  55%, 100% { background-position: -30% 0; }
}

/* =====================================================
   پلیر اختصاصی تریلر — پیش‌نمایش ۴۰٪ اول، لوپ، کنترل‌های شیک
   ===================================================== */
.cf-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  box-shadow: var(--shadow-deep);
  isolation: isolate;
}
.cf-player-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cf-player-veil {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6,10,8,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  z-index: 3;
}
.cf-player-veil.show { opacity: 1; pointer-events: all; }
.cf-player-bigplay {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #16121f;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 0 10px rgba(255,255,255,0.06);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.cf-player-bigplay svg { transform: translateX(-1px); }
.cf-player-bigplay:hover { transform: scale(1.08); }
.cf-player-bigplay:active { transform: scale(.94); }

.cf-player-soundnudge {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  z-index: 4;
  background: rgba(14,11,22,0.72);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(var(--glass-tint),0.18);
  color: var(--gold-soft);
  font-size: 12.5px;
  font-family: var(--font-body);
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  animation: cf-nudge-bob 1.6s ease-in-out infinite;
}
.cf-player-soundnudge.show { opacity: 1; transform: translateY(0); pointer-events: all; }
@keyframes cf-nudge-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.cf-player-badge {
  position: absolute;
  top: 14px;
  inset-inline-start: 14px;
  z-index: 3;
  background: rgba(14,11,22,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(var(--glass-tint),0.14);
  color: var(--text-muted);
  font-size: 11px;
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: .3px;
}

.cf-player-controls {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.5) 55%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .28s ease, transform .28s ease;
  /* پلیرهای ویدیویی همیشه چپ‌به‌راستن، حتی توی سایت‌های راست‌چین (مثل یوتیوب فارسی) */
  direction: ltr;
}
.cf-player:hover .cf-player-controls,
.cf-player.cf-touched .cf-player-controls { opacity: 1; transform: translateY(0); }

.cf-ctrl-btn {
  position: relative;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .15s ease;
}
.cf-ctrl-btn:hover { background: rgba(255,255,255,0.16); }
.cf-ctrl-btn:active { transform: scale(.9); }

/* دکمه پلی/توقف — چون اصلی‌ترین کنترله، سمت راست و کمی متمایزتره */
.cf-ctrl-btn-play {
  width: 34px;
  height: 34px;
  background: linear-gradient(160deg, var(--gold-soft), var(--gold));
  color: #16121f;
}
.cf-ctrl-btn-play:hover { background: linear-gradient(160deg, var(--gold), var(--gold-soft)); }
.cf-ctrl-btn-play .icon-play { transform: translateX(1px); }

.cf-progress { flex: 1; display: flex; align-items: center; cursor: pointer; padding: 8px 0; }
.cf-progress-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  overflow: visible;
}
.cf-progress-fill {
  position: absolute;
  left: 0;
  top: 0; bottom: 0;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 8px rgba(218,184,104,0.6);
}
.cf-progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.35), 0 0 10px rgba(218,184,104,0.7);
  transform: translate(-50%, -50%);
  transition: transform .15s ease;
}
.cf-progress:hover .cf-progress-handle { transform: translate(-50%, -50%) scale(1.25); }

.cf-time {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: center;
}

.cf-ctrl-btn .icon-pause,
.cf-ctrl-btn .icon-vol-off,
.cf-ctrl-btn .icon-fs-exit { display: none; }
.cf-player.cf-playing .icon-play { display: none; }
.cf-player.cf-playing .icon-pause { display: inline-flex; }
.cf-player.cf-muted .icon-vol-on { display: none; }
.cf-player.cf-muted .icon-vol-off { display: inline-flex; }
.cf-player.cf-fullscreen .icon-fs-enter { display: none; }
.cf-player.cf-fullscreen .icon-fs-exit { display: inline-flex; }

/* ---------- پاپ‌آپ عمودی صدا ---------- */
.cf-vol-wrap { position: relative; display: flex; }
.cf-vol-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px) scale(.9);
  transform-origin: bottom center;
  width: 40px;
  height: 118px;
  padding: 12px 0;
  border-radius: 14px;
  background: rgba(14,11,22,0.85);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 14px 34px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s cubic-bezier(.22,1,.36,1), transform .22s cubic-bezier(.22,1,.36,1);
}
.cf-vol-popup.show { opacity: 1; pointer-events: all; transform: translateX(-50%) translateY(0) scale(1); }
.cf-vol-slider-track {
  position: relative;
  width: 4px;
  height: 100%;
  border-radius: 4px;
  background: rgba(255,255,255,0.18);
  cursor: pointer;
}
.cf-vol-slider-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70%;
  border-radius: 4px;
  background: linear-gradient(0deg, var(--gold), var(--gold-soft));
  box-shadow: 0 0 8px rgba(218,184,104,0.6);
}
.cf-vol-slider-handle {
  position: absolute;
  left: 50%;
  bottom: 70%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.35), 0 0 10px rgba(218,184,104,0.7);
  transform: translate(-50%, 50%);
  transition: transform .15s ease;
}
.cf-vol-slider-track:hover .cf-vol-slider-handle { transform: translate(-50%, 50%) scale(1.2); }

@media (max-width: 520px) {
  .cf-player-controls { opacity: 1; transform: none; }
  .cf-player-bigplay { width: 58px; height: 58px; }
}
