/* ===================================================
   my-courses.css — صفحة كورساتي
   يُحمَّل بعد al-draiby.css ويعيد تعريف ما يلزم
   =================================================== */

/* ─── إعادة ضبط الـ main لهذه الصفحة فقط ─── */
body[data-page="my-courses"] main {
  padding-top: 16px;
  padding-bottom: 100px;
  padding-inline: 12px;    /* حواف موحدة يمين وشمال */
  display: grid;
  gap: 12px;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* كل العناصر المباشرة في main تأخذ العرض الكامل */
body[data-page="my-courses"] main > * {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}

/* ─── هيرو العنوان ─── */
.my-courses-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 4px;
}
.my-courses-hero h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text);
}

/* ─── ملخص الكورسات ─── */
.page-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  border-radius: 12px;
  color: #fff;
  width: 100%;
  box-sizing: border-box;
}
.page-summary .summary-label { font-size: .8rem; opacity: .85; }
.page-summary .summary-count { font-size: 1.3rem; font-weight: 900; line-height: 1; }
.summary-icon { font-size: 1.5rem; }

/* ─── قائمة الكورسات ─── */
.courses-list {
  display: grid;
  gap: 12px;
  width: 100%;
}

/* ─────────────────────────────────────────
   كارت الكورس المشترك — تخطيط عمودي
───────────────────────────────────────── */
.enrolled-card {
  background: var(--surface);
  border-radius: 14px;
  border: 1px solid rgba(2,132,199,.10);
  box-shadow: 0 4px 14px rgba(2,132,199,.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  box-sizing: border-box;
  transition: box-shadow .2s, transform .2s;
}
.enrolled-card:hover {
  box-shadow: 0 8px 22px rgba(2,132,199,.14);
  transform: translateY(-2px);
}

/* صورة مستطيلة علوية */
.enrolled-cover {
  display: block;
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  flex-shrink: 0;
}
.enrolled-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* شارة التقدم */
.enrolled-cover .progress-badge {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: .62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

/* محتوى الكارت */
.enrolled-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.enrolled-title {
  margin: 0;
  font-size: .92rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* شريط التقدم */
.progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.progress-bar-wrap {
  flex: 1;
  height: 5px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #0284c7);
  border-radius: 999px;
  transition: width .5s ease;
}
.progress-text {
  font-size: .7rem;
  font-weight: 800;
  color: var(--brand-2);
  white-space: nowrap;
}

/* chips معلومات */
.enrolled-meta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #f0f9ff;
  border: 1px solid rgba(14,165,233,.15);
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .68rem;
  font-weight: 800;
  color: #0369a1;
}
.meta-chip svg {
  width: 10px;
  height: 10px;
  stroke: #0369a1;
}

/* زر الدخول */
.enrolled-actions { margin-top: auto; }
.btn-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 7px 10px;
  border-radius: 9px;
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
  color: #fff;
  font-weight: 900;
  font-size: .78rem;
  text-decoration: none;
  border: none;
  box-shadow: 0 3px 8px rgba(2,132,199,.22);
  transition: filter .15s;
}
.btn-enter:hover { filter: brightness(1.06); }
.btn-enter svg { width: 13px; height: 13px; stroke: #fff; flex-shrink: 0; }

/* ─────────────────────────────────────────
   حالات فارغة / غير مسجل
───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
  padding: 48px 20px;
}
.empty-icon { font-size: 3rem; line-height: 1; }
.empty-state h2 { margin: 0; font-size: 1.15rem; font-weight: 900; color: var(--text); }
.empty-state p  { margin: 0; color: var(--muted); font-size: .9rem; max-width: 26ch; line-height: 1.6; }
.btn-browse {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 20px; border-radius: 12px;
  background: linear-gradient(180deg, #0ea5e9, #0284c7);
  color: #fff; font-weight: 900; font-size: .9rem; text-decoration: none;
  box-shadow: 0 4px 12px rgba(2,132,199,.22);
}

.guest-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; text-align: center; padding: 36px 20px;
}
.guest-state h2 { margin: 0; font-size: 1.1rem; font-weight: 900; }
.guest-state p  { margin: 0; color: var(--muted); line-height: 1.6; max-width: 28ch; }
.guest-actions  { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ─────────────────────────────────────────
   Skeleton loading
───────────────────────────────────────── */
.skeleton-card {
  background: var(--surface);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid rgba(2,132,199,.08);
  box-shadow: 0 4px 14px rgba(2,132,199,.06);
  display: grid;
  gap: 12px;
}
.skeleton-line {
  height: 13px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: mc-shimmer 1.4s infinite;
  border-radius: 8px;
}
.skeleton-line.short { width: 55%; }
.skeleton-line.thumb { height: 100px; border-radius: 10px; width: 100%; }
@keyframes mc-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─────────────────────────────────────────
   هيرو قسم جميع الكورسات
───────────────────────────────────────── */
.all-courses-section { width: 100%; box-sizing: border-box; }
.all-courses-section h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text);
}

/* ─────────────────────────────────────────
   السلايدر
───────────────────────────────────────── */
.cs-wrapper {
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
  width: 100%;
  box-sizing: border-box;
}
.cs-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  transition: transform .38s cubic-bezier(.4,0,.2,1);
  will-change: transform;
}

/* كارت السلايدر */
.cs-card {
  flex-shrink: 0;
  min-width: 0;
  background: var(--surface);
  border: 1px solid rgba(2,132,199,.09);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(2,132,199,.07);
  transition: box-shadow .2s, transform .2s;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}
.cs-card:hover {
  box-shadow: 0 7px 20px rgba(2,132,199,.13);
  transform: translateY(-2px);
}

/* صورة الكارت */
.cs-cover {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}
.cs-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* شارات السلايدر */
.cs-cover .cs-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: #fff; font-size: .65rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}
.cs-cover .cs-badge-coming {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  color: #fff; font-size: .65rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}

/* body الكارت */
.cs-body { padding: 8px 10px 10px; }
.cs-title {
  margin: 0 0 7px;
  font-size: .82rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cs-action {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 7px 0; border-radius: 9px;
  font-size: .78rem; font-weight: 800;
  text-decoration: none; border: none; cursor: pointer;
}
.cs-action.enrolled { background: linear-gradient(180deg,#0ea5e9,#0284c7); color: #fff; box-shadow: 0 3px 8px rgba(2,132,199,.22); }
.cs-action.buy      { background: #fff; color: #0284c7; border: 1px solid rgba(2,132,199,.25); }
.cs-action.soon     { background: #f1f5f9; color: #94a3b8; cursor: default; }

/* أزرار التنقل */
.cs-btn {
  position: absolute; top: 50%; transform: translateY(-80%);
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--brand-2); z-index: 5; transition: background .18s;
}
.cs-btn:hover  { background: var(--brand-2); color: #fff; }
.cs-btn:disabled { opacity: .2; pointer-events: none; }
.cs-btn svg    { width: 14px; height: 14px; }
.cs-prev { right: 6px; }
.cs-next { left:  6px; }

/* نقاط التنقل */
.cs-dots {
  display: flex; justify-content: center;
  gap: 6px; margin-top: 10px;
}
.cs-dot {
  width: 6px; height: 6px; border-radius: 50%; border: none;
  background: rgba(14,165,233,.2); cursor: pointer; padding: 0;
  transition: background .25s, width .25s, border-radius .25s;
}
.cs-dot.active { background: var(--brand-2); width: 16px; border-radius: 4px; }

/* ─────────────────────────────────────────
   Responsive
───────────────────────────────────────── */
@media (max-width: 480px) {
  .enrolled-body  { padding: 10px 12px 12px; gap: 6px; }
  .enrolled-title { font-size: .88rem; }
  .btn-enter      { font-size: .74rem; padding: 6px 8px; }
  .my-courses-hero h1 { font-size: 1.2rem; }
}

/* ─────────────────────────────────────────
   all-courses-section — بدون .card wrapper
   عشان السلايدر ما يتقطعش بالـ padding
───────────────────────────────────────── */
.all-courses-section {
  background: var(--surface);
  border-radius: 16px;
  border: 1px solid rgba(2,132,199,.08);
  box-shadow: 0 6px 20px rgba(2,132,199,.08);
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  padding-top: 16px;
  padding-bottom: 16px;
}
.all-courses-section h2 {
  padding-inline: 16px;
  margin-bottom: 12px;
}
/* الـ dots تاخد مسافة من الجوانب */
.all-courses-section .cs-dots {
  padding: 0;
  margin-top: 12px;
}
/* المحتوى المحقون من JS */
#enrolledContent {
  display: grid;
  gap: 12px;
  width: 100%;
}