/* ============================================
   TOUR.CSS - GUIDED TOUR SYSTEM
   ============================================ */

/* ---- Tour trigger button ---- */
.tour-trigger-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid rgba(102, 126, 234, 0.45);
    border-radius: var(--radius-md);
    color: var(--secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    white-space: nowrap;
    opacity: 0.75;
}

.tour-trigger-btn:hover {
    border-color: var(--secondary);
    background: rgba(102, 126, 234, 0.08);
    opacity: 1;
}

/* Pulsing ring on first visit */
@keyframes tourPulseRing {
    0%   { opacity: 0.9; transform: scale(1);    box-shadow: 0 0 0 0   rgba(102, 126, 234, 0.6); }
    60%  { opacity: 0.3; transform: scale(1.08); box-shadow: 0 0 0 6px rgba(102, 126, 234, 0);   }
    100% { opacity: 0.9; transform: scale(1);    box-shadow: 0 0 0 0   rgba(102, 126, 234, 0.6); }
}

.tour-trigger-btn.tour-pulse {
    color: var(--secondary);
    border-color: var(--secondary);
    animation: tourPulseRing 2s ease-in-out infinite;
}

/* ---- Overlay (4 pieces surrounding the spotlight) ---- */
.tour-overlay-piece {
    position: fixed;
    background: rgba(0, 0, 0, 0.72);
    z-index: 10200;
    pointer-events: all;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#tour-overlay-top    { top: 0; left: 0; right: 0; }
#tour-overlay-bottom { left: 0; right: 0; bottom: 0; }
#tour-overlay-left   { left: 0; }
#tour-overlay-right  { right: 0; }

/* ---- Spotlight frame ---- */
.tour-spotlight {
    position: fixed;
    z-index: 10201;
    border-radius: var(--radius-md);
    box-shadow:
        0 0 0 3px var(--secondary),
        0 0 24px rgba(102, 126, 234, 0.45);
    pointer-events: none;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Tooltip card ---- */
@keyframes tourTooltipIn {
    from { opacity: 0; transform: translateY(8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0)  scale(1);     }
}

.tour-tooltip {
    position: fixed;
    z-index: 10205;
    background: var(--card-bg);
    border: 1px solid var(--secondary);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(102, 126, 234, 0.15);
    animation: tourTooltipIn 0.22s ease;
}

.tour-tooltip-step {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--secondary);
    margin-bottom: var(--space-sm);
}

.tour-tooltip-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--space-sm) 0;
    line-height: 1.3;
}

.tour-tooltip-body {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 0 var(--space-md) 0;
}

.tour-tooltip-nav {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.tour-btn-skip {
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    padding: 4px 0;
    margin-right: auto;
    transition: color 0.15s;
}

.tour-btn-skip:hover {
    color: var(--text-secondary);
}

.tour-btn-back {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    padding: 5px 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.tour-btn-back:hover {
    border-color: var(--secondary);
    color: var(--text-primary);
}

.tour-btn-next {
    background: var(--secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 6px 16px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.tour-btn-next:hover {
    opacity: 0.88;
}

/* Arrow indicator pointing toward the highlighted element */
.tour-tooltip::before {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--card-bg);
    border: 1px solid var(--secondary);
    transform: rotate(45deg);
}

.tour-tooltip[data-arrow="top"]::before {
    bottom: -6px;
    left: 24px;
    border-top: none;
    border-left: none;
}

.tour-tooltip[data-arrow="bottom"]::before {
    top: -6px;
    left: 24px;
    border-bottom: none;
    border-right: none;
}

.tour-tooltip[data-arrow="left"]::before {
    right: -6px;
    top: 20px;
    border-bottom: none;
    border-left: none;
}

.tour-tooltip[data-arrow="right"]::before {
    left: -6px;
    top: 20px;
    border-top: none;
    border-right: none;
}

.tour-tooltip[data-arrow="none"]::before {
    display: none;
}

/* Final "done" step — centered overlay card */
.tour-tooltip.tour-tooltip--center {
    width: 360px;
    text-align: center;
}

.tour-tooltip--center .tour-tooltip-nav {
    justify-content: center;
}

.tour-tooltip--center .tour-btn-skip {
    display: none;
}
