/* US-064 Contextual Help drawer (Layout/HelpDrawer.razor) + field highlight. Global because the drawer pushes the page body,
   sits above Radzen dialogs (non-modal: the user keeps working in the dialog) and pulses inputs outside the component. */
:root {
    --hc-help-width: 440px;
    --hc-help-top: 56px;
    --hc-help-accent: #2e7d32;
    --hc-help-accent-soft: #e8f5e9;
    --hc-help-muted: #6b7280;
    --hc-help-border: #e5e7eb;
}

.hc-help-drawer {
    position: fixed;
    top: var(--hc-help-top);
    right: 0;
    bottom: 0;
    width: var(--hc-help-width);
    max-width: 100vw;
    z-index: 1105;              /* above .rz-dialog-wrapper / mask so it stays usable while a dialog is open */
    background: var(--rz-base-background-color, #fff);
    border-left: 1px solid var(--hc-help-border);
    box-shadow: -6px 0 18px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
}

.hc-help-drawer__resize {
    position: absolute;
    left: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
}

.hc-help-drawer__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem 0.4rem 1rem;
    border-bottom: 1px solid var(--hc-help-border);
}

.hc-help-drawer__title {
    flex: 1;
    min-width: 0;
    font-weight: 600;
    font-size: 1rem;
    color: var(--hc-help-accent);
}

.hc-help-drawer__kind {
    font-size: 0.7rem;
    color: var(--hc-help-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hc-help-drawer__body {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.hc-help-drawer__body .rz-tabview-panels {
    padding: 0.75rem 1rem 1.25rem;
}

.hc-help-drawer h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--hc-help-muted);
    margin: 1rem 0 0.4rem;
}

.hc-help-drawer h4:first-child { margin-top: 0; }
.hc-help-drawer p { margin: 0 0 0.5rem; line-height: 1.45; }
.hc-help-drawer ul { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.hc-help-drawer li { margin-bottom: 0.2rem; line-height: 1.4; }
.hc-help-muted { color: var(--hc-help-muted); }
.hc-help-footer { margin-top: 1rem; font-size: 0.72rem; color: var(--hc-help-muted); }

/* Rights badges: green = the user holds the right, grey = not. */
.hc-help-roles { display: flex; flex-direction: column; gap: 0.35rem; }
.hc-help-role { display: flex; gap: 0.5rem; align-items: baseline; }
.hc-help-badge {
    display: inline-block;
    flex: none;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    white-space: nowrap;
}
.hc-help-badge--on { background: var(--hc-help-accent); color: #fff; }
.hc-help-badge--off { background: #e5e7eb; color: #6b7280; }
.hc-help-role--off .hc-help-role__text { color: var(--hc-help-muted); }

/* Document flow strip: upstream -> this page -> downstream. */
.hc-help-flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 0.35rem; align-items: center; margin-bottom: 0.5rem; }
.hc-help-flow__col { display: flex; flex-direction: column; gap: 0.25rem; }
.hc-help-flow__node {
    border: 1px solid var(--hc-help-border);
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
    line-height: 1.25;
    background: #fafafa;
}
.hc-help-flow__node a { color: var(--hc-help-accent); text-decoration: none; }
.hc-help-flow__node a:hover { text-decoration: underline; }
.hc-help-flow__self {
    border: 2px solid var(--hc-help-accent);
    background: var(--hc-help-accent-soft);
    border-radius: 6px;
    padding: 0.4rem;
    font-weight: 600;
    text-align: center;
    font-size: 0.78rem;
}
.hc-help-flow__arrow { color: var(--hc-help-muted); }

/* Status stepper. */
.hc-help-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0; margin: 0.25rem 0 0.5rem; }
.hc-help-step {
    border: 1px solid #c8e6c9;
    background: #f5fbf5;
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: default;
}
.hc-help-step--current { background: var(--hc-help-accent); color: #fff; border-color: var(--hc-help-accent); box-shadow: 0 0 0 3px #a5d6a7; }
.hc-help-step--terminal { border-style: dashed; }
.hc-help-arrow { display: inline-flex; flex-direction: column; align-items: center; padding: 0 0.15rem; min-width: 3.2rem; cursor: help; }
.hc-help-arrow__label { font-size: 0.62rem; color: var(--hc-help-accent); font-weight: 600; text-align: center; line-height: 1.1; }
.hc-help-arrow svg { display: block; }
.hc-help-gap { width: 1rem; }
.hc-help-transitions { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.hc-help-transitions td { border-top: 1px solid var(--hc-help-border); padding: 0.35rem 0.25rem; vertical-align: top; }
.hc-help-transitions td:first-child { white-space: nowrap; font-weight: 600; }

/* Fields table. */
.hc-help-fields { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.hc-help-fields th { text-align: left; font-size: 0.7rem; color: var(--hc-help-muted); text-transform: uppercase; padding: 0.25rem; border-bottom: 1px solid var(--hc-help-border); }
.hc-help-fields td { padding: 0.35rem 0.25rem; vertical-align: top; }
.hc-help-fields tr.hc-help-field { cursor: pointer; }
.hc-help-fields tr.hc-help-field td { border-top: 1px solid var(--hc-help-border); }
.hc-help-fields tr.hc-help-field:hover td, .hc-help-fields tr.hc-help-field:hover + tr td { background: var(--hc-help-accent-soft); }
.hc-help-fields tr.hc-help-field--active td, .hc-help-fields tr.hc-help-field--active + tr td { background: #c8e6c9; }
.hc-help-fields td.hc-help-field__name { font-weight: 600; width: 26%; }
.hc-help-fields .hc-help-validation { color: #b45309; margin: 0; padding-left: 1rem; }
.hc-help-section-chip { display: inline-flex; gap: 0.25rem; align-items: center; background: var(--hc-help-accent-soft); color: var(--hc-help-accent); border-radius: 999px; padding: 0.1rem 0.5rem; font-size: 0.72rem; font-weight: 600; }
.hc-help-section-chip button { border: 0; background: none; color: inherit; cursor: pointer; padding: 0; font-size: 0.9rem; line-height: 1; }

/* Dependencies & effects. */
.hc-help-deps li a { color: var(--hc-help-accent); }
.hc-help-effects { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.hc-help-effects td { border-top: 1px solid var(--hc-help-border); padding: 0.3rem 0.25rem; vertical-align: top; }
.hc-help-effects td:first-child { width: 5.5rem; }
.hc-help-effects tr.hc-help-effects__action td { background: #f3f4f6; font-weight: 600; border-top: 2px solid var(--hc-help-border); }

/* Field highlight (help.js highlightField): 2-second green pulse. */
@keyframes hcHelpPulse {
    0% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.75); }
    50% { box-shadow: 0 0 0 7px rgba(46, 125, 50, 0.25); }
    100% { box-shadow: 0 0 0 0 rgba(46, 125, 50, 0); }
}
.hc-help-pulse {
    animation: hcHelpPulse 0.7s ease-out 3;
    outline: 2px solid var(--hc-help-accent) !important;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Wide screens: the page body (and centred dialogs) make room for the drawer so it never hides the form it explains. */
@media (min-width: 992px) {
    body.hc-help-open .rz-body { margin-right: var(--hc-help-width); }
    body.hc-help-open .rz-dialog-wrapper { padding-right: var(--hc-help-width); }
}

/* Phone width: full-width overlay. */
@media (max-width: 767px) {
    .hc-help-drawer { width: 100vw; left: 0; border-left: 0; }
    .hc-help-drawer__resize { display: none; }
    .hc-help-flow { grid-template-columns: 1fr; }
    .hc-help-flow__arrow { transform: rotate(90deg); justify-self: center; }
}

/* Four tabs in 440 px: compact labels so "Dependencies & effects" fits. */
.hc-help-drawer .rz-tabview-nav { flex-wrap: nowrap; }
.hc-help-drawer .rz-tabview-nav li > button { padding: 0.6rem 0.55rem; font-size: 0.72rem; white-space: nowrap; }
.hc-help-fields-btn .rz-button-icon-left { font-size: 1.1rem; }

/* US-069 help search (above the tabs) and results. */
.hc-help-search { position: relative; display: flex; align-items: center; padding: 0.5rem 0.75rem 0.5rem 1rem; border-bottom: 1px solid var(--hc-help-border); }
.hc-help-search__icon { position: absolute; left: 1.45rem; font-size: 1.1rem; color: var(--hc-help-muted); pointer-events: none; }
.hc-help-search__input { width: 100%; padding-left: 2rem !important; padding-right: 1.8rem !important; }
.hc-help-search__clear { position: absolute; right: 1.2rem; border: 0; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--hc-help-muted); }
.hc-help-results { padding: 0.75rem 1rem 1.25rem; }
.hc-help-hit { display: flex; flex-direction: column; gap: 0.15rem; width: 100%; text-align: left; background: none; border: 1px solid var(--hc-help-border);
    border-radius: 6px; padding: 0.5rem 0.65rem; margin-bottom: 0.45rem; cursor: pointer; font: inherit; color: inherit; }
.hc-help-hit:hover, .hc-help-hit:focus-visible { border-color: var(--hc-help-accent); background: rgba(46, 125, 50, 0.05); outline: none; }
.hc-help-hit__title { font-weight: 600; }
.hc-help-hit__where { font-size: 0.75rem; color: var(--hc-help-accent); }
.hc-help-hit__snippet { font-size: 0.8rem; color: var(--hc-help-muted); }
.hc-help-guide { display: flex; align-items: center; gap: 0.35rem; margin-top: 0.5rem; font-size: 0.85rem; }
.hc-help-guide .rzi { font-size: 1.1rem; color: var(--hc-help-accent); }

/* US-069 per-field tooltip icon (Shared/HelpTip.razor) next to a label. */
.hc-help-tip { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 0.25rem; cursor: help; color: var(--rz-text-secondary-color); border-radius: 50%; }
.hc-help-tip .rzi { font-size: 16px; }
.hc-help-tip:hover, .hc-help-tip:focus-visible { color: #2e7d32; outline: none; }
