/* لمسة جمالية بسيطة لصفحات الطالب (تُحمَّل من base.html). كل الحركات تتوقف مع «تقليل الحركة» في الجهاز. */

/* خلفية هادئة بزخارف فيزيائية خفيفة جداً: ذرة، موجة، سهم قوة */
body {
  background-color: #f6f9fa;
  background-image:
    radial-gradient(circle at 12% -10%, rgba(52, 165, 192, .10), transparent 42%),
    radial-gradient(circle at 100% 20%, rgba(245, 158, 11, .07), transparent 35%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' viewBox='0 0 220 220' fill='none' stroke='%230b6e86' stroke-opacity='.045' stroke-width='2'%3E%3Cellipse cx='50' cy='50' rx='26' ry='10'/%3E%3Cellipse cx='50' cy='50' rx='26' ry='10' transform='rotate(60 50 50)'/%3E%3Cellipse cx='50' cy='50' rx='26' ry='10' transform='rotate(120 50 50)'/%3E%3Ccircle cx='50' cy='50' r='3' fill='%230b6e86' fill-opacity='.06'/%3E%3Cpath d='M120 160 q12-24 24 0 t24 0 t24 0'/%3E%3Cpath d='M150 40 h40 m-10-8 l10 8 l-10 8'/%3E%3C/svg%3E");
  background-attachment: fixed, fixed, scroll;
}

/* رأس الصفحة (الدرس والصف والقوانين): شريط ملون ناعم ودوائر مدارية تتحرك ببطء */
.lx .lx-hero, .lx .cl-hero, .lw-top { position: relative; overflow: hidden; isolation: isolate; }
.lx .lx-hero, .lx .cl-hero {
  background: linear-gradient(135deg, #ffffff 0%, #f2fafc 55%, #e5f4f8 100%);
  border-color: #d3e8ee;
}
.lx .lx-hero::before, .lx .cl-hero::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; z-index: -1;
  background: linear-gradient(90deg, #0b6e86, #34a5c0 45%, #f59e0b 80%, #ef6c57);
}
.lx .lx-hero::after, .lx .cl-hero::after {
  content: ""; position: absolute; width: 220px; height: 220px; inset-inline-start: -60px; bottom: -110px; z-index: -1; border-radius: 50%;
  border: 2px dashed rgba(11, 110, 134, .14); box-shadow: 0 0 0 26px rgba(11, 110, 134, .035), 0 0 0 58px rgba(11, 110, 134, .025);
  animation: tc-orbit 40s linear infinite;
}
@keyframes tc-orbit { to { transform: rotate(360deg); } }
.lx .lx-hero h1, .lx .cl-hero h1 {
  background: linear-gradient(90deg, #0d3c4a, #0b6e86 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* البطاقات: ارتفاع لطيف عند المرور، وظهور تدريجي عند التمرير */
.lx .lx-card { transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
.lx a.lx-card:hover, .lx .lx-card.tc-hover:hover, .cl-stat:hover, .cl-link:hover {
  transform: translateY(-3px); box-shadow: 0 10px 24px -14px rgba(11, 60, 74, .35); border-color: #b9dbe3;
}
.cl-stat { transition: transform .25s ease, box-shadow .25s ease; }
.cl-stat b { background: linear-gradient(135deg, #0b6e86, #34a5c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tc-reveal { opacity: 0; transform: translateY(14px); }
.tc-reveal.tc-in { opacity: 1; transform: none; transition: opacity .55s ease, transform .55s ease; }

/* شرائح الصعوبة بنقطة ملونة */
.lx .lx-chip.E::before, .lx .lx-chip.M::before, .lx .lx-chip.H::before, .lx .lx-chip.X::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

/* أشرطة التقدم: لمعان خفيف يتحرك */
.lx .lx-bar > span { position: relative; overflow: hidden; }
.lx .lx-bar > span::after {
  content: ""; position: absolute; inset: 0; transform: translateX(100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: tc-shine 2.8s ease-in-out infinite;
}
@keyframes tc-shine { 60%, 100% { transform: translateX(-100%); } }

/* الأزرار الرئيسية */
.lx .lx-btn.primary { background: linear-gradient(135deg, #0b6e86, #138aa5); box-shadow: 0 6px 14px -8px rgba(11, 110, 134, .7); transition: transform .15s, box-shadow .15s, filter .15s; }
.lx .lx-btn.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.lx .lx-btn:active { transform: scale(.97); }

/* الإجابة: الصحيحة تنبض، والخاطئة تهتز قليلاً */
.lx .lx-choice.ok, .lx .sm-opt.ok { animation: tc-pop .45s ease; }
.lx .lx-choice.bad, .lx .sm-opt.bad { animation: tc-shake .4s ease; }
@keyframes tc-pop { 40% { transform: scale(1.035); } }
@keyframes tc-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* رسالة تشجيع صغيرة وقصاصات احتفال */
.tc-cheer {
  position: fixed; z-index: 2000; inset-inline-start: 50%; bottom: 22px; transform: translate(50%, 20px); opacity: 0;
  background: #14313b; color: #fff; border-radius: 99px; padding: 9px 20px; font-weight: 700; font-size: 16px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45); transition: opacity .3s, transform .3s; pointer-events: none; white-space: nowrap;
}
[dir="rtl"] .tc-cheer { transform: translate(50%, 20px); }
.tc-cheer.on { opacity: 1; transform: translate(50%, 0); }
.tc-confetti { position: fixed; z-index: 1999; pointer-events: none; width: 8px; height: 12px; border-radius: 2px; will-change: transform, opacity; }

/* حالة «لا يوجد محتوى» بشخصية لطيفة */
.lx .lx-empty::before {
  content: ""; display: block; width: 84px; height: 84px; margin: 0 auto 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 84 84'%3E%3Ccircle cx='42' cy='42' r='34' fill='%23e2f2f6'/%3E%3Cellipse cx='42' cy='42' rx='40' ry='13' fill='none' stroke='%2334a5c0' stroke-width='2.5' transform='rotate(-20 42 42)'/%3E%3Ccircle cx='32' cy='38' r='4' fill='%2314313b'/%3E%3Ccircle cx='52' cy='38' r='4' fill='%2314313b'/%3E%3Cpath d='M33 51 q9 7 18 0' fill='none' stroke='%2314313b' stroke-width='3' stroke-linecap='round'/%3E%3Ccircle cx='76' cy='30' r='4' fill='%23f59e0b'/%3E%3C/svg%3E") center/contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .lx .lx-hero::after, .lx .cl-hero::after, .lx .lx-bar > span::after { animation: none; }
  .tc-reveal { opacity: 1; transform: none; }
  .lx .lx-choice.ok, .lx .sm-opt.ok, .lx .lx-choice.bad, .lx .sm-opt.bad { animation: none; }
}
@media print {
  body { background: #fff !important; }
  .lx .lx-hero::before, .lx .lx-hero::after, .lx .cl-hero::before, .lx .cl-hero::after, .tc-cheer, .tc-confetti { display: none !important; }
  .tc-reveal { opacity: 1 !important; transform: none !important; }
}
