/* ═══ Portal Help Tooltip System ═══ */

/* Help icon button - small ? next to section titles */
.help-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid var(--portal-accent, #6c63ff);
    background: rgba(108, 99, 255, 0.1);
    color: var(--portal-accent, #6c63ff);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    margin-inline-start: 8px;
    transition: all 0.2s ease;
    vertical-align: middle;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
}

.help-icon-btn:hover {
    background: var(--portal-accent, #6c63ff);
    color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(108, 99, 255, 0.4);
}

.help-icon-btn svg {
    width: 14px;
    height: 14px;
}

/* Help Modal Overlay */
.help-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: helpFadeIn 0.2s ease;
}

.help-modal-overlay.active {
    display: flex;
}

@keyframes helpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Help Modal Card */
.help-modal {
    width: 100%;
    max-width: 520px;
    max-height: 80vh;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: helpSlideUp 0.25s ease;
}

@keyframes helpSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.help-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border-glass, rgba(255, 255, 255, 0.08));
}

.help-modal-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.help-modal-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--portal-accent, #6c63ff), #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.help-modal-icon svg {
    width: 20px;
    height: 20px;
}

.help-modal-header h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.help-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
}

.help-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
}

.help-modal-close svg {
    width: 18px;
    height: 18px;
}

/* Body */
.help-modal-body {
    padding: 20px 22px 24px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-secondary, #94a3b8);
    direction: rtl;
    text-align: right;
}

[dir="ltr"] .help-modal-body {
    direction: ltr;
    text-align: left;
}

.help-modal-body p {
    margin: 0 0 12px;
}

.help-modal-body p:last-child {
    margin-bottom: 0;
}

.help-modal-body ul {
    margin: 8px 0 12px;
    padding-inline-start: 20px;
}

.help-modal-body li {
    margin-bottom: 6px;
}

.help-modal-body strong {
    color: var(--text-primary, #fff);
    font-weight: 600;
}

.help-modal-body .help-highlight {
    color: var(--portal-accent, #6c63ff);
    font-weight: 600;
}

.help-modal-body .help-tip {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: rgba(108, 99, 255, 0.08);
    border: 1px solid rgba(108, 99, 255, 0.15);
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 12px;
    font-size: 0.84rem;
}

.help-modal-body .help-tip-icon {
    color: var(--portal-accent, #6c63ff);
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Responsive */
@media (max-width: 600px) {
    .help-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 14px;
    }

    .help-modal-header {
        padding: 14px 16px;
    }

    .help-modal-body {
        padding: 16px;
    }

    .help-icon-btn {
        width: 20px;
        height: 20px;
        margin-inline-start: 6px;
    }

    .help-icon-btn svg {
        width: 12px;
        height: 12px;
    }
}
