@import url(./iransans.css);
/* ---------- Base Styles ---------- */
body {
  font-family: IRANSansX;
  margin: 0;
  padding-top: 2rem;
}

/* ---------- Container Utility ---------- */
.container2 {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* ---------- Responsive Breakpoints ---------- */
@media (min-width: 640px) {
  .container2 { max-width: 640px; }
}
@media (min-width: 768px) {
  .container2 {
    max-width: 768px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 850px) {
  .container2 {
    max-width: 850px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 950px) {
  .container2 {
    max-width: 950px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 1050px) {
  .container2 {
    max-width: 1050px;
    padding-left: 2rem;
    padding-right: 2rem;
  }
}
@media (min-width: 1280px) {
  .container2 { max-width: 1280px; }
}
@media (min-width: 1536px) {
  .container2 { max-width: 1280px; }
}

/* ---------- Page Background ---------- */
.custom-bg {
  background: var(--color-bg-main);
  min-height: 100vh;
}

:root{
    --bg:#0b1422;
    --panel:#0f1a2a;
    --panel-2:#122035;
    --border:rgba(255,255,255,.10);
    --txt:#e9eef8; --muted:#aeb8ce;
    --gold1:#ffdf7a; --gold2:#ffcc4d; --accent:#3b82f6;
  }
  *{box-sizing:border-box}
  body{margin:0; background:var(--bg); color:var(--txt);
       }
  a{ color:inherit; text-decoration:none; }

  .wrap{ max-width: 1400px; margin: 18px auto; padding: 0 12px; }
  .head{
    display:flex; align-items:center; justify-content:space-between;
    background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:12px 16px; margin-bottom:12px;
  }
  .head h1{margin:0; font-size:1.05rem; font-weight:900; color:var(--gold1)}
  .head .btn{ padding:.55em .9em; border-radius:10px; border:1px solid var(--border); background:rgba(255,255,255,.06); }
    .content{ 
  display:grid; 
  gap:12px; 
  grid-template-columns: 320px 1fr; 
}

@media (max-width: 1050px){ 
  .content{ 
    grid-template-columns: 1fr; 
  }
  .player{ order: -1; } /* پلیر بیاد اول */
}

  /* Sidebar */
  .side{
    background:var(--panel); border:1px solid var(--border); border-radius:16px; overflow:hidden;
    max-height: calc(100vh - 140px); position: sticky; top:12px;
  }
  .side-head{ padding:14px 16px; font-weight:900; border-bottom:1px solid var(--border); display:flex; align-items:center; gap:8px; }
  .ch{ border-bottom:1px solid var(--border); }
  .ch > .ch-btn{
    width:100%; text-align:right; background:transparent; color:var(--txt); border:0; padding:12px 14px;
    display:flex; align-items:center; justify-content:space-between; font-weight:800; cursor:pointer;font-family: inherit;
  }
  .ch > .ch-btn:hover{ background:rgba(255,255,255,.04); }
  .arrow{ transition: transform .18s ease; }
  .ch.open > .ch-btn .arrow{ transform: rotate(180deg); }

  .ls-list{ display:none; padding: 0 6px 10px; }
  .ch.open .ls-list{ display:block; }

  .lesson{
    margin:6px 0 0; border:1px dashed var(--border); border-radius:12px; overflow:hidden;
    background: rgba(255,255,255,.02);
  }
  .lesson-head{
    width:100%; padding:10px 12px; border:0; display:flex; align-items:center; justify-content:space-between; gap:8px;
    background:transparent; color:var(--txt); cursor:pointer; font-weight:800; font-family: inherit;
  }
  .lesson-head:hover{ background: rgba(255,255,255,.04); }
  .lesson-title{ display:flex; align-items:center; gap:8px;font-family: inherit; }
  .badge-lock{ font-size:.78rem; padding:.15em .45em; border-radius:8px; border:1px solid #ffd2d2; color:#9a1a1a; background:#ffe5e5; }
  .badge-free{ font-size:.78rem; padding:.15em .45em; border-radius:8px; border:1px solid #c6ebd5; color:#126b2e; background:#dff5e7; }

  .asset-list{ display:none; border-top:1px dashed var(--border); background: rgba(255,255,255,.02); }
  .lesson.open .asset-list{ display:block; }
  .asset{
    display:flex; align-items:center; gap:10px; padding:10px 12px; border-top:1px dashed var(--border); cursor:pointer;
  }
  .asset:first-child{ border-top:0; }
  .asset:hover{ background: rgba(255,255,255,.03); }
  .asset .ico{ width:22px; text-align:center; }
  .asset .meta{ margin-inline-start:auto; color:var(--muted); font-size:.9rem; display:flex; gap:8px; }

  /* Player */
  .player{
    background:var(--panel); border:1px solid var(--border); border-radius:16px; overflow:hidden;
    min-height: 520px; display:flex; flex-direction:column;
  }
  .player-media{
    background:#040b14; aspect-ratio:16/9; width:100%;
    display:flex; align-items:center; justify-content:center;
  }
  video, audio, iframe{ width:100%; height:100%; border:0; display:block; }
  audio{ height:56px; }

  .player-bar{
    display:flex; flex-wrap:wrap; gap:10px; align-items:center; justify-content:space-between;
    padding:12px; border-top:1px solid var(--border); background:var(--panel-2);
  }
  .title{ font-weight:900; }
  .btn{
    display:inline-flex; align-items:center; gap:8px; padding:.6em 1.0em; border-radius:12px; cursor:pointer; text-decoration:none;
    border:1px solid var(--border); color:var(--txt); background: rgba(255,255,255,.06);
  }
  .btn-primary{
    background: linear-gradient(180deg, var(--gold1), var(--gold2)); color:#1a1a1a; border:0; font-weight:900;
    box-shadow: 0 10px 24px rgba(255,204,77,.25);
  }

/* ---- Chapter ---- */
.ch > .ch-btn{
  width:100%; 
  text-align:right; 
  background: linear-gradient(90deg, rgba(255,223,122,0.05), transparent);
  color:var(--gold1); 
  border:0; 
  padding:12px 14px;
  display:flex; align-items:center; justify-content:space-between; 
  font-weight:900; cursor:pointer; font-family: inherit;
  border-inline-start:3px solid var(--gold2);
}
.ch > .ch-btn:hover{ 
  background: linear-gradient(90deg, rgba(255,223,122,0.12), transparent); 
}

/* ---- Lesson ---- */
.lesson{
  margin:6px 0 0; 
  border:1px solid var(--accent); 
  border-radius:12px; 
  overflow:hidden;
  background: rgba(59,130,246,.05);
}
.lesson-head{
  width:100%; 
  padding:10px 12px; 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  gap:8px;
  color:var(--txt); 
  cursor:pointer; 
  font-weight:800; 
}
.lesson-head:hover{ background: rgba(59,130,246,.12); }
.lesson-title{ display:flex; align-items:center; gap:8px; }

/* ---- Asset ---- */
.asset-list{ 
  display:none; 
  border-top:1px dashed var(--border); 
  background: rgba(255,255,255,.02); 
}
.lesson.open .asset-list{ display:block; }

.asset{
  display:flex; 
  align-items:center; 
  gap:10px; 
  padding:10px 12px; 
  border-top:1px solid var(--border); 
  cursor:pointer;
  transition: background .2s;
}
.asset:first-child{ border-top:0; }
.asset:hover{ background: rgba(255,255,255,.06); }
.asset .ico{ width:22px; text-align:center; }
.asset .meta{ margin-inline-start:auto; color:var(--muted); font-size:.9rem; display:flex; gap:8px; }
/* === Audio player container tweaks (course_player.php) === */
.player .player-media{
  background: transparent !important;   /* پشت پلیر دیگه تیره/سیاه نباشه */
  box-shadow: none !important;
  padding: 0 !important;
}

/* فاصله‌ی عمودی خودِ کارت پلیر از بالا و پایین */
.player .player-media .rm-audio{
  margin-block: 24px; /* می‌تونی 16px یا 32px بذاری */
}
.player{ background: var(--panel, transparent); }


.side{ position: sticky; top:12px; max-height: calc(100dvh - 140px); }
.side-scroll{
  overflow: auto;
  max-height: inherit;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* اسکرول ظریف و مینیمال برای سایدبار درختی */
.side-scroll{
  /* موجود: overflow:auto; max-height:inherit; ... */
  scrollbar-gutter: stable both-edges;

  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color:
    color-mix(in oklab, var(--accent) 48%, transparent)
    color-mix(in oklab, var(--panel-2) 70%, transparent);
}

/* WebKit (Chrome/Edge/Safari) */
.side-scroll::-webkit-scrollbar{
  width: 6px;
  height: 6px;
}
.side-scroll:hover::-webkit-scrollbar{
  width: 8px;
  height: 8px;
}

.side-scroll::-webkit-scrollbar-track{
  background: transparent;
}

.side-scroll::-webkit-scrollbar-thumb{
  background-color: color-mix(in oklab, var(--accent) 56%, transparent);
  border: 2px solid transparent;          /* ایجاد فضای تنفسی اطراف دستگیره */
  border-radius: 999px;                    /* ظاهر قرصی و لطیف */
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--accent) 20%, transparent);
}

.side-scroll:hover::-webkit-scrollbar-thumb{
  background-color: color-mix(in oklab, var(--accent) 80%, transparent);
}

.side-scroll::-webkit-scrollbar-thumb:active{
  background-color: var(--accent);
}

.side-scroll::-webkit-scrollbar-corner{
  background: transparent;
}
/* موبایل/تک‌ستونه: اسکرول فقط روی کل صفحه */
@media (max-width: 1050px){
  .side{
    position: static;      /* دیگر sticky نباشد */
    top: auto;
    max-height: none;      /* محدودیت ارتفاع برداشته شود */
    overscroll-behavior: auto;
  }
  .side-scroll{
    overflow: visible;     /* اسکرول داخلی غیرفعال شود */
    max-height: none;
    -webkit-overflow-scrolling: auto;  /* iOS: رفتار اسکرول عادی */
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
    touch-action: pan-y;   /* پیمایش عمودی روان‌تر روی تاچ */
  }
}
/* حذف هرچیز مربوط به کیفیت/دانلود اگر هنوز در مارکاپ باقی مانده */
.asset .quality,
.asset .quality-label,
.asset .q,
.asset .btn-download,
.asset .download,
.asset .ico-download { display: none !important; }

/* آیکون قفل/قفلِ باز در ستون چپ */
.asset .ico{
  width: 28px; flex:0 0 28px;
  display:flex; align-items:center; justify-content:center;
}
.asset.is-open  .ico i{ color: color-mix(in oklab, var(--accent) 85%, white); }
.asset.is-locked .ico i{ color: #ff8fa3; } /* قرمز ملایم برای قفل */

/* حالت هاور/فوکوس آیتم‌ها */
.asset:focus-visible,
.asset:hover{
  background: color-mix(in oklab, var(--panel-2) 70%, transparent);
}

/* پیام قفل داخل پلیر */
.locked-msg{
  min-height: 220px;
  display:grid; place-items:center;
  text-align:center;
  padding: 32px 16px;
  color: var(--muted);
}
.locked-msg i{
  font-size: 40px;
  margin-bottom: 12px;
  color: #ff8fa3;
}
.locked-msg p{
  font-size: 15px;
  line-height: 1.9;
}

