/**
 * Guided Tour Styles
 * Matches the glassmorphism theme of the main site
 */

/* Tour Overlay - darkens the page except for highlighted element */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms cubic-bezier(.2,.8,.2,1);
}

.tour-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.tour-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}

/* Highlight ring around target element */
.tour-highlight-ring {
    position: fixed;
    border-radius: 12px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.65),
        0 0 0 4px var(--accent, #6E73EC),
        0 0 24px 6px rgba(110, 115, 236, 0.5);
    background: transparent;
    transition: all 260ms cubic-bezier(.2,.8,.2,1);
    z-index: 1;
    pointer-events: none;
}

/* Tour Tooltip */
.tour-tooltip {
    position: fixed;
    z-index: 9995;
    max-width: 380px;
    min-width: 280px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 260ms cubic-bezier(.2,.8,.2,1), transform 260ms cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
}

.tour-tooltip.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.tour-tooltip-content {
    background: color-mix(in srgb, var(--surface, #FFFFFF) 92%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border: 1px solid var(--stroke, rgba(200,200,210,.18));
    border-radius: 16px;
    box-shadow:
        0 14px 44px rgba(10, 12, 30, 0.18),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 1.25rem 1.5rem;
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.tour-tooltip-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
    color: var(--bs-body-color, #14141E);
    line-height: 1.3;
}

.tour-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--text-soft, rgba(20,20,30,.68));
    cursor: pointer;
    padding: 0;
    margin: -0.25rem -0.5rem 0 0;
    opacity: 0.7;
    transition: opacity 160ms;
}

.tour-close-btn:hover {
    opacity: 1;
    color: var(--bs-body-color, #14141E);
}

.tour-tooltip-text {
    color: var(--text-soft, rgba(20,20,30,.68));
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0 0 1.25rem 0;
}

.tour-tooltip-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.tour-progress {
    font-size: 0.8rem;
    color: var(--text-soft, rgba(20,20,30,.68));
    opacity: 0.8;
    font-weight: 500;
}

.tour-tooltip-actions {
    display: flex;
    gap: 0.5rem;
}

.tour-tooltip-actions .btn {
    font-weight: 600;
    padding: 0.4rem 1rem;
}

.tour-skip-btn {
    opacity: 0.8;
}

.tour-skip-btn:hover {
    opacity: 1;
}

/* Tooltip Arrow */
.tour-tooltip-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: color-mix(in srgb, var(--surface, #FFFFFF) 92%, transparent);
    border: 1px solid var(--stroke, rgba(200,200,210,.18));
    transform: rotate(45deg);
    z-index: -1;
}

.tour-tooltip[data-position="bottom"] .tour-tooltip-arrow {
    top: -8px;
    left: 50%;
    margin-left: -7px;
    border-right: none;
    border-bottom: none;
}

.tour-tooltip[data-position="top"] .tour-tooltip-arrow {
    bottom: -8px;
    left: 50%;
    margin-left: -7px;
    border-left: none;
    border-top: none;
}

.tour-tooltip[data-position="left"] .tour-tooltip-arrow {
    right: -8px;
    top: 50%;
    margin-top: -7px;
    border-left: none;
    border-bottom: none;
}

.tour-tooltip[data-position="right"] .tour-tooltip-arrow {
    left: -8px;
    top: 50%;
    margin-top: -7px;
    border-right: none;
    border-top: none;
}

/* Tour Complete Modal */
.tour-complete-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 260ms cubic-bezier(.2,.8,.2,1);
}

.tour-complete-modal.active {
    opacity: 1;
}

.tour-complete-content {
    background: color-mix(in srgb, var(--surface, #FFFFFF) 95%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border: 1px solid var(--stroke, rgba(200,200,210,.18));
    border-radius: 20px;
    box-shadow:
        0 22px 70px rgba(10, 12, 30, 0.22),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    transform: scale(0.95) translateY(20px);
    animation: tourModalIn 400ms cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes tourModalIn {
    to {
        transform: scale(1) translateY(0);
    }
}

.tour-complete-icon {
    color: var(--accent, #6E73EC);
    margin-bottom: 1rem;
}

.tour-complete-icon svg {
    width: 56px;
    height: 56px;
}

.tour-complete-content h3 {
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--bs-body-color, #14141E);
}

.tour-complete-content p {
    color: var(--text-soft, rgba(20,20,30,.68));
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.75rem;
}

.tour-complete-content .btn {
    font-weight: 600;
    padding: 0.6rem 2rem;
    font-size: 1rem;
}

/* Dark Mode Support */
[data-bs-theme="dark"] .tour-overlay::before,
[data-bs-theme="dark"] .tour-highlight-ring {
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.75),
        0 0 0 4px var(--accent, #6E73EC),
        0 0 24px 6px rgba(110, 115, 236, 0.4);
}

[data-bs-theme="dark"] .tour-tooltip-content,
[data-bs-theme="dark"] .tour-complete-content {
    background: color-mix(in srgb, var(--surface, #1a1a2e) 95%, transparent);
    box-shadow:
        0 14px 44px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

[data-bs-theme="dark"] .tour-tooltip-arrow {
    background: color-mix(in srgb, var(--surface, #1a1a2e) 95%, transparent);
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .tour-tooltip {
        max-width: calc(100vw - 32px);
        min-width: auto;
        left: 16px !important;
        right: 16px;
        width: auto;
    }

    .tour-tooltip-content {
        padding: 1rem 1.25rem;
    }

    .tour-tooltip-title {
        font-size: 1.05rem;
    }

    .tour-tooltip-text {
        font-size: 0.9rem;
    }

    .tour-tooltip-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .tour-progress {
        text-align: center;
    }

    .tour-tooltip-actions {
        justify-content: space-between;
    }

    .tour-tooltip-actions .btn {
        flex: 1;
    }

    .tour-complete-content {
        padding: 2rem 1.5rem;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-tooltip,
    .tour-highlight-ring,
    .tour-complete-modal,
    .tour-complete-content {
        transition: none;
        animation: none;
    }

    .tour-complete-content {
        transform: none;
    }
}
