/* ═══════════════════════════════════════════════════════════ */
/* V2 HELP DOCUMENTATION — Styling for in-app help pages      */
/* ═══════════════════════════════════════════════════════════ */

/* ── Modal Overlay ── */
.v2-help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.60);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.v2-help-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ── Slide-in Panel ── */
.v2-help-panel {
    position: fixed;
    top: 0;
    right: -520px;
    width: 500px;
    max-width: 92vw;
    height: 100%;
    background: #ffffff;
    z-index: 9999;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v2-help-panel.active {
    right: 0;
}

/* ── Panel Header ── */
.v2-help-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #ffffff;
    flex-shrink: 0;
}

.v2-help-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.v2-help-panel-header h3 i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.v2-help-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-help-academy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 18px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    line-height: 1;
}

.v2-help-academy-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.v2-help-close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    padding: 0;
    box-sizing: border-box;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #ffffff;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    line-height: 1;
}

.v2-help-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.v2-help-card.academy-banner {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-decoration: none;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.875rem;
}

.v2-help-card.academy-banner:hover {
    background: #dbeafe;
    color: #1d4ed8;
}

.v2-help-card.academy-banner i.icon-academy {
    font-size: 16px;
    margin-right: 6px;
}

/* ── Panel Body (Scrollable) ── */
.v2-help-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    -webkit-overflow-scrolling: touch;
}

/* ── Documentation Content Styles ── */
.v2-help-section {
    margin-bottom: 28px;
}

.v2-help-section:last-child {
    margin-bottom: 0;
}

.v2-help-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.v2-help-section-title i {
    color: #3b82f6;
    font-size: 1.1rem;
}

.v2-help-text {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #475569;
    margin: 0 0 10px 0;
}

/* ── Help Cards (tips, warnings) ── */
.v2-help-card {
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-left: 3px solid #3b82f6;
}

.v2-help-card.tip {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.v2-help-card.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.v2-help-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.v2-help-card p {
    font-size: 0.85rem;
    line-height: 1.55;
    color: #64748b;
    margin: 0;
}

/* ── Step Lists ── */
.v2-help-steps {
    list-style: none;
    padding: 0;
    margin: 0 0 12px 0;
    counter-reset: help-step;
}

.v2-help-steps li {
    counter-increment: help-step;
    padding: 10px 12px 10px 44px;
    position: relative;
    font-size: 0.86rem;
    line-height: 1.55;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}

.v2-help-steps li:last-child {
    border-bottom: none;
}

.v2-help-steps li strong {
    color: #0f172a;
    font-weight: 700;
}

.v2-help-steps li::before {
    content: counter(help-step);
    position: absolute;
    left: 8px;
    top: 10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #3b82f6;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Field descriptions ── */
.v2-help-field-list {
    margin: 0 0 12px 0;
    padding: 0;
    list-style: none;
}

.v2-help-field-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #475569;
}

.v2-help-field-list li:last-child {
    border-bottom: none;
}

.v2-help-field-name {
    font-weight: 700;
    color: #1e293b;
}

/* ── User Permissions Strip & Dynamic Rights Bar ── */
.v2-help-rights-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-help-rights-title {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.v2-help-rights-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.v2-help-right-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 600;
}

.v2-help-right-badge.is-allowed {
    background: #dcfce7;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.v2-help-right-badge.is-denied {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    opacity: 0.75;
}

.v2-help-forbidden-box {
    text-align: center;
    padding: 50px 24px;
    background: #ffffff;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    margin-top: 20px;
}

.v2-help-forbidden-icon {
    font-size: 2.4rem;
    color: #ef4444;
    margin-bottom: 12px;
}

.v2-help-forbidden-box h4 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #991b1b;
    margin: 0 0 8px 0;
}

.v2-help-forbidden-box p {
    font-size: 0.9rem;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

/* ── Keyboard shortcuts / badges ── */
.v2-help-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.v2-help-badge.blue {
    background: #dbeafe;
    color: #1d4ed8;
}

.v2-help-badge.green {
    background: #dcfce7;
    color: #16a34a;
}

.v2-help-badge.red {
    background: #fee2e2;
    color: #dc2626;
}

.v2-help-badge.amber {
    background: #fef3c7;
    color: #d97706;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .v2-help-panel {
        width: 100%;
        max-width: 100vw;
        right: -100%;
    }

    .v2-help-panel-body {
        padding: 16px;
    }

    .v2-help-section-title {
        font-size: 0.92rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HIGH-VISIBILITY HELP BUTTON (Exact CRM Feature Orange + Double-Pulse Beacon)
   ═══════════════════════════════════════════════════════════════ */
.v2-btn-help,
[data-action="showHelp"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: #ffffff !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    font-family: inherit !important;
    line-height: 1 !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45) !important;
    animation: v2-help-beacon 1.8s infinite ease-in-out !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.v2-btn-help i,
[data-action="showHelp"] i {
    color: #ffffff !important;
    font-size: 1rem !important;
}

.v2-btn-help:hover,
[data-action="showHelp"]:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #ffffff !important;
    border-color: #ffffff !important;
    transform: scale(1.2) !important;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.95), 0 4px 12px rgba(0, 0, 0, 0.2) !important;
    animation: none !important;
}

.v2-btn-help:active,
[data-action="showHelp"]:active {
    transform: scale(0.95) !important;
}

/* Pulsing radar/beacon animation: double-pulse flash cycle for immediate peripheral spotting */
@keyframes v2-help-beacon {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
        transform: scale(1);
        filter: brightness(1);
    }
    20% {
        box-shadow: 0 0 0 7px rgba(245, 158, 11, 0.35), 0 0 16px rgba(245, 158, 11, 0.85);
        transform: scale(1.14);
        filter: brightness(1.22);
    }
    40% {
        box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15), 0 2px 8px rgba(245, 158, 11, 0.45);
        transform: scale(1.03);
        filter: brightness(1.05);
    }
    60% {
        box-shadow: 0 0 0 7px rgba(245, 158, 11, 0.35), 0 0 16px rgba(245, 158, 11, 0.85);
        transform: scale(1.14);
        filter: brightness(1.22);
    }
    80% {
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.45);
        transform: scale(1);
        filter: brightness(1);
    }
}

@media (max-width: 768px) {
    .v2-btn-help,
    [data-action="showHelp"] {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        font-size: 1rem !important;
    }
}