/* =============================================
   VIVIANA – ONBOARDING TUTORIAL HINTS
   Context-aware coachmarks · Glassmorphic dark
   Mobile-first · v2.0
   ============================================= */

/* ── Scrim / Backdrop ─────────────────────── */
.obt-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: radial-gradient(
        ellipse at 50% 40%,
        rgba(13, 10, 15, 0.45) 0%,
        rgba(13, 10, 15, 0.78) 100%
    );
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

.obt-backdrop.obt-visible {
    opacity: 1;
    pointer-events: auto;
}

/* ── Spotlight Cutout ─────────────────────── */
.obt-spotlight {
    position: fixed;
    z-index: 9999;
    border-radius: var(--border-radius-md, 12px);
    box-shadow:
        0 0 0 9999px rgba(13, 10, 15, 0.72),
        inset 0 0 0 1px rgba(255, 64, 129, 0.12);
    pointer-events: none;
    transition:
        top 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        left 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        width 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
        height 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: top, left, width, height;
}

/* Breathing glow ring */
.obt-spotlight::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(
        135deg,
        rgba(233, 30, 99, 0.35),
        rgba(124, 77, 255, 0.25),
        rgba(233, 30, 99, 0.35)
    );
    background-size: 200% 200%;
    animation: obtGlowShift 4s ease-in-out infinite;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    padding: 2px;
    opacity: 0.8;
}

@keyframes obtGlowShift {
    0%, 100% { background-position: 0% 50%; opacity: 0.6; }
    50%      { background-position: 100% 50%; opacity: 1; }
}

/* ── Tooltip Card ─────────────────────────── */
.obt-tooltip {
    --_obt-glass: rgba(22, 18, 24, 0.88);
    --_obt-border: rgba(255, 255, 255, 0.07);
    --_obt-arrow-offset: 50%;

    position: fixed;
    z-index: 10000;
    max-width: 310px;
    width: calc(100vw - 48px);
    background:
        linear-gradient(
            168deg,
            rgba(233, 30, 99, 0.06) 0%,
            transparent 40%
        ),
        var(--_obt-glass);
    border: 1px solid var(--_obt-border);
    border-radius: var(--border-radius-lg, 20px);
    padding: 0;
    color: var(--text-primary, #fff);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.55),
        0 1px 3px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    opacity: 0;
    transform: translateY(10px) scale(0.97);
    pointer-events: none;
    transition:
        opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    will-change: opacity, transform;
    overflow: hidden;
}

/* Accent stripe along the left edge */
.obt-tooltip::before {
    content: '';
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(
        180deg,
        var(--primary-color, #FF4081) 0%,
        var(--secondary-color, #7C4DFF) 100%
    );
    opacity: 0.85;
}

.obt-tooltip.obt-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ── Arrows ───────────────────────────────── */

/* Arrow down — tooltip sits ABOVE target */
.obt-tooltip.obt-arrow-down::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: var(--_obt-arrow-offset, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--_obt-glass);
    border-right: 1px solid var(--_obt-border);
    border-bottom: 1px solid var(--_obt-border);
    border-radius: 0 0 4px 0;
    box-shadow: 4px 4px 12px rgba(0, 0, 0, 0.25);
}

/* Arrow up — tooltip sits BELOW target */
.obt-tooltip.obt-arrow-up::after {
    content: '';
    position: absolute;
    top: -7px;
    left: var(--_obt-arrow-offset, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: var(--_obt-glass);
    border-left: 1px solid var(--_obt-border);
    border-top: 1px solid var(--_obt-border);
    border-radius: 4px 0 0 0;
}

/* ── Inner Content Area ───────────────────── */
.obt-tooltip-inner {
    padding: 20px 20px 16px 22px;
}

/* ── Header: icon + title ─────────────────── */
.obt-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.obt-tooltip-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm, 8px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(
        135deg,
        rgba(233, 30, 99, 0.14) 0%,
        rgba(124, 77, 255, 0.10) 100%
    );
    border: 1px solid rgba(233, 30, 99, 0.18);
    color: var(--primary-color, #FF4081);
}

.obt-tooltip-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.obt-tooltip-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.2px;
    line-height: 1.2;
    color: var(--text-primary, #fff);
}

/* ── Body text ────────────────────────────── */
.obt-tooltip-body {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary, #B0B0B0);
    margin-bottom: 14px;
    padding-right: 4px;
}

/* ── Footer: dots + actions ───────────────── */
.obt-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Step indicator dots */
.obt-step-dots {
    display: flex;
    gap: 5px;
    align-items: center;
}

.obt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.obt-dot.obt-active {
    width: 20px;
    border-radius: 3px;
    background: linear-gradient(
        90deg,
        var(--primary-color, #FF4081),
        var(--secondary-color, #7C4DFF)
    );
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.3);
}

.obt-dot.obt-done {
    background: rgba(233, 30, 99, 0.4);
}

/* Action buttons container */
.obt-tooltip-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Primary "Verstanden" / "Got it" button */
.obt-next-btn {
    background: linear-gradient(
        135deg,
        var(--primary-color, #E91E63) 0%,
        var(--primary-dark, #F50057) 100%
    );
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm, 8px);
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: 0.1px;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition:
        transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease;
    box-shadow: 0 2px 10px rgba(233, 30, 99, 0.3);
}

.obt-next-btn:active {
    transform: scale(0.94);
    box-shadow: 0 1px 4px rgba(233, 30, 99, 0.2);
}

/* Secondary skip link */
.obt-skip-btn {
    background: none;
    border: none;
    color: var(--text-muted, #666);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    padding: 6px 4px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.obt-skip-btn:active {
    color: var(--text-secondary, #B0B0B0);
}

/* ── Centered tooltip (no target) ─────────── */
.obt-tooltip.obt-centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(0.97);
}

.obt-tooltip.obt-centered.obt-visible {
    transform: translate(-50%, -50%) scale(1);
}

/* Hide accent stripe when centered */
.obt-tooltip.obt-centered::before {
    display: none;
}

/* ── Entrance animation stagger ───────────── */
.obt-tooltip.obt-visible .obt-tooltip-header {
    animation: obtFadeUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.05s both;
}

.obt-tooltip.obt-visible .obt-tooltip-body {
    animation: obtFadeUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.12s both;
}

.obt-tooltip.obt-visible .obt-tooltip-footer {
    animation: obtFadeUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.18s both;
}

@keyframes obtFadeUp {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Reduced motion ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .obt-backdrop,
    .obt-spotlight,
    .obt-tooltip {
        transition-duration: 0.01ms !important;
    }

    .obt-spotlight::before {
        animation: none !important;
    }

    .obt-tooltip.obt-visible .obt-tooltip-header,
    .obt-tooltip.obt-visible .obt-tooltip-body,
    .obt-tooltip.obt-visible .obt-tooltip-footer {
        animation: none !important;
        opacity: 1;
    }

    .obt-dot {
        transition-duration: 0.01ms !important;
    }
}

/* ── Safe area padding for notched phones ─── */
@supports (padding: env(safe-area-inset-bottom)) {
    .obt-tooltip {
        --_obt-safe-bottom: env(safe-area-inset-bottom, 0px);
    }
}
