/* ==========================================================================
   Guided Tour — Spotlight overlay + tooltip system
   ========================================================================== */

/* ── Overlay backdrop ─────────────────────────────────────────────────── */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.tour-overlay.active {
    pointer-events: auto;
}

/* SVG-based spotlight mask — the "hole" that reveals the target element */
.tour-overlay svg {
    width: 100%;
    height: 100%;
}
.tour-overlay .tour-mask-bg {
    fill: rgba(0, 0, 0, 0.72);
}
.tour-overlay .tour-spotlight {
    rx: 8;
    ry: 8;
    transition: x 0.3s ease, y 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* Click-through on the spotlight cutout so users can interact with the target */
.tour-spotlight-click {
    position: fixed;
    z-index: 10001;
    cursor: pointer;
    pointer-events: auto;
    border-radius: 8px;
    transition: top 0.3s ease, left 0.3s ease, width 0.3s ease, height 0.3s ease;
}

/* ── Tooltip ──────────────────────────────────────────────────────────── */
.tour-tooltip {
    position: fixed;
    z-index: 10002;
    width: 380px;
    max-width: calc(100vw - 32px);
    background: #15171b;
    border: 1px solid #262a30;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    font-family: 'Inter', -apple-system, sans-serif;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tour-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem 0.5rem;
}
.tour-tooltip-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e9ecf1;
    margin: 0;
}
.tour-tooltip-step {
    font-size: 0.75rem;
    color: #5f6671;
    white-space: nowrap;
}

.tour-tooltip-body {
    padding: 0.25rem 1.25rem 1rem;
    color: #c2c9d2;
    font-size: 0.9rem;
    line-height: 1.6;
}
.tour-tooltip-body p {
    margin: 0 0 0.5rem;
}
.tour-tooltip-body p:last-child {
    margin-bottom: 0;
}

.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #262a30;
}

.tour-tooltip-progress {
    display: flex;
    gap: 4px;
}
.tour-tooltip-progress .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #262a30;
    transition: background 0.2s;
}
.tour-tooltip-progress .dot.active {
    background: #f5a623;
}
.tour-tooltip-progress .dot.done {
    background: #25d0a0;
}

.tour-tooltip-nav {
    display: flex;
    gap: 0.5rem;
}

/* Tour buttons */
.tour-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    line-height: 1.4;
}
.tour-btn-secondary {
    background: transparent;
    border: 1px solid #262a30;
    color: #8b929d;
}
.tour-btn-secondary:hover {
    border-color: #f5a623;
    color: #f5a623;
}
.tour-btn-primary {
    background: #178f6b;
    color: #fff;
}
.tour-btn-primary:hover {
    background: #1fb389;
}
.tour-btn-skip {
    background: transparent;
    color: #5f6671;
    font-size: 0.78rem;
    padding: 0.4rem 0.6rem;
}
.tour-btn-skip:hover {
    color: #ff5b5b;
}

/* ── Action badge (tells user what to do) ────────────────────────────── */
.tour-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(245, 166, 35, 0.12);
    border: 1px solid rgba(245, 166, 35, 0.25);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #f5a623;
    margin-top: 0.5rem;
}
.tour-action-badge i {
    font-size: 0.72rem;
}

/* ── Close-position prompt ───────────────────────────────────────────── */
.tour-close-prompt {
    position: fixed;
    z-index: 10003;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    max-width: calc(100vw - 32px);
    background: #15171b;
    border: 1px solid #262a30;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
    padding: 1.5rem;
    text-align: center;
    font-family: 'Inter', -apple-system, sans-serif;
}
.tour-close-prompt h4 {
    color: #e9ecf1;
    margin-bottom: 0.75rem;
}
.tour-close-prompt p {
    color: #8b929d;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}
.tour-close-prompt .btn-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ── Arrow (CSS triangle pointing at target) ─────────────────────────── */
.tour-tooltip-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #15171b;
    border: 1px solid #262a30;
    transform: rotate(45deg);
}
.tour-tooltip-arrow.arrow-top {
    top: -7px;
    left: 24px;
    border-bottom: none;
    border-right: none;
}
.tour-tooltip-arrow.arrow-bottom {
    bottom: -7px;
    left: 24px;
    border-top: none;
    border-left: none;
}
.tour-tooltip-arrow.arrow-left {
    left: -7px;
    top: 20px;
    border-bottom: none;
    border-right: none;
}
.tour-tooltip-arrow.arrow-right {
    right: -7px;
    top: 20px;
    border-top: none;
    border-left: none;
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tour-tooltip {
        width: calc(100vw - 24px);
        left: 12px !important;
        right: 12px !important;
    }
    .tour-close-prompt {
        width: calc(100vw - 24px);
    }
}
