/* ════════════════════════════════════════════════════════════════════════
   🏆 [GOLD-PATH PRIME 2026-08-02] الطبقة 118 — الستورفرونت الذهبي
   ────────────────────────────────────────────────────────────────────────
   مكوّنات: إخفاء «موادي» الشرطي (gld-no-home) · ولادة التبويب · الشريط
   العلوي (امتداد .gp-banner من الطبقة 113 — لا CSS من الصفر) · شريط الصدى ·
   بطاقة جامعتك · شارة/شيت الكتب · توست الاستحقاق · بروز بطاقة الجامعة الأم.
   مستقلة بعد الباندل (ترتيب المصدر يغلب) — لا لمس bundle-core (فخ الكتل
   اليدوية بذيله). للإزالة: احذف هذا الملف + سطر <link> + موديولات gld-.
   ════════════════════════════════════════════════════════════════════════ */

/* ── إخفاء «موادي» بلا حذف DOM (قانون navMap بنسختيه) ─────────────────── */
#bottomNav.gld-no-home .nav-item:first-child { display: none; }

/* ولادة التبويب عند أول استحقاق (M2.5) */
@keyframes gldBirth {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
#bottomNav .nav-item.gld-birth { animation: gldBirth .9s cubic-bezier(.34,1.56,.64,1) both; }

/* ── الشريط العلوي — امتداد .gp-banner (الطبقة 113 تحمل الأساس) ────────── */
.gld-banner { position: relative; margin: 0 auto 14px; }
.gld-banner .gld-banner-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.gld-banner .gld-btn-ghost { background: transparent; border: 1px solid rgba(168,85,247,.45); }
.gld-banner-fold {
  position: absolute; top: 6px; inset-inline-start: 8px;
  width: 26px; height: 26px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.08); color: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
}
.gld-banner-fold i { transition: transform .25s ease; }
.gld-banner.gld-banner-min { padding-block: 6px; }
.gld-banner.gld-banner-min .gp-banner-txt,
.gld-banner.gld-banner-min .gld-banner-btns { display: none; }
.gld-banner.gld-banner-min::after { content: 'وصّل لمادتك خلال ثوانٍ ⚡'; font-size: .8rem; opacity: .85; margin-inline-start: 40px; }
.gld-banner.gld-banner-min .gld-banner-fold i { transform: rotate(180deg); }

/* ── رقاقة «كمّل من حيث وقفت ↪» (M4.6 — اختيارية، لا قفز تلقائي) ───────── */
.gld-resume-chip {
  display: block; margin: 0 auto 12px; padding: 7px 16px;
  border-radius: 999px; border: 1px solid rgba(168,85,247,.4);
  background: rgba(168,85,247,.12); color: inherit; cursor: pointer; font-size: .8rem;
}
:root[data-theme="light"] .gld-resume-chip { background: rgba(124,58,237,.08); color: #2a2140; }

/* ── شريط «طلباتك» — صدى محلي (0.6) ───────────────────────────────────── */
.gld-echo {
  max-width: 680px; margin: 0 auto 14px; padding: 12px 14px;
  border-radius: 14px; border: 1px solid var(--border-color, rgba(168,85,247,.25));
  background: var(--bg-card, rgba(30,20,50,.5));
}
.gld-echo-head { font-weight: 700; font-size: .9rem; margin-bottom: 8px; }
.gld-echo-head i { color: #a855f7; margin-inline-end: 6px; }
.gld-echo-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: .85rem; }
.gld-echo-row i { color: #f59e0b; font-size: .8rem; }
.gld-echo-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gld-echo-state {
  font-size: .72rem; padding: 3px 10px; border-radius: 999px;
  background: rgba(245,158,11,.14); color: #f59e0b; border: 1px solid rgba(245,158,11,.3);
}
.gld-echo-cta {
  margin-top: 8px; width: 100%; padding: 9px; border: none; border-radius: 10px;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff;
  font-weight: 700; font-size: .85rem; cursor: pointer;
}

/* ── بطاقة جامعتك (0.6 — بديل الفتح التلقائي) ──────────────────────────── */
/* 🚪 [ONE-DOOR V1 2026-08-02 M1] الغلاف صار div role="group" بصفّين وظيفيين:
   الجسم .gld-uni-main (ادخل مباشرة ↩) + الزر الثانوي .gld-uni-change (تغيير
   الجامعة) — زران حقيقيان، لا زر داخل زر. نفس اللغة الزجاجية RTL. */
.gld-uni-card {
  display: flex; align-items: center; gap: 12px; width: 100%; max-width: 680px;
  margin: 0 auto 16px; padding: 12px 16px; border-radius: 14px;
  flex-wrap: wrap; cursor: default;
  border: 1px solid var(--ua-c1, rgba(168,85,247,.35));
  /* fallback أولاً (iOS قديم بلا color-mix) ثم التدرج الملوّن يدهسه حيث يُدعم */
  background: var(--bg-card, rgba(30,20,50,.5));
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--ua-c1, #a855f7) 18%, transparent),
    color-mix(in srgb, var(--ua-c2, #7c3aed) 8%, transparent));
  color: inherit; text-align: start;
}
.gld-uni-main {
  display: flex; align-items: center; gap: 12px; flex: 1 1 100%;
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: inherit; text-align: start; font-family: inherit; font-size: inherit;
  -webkit-tap-highlight-color: transparent;
}
.gld-uni-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.9); padding: 3px; }
.gld-uni-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.gld-uni-txt small { opacity: .75; font-size: .75rem; }
.gld-uni-card > i,
.gld-uni-main > i { color: var(--ua-c1, #a855f7); }
.gld-uni-change {
  display: inline-flex; align-items: center; gap: 6px;
  margin-inline-start: 54px;   /* بمحاذاة النص: عرض الشعار 42 + الفجوة 12 */
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  font-family: inherit; font-size: .78rem; font-weight: 700;
  color: var(--ua-c1, #a855f7); background: transparent;
  /* fallback أولاً (iOS قديم بلا color-mix) ثم اللون الجامعي يدهسه حيث يُدعم */
  border: 1px dashed rgba(168,85,247,.45);
  border-color: color-mix(in srgb, var(--ua-c1, #a855f7) 45%, transparent);
  -webkit-tap-highlight-color: transparent;
}
.gld-uni-change:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  .gld-uni-change:active { transform: none; }
}

/* ── بطاقات الهَب (M4.3/M5) ─────────────────────────────────────────────
   🎭 [GRAND-STAGE 2026-08-05] اغتيل عقد nth-child/grid-column الهش الذي كان
   هنا (ONE-DOOR V1b): الترتيب والشبكة 2×2 صارا بالطبقة 120 بمفاتيح
   rx-card-<key> الصريحة (data-tile-key) — لا فهرس بعد اليوم. للتراجع: أعد
   القواعد الأربع من تاريخ git وأسقط نظيرتها في 120. */
.rx-choice-badge {
  position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3;
  font-size: .7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706); color: #1a1030;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}

/* ── شيت الكتب (M5.2) ──────────────────────────────────────────────────── */
#gldSheet { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; justify-content: center; }
#gldSheet .gld-sheet-back { position: absolute; inset: 0; background: rgba(5,3,15,.6); backdrop-filter: blur(3px); }
#gldSheet .gld-sheet {
  position: relative; width: min(480px, 94vw); margin-bottom: max(16px, env(safe-area-inset-bottom));
  padding: 22px 20px; border-radius: 20px; text-align: center;
  background: var(--bg-card, #1c1233); border: 1px solid rgba(168,85,247,.35);
  animation: gldSheetUp .3s ease both;
}
@keyframes gldSheetUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
#gldSheet .gld-sheet-icon { font-size: 1.8rem; color: #a855f7; margin-bottom: 8px; }
#gldSheet h3 { margin: 0 0 8px; font-size: 1.05rem; }
#gldSheet p { margin: 0 0 14px; font-size: .85rem; opacity: .8; }
#gldSheet .gp-banner-btn { width: 100%; }

/* ── توست الاستحقاق (M2.5 — لا قفز تلقائي) ─────────────────────────────── */
.gld-access-toast {
  position: fixed; bottom: calc(84px + env(safe-area-inset-bottom)); inset-inline: 0;
  margin: 0 auto; width: max-content; max-width: 92vw; z-index: 1300;
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-radius: 14px; background: linear-gradient(135deg, #2a1650, #1c1233);
  border: 1px solid rgba(168,85,247,.5); box-shadow: 0 8px 30px rgba(0,0,0,.5);
  animation: gldToastIn .4s ease both; font-size: .9rem;
}
@keyframes gldToastIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.gld-access-toast button {
  border: none; border-radius: 10px; padding: 8px 14px; cursor: pointer;
  background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; font-weight: 700; font-size: .82rem;
}

/* ── الثيم الفاتح (عقد :root[data-theme="light"] — عزل الطبقة 99) ──────── */
:root[data-theme="light"] .gld-echo { background: #fff; border-color: rgba(124,58,237,.25); }
:root[data-theme="light"] .gld-banner-fold { background: rgba(0,0,0,.06); }
:root[data-theme="light"] #gldSheet .gld-sheet { background: #fff; color: #2a2140; }
:root[data-theme="light"] .gld-access-toast { background: #fff; color: #2a2140; border-color: rgba(124,58,237,.35); }
:root[data-theme="light"] .gld-uni-logo { background: #f4f1fa; }
/* 🎭 [GRAND-STAGE E1 2026-08-05] «إنشاء حساب/تسجيل الدخول» الشبح كان مختفياً:
   .gld-btn-ghost يرث color:#fff من .gp-banner-btn (113:51) وoverride الحد
   وحده لا يكفي — اللون صريح بالثيم الفاتح (تباين ≥4.5 على أرضية الشريط) */
:root[data-theme="light"] .gld-banner .gld-btn-ghost { border-color: rgba(124,58,237,.4); color: #5b21b6; font-weight: 700; }

/* ── حركة مخفّضة ───────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #bottomNav .nav-item.gld-birth,
  #gldSheet .gld-sheet,
  .gld-access-toast { animation: none; }
}

/* موبايل ضيّق: أزرار الشريط تمتد */
@media (max-width: 480px) {
  .gld-banner .gld-banner-btns { flex-basis: 100%; }
  .gld-banner .gld-banner-btns .gp-banner-btn { flex: 1; }
}
