/* onboarding.css — spotlight guiado de primeira visita */

/* 4 painéis escuros que cercam o elemento em destaque (técnica robusta a
   contextos de empilhamento — não depende do z-index do elemento alvo) */
.ob-mask {
    position: fixed;
    z-index: 99990;
    background: rgba(5, 12, 9, 0.78);
    pointer-events: auto;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Área "vazada" sobre o elemento em destaque — transparente, mas ainda
   bloqueia cliques para evitar navegação acidental durante o tour */
.ob-hole {
    position: fixed;
    z-index: 99990;
    background: transparent;
    pointer-events: auto;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Anel de destaque desenhado sobre o buraco — border-radius ajustado
   dinamicamente via JS para ficar concêntrico ao elemento real (raio do
   elemento + padding do anel) */
.ob-ring {
    position: fixed;
    z-index: 99991;
    border: 2px solid var(--color-med);
    border-radius: 12px;
    box-shadow: 0 0 0 4px rgba(78, 204, 163, 0.25), 0 0 24px rgba(78, 204, 163, 0.35);
    pointer-events: none;
    opacity: 0;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease,
                border-radius 0.3s ease, opacity 0.2s ease;
}

.ob-tooltip {
    position: fixed;
    z-index: 99992;
    max-width: 320px;
    background: rgba(var(--rgb-darkest), 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.4rem 1.6rem;
    /* Sombra em camadas em vez de borda dura — se adapta a qualquer fundo */
    box-shadow:
        0 1px 1px rgba(0, 0, 0, 0.08),
        0 4px 10px rgba(0, 0, 0, 0.2),
        0 20px 45px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(var(--rgb-light), 0.14);
    color: var(--color-lightest);
    font-family: var(--font-ui);
    opacity: 0;
    transition: opacity 0.2s ease, top 0.3s ease, left 0.3s ease;
}

.ob-tooltip.ob-visible {
    opacity: 1;
}

.ob-tooltip.ob-centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 420px;
    text-align: center;
}

/* Seta apontando do tooltip para o elemento iluminado */
.ob-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ob-arrow.ob-arrow-visible { opacity: 1; }

.ob-arrow.ob-arrow-down {
    bottom: -16px;
    border-top-color: rgba(var(--rgb-darkest), 0.92);
}

.ob-arrow.ob-arrow-up {
    top: -16px;
    border-bottom-color: rgba(var(--rgb-darkest), 0.92);
}

/* Dots de progresso */
.ob-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
}

.ob-dot {
    width: 6px;
    height: 6px;
    border-radius: 3px;
    background: rgba(var(--rgb-light), 0.22);
    transition: background 0.25s ease, width 0.25s ease;
}

.ob-dot.ob-dot-active {
    width: 18px;
    background: var(--color-med);
}

.ob-tooltip.ob-centered .ob-dots {
    justify-content: center;
}

/* Cabeçalho: ícone + título */
.ob-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.7rem;
}

.ob-tooltip.ob-centered .ob-head {
    flex-direction: column;
    gap: 0.6rem;
}

.ob-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(var(--rgb-med), 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    line-height: 1;
}

.ob-tooltip h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-lightest);
}

.ob-tooltip p {
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(var(--rgb-light), 0.85);
    margin-bottom: 1.2rem;
}

/* Entrada em camadas escalonadas — anima uma vez por passo (innerHTML é
   reconstruído a cada renderTooltip, então o keyframe sempre reinicia) */
.ob-stagger {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(3px);
    animation: obFadeInUp 380ms ease-out forwards;
}

@keyframes obFadeInUp {
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.ob-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.ob-tooltip.ob-centered .ob-actions {
    justify-content: center;
}

.ob-skip {
    background: none;
    border: none;
    color: rgba(var(--rgb-light), 0.5);
    font-size: 0.82rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    padding: 0.4rem 0;
}

.ob-skip:hover { color: rgba(var(--rgb-light), 0.8); }

.ob-next {
    background: var(--color-med);
    color: var(--color-darkest);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.3rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s ease, scale 0.15s ease-out;
}

.ob-next:hover { background: var(--color-lightest); }
.ob-next:active { scale: 0.96; }

@media (max-width: 640px) {
    .ob-tooltip { max-width: calc(100vw - 2.5rem); }
}

/* ── Profile setup popup (exibido após conclusão do tutorial) ──────────── */
#ob-profile-modal {
    position: fixed;
    inset: 0;
    z-index: 99993;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 12, 9, 0.80);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
}
#ob-profile-modal.ob-profile-visible { opacity: 1; }

.ob-profile-card {
    background: rgba(var(--rgb-darkest), 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 1.8rem 2rem;
    max-width: 440px;
    width: calc(100vw - 3rem);
    box-shadow:
        0 4px 20px rgba(0,0,0,0.4),
        0 0 0 1px rgba(var(--rgb-light), 0.12);
    color: var(--color-lightest);
    font-family: var(--font-ui);
    transform: translateY(18px);
    transition: transform 0.35s ease;
}
#ob-profile-modal.ob-profile-visible .ob-profile-card { transform: translateY(0); }

.ob-profile-card > p {
    font-size: 0.88rem;
    color: rgba(var(--rgb-light), 0.70);
    margin: 0.5rem 0 1.3rem;
    line-height: 1.55;
}

.ob-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 0.85rem;
}
.ob-field label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(var(--rgb-light), 0.50);
}
.ob-field input {
    background: rgba(var(--rgb-light), 0.06);
    border: 1px solid rgba(var(--rgb-light), 0.12);
    border-radius: 8px;
    padding: 0.55rem 0.8rem;
    color: var(--color-lightest);
    font-size: 0.9rem;
    font-family: var(--font-ui);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}
.ob-field input:focus { border-color: var(--color-med); }
.ob-field input::placeholder { color: rgba(var(--rgb-light), 0.28); }

.ob-field-row {
    flex-direction: row;
    gap: 0.8rem;
}
.ob-field-row > div {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.ob-field-row label {
    font-size: 0.73rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(var(--rgb-light), 0.50);
}

@media (max-width: 480px) {
    .ob-field-row { flex-direction: column; }
    .ob-profile-card { padding: 1.4rem 1.4rem; }
}
