/* ================================================================
   مرصد الأسباب — تنسيقات المساعدة السياقية
   ================================================================ */

/* ===== أيقونة المساعدة ===== */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0 0.2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #28709E;
    font-size: 0.9rem;
    vertical-align: middle;
    transition: all 0.15s;
    opacity: 0.6;
}
.help-icon:hover {
    opacity: 1;
    color: #1C3F60;
    transform: scale(1.15);
}
.help-icon:focus {
    outline: 2px solid #C19447;
    outline-offset: 2px;
    border-radius: 50%;
}

/* ===== Popover (البطاقة المنبثقة) ===== */
.help-popover-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 45, 69, 0.6);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(2px);
    animation: helpFadeIn 0.2s ease;
}
.help-popover-overlay.visible {
    display: flex;
}
@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.help-popover {
    background: white;
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    direction: rtl;
    animation: helpSlideIn 0.25s ease;
}
@keyframes helpSlideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.help-popover-header {
    background: linear-gradient(135deg, #1C3F60 0%, #28709E 100%);
    color: white;
    padding: 1.1rem 1.4rem;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.help-popover-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.help-popover-header h3::before {
    content: '\F505';
    font-family: 'bootstrap-icons';
    color: #C19447;
    font-size: 1.3rem;
}
.help-popover-close {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.15s;
}
.help-popover-close:hover {
    background: rgba(255,255,255,0.25);
}
.help-popover-body {
    padding: 1.3rem 1.4rem;
    color: #1F2937;
    line-height: 1.85;
    font-size: 0.95rem;
    white-space: pre-wrap;
}
.help-popover-footer {
    padding: 0.8rem 1.4rem;
    background: #F4F6F9;
    border-radius: 0 0 12px 12px;
    text-align: left;
    font-size: 0.82rem;
    color: #6B7280;
}

/* ===== شاشة الترحيب (Welcome) ===== */
.welcome-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 45, 69, 0.85);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    backdrop-filter: blur(4px);
}
.welcome-overlay.visible {
    display: flex;
}
.welcome-card {
    background: white;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 30px 80px rgba(0,0,0,0.3);
    direction: rtl;
}
.welcome-header {
    background: linear-gradient(135deg, #1C3F60 0%, #142D45 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px 16px 0 0;
    text-align: center;
    position: relative;
}
.welcome-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 4px;
    background: #C19447;
}
.welcome-header .icon-circle {
    width: 60px;
    height: 60px;
    background: rgba(193, 148, 71, 0.2);
    border: 2px solid #C19447;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: #E6C77C;
    font-size: 1.8rem;
}
.welcome-header h2 {
    margin: 0 0 0.4rem;
    color: white;
    font-size: 1.6rem;
}
.welcome-header .subtitle {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
}

.welcome-body {
    padding: 1.8rem 2rem;
}
.welcome-section {
    margin-bottom: 1.5rem;
}
.welcome-section h4 {
    color: #1C3F60;
    font-size: 1rem;
    margin: 0 0 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.welcome-section h4 i {
    color: #C19447;
}
.welcome-section p {
    color: #1F2937;
    line-height: 1.8;
    margin: 0;
    font-size: 0.94rem;
}
.welcome-steps {
    background: #F4F6F9;
    border-radius: 10px;
    padding: 1.2rem 1.5rem;
    margin: 1.2rem 0;
}
.welcome-step {
    display: flex;
    gap: 0.9rem;
    margin-bottom: 1rem;
}
.welcome-step:last-child { margin-bottom: 0; }
.welcome-step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #1C3F60;
    color: #C19447;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-family: monospace;
}
.welcome-step-content {
    flex: 1;
}
.welcome-step-content strong {
    color: #1C3F60;
    display: block;
    margin-bottom: 0.2rem;
}
.welcome-step-content span {
    color: #4B5563;
    font-size: 0.9rem;
    line-height: 1.6;
}

.welcome-tip {
    background: #FFFBEB;
    border-right: 4px solid #C19447;
    padding: 0.9rem 1.1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #92400E;
    line-height: 1.7;
}

.welcome-footer {
    padding: 1.2rem 2rem;
    background: #F4F6F9;
    border-radius: 0 0 16px 16px;
    display: flex;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.welcome-footer .help-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    color: #6B7280;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ===== شريط الترحيب الصغير (banner) ===== */
.welcome-banner {
    background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
    border: 1px solid #FBBF24;
    border-radius: 10px;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.welcome-banner .banner-icon {
    color: #C19447;
    font-size: 1.4rem;
}
.welcome-banner .banner-text {
    flex: 1;
    color: #92400E;
    font-size: 0.92rem;
    line-height: 1.6;
}
.welcome-banner .banner-text strong {
    color: #78350F;
}
.welcome-banner .banner-link {
    background: #C19447;
    color: #1C3F60;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.welcome-banner .banner-link:hover {
    background: #E6C77C;
    color: #1C3F60;
}
.welcome-banner .banner-dismiss {
    background: transparent;
    border: 1px solid #FBBF24;
    color: #92400E;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}
.welcome-banner .banner-dismiss:hover {
    background: rgba(193, 148, 71, 0.2);
}

/* ===== تطوير الحالات الفارغة (Coaching empty states) ===== */
.empty-coach {
    background: #FAFBFC;
    border: 1px dashed #D6DCE4;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}
.empty-coach .coach-icon {
    font-size: 2.2rem;
    color: #C19447;
    margin-bottom: 0.7rem;
    display: inline-block;
}
.empty-coach h4 {
    color: #1C3F60;
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}
.empty-coach p {
    color: #4B5563;
    margin: 0 0 0.8rem;
    line-height: 1.7;
    font-size: 0.92rem;
}
.empty-coach .coach-tip {
    background: rgba(193, 148, 71, 0.1);
    border-radius: 6px;
    padding: 0.6rem 0.9rem;
    color: #78350F;
    font-size: 0.85rem;
    margin-top: 0.7rem;
    display: inline-block;
}
.empty-coach .coach-tip::before {
    content: '\F4EE';
    font-family: 'bootstrap-icons';
    margin-left: 0.4rem;
    color: #C19447;
}

/* ===== استجابة الجوال ===== */
@media (max-width: 600px) {
    .help-popover, .welcome-card {
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        margin-bottom: 0;
    }
    .welcome-header { padding: 1.5rem 1.2rem; }
    .welcome-body { padding: 1.2rem; }
    .welcome-footer { flex-direction: column-reverse; }
}
