/* =====================================================
   INRADR — Product tour — Driver.js 1.8.0 adapter (vendor sheet linked right before this file)
   inradr-feature layer (adapter): DevExpress / XAF / vendor selectors and tokens only.
   Maps inradr-design values (var(--inradr-*)) onto the framework; no new base values and
   no hex literals. Internal --dxbl-* tokens are set on the element that declares them and
   carry "re-verify on DX upgrade" (full list: inradr-feature/README.md).
   Never target a bare .dxbl-modal (it also matches the XAF skip link).
   ===================================================== */

/* Driver.js 1.8.0 skin (A 72b8dc3 values). driver.css is flat (0,1,0 / 0,2,0) and sets all:unset on
   .driver-popover, the close and the footer buttons; custom properties survive that, and every rule
   here beats it (0,2,0 on the container, later in the cascade). DOM per the 26.1 capture "Driver.js
   popover (WP-18)": div.driver-popover.inradr-tour-popover > close button, arrow, header title,
   description, footer (progress text + navigation buttons).
   The JS module focuses "Weiter" on every step, so backgrounds change on :hover only and keyboard
   focus shows through :focus-visible; otherwise "Weiter" would always look hovered. */

/* ── Popover ─────────────────────────────────────────────────────── */

/* --driver-popover-font-family is Driver.js' public hook (read by .driver-popover in driver.css);
   the buttons inherit the family through all:unset. Layer: above DevExpress popups (1050+), below
   XAF alerts (31000), the loading indicator, #blazor-error-ui and the reconnect dialog. */
.driver-popover.inradr-tour-popover {
    --driver-popover-font-family: var(--inradr-font-body);
    background-color: var(--inradr-color-surface);
    color: var(--inradr-color-text-primary);
    border: 1px solid var(--inradr-color-border);
    border-radius: var(--inradr-radius-md); /* dialogs, per inradr-radius.css */
    box-shadow: var(--inradr-elevation-3-shadow);
    padding: var(--inradr-space-sm);
    min-width: 280px;
    max-width: 360px;
    z-index: calc(var(--inradr-layer-tour) + 1);
}

.inradr-tour-popover .driver-popover-title {
    font-family: var(--inradr-font-heading);
    font-size: var(--inradr-text-h3-size);
    font-weight: var(--inradr-text-body-strong-weight);
    line-height: var(--inradr-text-h3-line-height);
    color: var(--inradr-color-text-heading);
    padding-right: var(--inradr-space-md); /* room for the close button */
}

.inradr-tour-popover .driver-popover-description {
    font-size: var(--inradr-text-body-size);
    font-weight: var(--inradr-text-body-weight);
    line-height: var(--inradr-text-body-line-height);
    color: var(--inradr-color-text-primary);
}

.inradr-tour-popover .driver-popover-footer {
    margin-top: var(--inradr-space-sm);
    gap: var(--inradr-space-xs);
}

/* text-body, not text-muted: muted misses AA on white. */
.inradr-tour-popover .driver-popover-progress-text {
    font-size: var(--inradr-text-caption-size);
    line-height: var(--inradr-text-caption-line-height);
    color: var(--inradr-color-text-body);
}

/* ── Close button ("×", aria-label set by the JS module) ────────────
   driver.css colours :hover and :focus at 0,2,0; this rule wins the :focus case by order, the
   :hover rule below by specificity. */
.inradr-tour-popover .driver-popover-close-btn {
    color: var(--inradr-color-text-body);
    border-radius: var(--inradr-radius-sm);
}

.inradr-tour-popover .driver-popover-close-btn:hover {
    color: var(--inradr-color-text-primary);
}

/* ── Footer buttons: "Weiter"/"Fertig" filled accent, "Zurück" outlined ──
   driver.css paints :hover and :focus light grey at 0,2,0; the base rule resets that by order. The
   hover rules sit at 0,4,0 (above the next button's fill), the next button's hover comes last. The
   disabled "Zurück" keeps driver.css' opacity and pointer-events:none. */
.inradr-tour-popover .driver-popover-footer-btn {
    font-size: var(--inradr-text-body-size);
    font-weight: var(--inradr-text-body-strong-weight);
    line-height: var(--inradr-text-body-line-height);
    padding: var(--inradr-space-xxs) var(--inradr-space-2xs);
    border-radius: var(--inradr-radius-sm);
    border: 1px solid var(--inradr-color-accent);
    background-color: transparent;
    color: var(--inradr-color-accent);
    text-shadow: none;
}

.inradr-tour-popover .driver-popover-footer .driver-popover-footer-btn:hover {
    background-color: var(--inradr-color-accent-tint-8);
}

/* Driver.js puts "Fertig" into the next button on the last step. */
.inradr-tour-popover .driver-popover-footer .driver-popover-next-btn {
    background-color: var(--inradr-color-accent);
    border-color: var(--inradr-color-accent);
    color: var(--inradr-color-text-on-navy);
}

.inradr-tour-popover .driver-popover-footer .driver-popover-next-btn:hover {
    background-color: var(--inradr-color-accent-hover);
    border-color: var(--inradr-color-accent-hover);
}

/* Own element: accent ring (OQ-02). driver.css sets outline:0 on the footer buttons. */
.inradr-tour-popover .driver-popover-footer-btn:focus-visible,
.inradr-tour-popover .driver-popover-close-btn:focus-visible {
    outline: var(--inradr-focus-ring-width) solid var(--inradr-focus-ring-color);
    outline-offset: var(--inradr-focus-ring-offset);
}

/* ── Arrow ───────────────────────────────────────────────────────────
   The visible colour of the arrow is border-<side>-color of its side class. Never set the
   border-color shorthand on .driver-popover-arrow: the arrow would turn into a square. */
.inradr-tour-popover .driver-popover-arrow-side-left {
    border-left-color: var(--inradr-color-surface);
}

.inradr-tour-popover .driver-popover-arrow-side-right {
    border-right-color: var(--inradr-color-surface);
}

.inradr-tour-popover .driver-popover-arrow-side-top {
    border-top-color: var(--inradr-color-surface);
}

.inradr-tour-popover .driver-popover-arrow-side-bottom {
    border-bottom-color: var(--inradr-color-surface);
}

/* ── Overlay ─────────────────────────────────────────────────────────
   The scrim colour is --inradr-color-backdrop, which the JS module reads and hands to Driver.js. */
.driver-overlay {
    /* !important: Driver.js writes z-index:10000 as an inline style on the overlay svg. */
    z-index: var(--inradr-layer-tour) !important;
}

/* ── Interaction during a tour ───────────────────────────────────────
   driver.css makes everything but the highlighted element and the popover unclickable
   (.driver-active * {pointer-events:none}, 0,1,0, loaded after XAF styles.css). */

/* The highlighted element is explained, not operated (disableActiveInteraction). driver.css enforces
   that at 0,1,0 only; any later !important pointer-events rule with a higher specificity would open
   the hole in the overlay and let Driver.js' tab trap (it checks computed pointer-events) move focus
   into the target. Specificity here: 0,3,2. */
html body.driver-active .driver-active-element.driver-no-interaction,
html body.driver-active .driver-active-element.driver-no-interaction * {
    /* !important: must outrank driver.css' own !important on .driver-no-interaction (vendor sheet). */
    pointer-events: none !important;
}

/* The Blazor error UI (shown by blazor.server.js, OQ-33) and the reconnect dialog (a shadow host;
   pointer-events inherit into the shadow tree) must stay operable.
   ANNAHME (WP-00): #components-reconnect-modal is not in any 26.1 capture (Blazor injects it on
   disconnect; id per XAF styles.css 26.1.4). */
.driver-active #blazor-error-ui,
.driver-active #blazor-error-ui *,
.driver-active #components-reconnect-modal,
.driver-active #components-reconnect-modal * {
    pointer-events: auto;
}

/* XAF alerts (validation and error messages) sit above the overlay and must stay closable: XAF's
   ".xaf-alerts-stack-scrollable {pointer-events:all}" and ".xaf-alert {pointer-events:all}" lose to
   the later driver.css at equal specificity, and the close and action buttons have no rule at all.
   0,2,0 beats ".driver-active *". The stack itself keeps pointer-events:none, so clicks beside the
   alerts still reach the overlay. The summary alert ("Close all"/"Show all") is a sibling of the
   scrollable list inside .xaf-alerts-stack-inner (XAF 26.1 AlertsHandler.razor, AlertSummary.razor).
   DOM: capture "Alert stack with a validation alert (WP-09, WP-18)": .xaf-alerts-stack-inner >
   .xaf-alerts-stack-scrollable + div.xaf-alert-summary. */
.driver-active .xaf-alerts-stack-scrollable,
.driver-active .xaf-alerts-stack-scrollable *,
.driver-active .xaf-alerts-stack-inner > .xaf-alert-summary,
.driver-active .xaf-alerts-stack-inner > .xaf-alert-summary * {
    pointer-events: auto;
}
