/* =====================================================================
   تحسين شكل صفحة الطالب + الأنيميشن (teacher/student-dashboard.html)
   - بيعرّف الكلاسات اللي الصفحة بتستخدمها ومش موجودة في output.css
     (ده سبب الحدود السودا والمربعات الفاتحة في الوضع الليلي)
   - أنيميشن دخول هادي + فتح وقفل ناعم للأقسام
   - التلفونات القديمة (html.te-lite) ومن مفعّل «تقليل الحركة»: من غير أنيميشن ولا blur
   ===================================================================== */

/* ---------- 1) كلاسات ناقصة من output.css ---------- */
.-top-10{top:-2.5rem}.-left-10{left:-2.5rem}.-right-10{right:-2.5rem}.-bottom-10{bottom:-2.5rem}
.min-h-\[120px\]{min-height:120px}.min-w-\[190px\]{min-width:190px}
.mt-7{margin-top:1.75rem}.pb-8{padding-bottom:2rem}
.border-t-0{border-top-width:0}.border-x-0{border-left-width:0;border-right-width:0}
.z-\[9998\]{z-index:9998}
@media (min-width:640px){
  .sm\:p-7{padding:1.75rem}.sm\:py-8{padding-top:2rem;padding-bottom:2rem}.sm\:text-left{text-align:left}
}
.bg-amber-400\/10{background-color:rgba(251,191,36,.10)}
.bg-emerald-400\/10{background-color:rgba(52,211,153,.10)}
.bg-amber-50\/70{background-color:rgba(255,251,235,.70)}
.bg-blue-50\/70{background-color:rgba(239,246,255,.70)}
.bg-white\/60{background-color:rgba(255,255,255,.60)}
.bg-white\/70{background-color:rgba(255,255,255,.70)}
.border-amber-200\/70{border-color:rgba(253,230,138,.70)}
.border-blue-200\/70{border-color:rgba(191,219,254,.70)}
.border-slate-200\/70{border-color:rgba(226,232,240,.70)}
.hover\:bg-blue-100:hover{background-color:#dbeafe}
.dark .dark\:bg-amber-950\/20{background-color:rgba(69,26,3,.20)}
.dark .dark\:bg-amber-950\/30{background-color:rgba(69,26,3,.30)}
.dark .dark\:bg-amber-950\/40{background-color:rgba(69,26,3,.40)}
.dark .dark\:bg-blue-950\/20{background-color:rgba(23,37,84,.20)}
.dark .dark\:bg-blue-950\/30{background-color:rgba(23,37,84,.30)}
.dark .dark\:bg-blue-950\/40{background-color:rgba(23,37,84,.40)}
.dark .dark\:bg-emerald-950\/30{background-color:rgba(2,44,34,.30)}
.dark .dark\:bg-emerald-950\/40{background-color:rgba(2,44,34,.40)}
.dark .dark\:bg-purple-950\/40{background-color:rgba(59,7,100,.40)}
.dark .dark\:bg-violet-950\/40{background-color:rgba(46,16,101,.40)}
.dark .dark\:bg-red-950\/30{background-color:rgba(69,10,10,.30)}
.dark .dark\:bg-red-950\/40{background-color:rgba(69,10,10,.40)}
.dark .dark\:bg-slate-900\/40{background-color:rgba(15,23,42,.40)}
.dark .dark\:bg-slate-900\/50{background-color:rgba(15,23,42,.50)}
.dark .dark\:border-amber-900\/40{border-color:rgba(120,53,15,.40)}
.dark .dark\:border-blue-900\/40{border-color:rgba(30,58,138,.40)}
.dark .dark\:border-slate-700\/40{border-color:rgba(51,65,85,.40)}
.dark .dark\:border-slate-700\/50{border-color:rgba(51,65,85,.50)}
.dark .dark\:text-emerald-700{color:#047857}
.dark .dark\:text-slate-500{color:#64748b}
.dark .dark\:text-slate-700{color:#334155}
.dark .dark\:text-violet-400{color:#a78bfa}
/* أي حدود من غير لون (Tailwind v4 بيخليها بلون النص = أسود) → لون هادي */
.glass-panel .border:not([class*="border-"]),
.glass-panel .border-t:not([class*="border-slate"]){border-color:rgba(226,232,240,.8)}
.dark .glass-panel .border:not([class*="border-"]),
.dark .glass-panel .border-t:not([class*="border-slate"]){border-color:rgba(51,65,85,.5)}

/* ---------- 2) ترتيب ووضوح ---------- */
/* الأرقام الكبيرة: أرقام بنفس العرض عشان مايتهزّش وهو بيعد */
#lessonsCount,#quizzesCount,#averageScore,#gamesCount,#creditBalance,
#publishedContentCount,#newContentCount,#progressPercent,#levelCreditText{font-variant-numeric:tabular-nums}

/* الهيدر: ظل خفيف لما تنزل في الصفحة */
header.sp-scrolled{box-shadow:0 8px 24px -12px rgba(15,23,42,.18)}
.dark header.sp-scrolled{box-shadow:0 8px 24px -12px rgba(0,0,0,.6)}

/* الموبايل: كروت الإحصائيات اتنين جنب بعض بدل واحد تحت التاني */
@media (max-width:639px){
  .sp-stats{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:.75rem!important}
  .sp-stats>.stat-card{padding:1rem!important;border-radius:1.25rem!important}
  .sp-stats>.stat-card .h-12.w-12{width:2.5rem;height:2.5rem;border-radius:.85rem}
  .sp-stats>.stat-card .h-12.w-12 svg{width:1.25rem;height:1.25rem}
  .sp-stats>.stat-card .text-3xl{font-size:1.6rem;line-height:2rem}
  .sp-stats>.stat-card .text-sm{font-size:.78rem}
}

/* زرار الأقسام اللي بتتفتح: إحساس ضغط */
.history-toggle{-webkit-tap-highlight-color:transparent}
.history-toggle:active{transform:scale(.99)}
.history-toggle[aria-expanded="true"]{background:rgba(148,163,184,.06)}

/* ---------- 3) أنيميشن ---------- */
@keyframes spFadeUp{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes spOpen{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
@keyframes spShine{from{transform:translateX(100%)}to{transform:translateX(-100%)}}
@keyframes spWave{0%,60%,100%{transform:rotate(0)}10%,30%{transform:rotate(14deg)}20%,40%{transform:rotate(-8deg)}}
@keyframes spPop{0%{transform:scale(1)}40%{transform:scale(1.12)}100%{transform:scale(1)}}

/* دخول الأقسام: بيبان واحد ورا التاني لما يوصله السكرول */
.sp-reveal{opacity:0;transform:translateY(14px)}
.sp-reveal.sp-in{animation:spFadeUp .55s cubic-bezier(.22,1,.36,1) both;animation-delay:var(--sp-d,0s)}

/* فتح قسم (سجل الاختبارات/الواجبات/المشاهدات) بنعومة */
.history-content.open{animation:spOpen .35s ease both}

/* شريط التقدم: لمعة بتعدي عليه */
.progress-fill{position:relative;overflow:hidden}
.progress-fill::after{content:"";position:absolute;inset:0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.45),transparent);
  animation:spShine 2.6s ease-in-out 1s infinite}

/* إيد «أهلاً بك 👋» بتسلّم مرة واحدة */
.sp-wave{display:inline-block;transform-origin:70% 70%;animation:spWave 1.6s ease .6s 1}

/* الرقم بيعمل نطة صغيرة لما يتغير */
.sp-pop{animation:spPop .45s ease}

/* الأفاتار: لمعة خفيفة عند المرور */
.profile-avatar{transition:transform .3s ease}
.profile-avatar:hover{transform:rotate(-4deg) scale(1.04)}

/* ---------- 4) التلفونات القديمة + تقليل الحركة ---------- */
html.te-lite .glass-panel{backdrop-filter:none!important;-webkit-backdrop-filter:none!important;background:rgba(255,255,255,.96)}
html.te-lite.dark .glass-panel{background:rgba(15,23,42,.97)}
html.te-lite .blur-2xl{display:none}
html.te-lite .sp-reveal{opacity:1!important;transform:none!important;animation:none!important}
html.te-lite .progress-fill::after,html.te-lite .credit-glow,html.te-lite .new-content-badge,
html.te-lite .sp-wave,html.te-lite .sp-pop,html.te-lite .history-content.open{animation:none!important}
html.te-lite .stat-card:hover,html.te-lite .new-content-card:hover{transform:none}
@media (prefers-reduced-motion:reduce){
  .sp-reveal{opacity:1!important;transform:none!important;animation:none!important}
  .progress-fill::after,.sp-wave,.sp-pop,.history-content.open{animation:none!important}
}
/* v18 — تبويبات صفحة الطالب (student-tabs.js) */
.st-tabs{position:sticky;top:0;z-index:40;display:flex;gap:.35rem;margin:0 0 1.5rem;padding:.35rem;border-radius:1.15rem;background:rgba(255,255,255,.82);border:1px solid rgba(226,232,240,.9);box-shadow:0 10px 25px -18px rgba(15,23,42,.45);overflow-x:auto;scrollbar-width:none;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.st-tabs::-webkit-scrollbar{display:none}
.dark .st-tabs{background:rgba(15,23,42,.82);border-color:rgba(51,65,85,.6)}
.st-tab{position:relative;flex:1 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.6rem .9rem;border-radius:.85rem;font-weight:800;font-size:.86rem;color:#475569;white-space:nowrap;transition:background .2s,color .2s,box-shadow .2s}
.dark .st-tab{color:#cbd5e1}
.st-tab:hover{background:rgba(241,245,249,.9)}.dark .st-tab:hover{background:rgba(30,41,59,.8)}
.st-tab.on{background:linear-gradient(135deg,#10b981,#059669);color:#fff;box-shadow:0 8px 18px -10px rgba(5,150,105,.8)}
.st-tab:focus-visible{outline:2px solid #10b981;outline-offset:2px}
.st-e{font-size:1rem;line-height:1}
.st-dot{position:absolute;top:.35rem;inset-inline-end:.4rem;width:.55rem;height:.55rem;border-radius:999px;background:#ef4444;box-shadow:0 0 0 2px #fff}
.st-dot[hidden]{display:none}
.st-hide{display:none!important}
@keyframes stIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.st-in{animation:stIn .35s ease both}
html.te-lite .st-in{animation:none}
html.te-lite .st-tabs{-webkit-backdrop-filter:none;backdrop-filter:none;background:#fff}
html.te-lite.dark .st-tabs{background:#0f172a}
@media (prefers-reduced-motion:reduce){.st-in{animation:none}}
@media (max-width:480px){.st-tabs{gap:.2rem;padding:.3rem;margin-bottom:1.1rem}.st-tab{flex:1 1 0;min-width:0;flex-direction:column;gap:.1rem;padding:.4rem .2rem;font-size:.74rem}.st-e{font-size:1.05rem}.st-dot{top:.25rem;inset-inline-end:22%}}
@media print{.st-tabs{display:none}}

/* v-c8b — زرار «احجز حصة أونلاين» في شريط التبويبات (بعد السجل) */
.st-book{position:relative;flex:1 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;padding:.6rem .9rem;border-radius:.85rem;font-weight:900;font-size:.86rem;color:#fff;background:linear-gradient(135deg,#6366f1,#4f46e5);white-space:nowrap;text-decoration:none;box-shadow:0 8px 18px -10px rgba(79,70,229,.85);transition:background .2s,transform .2s,box-shadow .2s}
.st-book:hover{background:linear-gradient(135deg,#4f46e5,#4338ca);transform:translateY(-1px)}
.st-book:focus-visible{outline:2px solid #6366f1;outline-offset:2px}
.st-book:active{transform:translateY(0)}

/* Mobile fix: keep student tabs readable and touchable; let the bar scroll instead of squeezing buttons. */
@media (max-width:480px){
  .st-tabs{
    flex-wrap:nowrap;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-x:contain;
    touch-action:pan-x;
    scroll-snap-type:x proximity;
    scrollbar-width:thin;
    scrollbar-color:rgba(100,116,139,.45) transparent;
  }
  .st-tabs::-webkit-scrollbar{display:block;height:4px}
  .st-tab{
    flex:0 0 auto;
    min-width:78px;
    min-height:48px;
    padding:.45rem .55rem;
    scroll-snap-align:start;
  }
  .st-tab .st-lbl{display:inline;white-space:nowrap}
  .st-book{
    flex:0 0 auto;
    min-width:155px;
    min-height:48px;
    padding:.45rem .65rem;
    font-size:.76rem;
    scroll-snap-align:start;
  }
}
@media (max-width:350px){.st-tab{min-width:72px}.st-book{min-width:145px}}
@media (max-width:480px){
  .history-toggle{min-height:60px;gap:.55rem;padding:.9rem;touch-action:manipulation}
  .history-toggle>div:first-child{flex:1;min-width:0}
  .history-toggle h3{font-size:.95rem;line-height:1.3;overflow-wrap:anywhere}
  .history-toggle p{font-size:.72rem;line-height:1.45}
  .history-toggle>div:last-child{width:2.25rem;height:2.25rem}
}
