:root{--eg-primary:#1e73be;--eg-text:#111;--eg-muted:#6b7280;--eg-bg:#f7f8fa;}
/* نفس التنسيقات السابقة (أزرار زرقاء ونص أبيض وتوسيط) */
.edugate-stage{direction:rtl;max-width:1100px;margin:0 auto}
.edugate-note{padding:12px;background:#fff3cd;border:1px solid #ffeeba;border-radius:12px}
.edugate-grades-bar{position:sticky;top:0;z-index:5;display:flex;gap:.6rem;flex-wrap:wrap;justify-content:center;padding:1rem;background:var(--eg-bg);border-radius:12px;margin:18px 0}
.eg-grade-pill{appearance:none;border:1px solid #d1d5db;background:#fff;color:var(--eg-primary);padding:.8rem 1.2rem;border-radius:999px;cursor:pointer;font-weight:800;font-size:1.12rem}
.eg-grade-pill.is-active,.eg-grade-pill:hover{border-color:var(--eg-primary);color:#fff;background:var(--eg-primary)}
.edugate-mega{margin-bottom:16px}
.eg-subjects-mega{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;max-width:1000px;margin:0 auto}
.eg-subject-card{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px;border:1px solid #e5e7eb;border-radius:12px;background:#fff;text-decoration:none;color:inherit}
.eg-subject-card:hover{border-color:var(--eg-primary)}
.eg-subject-name{font-weight:700}
.eg-count{background:#eef6ff;color:#0f4c81;font-size:.85rem;padding:.15rem .45rem;border-radius:999px}
.edugate-subject-panel{border:1px solid #e5e7eb;border-radius:12px;padding:12px;background:#fff;max-width:1000px;margin:0 auto}
.eg-breadcrumb{color:var(--eg-muted);font-size:.92rem;margin-bottom:6px;text-align:center}
.eg-panel-head{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:10px}
.eg-title{margin:0;font-size:1.25rem;color:var(--eg-primary)}
.eg-teachers.eg-3col{display:grid;grid-template-columns:repeat(3,minmax(220px,1fr));gap:14px;margin-bottom:14px}
@media (max-width:960px){.eg-teachers.eg-3col{grid-template-columns:repeat(2,minmax(220px,1fr));}}
@media (max-width:640px){.eg-teachers.eg-3col{grid-template-columns:1fr;}}
.eg-teacher-video{position:relative;border-radius:12px;overflow:hidden;background:#000;aspect-ratio:16/9}
.eg-thumb{width:100%;height:100%;object-fit:cover;display:block}
.eg-thumb-fallback{width:100%;height:100%;background:linear-gradient(135deg,#0f4c81,#1e73be)}
.eg-play{position:absolute;inset:auto 50% 50% auto;transform:translate(50%,50%);width:64px;height:64px;border-radius:50%;border:0;background:#fff;box-shadow:0 6px 20px rgba(0,0,0,.25);cursor:pointer}
.eg-play:before{content:'';position:absolute;left:26px;top:21px;border-left:18px solid #1e73be;border-top:11px solid transparent;border-bottom:11px solid transparent}
.eg-teacher-name{text-align:center;margin-top:6px;font-weight:800;color:#0f4c81}
.eg-type-bar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px;justify-content:center}
.eg-type-btn{background:var(--eg-primary);color:#fff;border:none;border-radius:10px;padding:.6rem 1rem;cursor:pointer;display:flex;gap:6px;align-items:center;font-weight:800}
.eg-type-count{background:#fff;color:#1e73be;border-radius:999px;padding:0 .5rem;font-weight:800}
.eg-resources .eg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px;max-width:1000px;margin:0 auto}
.eg-card{border:1px solid #e5e7eb;border-radius:12px;padding:12px;background:#fff;display:flex;flex-direction:column;gap:8px}
.eg-card-title{margin:0;font-size:1rem;color:#fff;background:var(--eg-primary);padding:.45rem .6rem;border-radius:8px}
.eg-card-excerpt{color:#6b7280}
.eg-btn,.eg-view-btn{display:inline-block;background:var(--eg-primary);color:#fff;text-decoration:none;padding:.55rem .9rem;border-radius:8px;border:none;cursor:pointer;font-weight:800}
.eg-actions{display:flex;gap:8px;align-items:center}
.eg-file-row{display:flex;gap:8px;align-items:center;color:#6b7280;font-size:.92rem}
.eg-file-icon{display:inline-flex;align-items:center;justify-content:center;width:40px;height:24px;border:1px solid #e5e7eb;border-radius:6px;background:#f9fafb;font-weight:700;padding:2px}
.eg-ext{font-weight:900;color:#0f4c81}
.eg-load-more{margin-top:12px;display:block;width:100%;background:#111;color:#fff;border:none;border-radius:10px;padding:.75rem}
.eg-viewer{margin:10px 0;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;display:none}
.eg-viewer iframe{width:100%;height:540px;border:0}
.eg-viewer.is-open{display:block}
.eg-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;background:rgba(0,0,0,.5);z-index:9999}
.eg-modal.is-open{display:flex}
.eg-modal-box{background:#fff;border-radius:12px;max-width:1100px;width:96%;max-height:90vh;display:flex;flex-direction:column;overflow:hidden}
.eg-modal-head{display:flex;justify-content:space-between;align-items:center;padding:10px 12px;border-bottom:1px solid #eee}
.eg-modal-title{margin:0;font-size:1rem}
.eg-modal-close{background:#111;color:#fff;border:0;border-radius:8px;padding:.4rem .65rem;cursor:pointer}
.eg-modal-body{flex:1}
.eg-modal-body iframe{width:100%;height:80vh;border:0}
