/* onboarding.css — YallaTonight interactive guided walkthrough (self-contained).
 *
 * A tiny spotlight-tour engine's styling. Deliberately NOT dependent on the site
 * design tokens so the exact same tour renders correctly on every surface
 * (customer, partner day/night, admin HUD, standalone door scanner). Colours are
 * explicit; only the accent is themed per-tour via the inline --ytob-accent var.
 * All classes are prefixed .ytob- to avoid any collision. Fully RTL-safe (logical
 * properties) and mobile-safe (popover becomes a bottom sheet on small screens).
 */

.ytob-root {
    --ytob-accent: #7c3aed;
    --ytob-surface: #14121f;
    --ytob-surface-2: #1d1a2b;
    --ytob-text: #f5f4fb;
    --ytob-text-dim: #a9a4c0;
    --ytob-border: rgba(255, 255, 255, 0.10);
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    pointer-events: none;                 /* children opt back in */
    font-family: 'Inter', 'Noto Kufi Arabic', system-ui, sans-serif;
}
.ytob-root[hidden] { display: none; }

/* ── Backdrop that blocks interaction with the page behind the tour ── */
.ytob-blocker {
    position: fixed;
    inset: 0;
    pointer-events: auto;                 /* swallow clicks on the page */
    background: transparent;              /* darkening comes from the spotlight */
    -webkit-tap-highlight-color: transparent;
}
/* No target for a step → dim the whole screen and centre the popover. */
.ytob-root.ytob-centered .ytob-blocker { background: rgba(4, 3, 12, 0.72); }

/* ── The spotlight cutout: a positioned box whose massive spread shadow darkens
   everything except the highlighted element. ── */
.ytob-spot {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(4, 3, 12, 0.68);
    outline: 2px solid var(--ytob-accent);
    outline-offset: 2px;
    pointer-events: none;
    transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.ytob-root.ytob-centered .ytob-spot { display: none; }

/* ── Popover card ── */
.ytob-pop {
    position: absolute;
    width: min(340px, calc(100vw - 32px));
    background: var(--ytob-surface);
    color: var(--ytob-text);
    border: 1px solid var(--ytob-border);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55),
                0 0 0 1px rgba(255, 255, 255, 0.02),
                0 0 40px -8px var(--ytob-accent);
    padding: 20px 20px 16px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-sizing: border-box;
}
.ytob-pop.ytob-show { opacity: 1; transform: translateY(0); }
.ytob-root.ytob-centered .ytob-pop {
    position: fixed;
    inset-inline: 0;
    margin-inline: auto;
    top: 50%;
    transform: translateY(-50%);
}
.ytob-root.ytob-centered .ytob-pop.ytob-show { transform: translateY(-50%); }

/* Arrow pointing at the highlighted element (hidden in centred mode). */
.ytob-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--ytob-surface);
    border: 1px solid var(--ytob-border);
    transform: rotate(45deg);
    z-index: -1;
}
.ytob-root.ytob-centered .ytob-arrow { display: none; }

/* ── Header ── */
.ytob-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-inline-end: 26px;             /* room for the close X */
}
.ytob-ico {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--ytob-accent);
    background: color-mix(in srgb, var(--ytob-accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--ytob-accent) 32%, transparent);
}
.ytob-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    font-family: 'Space Grotesk', 'Noto Kufi Arabic', system-ui, sans-serif;
}
.ytob-body {
    margin: 0 0 14px;
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--ytob-text-dim);
}

/* ── Close (X) ── */
.ytob-x {
    position: absolute;
    top: 12px;
    inset-inline-end: 12px;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ytob-text-dim);
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.ytob-x:hover { background: var(--ytob-surface-2); color: var(--ytob-text); }

/* ── Progress dots ── */
.ytob-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.ytob-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ytob-border);
    transition: background 0.25s, width 0.25s;
}
.ytob-dot.ytob-dot-on { background: var(--ytob-accent); width: 18px; border-radius: 4px; }
.ytob-dot.ytob-dot-done { background: color-mix(in srgb, var(--ytob-accent) 55%, transparent); }

/* ── Footer / actions ── */
.ytob-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.ytob-count {
    font-size: 0.76rem;
    color: var(--ytob-text-dim);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.ytob-actions { display: flex; align-items: center; gap: 8px; }
.ytob-btn {
    appearance: none;
    border: 1px solid var(--ytob-border);
    background: var(--ytob-surface-2);
    color: var(--ytob-text);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}
.ytob-btn:hover { transform: translateY(-1px); }
.ytob-btn:active { transform: translateY(0); }
.ytob-btn:focus-visible { outline: 2px solid var(--ytob-accent); outline-offset: 2px; }
.ytob-btn-ghost { background: transparent; color: var(--ytob-text-dim); border-color: transparent; }
.ytob-btn-ghost:hover { color: var(--ytob-text); background: var(--ytob-surface-2); }
.ytob-btn-primary {
    background: var(--ytob-accent);
    border-color: var(--ytob-accent);
    color: #fff;
    box-shadow: 0 4px 16px -4px var(--ytob-accent);
}
.ytob-btn-primary:hover { box-shadow: 0 8px 24px -6px var(--ytob-accent); }

/* ── Floating "Help / Guide" replay button ── */
.ytob-help-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;                           /* physical left in BOTH directions — the
                                             AI concierge / support widgets sit bottom
                                             -right, so this never collides (incl. RTL) */
    z-index: 2147482000;                  /* just under an active tour */
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--ytob-help-accent, #7c3aed) 45%, transparent);
    background: #14121f;
    color: var(--ytob-help-accent, #7c3aed);
    font-size: 1.05rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ytob-help-btn:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 30px -4px var(--ytob-help-accent, #7c3aed);
}
.ytob-help-btn:focus-visible { outline: 2px solid var(--ytob-help-accent, #7c3aed); outline-offset: 3px; }
/* A small pulse ring the first time, to hint it exists. */
.ytob-help-btn .ytob-help-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 2px solid var(--ytob-help-accent, #7c3aed);
    opacity: 0;
    pointer-events: none;
}
.ytob-help-btn.ytob-pulse .ytob-help-ring { animation: ytobPulse 2.2s ease-out 3; }
@keyframes ytobPulse {
    0%   { opacity: 0.6; transform: scale(0.9); }
    100% { opacity: 0;   transform: scale(1.6); }
}

/* ── Mobile: popover becomes a bottom sheet, always readable ── */
@media (max-width: 640px) {
    .ytob-pop,
    .ytob-root.ytob-centered .ytob-pop {
        position: fixed;
        inset-inline: 12px;
        top: auto;
        bottom: 12px;
        width: auto;
        margin-inline: 0;
        transform: translateY(8px);
        max-height: 70vh;
        overflow-y: auto;
    }
    .ytob-pop.ytob-show,
    .ytob-root.ytob-centered .ytob-pop.ytob-show { transform: translateY(0); }
    .ytob-arrow { display: none; }
    .ytob-help-btn { bottom: 84px; }      /* clear the customer mobile bottom bar */
}

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .ytob-spot, .ytob-pop, .ytob-btn, .ytob-help-btn, .ytob-dot { transition: none; }
    .ytob-help-btn.ytob-pulse .ytob-help-ring { animation: none; }
}
