/* ═══════════════════════════════════════════════════════════
   KRONYQL Guided Tour — Frosted-Glass Spotlight System
   Zero dependencies. Light overlay, page stays visible.
   ═══════════════════════════════════════════════════════════ */

/* ── Overlay mask (light tint, not blackout) ────────────── */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.tour-overlay.active {
    pointer-events: auto;
}

.tour-overlay-bg {
    position: fixed;
    inset: 0;
    background: rgba(8, 16, 32, 0.38);
    z-index: 99998;
    transition: opacity 0.4s ease;
    opacity: 0;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.tour-overlay.active .tour-overlay-bg {
    opacity: 1;
}

/* ── Spotlight cutout (soft glow, not pit-of-darkness) ── */
.tour-spotlight {
    position: fixed;
    z-index: 99999;
    border-radius: 14px;
    box-shadow: 0 0 0 9999px rgba(8, 16, 32, 0.38);
    pointer-events: none;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255,255,255,0.03);
}

.tour-spotlight::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.18), rgba(168, 85, 247, 0.12), rgba(245, 158, 11, 0.10));
    z-index: -1;
    filter: blur(8px);
    opacity: 0.7;
}

.tour-spotlight::after {
    content: '';
    position: absolute;
    inset: -3px;
    border: 1.5px solid rgba(0, 212, 255, 0.45);
    border-radius: 16px;
    animation: tourPulse 2.5s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
        border-color: rgba(0, 212, 255, 0.45);
    }
    50% {
        box-shadow: 0 0 28px rgba(0, 212, 255, 0.30), 0 0 60px rgba(168, 85, 247, 0.08);
        border-color: rgba(0, 212, 255, 0.65);
    }
}

/* ── Tooltip (frosted glass card) ───────────────────────── */
.tour-tooltip {
    position: fixed;
    z-index: 100000;
    width: 400px;
    max-width: calc(100vw - 40px);
    background: linear-gradient(160deg,
        rgba(15, 25, 50, 0.82),
        rgba(12, 20, 42, 0.78));
    border: 1px solid rgba(0, 212, 255, 0.22);
    border-radius: 20px;
    padding: 0;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 40px rgba(0, 212, 255, 0.06);
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    overflow: hidden;
}

.tour-tooltip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4ff, #a855f7, #f59e0b, #00d4ff);
    background-size: 300% 100%;
    animation: tourShimmer 4s ease-in-out infinite;
    border-radius: 20px 20px 0 0;
}

@keyframes tourShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.tour-tooltip.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.tour-tooltip-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 0;
}

.tour-tooltip-icon {
    font-size: 1.6em;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.tour-tooltip-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15em;
    font-weight: 700;
    color: #f0f4ff;
    letter-spacing: -0.01em;
}

.tour-tooltip-body {
    padding: 14px 24px 20px;
    color: #b0bcd5;
    font-size: 0.9em;
    line-height: 1.75;
}

.tour-tooltip-body strong {
    color: #5ee7ff;
    font-weight: 600;
}

/* ── Tooltip footer ─────────────────────────────────────── */
.tour-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(0, 0, 0, 0.12);
    gap: 12px;
}

.tour-step-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78em;
    color: rgba(148, 163, 184, 0.7);
    flex-shrink: 0;
}

.tour-nav-btns {
    display: flex;
    gap: 8px;
}

.tour-btn {
    padding: 9px 18px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85em;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.tour-btn-back {
    background: rgba(255, 255, 255, 0.06);
    color: #b0bcd5;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tour-btn-back:hover {
    color: #f0f4ff;
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(0, 212, 255, 0.3);
}

.tour-btn-next {
    background: linear-gradient(135deg, #00d4ff, #38bdf8);
    color: #0a1628;
    box-shadow: 0 2px 12px rgba(0, 212, 255, 0.25);
}

.tour-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
    background: linear-gradient(135deg, #22e0ff, #4ecbf5);
}

.tour-btn-skip {
    background: transparent;
    color: rgba(148, 163, 184, 0.6);
    font-size: 0.78em;
    padding: 9px 12px;
}

.tour-btn-skip:hover {
    color: #f87171;
}

/* ── Progress bar (thicker, glowing) ────────────────────── */
.tour-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.06);
    z-index: 100001;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tour-progress.active {
    opacity: 1;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #a855f7, #f59e0b);
    border-radius: 0 3px 3px 0;
    transition: width 0.5s ease;
    width: 0%;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

/* ── Page-transition loading state (frosted, not blackout) */
.tour-loading {
    position: fixed;
    inset: 0;
    z-index: 100002;
    background: rgba(8, 16, 32, 0.55);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.tour-loading.active {
    opacity: 1;
    pointer-events: auto;
}

.tour-loading-spinner {
    width: 36px;
    height: 36px;
    border: 2.5px solid rgba(0, 212, 255, 0.15);
    border-top-color: #00d4ff;
    border-radius: 50%;
    animation: tourSpin 0.8s linear infinite;
    margin-bottom: 16px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

@keyframes tourSpin {
    to { transform: rotate(360deg); }
}

.tour-loading-text {
    font-family: 'Space Grotesk', sans-serif;
    color: #b0bcd5;
    font-size: 0.92em;
}

/* ── Launch button (for pages that embed it) ────────────── */
.tour-launch-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.12), rgba(147, 51, 234, 0.08));
    border: 1px solid rgba(0, 212, 255, 0.35);
    border-radius: 12px;
    color: #00d4ff;
    font-weight: 700;
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tour-launch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 212, 255, 0.2);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.22), rgba(147, 51, 234, 0.12));
    border-color: rgba(0, 212, 255, 0.6);
}

.tour-launch-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00d4ff;
    animation: launchPulse 1.5s ease-in-out infinite;
}

@keyframes launchPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(0, 212, 255, 0.4); }
    50% { opacity: 0.5; box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .tour-tooltip {
        width: calc(100vw - 30px);
        left: 15px !important;
        right: 15px !important;
        border-radius: 16px;
    }
    .tour-tooltip-title { font-size: 1em; }
    .tour-tooltip-body { font-size: 0.84em; }
    .tour-tooltip-header { padding: 16px 18px 0; }
    .tour-tooltip-body { padding: 10px 18px 16px; }
    .tour-tooltip-footer { padding: 12px 18px; }
}
