/* =============================================================
   مختبر كاوزا — إضافات CSS لـ v1.7
   إصلاحات لاحقة عَلى v1.6:
   - تَضييق دليل المنهجيات الخارجي إلى ~1050px
   - زيادة الفاصل بين الترقيم والنصّ في الخطوات
   - تَموضع المنبثقات (help-popover)
   - فاصل عَلوي بين الهيدر وأوّل المحتوى
   - شعار الهيدر بدون رابط
   ============================================================= */

/* ===== (1) دليل المنهجيات الخارجي — تَضييق أكثر ===== */

body.landing-body main.container,
body.landing-body main.guest-narrow {
    max-width: 1050px !important;
    margin-inline: auto !important;
    padding-inline: 1.5rem !important;
}

/* ===== (2) الخطوات التَطبيقية — فصل واضح ===== */

.method-step {
    /* مساحة كبيرة على اليمين (في RTL) لاستيعاب الرَّقم */
    padding-inline-start: 5.5rem !important;
    padding-inline-end: 1rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    min-height: 72px;
    position: relative;
}

.method-step::before {
    inset-inline-start: 1.2rem !important;
    top: 1rem !important;
    transform: none !important;  /* لا توسيط رأسي */
    width: 38px !important;
    height: 38px !important;
    font-size: 1.05rem !important;
}

/* ===== (6) فاصل عَلوي بين الهيدر وأوّل المحتوى ===== */

.main-content {
    padding-top: 1.5rem;
}

.main-content > .container {
    margin-top: 0;
}

/* الصفحات بهيرو: مسافة من الأعلى */
.main-content > .container > .dash-hero:first-child,
.main-content > .container > .page-header:first-child {
    margin-top: 0.5rem;
}

/* ===== (3) منبثقة المساعدة — تَموضع وحَجم صَحيحَين ===== */

.help-popover {
    position: absolute !important;
    z-index: 10001;
    background: white !important;
    border: 1px solid var(--gold) !important;
    border-radius: 10px !important;
    padding: 1rem 1.2rem !important;
    max-width: 380px !important;
    min-width: 240px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18) !important;
    font-family: 'Tajawal', sans-serif;
    direction: rtl;
    overflow-y: auto;
    max-height: 70vh;
}

.help-popover-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.25);
    z-index: 10000;
}

.help-popover-title {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--navy);
    font-weight: 700;
    font-size: 0.95rem;
    padding-bottom: 0.5rem;
    margin-bottom: 0.55rem;
    border-bottom: 1px solid var(--border);
}

.help-popover-title > span {
    flex: 1;
}

.help-popover-close {
    background: var(--lighter);
    border: 1px solid var(--border);
    color: var(--ink);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    padding: 0;
}

.help-popover-close:hover {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.help-popover-body {
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.help-popover-body strong {
    color: var(--navy);
}

/* ===== (10) شعار الهيدر بدون رابط ===== */

/* لاحظ: في header.php سَنُحوّل <a> إلى <div>، لكن نَحتاج تَنسيقًا للحالتَين */

.navbar-brand .brand-link,
.navbar-brand .brand-static {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: inherit;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
    padding-inline-end: 1.1rem;
    margin-inline-end: 0.6rem;
    cursor: default;  /* لا مؤشّر يَد */
}

/* ===== مَوقع زرّ tutorial-launch ===== */

.tutorial-launch {
    margin-top: 0.5rem;
}

/* ===== تَوسيط محتوى المنبثقات بحَجم ثابت ===== */

.tutorial-window,
.about-lab-window {
    /* تأكيد إضافي لتَجاوز أيّ override */
    box-sizing: border-box;
}

/* ===== EFQM editing panel في case-view ===== */

.efqm-edit-panel {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    border: 1px solid #3B82F6;
    border-radius: 10px;
    padding: 1rem 1.2rem;
    margin: 0.8rem 0;
}

.efqm-edit-panel h4 {
    color: #1E40AF;
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.efqm-edit-panel select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid #3B82F6;
    border-radius: 6px;
    background: white;
    font-family: inherit;
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
}

.efqm-edit-panel .efqm-actions {
    display: flex;
    gap: 0.5rem;
}

.efqm-current-pill {
    background: white;
    border: 1px solid #3B82F6;
    color: #1E40AF;
    padding: 0.25rem 0.7rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
