/* =============================================================
   rda_onboarding.css
   -------------------------------------------------------------
   Estilos del tour interactivo (RDAOnboarding) y de los tooltips
   contextuales con boton '?'. Sin dependencias externas.

   Paleta alineada con data_shell.css:
     fondo card oscuro : #0F1E22
     borde teal        : #134E4A
     teal claro        : #7FD4D4 / #2DD4BF
     ambar accent      : #F59E0B
   ============================================================= */

/* ---------- Overlay del tour ---------- */
.rda-tour-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 12, 0.25);
    z-index: 9998;
    pointer-events: none;
    /* default: invisible y NO captura clicks */
    transition: opacity 180ms ease-out;
    opacity: 0;
}

.rda-tour-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Hueco recortado sobre el anchor (efecto spotlight). Lo usamos
   con una "cuarto-overlay" en lugar de SVG masks por simplicidad. */
.rda-tour-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: 8px;
    box-shadow:
        0 0 0 4px rgba(45, 212, 191, 0.55),
        0 0 0 9999px rgba(2, 8, 12, 0.67);
    pointer-events: none;
    transition: top 220ms ease, left 220ms ease, width 220ms ease, height 220ms ease;
}

/* ---------- Globo (popover) del tour ---------- */
.rda-tour-pop {
    position: fixed;
    z-index: 10000;
    max-width: 360px;
    min-width: 280px;
    background: #0F1E22;
    border: 1px solid #134E4A;
    border-radius: 10px;
    color: #E6FAF7;
    padding: 14px 16px 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 180ms ease-out, transform 180ms ease-out;
    pointer-events: none;
    /* default: NO captura clicks fuera del tour */
}

.rda-tour-pop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.rda-tour-pop .rda-tour-title {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 700;
    color: #7FD4D4;
    letter-spacing: 0.3px;
}

.rda-tour-pop .rda-tour-body {
    margin: 0 0 12px 0;
    color: #C7E9E5;
}

.rda-tour-pop .rda-tour-body p {
    margin: 0 0 6px 0;
}

.rda-tour-pop .rda-tour-body ul {
    margin: 4px 0 4px 0;
    padding-left: 18px;
}

.rda-tour-pop .rda-tour-body li {
    margin: 2px 0;
}

.rda-tour-pop .rda-tour-body strong {
    color: #FCD34D;
}

.rda-tour-pop .rda-tour-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(45, 212, 191, 0.15);
}

.rda-tour-pop .rda-tour-progress {
    font-size: 11px;
    color: #7FD4D4;
    opacity: 0.75;
    letter-spacing: 0.4px;
}

.rda-tour-pop .rda-tour-buttons {
    display: inline-flex;
    gap: 6px;
}

.rda-tour-pop button {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #134E4A;
    background: #0B1518;
    color: #C7E9E5;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: background 120ms ease, border-color 120ms ease;
}

.rda-tour-pop button:hover {
    background: #134E4A;
    border-color: #2DD4BF;
}

.rda-tour-pop button.primary {
    background: #2DD4BF;
    border-color: #2DD4BF;
    color: #062023;
}

.rda-tour-pop button.primary:hover {
    background: #36E1CB;
    border-color: #36E1CB;
}

.rda-tour-pop button.ghost {
    background: transparent;
    border-color: transparent;
    color: #7FD4D4;
}

.rda-tour-pop button.ghost:hover {
    color: #FCD34D;
    background: transparent;
}

.rda-tour-pop button[disabled] {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Boton X flotante (cerrar) en la esquina superior derecha del popover.
   Fix 2026-05-19: siempre visible para garantizar salida del tour aunque
   el popover quede mal posicionado o detras de un overlay del host Qt. */
.rda-tour-pop .rda-tour-close-x {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    padding: 0;
    line-height: 1;
    font-size: 16px;
    font-weight: 700;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: #7FD4D4;
    cursor: pointer;
    z-index: 2;
}

.rda-tour-pop .rda-tour-close-x:hover {
    background: rgba(252, 211, 77, 0.12);
    border-color: #FCD34D;
    color: #FCD34D;
}

/* Flecha del popover. Aplicada segun el lado: top|bottom|left|right. */
.rda-tour-pop[data-side="bottom"]::before,
.rda-tour-pop[data-side="top"]::before,
.rda-tour-pop[data-side="left"]::before,
.rda-tour-pop[data-side="right"]::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
}

.rda-tour-pop[data-side="bottom"]::before {
    top: -16px;
    left: 24px;
    border-bottom-color: #0F1E22;
}

.rda-tour-pop[data-side="top"]::before {
    bottom: -16px;
    left: 24px;
    border-top-color: #0F1E22;
}

.rda-tour-pop[data-side="right"]::before {
    left: -16px;
    top: 16px;
    border-right-color: #0F1E22;
}

.rda-tour-pop[data-side="left"]::before {
    right: -16px;
    top: 16px;
    border-left-color: #0F1E22;
}

/* Variante: paso centrado (sin anchor, ej. bienvenida y cierre). */
.rda-tour-pop.centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 4px));
}

.rda-tour-pop.centered.visible {
    transform: translate(-50%, -50%);
}

.rda-tour-pop.centered::before {
    display: none;
}

/* ---------- Boton '?' contextual ---------- */
.rda-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(45, 212, 191, 0.12);
    color: #7FD4D4;
    border: 1px solid rgba(45, 212, 191, 0.35);
    font-size: 11px;
    font-weight: 700;
    cursor: help;
    margin-left: 6px;
    padding: 0;
    line-height: 1;
    vertical-align: middle;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
    font-family: inherit;
}

.rda-help-btn:hover,
.rda-help-btn:focus {
    outline: none;
    background: #2DD4BF;
    color: #062023;
    border-color: #2DD4BF;
}

/* Tooltip que aparece al pasar/click sobre '?' */
.rda-help-tip {
    position: fixed;
    z-index: 10001;
    max-width: 280px;
    background: #0F1E22;
    border: 1px solid #134E4A;
    border-radius: 8px;
    padding: 10px 12px;
    color: #C7E9E5;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.rda-help-tip.visible {
    opacity: 1;
    transform: translateY(0);
}

.rda-help-tip strong {
    color: #FCD34D;
}

.rda-help-tip code {
    background: rgba(45, 212, 191, 0.12);
    color: #7FD4D4;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 11px;
}

/* ---------- Pulso de resaltado sobre cualquier anchor ---------- */
@keyframes rda-tour-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(45, 212, 191, 0.55);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(45, 212, 191, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(45, 212, 191, 0);
    }
}

.rda-tour-pulse {
    animation: rda-tour-pulse 1.4s ease-out 2;
    border-radius: 6px;
}

/* =============================================================
   FAB "?" abajo-derecha + mini-menu (Iniciar tour / Senalar)
   ============================================================= */
.rda-help-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9990;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #2DD4BF;
    background: #0F1E22;
    color: #2DD4BF;
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 0 0 rgba(45, 212, 191, 0.35);
    transition: transform 140ms ease, box-shadow 200ms ease, background 140ms ease, color 140ms ease;
}

.rda-help-fab:hover,
.rda-help-fab:focus {
    outline: none;
    transform: translateY(-2px);
    background: #134E4A;
    color: #7FD4D4;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 6px rgba(45, 212, 191, 0.12);
}

.rda-help-fab.open {
    background: #2DD4BF;
    color: #062023;
    border-color: #2DD4BF;
}

.rda-help-fab-menu {
    position: fixed;
    z-index: 9991;
    min-width: 240px;
    background: #0F1E22;
    border: 1px solid #134E4A;
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 140ms ease, transform 140ms ease;
}

.rda-help-fab-menu.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.rda-help-fab-menu button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #C7E9E5;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.rda-help-fab-menu button:hover,
.rda-help-fab-menu button:focus {
    outline: none;
    background: #134E4A;
}

.rda-help-fab-menu button .ic {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #134E4A;
    color: #2DD4BF;
    border-radius: 50%;
    font-weight: 700;
}

.rda-help-fab-menu button .lbl {
    font-size: 12px;
    line-height: 1.3;
}

.rda-help-fab-menu button .lbl strong {
    color: #FCD34D;
}

.rda-help-fab-menu button .lbl small {
    color: #8FB7B0;
    font-size: 11px;
}

/* =============================================================
   Modo "senalar para ayuda"
   ============================================================= */
body.rda-pick-mode,
body.rda-pick-mode * {
    cursor: help !important;
}

.rda-pick-hover {
    outline: 2px dashed #2DD4BF !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.12) !important;
    transition: outline 80ms linear, box-shadow 120ms ease;
}

.rda-pick-banner {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(-14px);
    z-index: 10002;
    background: #0F1E22;
    border: 1px solid #2DD4BF;
    border-radius: 999px;
    padding: 8px 16px;
    color: #C7E9E5;
    font-size: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.rda-pick-banner.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.rda-pick-banner strong {
    color: #FCD34D;
}

.rda-pick-banner .rda-pick-cancel {
    background: transparent;
    border: 1px solid #134E4A;
    border-radius: 999px;
    color: #C7E9E5;
    padding: 3px 10px;
    font-size: 11px;
    cursor: pointer;
}

.rda-pick-banner .rda-pick-cancel:hover {
    background: #134E4A;
    color: #2DD4BF;
}

.rda-pick-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    z-index: 10003;
    background: #1E293B;
    color: #FCD34D;
    border: 1px solid #475569;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 160ms ease, transform 160ms ease;
}

.rda-pick-toast.visible {
    opacity: 1;
    transform: translateY(0);
}