/* =====================================================
   VIDEO PLAYER PAGE — video.css
   ===================================================== */

@font-face{
    font-family:'SahelVF';
    src:url('../fonts/Sahel-VF.woff2') format('woff2');
    font-weight:100 900;
    font-style:normal;
    font-display:swap;
}

@font-face{
    font-family:'SahelSemiBold';
    src:url('../fonts/Sahel-SemiBold.woff2') format('woff2');
    font-weight:600;
    font-style:normal;
    font-display:swap;
}

/* برچسب گرید کناری: ظاهر در style.css (گروه .badge.s / .badge.iranian)؛ اینجا فقط اندازه */
.vp-side-card .vp-side-badge{
  top: 4px;
  right: 4px;
  gap: 4px;
  padding: 3px 7px 3px 6px;
  font-size: 10.5px;
}
.vp-side-card .vp-side-badge::before{ width: 11px; height: 11px; }

/* body override */
.vp-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #000;
}

/* =====================================================
   LAYOUT اصلی
   ===================================================== */

.vp-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0 24px;
  align-items: start;
  padding-top: 20px;
  padding-bottom: 24px;
  max-width: 1300px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}

/* =====================================================
   ستون اصلی — پلیر
   ===================================================== */

/* ستون اصلی: فرزندان مستقیم در ستون ۲ گرید می‌نشینند تا ردیف ۱ دقیقاً هم‌قد iframe باشد */
.vp-main {
  display: contents;
}
.vp-main > * {
  grid-column: 2;
  min-width: 0;
}
.vp-main > .vp-player-wrap {
  grid-row: 1;
}

.vp-player-wrap {
  width: 100%;
  background: #000;
  border-radius: 0;
  overflow: hidden;
}

.vp-player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #050505;
}

@supports not (aspect-ratio: 16/9) {
  .vp-player-box {
    height: 0;
    padding-top: 56.25%;
    position: relative;
  }
}

.vp-player-box iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* =====================================================
   اطلاعات ویدیو
   ===================================================== */

.vp-info {
  padding: 14px 0 0;
  direction: ltr;
}

.vp-title {
  font-size: 20px;
  font-weight: 500;
  font-family: 'SahelVF', tahoma, sans-serif;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.4;
  direction: rtl;
  text-align: right;
}

/* تایتل انگلیسی — فقط از نظر بصری مخفی، در DOM و SEO سر جاشه */
.vp-en-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: 0;
}

.vp-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aaa;
  font-size: 14px;
  margin-bottom: 12px;
  direction: ltr;
}

.vp-views { color: #aaa; }

/* دکمه‌های اکشن */
.vp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid #1f1f1f;
  flex-wrap: wrap;
}

.vp-action-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.vp-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: #1a1a1a;
  border: 1px solid #2f2f2f;
  border-radius: 999px;
  color: #ccc;
  font-size: 13px;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}

.vp-action-btn:hover {
  background: #252525;
  border-color: #444;
  color: #fff;
}

.vp-action-btn.active {
  border-color: #f7971d;
  color: #f7971d;
}

.vp-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: #f7971d;
  color: #000;
  font-weight: 700;
  font-size: 13px;
  border-radius: 999px;
  text-decoration: none;
  border: none;
  transition: background .2s, box-shadow .2s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.vp-more-btn:hover {
  background: #ffaa3d;
  box-shadow: 0 4px 20px rgba(247,151,29,.4);
}

/* کانال */
.vp-channel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0 12px;
  border-bottom: 1px solid #1a1a1a;
}

.vp-channel-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1e1e1e;
  border: 1.5px solid #2f2f2f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #666;
  flex-shrink: 0;
  font-weight: 300;
}

.vp-channel-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.vp-channel-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  direction: ltr;
}

.vp-channel-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: #3b82f6;
  border-radius: 50%;
  font-size: 9px;
  color: #fff;
  flex-shrink: 0;
}

.vp-channel-count {
  font-size: 12px;
  color: #777;
}

/* بج‌ها */
.vp-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 4px;
  flex-wrap: wrap;
}



/* =====================================================
   SIDEBAR — ویدیوهای پیشنهادی دسکتاپ
   ===================================================== */

/* سایدبار: ثابت (بدون sticky) و دقیقاً هم‌قد iframe؛ فهرست داخل آن اسکرول می‌شود */
.vp-sidebar {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(180deg, #0d0d0d, #090909);
  border: 1px solid #1c1c1c;
}
.vp-sidebar-scroll {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(247,151,29,.35) transparent;
}
.vp-sidebar-scroll::-webkit-scrollbar { width: 6px; }
.vp-sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.vp-sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(247,151,29,.3);
  border-radius: 6px;
}
.vp-sidebar-scroll::-webkit-scrollbar-thumb:hover { background: rgba(247,151,29,.55); }

.vp-side-card {
  display: grid;
  grid-template-columns: 168px 1fr;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  border-radius: 10px;
  transition: background .2s;
  padding: 6px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.vp-side-card:hover {
  background: rgba(255,255,255,.04);
}

.vp-side-thumb {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: #111;
  flex-shrink: 0;
}

.vp-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.vp-side-dur {
  position: absolute;
  bottom: 6px;
  left: 6px;
  right: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
  background: rgba(8,8,8,.74);
  border: 1px solid rgba(255,255,255,.12);
  color: #f2f2f2;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
  padding: 2px 5px 2px 4px;
  border-radius: 3px;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.vp-side-dur::before {
  content: '';
  width: 0; height: 0;
  border-style: solid;
  border-width: 3px 0 3px 5px;
  border-color: transparent transparent transparent #f7971d;
}

.vp-side-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 2px 0;
}

.vp-side-title {
  font-size: 14px;
  font-weight: 500;
  font-family: 'SahelVF', tahoma, sans-serif;
  color: #e0e0e0;
  line-height: 1.35;
  direction: rtl;
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vp-side-ch {
  font-size: 11px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 4px;
  direction: ltr;
}

.vp-side-views {
  font-size: 11px;
  color: #666;
  direction: ltr;
}

/* =====================================================
   GRID ویدیوها (پایین صفحه)
   ===================================================== */

.vp-grid-section {
  margin-top: -24px;
  padding-bottom: 0;
}

/* View More button */
.vp-viewmore-wrap {
  text-align: center;
  padding: 20px 0 30px;
}

.vp-viewmore-btn {
  display: inline-block;
  padding: 11px 36px;
  background: transparent;
  border: 1.5px solid #f7971d;
  border-radius: 4px;
  color: #f7971d;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .5px;
  transition: background .2s, box-shadow .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}

.vp-viewmore-btn:hover {
  background: rgba(247,151,29,.08);
  box-shadow: 0 0 20px rgba(247,151,29,.25);
  color: #ffaa3d;
}

/* =====================================================
   SHARE TOAST
   ===================================================== */

.vp-share-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1e1e;
  color: #fff;
  border: 1px solid rgba(247,151,29,.3);
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 14px;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
  white-space: nowrap;
}

.vp-share-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* تبلت: sidebar زیر پلیر */
/* =====================================================
   RESPONSIVE
   ===================================================== */

/* لپ‌تاپ کوچک: سایدبار کمی باریک‌تر */
@media (max-width: 1300px) and (min-width: 1101px) {
  .vp-layout {
    grid-template-columns: 320px 1fr;
  }
  .vp-side-card {
    grid-template-columns: 136px 1fr;
  }
}

/* تبلت: سایدبار باریک‌تر ولی همچنان هم‌قد iframe */
@media (max-width: 1100px) and (min-width: 901px) {
  .vp-layout {
    grid-template-columns: 250px 1fr;
    gap: 0 16px;
  }
  .vp-side-card {
    grid-template-columns: 100px 1fr;
    gap: 8px;
  }
  .vp-side-title { font-size: 12.5px; }
  .vp-side-ch, .vp-side-views { font-size: 10.5px; }
  .vp-side-card .vp-side-badge { font-size: 9.5px; padding: 2px 5px 2px 4px; }
  .vp-side-card .vp-side-badge::before { display: none; }
}

/* ≤ 900: سایدبار مخفی و پلیر تمام‌عرض (ویدیوها در گرید پایین می‌آیند) */
@media (max-width: 900px) {
  .vp-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .vp-main > * {
    grid-column: 1;
  }
  .vp-sidebar {
    display: none;
  }
}

/* موبایل: iframe چسبیده به لبه‌ها */
@media (max-width: 768px) {
  .vp-layout {
    padding-top: 0;
    padding-bottom: 10px;
    padding-left: 0;
    padding-right: 0;
  }
  .vp-player-wrap {
    border-radius: 0;
  }
  .vp-info {
    padding: 10px 12px 0;
  }
  .vp-title {
    font-size: 16px;
  }
  .vp-meta-row {
    font-size: 12px;
  }
  .vp-actions {
    gap: 8px;
    padding: 8px 12px 12px;
  }
  .vp-action-btn {
    padding: 7px 10px;
    font-size: 12px;
  }
  .vp-more-btn {
    padding: 8px 14px;
    font-size: 12px;
  }
  .vp-channel-row {
    padding: 12px 12px 10px;
  }
  .vp-channel-avatar {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .vp-channel-name {
    font-size: 13px;
  }
  .vp-badges {
    padding: 10px 12px 4px;
  }
  .vp-grid-section {
    padding-left: 0;
    padding-right: 0;
    margin-top: 8px;
  }

}

@media (max-width: 600px) {
  .vp-action-btn span {
    display: none;
  }
}

/* ===== Channel link styles ===== */
.vp-channel-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
}
.vp-channel-avatar-link:hover .vp-channel-avatar {
  border-color: #f7971d;
  box-shadow: 0 0 0 2px rgba(247,151,29,.3);
}
.vp-channel-name-link {
  text-decoration: none;
  color: inherit;
}
.vp-channel-name-link:hover .vp-channel-name {
  color: #f7971d;
}

/* ===== بازیگران ویدیو (زیر کانال) ===== */
.vp-actors {
  padding: 14px 0 12px;
  border-bottom: 1px solid #1a1a1a;
}
.vp-actors-title {
  font-size: 15px;
  color: #8a8a8a;
  margin-bottom: 12px;
  direction: ltr;
  text-align: left;
}
.vp-actors-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  direction: ltr;
}
.vp-actor {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}
.vp-actor-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e1e center / cover no-repeat;
  border: 1.5px solid #2f2f2f;
  color: #666;
  font-size: 18px;
  font-weight: 300;
  transition: border-color .2s, box-shadow .2s;
}
.vp-actor-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  unicode-bidi: plaintext;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .2s;
}
/* hover هماهنگ با آواتار و نام کانال */
.vp-actor:hover .vp-actor-avatar {
  border-color: #f7971d;
  box-shadow: 0 0 0 2px rgba(247,151,29,.3);
}
.vp-actor:hover .vp-actor-name {
  color: #f7971d;
}
@media (max-width: 768px) {
  .vp-actors { padding: 12px 12px 10px; }
  .vp-actors-title { font-size: 14px; margin-bottom: 10px; }
  .vp-actors-list { gap: 10px 18px; }
  .vp-actor-avatar { width: 36px; height: 36px; font-size: 16px; }
  .vp-actor-name { font-size: 14px; }
}


/* =====================================================
   SIDEBAR CARD REMASTER — هم‌سبک با کارت‌های گرید (خط داغی + قاب‌نما + برجستگی)
   فقط transform / opacity؛ بدون blur و انیمیشن دائمی.
   ===================================================== */
.vp-side-thumb img { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.vp-side-thumb::after {
  /* سایه‌ی ملایم پایین عکس برای خوانایی چیپ مدت‌زمان */
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 46%;
  background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
  pointer-events: none;
  z-index: 2;
}
.vp-side-badge { z-index: 3; }

/* نشانگر نارنجی کنار عنوان (پلی‌هد) — absolute تا با line-clamp تداخل نکند */
.vp-side-info { position: relative; padding-right: 11px; }
.vp-side-info::before {
  content: '';
  position: absolute;
  right: 0; top: 4px;
  width: 3px; height: 14px;
  border-radius: 2px;
  background: #f7971d;
  opacity: .5;
  transform: scaleY(.55);
  transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}
.vp-side-card:hover .vp-side-info::before { opacity: 1; transform: scaleY(1); }
.vp-side-card:hover .vp-side-title { color: #fff; }
.vp-side-card.hot .vp-side-views { color: #f7b24d; }

/* برجستگی ثابت (اندازه‌های بزرگ‌تر از موبایل) — بدون تغییر بوردر/جابه‌جایی هنگام هاور */
@media (min-width: 769px) {
  .vp-sidebar-scroll { gap: 8px; }
  .vp-side-card {
    background: linear-gradient(180deg, #171717 0%, #0f0f0f 100%);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 3px 8px rgba(0,0,0,.5);
  }
  .vp-side-card:hover {
    background: linear-gradient(180deg, #1b1b1b 0%, #101010 100%);
  }
}

/* تمام‌صفحه‌ی مجازی پلیر (فال‌بک iPhone) */
.vp-player-box.vp-pfs{ position:fixed !important; inset:0 !important; width:100vw !important; height:100vh !important; height:100dvh !important; max-width:none !important; aspect-ratio:auto !important; border-radius:0 !important; z-index:2147483000 !important; background:#000; }
html.vp-pfs-lock, html.vp-pfs-lock body{ overflow:hidden !important; }
