/* ============================================================
   lessons-collections.css — بطاقات المجموعات التعليمية (الطالب + الإدارة)
   يعتمد على tokens.css فقط. أغلفة بتدرجات + رسوم هندسية خفيفة.
   ============================================================ */

/* ---- هوية اللون لكل مجموعة (يُضبط بـ data-color) ---- */
[data-color] { --lc-a: #5b7fe0; --lc-b: #8aa8f2; --lc-ink: #1f3a82; }
[data-color="indigo"]  { --lc-a: #4f5fd6; --lc-b: #8b97f0; --lc-ink: #26308f; }
[data-color="violet"]  { --lc-a: #7a56d8; --lc-b: #b199f0; --lc-ink: #3f2a8c; }
[data-color="teal"]    { --lc-a: #1f9d9a; --lc-b: #6fd0c8; --lc-ink: #0d5755; }
[data-color="amber"]   { --lc-a: #e0952a; --lc-b: #f4c874; --lc-ink: #7a4a07; }
[data-color="rose"]    { --lc-a: #e0475f; --lc-b: #f59aa9; --lc-ink: #8a1d31; }
[data-color="sky"]     { --lc-a: #2f8fe0; --lc-b: #86c3f5; --lc-ink: #124f86; }
[data-color="emerald"] { --lc-a: #2f9f6a; --lc-b: #86d6ab; --lc-ink: #125c38; }
[data-color="slate"]   { --lc-a: #4b5563; --lc-b: #9aa5b4; --lc-ink: #1f2937; }

/* ---- الغلاف ---- */
.lc-cover {
  position: relative; overflow: hidden; isolation: isolate;
  background: linear-gradient(135deg, var(--lc-a), var(--lc-b));
  color: #fff;
}
.lc-cover::before, .lc-cover::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  border-radius: 50%; background: rgba(255,255,255,.14);
}
.lc-cover::before { width: 150px; height: 150px; inset-block-start: -44px; inset-inline-end: -36px; }
.lc-cover::after  { width: 96px; height: 96px; inset-block-end: -30px; inset-inline-start: 18%;
  border-radius: 24px; transform: rotate(24deg); background: rgba(255,255,255,.10); }
.lc-cover > img.lc-cover-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2;
}
.lc-cover.has-img::before, .lc-cover.has-img::after { display: none; }
.lc-cover.has-img .lc-cover-shade { position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10,12,16,.38) 0%, rgba(10,12,16,.30) 38%, rgba(10,12,16,.78) 100%); }
/* النص فوق الغلاف أبيض دائمًا (يتفوق على قواعد h1/h2 العامة للوحة الإدارة) */
.lc-cover :is(h2, h3, p) { color: #fff; letter-spacing: 0; text-shadow: 0 1px 6px rgba(0,0,0,.45); }

/* ---- بطاقة مجموعة ---- */
.lc-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .lc-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .lc-grid.lc-grid-wide { grid-template-columns: repeat(3, 1fr); } }

.lc-card {
  display: flex; flex-direction: column; text-align: start; width: 100%;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-xl); overflow: hidden; cursor: pointer; padding: 0;
  box-shadow: var(--shadow-card); font-family: inherit; color: inherit;
  transition: transform .22s ease, box-shadow .22s ease;
  animation: lc-rise .4s ease both;
}
.lc-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lifted); }
.lc-card:active { transform: scale(.985); }
.lc-card:focus-visible { outline: 3px solid var(--lc-a); outline-offset: 2px; }
.lc-card .lc-cover { min-height: 120px; padding: 44px 14px 12px; display: flex; align-items: flex-end; }
.lc-card .lc-cover h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.lc-badge {
  position: absolute; inset-block-start: 10px; inset-inline-start: 10px;
  background: rgba(255,255,255,.94); color: var(--lc-ink); font-size: 11px; font-weight: 700; text-shadow: none;
  padding: 3px 9px; border-radius: 999px;
}
.lc-badge.is-draft { background: rgba(23,25,29,.78); color: #fff; }
.lc-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.lc-desc { margin: 0; font-size: 12.5px; font-weight: 500; line-height: 1.7; color: var(--color-text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lc-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--color-text); }
.lc-meta span { background: #F4F2F2; border-radius: 999px; padding: 3px 10px; }
.lc-progress { height: 8px; border-radius: 999px; background: var(--color-border); overflow: hidden; }
.lc-progress > i { display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--lc-a), var(--lc-b)); transition: width .6s ease; }
.lc-progress-label { font-size: 11px; font-weight: 600; color: var(--color-text-muted); }

/* ---- هيرو المجموعة ---- */
.lc-hero { border-radius: var(--radius-xl); padding: 56px 16px 16px; min-height: 140px; display: flex; flex-direction: column;
  justify-content: flex-end; gap: 8px; box-shadow: var(--shadow-card); margin-bottom: 18px; animation: lc-rise .35s ease both; }
.lc-hero h2 { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.lc-hero p { margin: 0; font-size: 12.5px; font-weight: 500; line-height: 1.7; }
.lc-hero .lc-progress { background: rgba(255,255,255,.3); }
.lc-hero .lc-progress > i { background: #fff; }

.lc-section-title { margin: 20px 2px 10px; font-size: 14px; font-weight: 700; color: var(--color-text); display: flex; align-items: center; gap: 8px; }
.lc-section-title small { font-size: 11.5px; font-weight: 600; color: var(--color-text-muted); }

/* ---- بطاقة وحدة ---- */
.lc-unit {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; padding: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  cursor: pointer; font-family: inherit; color: inherit; box-shadow: var(--shadow-soft);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; animation: lc-rise .35s ease both;
}
.lc-unit:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: var(--lc-a); }
.lc-unit-num { flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; font-size: 15px; color: #fff; background: linear-gradient(135deg, var(--lc-a), var(--lc-b)); }
.lc-unit-body { flex: 1; min-width: 0; }
.lc-unit-body h4 { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.lc-unit-body p { margin: 2px 0 0; font-size: 11.5px; font-weight: 500; color: var(--color-text-muted); }
.lc-stack { display: flex; flex-direction: column; gap: 10px; }

/* ---- التنقل ---- */
.lc-back { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--color-border);
  background: var(--color-surface); font-family: inherit; font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--color-text); margin-bottom: 12px; }
.lc-back:hover { background: var(--color-surface-soft); }
.lc-crumbs { font-size: 12px; font-weight: 500; color: var(--color-text-muted); margin: 0 2px 12px; }

/* ---- حالة المشاهدة ---- */
.lc-done { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--color-green-dark);
  background: var(--color-green-light); border-radius: 999px; padding: 3px 9px; }

/* ---- حالات فارغة ---- */
.lc-empty { text-align: center; padding: 34px 18px; border: 2px dashed var(--color-border); border-radius: var(--radius-xl);
  color: var(--color-text-muted); font-weight: 500; font-size: 12.5px; line-height: 1.8; }
.lc-empty b { display: block; color: var(--color-text); font-size: 14px; font-weight: 700; margin-bottom: 4px; }

@keyframes lc-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.lc-skel { height: 170px; border-radius: var(--radius-xl); background: linear-gradient(90deg, #f1eeee 25%, #faf8f8 50%, #f1eeee 75%);
  background-size: 200% 100%; animation: lc-shimmer 1.3s infinite; }
@keyframes lc-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .lc-card, .lc-unit, .lc-hero, .lc-skel, .lc-progress > i { animation: none; transition: none; }
}

/* ---- مشغل: شريط التنقل ---- */
.lc-player-nav { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--color-border); }
.lc-player-nav button { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--color-border); background: var(--color-surface);
  font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; color: var(--color-text); }
.lc-player-nav button:disabled { opacity: .4; cursor: default; }
.lc-player-nav button.is-main { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: #fff; }
.lc-player-desc { padding: 12px 16px 0; font-size: 12.5px; font-weight: 500; line-height: 1.8; color: var(--color-text-muted); }
.lc-player-status { padding: 10px 16px 0; }

