/* css/tour.css - glassmorphism onboarding tour */

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.18);
    z-index: var(--z-modal-backdrop);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

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

/* when spotlight is active, overlay becomes transparent so dimming
   comes only from the spotlight box-shadow (no double-layer) */
.tour-overlay.has-spotlight {
    background: transparent;
}

.tour-spotlight {
    position: fixed;
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.18);
    z-index: var(--z-modal);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
}

.tour-spotlight.visible {
    opacity: 1;
}

.tour-target-highlight {
    position: relative !important;
    z-index: calc(var(--z-modal) + 1) !important;
    pointer-events: auto !important;
}

/* nav-level targets already have position from parent -- just elevate z-index */
nav .tour-target-highlight,
.landing-nav .tour-target-highlight {
    position: static !important;
}

/* give small inline targets a visible highlight ring */
a.tour-target-highlight,
button.tour-target-highlight {
    border-radius: 8px;
    box-shadow: 0 0 0 3px var(--mountain-meadow-400, #34d39e),
                0 0 16px rgba(16, 185, 129, 0.25);
}

/* glass popover */
.tour-popover {
    position: fixed;
    z-index: calc(var(--z-modal) + 2);
    width: 360px;
    max-width: calc(100vw - 32px);
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 1.5rem 1.75rem;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
    color: #fff;
}

[data-theme="light"] .tour-popover {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

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

/* arrow */
.tour-popover::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    transform: rotate(45deg);
}

[data-theme="light"] .tour-popover::after {
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
}

.tour-popover[data-placement="bottom"]::after {
    top: -8px;
    left: var(--arrow-left, 50%);
    transform: rotate(45deg);
}

.tour-popover[data-placement="top"]::after {
    bottom: -8px;
    left: var(--arrow-left, 50%);
    transform: rotate(225deg);
}

.tour-popover[data-placement="center"]::after {
    display: none;
}

.tour-popover[data-placement="center"] {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%);
}

.tour-popover[data-placement="center"].visible {
    transform: translate(-50%, -50%);
}

/* step counter */
.tour-step-counter {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mountain-meadow-400, #34d39e);
    margin-bottom: 0.5rem;
}

/* header */
.tour-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 0.75rem;
}

.tour-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: inherit;
    margin: 0;
    line-height: 1.3;
}

.tour-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

[data-theme="light"] .tour-close {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.4);
}

.tour-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .tour-close:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

/* content */
.tour-content {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.55;
    margin-bottom: 1.25rem;
}

[data-theme="light"] .tour-content {
    color: var(--text-secondary);
}

/* footer */
.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* progress dots */
.tour-progress {
    display: flex;
    gap: 5px;
}

.tour-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s, transform 0.3s;
}

[data-theme="light"] .tour-dot {
    background: rgba(0, 0, 0, 0.12);
}

.tour-dot.active {
    background: var(--mountain-meadow-400, #34d39e);
    transform: scale(1.2);
}

.tour-dot.completed {
    background: var(--mountain-meadow-600, #059666);
}

/* buttons */
.tour-buttons {
    display: flex;
    gap: 0.5rem;
}

.tour-btn {
    padding: 0.45rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.tour-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .tour-btn-secondary {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

.tour-btn-secondary:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="light"] .tour-btn-secondary:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.1);
}

.tour-btn-primary {
    background: var(--mountain-meadow-500, #10b981);
    color: #fff;
}

.tour-btn-primary:hover {
    background: var(--mountain-meadow-600, #059666);
}

/* mobile */
@media (max-width: 480px) {
    .tour-popover {
        width: calc(100vw - 24px);
        padding: 1.25rem;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-spotlight,
    .tour-popover {
        transition: none;
    }
}
