/*
|--------------------------------------------------------------------------
| OperaFlow Design System V2 — Contextual Help
|--------------------------------------------------------------------------
| File: public/assets/css/operaflow-v2/components/help.css
|--------------------------------------------------------------------------
*/

/*
|--------------------------------------------------------------------------
| Floating help trigger
|--------------------------------------------------------------------------
*/

.of-help-btn {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: var(--of-z-toast);

    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 3.25rem;
    padding: 0 1.125rem;
    gap: var(--of-space-2);

    background:
        linear-gradient(
            135deg,
            #0f172a,
            #1e3a8a 48%,
            #0284c7
        );

    color: #ffffff;

    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: var(--of-radius-pill);

    font-size: var(--of-font-size-sm);
    font-weight: var(--of-font-weight-black);
    letter-spacing: 0.04em;

    cursor: pointer;

    box-shadow:
        0 18px 44px rgba(2, 132, 199, 0.28),
        0 8px 18px rgba(15, 23, 42, 0.2);

    transition:
        transform var(--of-transition-fast),
        box-shadow var(--of-transition-fast);
}

.of-help-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 24px 56px rgba(2, 132, 199, 0.34),
        0 10px 24px rgba(15, 23, 42, 0.26);
}

.of-help-btn > span:first-child {
    display: inline-grid;
    place-items: center;

    width: 1.75rem;
    height: 1.75rem;

    background: rgba(255, 255, 255, 0.16);

    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--of-radius-pill);

    font-size: 1rem;
    font-weight: var(--of-font-weight-black);
}

/*
|--------------------------------------------------------------------------
| Modal backdrop
|--------------------------------------------------------------------------
*/

.of-help-backdrop {
    position: fixed;
    inset: 0;
    z-index: calc(var(--of-z-toast) + 1);

    display: none;

    padding: var(--of-space-6);

    background: rgba(15, 23, 42, 0.64);

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.of-help-backdrop.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/*
|--------------------------------------------------------------------------
| Modal
|--------------------------------------------------------------------------
*/

.of-help-modal {
    width: min(61.25rem, 96vw);
    max-height: 88vh;
    overflow: hidden;

    background: var(--of-modal-bg);
    color: var(--of-text-primary);

    border: 1px solid var(--of-modal-border);
    border-radius: var(--of-radius-2xl);

    box-shadow: var(--of-shadow-lg);
}

.of-help-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    padding: var(--of-space-6);
    gap: var(--of-space-5);

    background:
        radial-gradient(
            circle at top left,
            var(--of-primary-soft-bg),
            transparent 36%
        ),
        var(--of-surface-1);

    border-bottom: 1px solid var(--of-border-default);
}

.of-help-kicker {
    display: inline-flex;
    align-items: center;

    min-height: 1.75rem;
    margin-bottom: var(--of-space-3);
    padding: 0 var(--of-space-3);
    gap: var(--of-space-2);

    background: var(--of-primary-soft-bg);
    color: var(--of-primary-soft-text);

    border: 1px solid var(--of-primary-soft-border);
    border-radius: var(--of-radius-pill);

    font-size: var(--of-font-size-xs);
    font-weight: var(--of-font-weight-black);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.of-help-title {
    margin: 0;

    color: var(--of-text-primary);

    font-size: var(--of-font-size-2xl);
    font-weight: var(--of-font-weight-black);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.of-help-subtitle {
    max-width: 45rem;
    margin-top: var(--of-space-2);

    color: var(--of-text-muted);

    font-size: var(--of-font-size-sm);
    line-height: var(--of-line-height-relaxed);
}

.of-help-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 2.5rem;
    height: 2.5rem;
    flex: 0 0 2.5rem;

    background: var(--of-secondary-bg);
    color: var(--of-secondary-text);

    border: 1px solid var(--of-secondary-border);
    border-radius: var(--of-radius-md);

    font-size: 1.375rem;
    line-height: 1;

    cursor: pointer;
}

.of-help-close:hover {
    background: var(--of-secondary-bg-hover);
}

/*
|--------------------------------------------------------------------------
| Modal content
|--------------------------------------------------------------------------
*/

.of-help-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    max-height: calc(88vh - 9.375rem);
    padding: var(--of-space-5);
    gap: var(--of-space-4);
    overflow: auto;

    background: var(--of-page-bg-soft);
}

.of-help-card {
    padding: var(--of-space-5);

    background: var(--of-surface-1);

    border: 1px solid var(--of-border-default);
    border-radius: var(--of-radius-xl);

    box-shadow: var(--of-shadow-sm);
}

.of-help-card.full {
    grid-column: 1 / -1;
}

.of-help-card h3 {
    display: flex;
    align-items: center;

    margin: 0 0 var(--of-space-3);
    gap: var(--of-space-2);

    color: var(--of-text-primary);

    font-size: var(--of-font-size-md);
    font-weight: var(--of-font-weight-black);
}

.of-help-card h3::before {
    content: "";

    width: 0.5625rem;
    height: 0.5625rem;
    flex: 0 0 0.5625rem;

    background: var(--of-primary);

    border-radius: var(--of-radius-pill);

    box-shadow: 0 0 0 5px var(--of-primary-soft-bg);
}

.of-help-list {
    margin: 0;
    padding: 0;

    color: var(--of-text-secondary);

    font-size: var(--of-font-size-sm);
    line-height: var(--of-line-height-relaxed);

    list-style: none;
}

.of-help-list li {
    position: relative;

    padding:
        var(--of-space-3)
        0
        var(--of-space-3)
        1.875rem;

    border-top: 1px solid var(--of-border-subtle);
}

.of-help-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.of-help-list li::before {
    content: "✓";

    position: absolute;
    top: var(--of-space-3);
    left: 0;

    display: grid;
    place-items: center;

    width: 1.25rem;
    height: 1.25rem;

    background: var(--of-info-bg);
    color: var(--of-info-text);

    border-radius: var(--of-radius-pill);

    font-size: var(--of-font-size-xs);
    font-weight: var(--of-font-weight-black);
}

.of-help-list li:first-child::before {
    top: 0;
}

/*
|--------------------------------------------------------------------------
| Responsive
|--------------------------------------------------------------------------
*/

@media (max-width: 760px) {
    .of-help-btn {
        right: 0.875rem;
        bottom: 0.875rem;
        top: auto;
        left: auto;
    
        width: 3rem;
        height: 3rem;
        min-width: 3rem;
        min-height: 3rem;
        padding: 0;
    
        border-radius: 999px;
    }
    
    .of-help-btn > span:first-child {
        width: 1.75rem;
        height: 1.75rem;
    }
    
    .of-help-btn > span:last-child {
        display: none;
    }

    .of-help-backdrop {
        padding: var(--of-space-3);
    }

    .of-help-modal {
        width: 100%;
        max-height: 94vh;
        border-radius: var(--of-radius-xl);
    }

    .of-help-head {
        padding: var(--of-space-4);
    }

    .of-help-body {
        grid-template-columns: 1fr;

        max-height: calc(94vh - 8rem);
        padding: var(--of-space-3);
    }

    .of-help-card.full {
        grid-column: auto;
    }
}

/*
|--------------------------------------------------------------------------
| Print
|--------------------------------------------------------------------------
*/

@media print {
    body * {
        visibility: hidden;
    }

    .of-help-modal,
    .of-help-modal * {
        visibility: visible;
    }

    .of-help-backdrop {
        position: static;

        display: block !important;
        padding: 0;

        background: #ffffff;
    }

    .of-help-modal {
        width: 100%;
        max-height: none;

        border: 0;
        box-shadow: none;
    }

    .of-help-close {
        display: none;
    }
}