/*
  تأثيرات موحّدة لكل صفحات المنصة (١٣ نوفمبر).

  كانت كل صفحة تنسّق أزرارها وحدها، فبعضها يتغيّر عند مرور الفأرة وبعضها لا،
  ولا يظهر عند الضغط إلا القليل. هذا الملف يُضاف إلى كل صفحة ولا يغيّر عمل أي زر:
    - مرور الفأرة: توهّج ذهبي خفيف (ولون أحمر لأزرار الحذف).
    - الضغط: انضغاط لحظي.
    - التنقل بلوحة المفاتيح: إطار ذهبي حول الزر المحدَّد.
    - زر يرسل إلى الخادم: دائرة دوّارة في زاويته، ثم ✓ خضراء أو ! حمراء.
    - إشعار منبثق للعمليات التي لا تظهر نتيجتها بجانب الزر.
    - في لوحة المدرّب: تبويب سائل، ومفتاح حالة المتدرب، وتعبئة موجية لملفات الدرجات.
  بطاقات الشعب (role=button) لها تأثيرها الخاص فلا تدخل هنا.
  الاختيار: الخفة أولًا. لا مرشّح رسومي إلا في شريط التبويبات وحده، ومن فعّل
  «تقليل الحركة» في جهازه تتوقف عنده الحركة كلها.
*/
:root{--fx-gold:217,177,102;--fx-ok:95,191,143;--fx-bad:217,122,108}

/* ---------------- مرور الفأرة والضغط ---------------- */
:where(button, a.ghost, a.btn, a.fl, .linkbtn, .exam-row .acts a, .shortcuts a, a.filesbtn, a.livelab,
       a.oversight, #lecgrid a.th, #th-list a, .links a){
  transition:box-shadow .18s ease, filter .18s ease, scale .1s ease, border-color .18s ease, color .18s ease;
}
button:not(:disabled):hover, a.ghost:hover, a.btn:hover, .linkbtn:not(:disabled):hover, .exam-row .acts a:hover,
.shortcuts a:hover, a.filesbtn:hover, a.livelab:hover, a.oversight:hover, #lecgrid a.th:hover, #th-list a:hover,
.links a:hover{
  box-shadow:inset 0 0 0 999px rgba(var(--fx-gold),.09), 0 0 0 3px rgba(var(--fx-gold),.14), 0 0 16px rgba(var(--fx-gold),.24);
  filter:brightness(1.08);
}
button.danger:not(:disabled):hover, button.del:not(:disabled):hover{
  box-shadow:inset 0 0 0 999px rgba(var(--fx-bad),.1), 0 0 0 3px rgba(var(--fx-bad),.16), 0 0 16px rgba(var(--fx-bad),.26);
}
button:not(:disabled):active, a.ghost:active, a.btn:active, .linkbtn:not(:disabled):active, .exam-row .acts a:active,
.shortcuts a:active, a.filesbtn:active, a.livelab:active, a.oversight:active, #lecgrid a.th:active, #th-list a:active,
.links a:active{
  scale:.97;filter:brightness(.92);
}
:where(button, a, summary, select, [role=button]):focus-visible{outline:2px solid rgb(var(--fx-gold));outline-offset:2px}

/* ---------------- جارٍ الإرسال ثم تم أو لم يتم ---------------- */
.fx-rel{position:relative}
.fx-busy{cursor:progress!important}
.fx-busy::after, .fx-ok::after, .fx-fail::after{
  content:"";position:absolute;top:-7px;inset-inline-end:-7px;width:18px;height:18px;border-radius:50%;
  box-sizing:border-box;pointer-events:none;z-index:3;
  font:700 11px/18px "Segoe UI",Tahoma,sans-serif;text-align:center;
}
.fx-busy::after{border:2.5px solid rgba(var(--fx-gold),.3);border-top-color:rgb(var(--fx-gold));
                background:#0b2b29;animation:fx-spin .7s linear infinite}
.fx-ok{box-shadow:0 0 0 3px rgba(var(--fx-ok),.35), 0 0 16px rgba(var(--fx-ok),.35)!important}
.fx-ok::after{content:"✓";background:rgb(var(--fx-ok));color:#06231a;animation:fx-pop .3s ease}
.fx-fail{box-shadow:0 0 0 3px rgba(var(--fx-bad),.4), 0 0 16px rgba(var(--fx-bad),.35)!important;animation:fx-shake .35s ease}
.fx-fail::after{content:"!";background:rgb(var(--fx-bad));color:#2a0d08;animation:fx-pop .3s ease}
@keyframes fx-spin{to{transform:rotate(360deg)}}
@keyframes fx-pop{from{scale:0}60%{scale:1.25}to{scale:1}}
@keyframes fx-shake{25%{translate:-4px 0}50%{translate:4px 0}75%{translate:-2px 0}}

/* ---------------- الإشعار المنبثق ---------------- */
#fx-toasts{position:fixed;z-index:9999;bottom:18px;left:18px;display:flex;flex-direction:column;gap:8px;
           max-width:min(440px, calc(100vw - 32px));pointer-events:none}
.fx-toast{display:flex;align-items:center;gap:10px;padding:10px 16px;border-radius:12px;direction:rtl;
          font:15px/1.6 "Segoe UI","Noto Kufi Arabic",Tahoma,sans-serif;color:#f3f1ea;
          background:#0f3a35;border:1px solid rgb(var(--fx-ok));box-shadow:0 10px 26px rgba(0,0,0,.45);
          pointer-events:auto;animation:fx-in .25s ease}
.fx-toast.err{border-color:rgb(var(--fx-bad))}
.fx-toast .ic{flex:none;display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;
              background:rgb(var(--fx-ok));color:#06231a;font-weight:700;font-size:13px}
.fx-toast.err .ic{background:rgb(var(--fx-bad));color:#2a0d08}
.fx-toast .n{font:700 12px Consolas,monospace;color:#22190a;background:rgb(var(--fx-gold));border-radius:10px;padding:0 7px}
.fx-toast.out{opacity:0;translate:0 8px;transition:opacity .3s, translate .3s}
@keyframes fx-in{from{opacity:0;translate:0 12px}}
@media (max-width:640px){#fx-toasts{left:16px;right:16px;max-width:none}}

/* ---------------- لوحة المدرّب: تبويب سائل ---------------- */
nav.views.fx-liquid{position:relative}
nav.views .fx-goo{position:absolute;inset:0;filter:url(#fx-goo);pointer-events:none;z-index:0}
nav.views .fx-ind{position:absolute;border-radius:11px;background:rgb(var(--fx-gold));opacity:0}
nav.views.fx-ready .fx-ind{opacity:1}
nav.views .fx-ind.a{transition:left .3s cubic-bezier(.5,0,.2,1), top .3s, width .3s, height .3s}
nav.views .fx-ind.b{transition:left .62s cubic-bezier(.65,0,.2,1), top .62s, width .62s, height .62s}
nav.views.fx-liquid a{position:relative;z-index:1;transition:color .3s}
nav.views.fx-liquid a.on{color:#22190a;border-bottom-color:transparent}

/* ---------------- لوحة المدرّب: مفتاح حالة المتدرب ---------------- */
select.st-sel.fx-hidden{display:none}
button.fx-sw{display:inline-flex;align-items:center;gap:8px;padding:3px 8px;border:0;border-radius:14px;width:auto;
             background:transparent;color:rgb(var(--fx-ok));font:inherit;font-size:14px;font-weight:700;cursor:pointer}
button.fx-sw.off{color:rgb(var(--fx-bad))}
.fx-sw .fx-k{position:relative;flex:none;width:44px;height:24px;border-radius:12px;
             background:rgba(var(--fx-ok),.22);border:1px solid rgba(var(--fx-ok),.6);transition:background .3s, border-color .3s}
.fx-sw.off .fx-k{background:rgba(var(--fx-bad),.2);border-color:rgba(var(--fx-bad),.6)}
.fx-sw .fx-k::after{content:"";position:absolute;top:3px;right:3px;width:16px;height:16px;border-radius:9px;
                    background:rgb(var(--fx-ok));transition:right .32s cubic-bezier(.5,0,.2,1), background .3s}
.fx-sw.off .fx-k::after{right:23px;background:rgb(var(--fx-bad))}
.fx-sw .fx-t{min-width:44px;text-align:start}
/* الدائرة تتمدّد وهي تنتقل كقطرة، ثم تعود دائرة: بلا مرشّح رسومي */
.fx-flow::after{animation:fx-stretch .34s ease}
@keyframes fx-stretch{50%{width:30px}}
/* مفتاح «الأسابيع النظرية» الموجود: الحركة نفسها */
.switch .knob.fx-flow::after{animation:fx-stretch-sm .32s ease}
@keyframes fx-stretch-sm{50%{width:30px}}

/* ---------------- لوحة المدرّب: تعبئة موجية لملفات الدرجات ---------------- */
.exam-row .acts a[href*="/gradebook."]{position:relative;overflow:hidden;isolation:isolate;transition:color .35s, box-shadow .18s, filter .18s, scale .1s}
.exam-row .acts a[href*="/gradebook."]::before{
  content:"";position:absolute;z-index:-1;left:-50%;width:200%;aspect-ratio:1;top:calc(100% + 30px);
  background:rgb(var(--fx-gold));border-radius:42%;transition:top .6s ease;
  animation:fx-spin 5s linear infinite;animation-play-state:paused}
.exam-row .acts a[href*="/gradebook."]:hover{color:#22190a}
.exam-row .acts a[href*="/gradebook."]:hover::before{top:-80%;animation-play-state:running}

/* ---------------- تقليل الحركة ---------------- */
@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}
