/* ============================================ */
/* PRODUCT TOUR - Editorial guide               */
/* ============================================ */

.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 220ms ease;
}

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

.tour-blur {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 1;
    transition:
        clip-path 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
        opacity 220ms ease;
}

.tour-blur.no-hole {
    clip-path: none !important;
}

.tour-spotlight-border {
    position: fixed;
    z-index: 10001;
    border: 1px solid rgba(42, 38, 30, 0.52);
    outline: 1px solid rgba(255, 255, 255, 0.86);
    outline-offset: 3px;
    box-shadow: 0 14px 34px rgba(24, 22, 19, 0.14);
    pointer-events: none;
    opacity: 0;
    transition:
        opacity 220ms ease,
        top 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
        left 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
        width 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
        height 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.tour-popover {
    position: fixed;
    z-index: 10004;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 24px);
    width: 382px;
    max-width: calc(100vw - 2rem);
    color: var(--luxury-text-primary, #141414);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 246, 240, 0.94)),
        var(--luxury-bg-primary, #ffffff);
    border: 1px solid rgba(35, 32, 27, 0.18);
    box-shadow:
        0 26px 54px rgba(20, 18, 15, 0.18),
        0 1px 0 rgba(255, 255, 255, 0.82) inset;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 220ms ease;
}

.tour-popover:focus {
    outline: none;
}

.tour-popover::before {
    content: "";
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(35, 32, 27, 0.08);
    pointer-events: none;
}

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

.tour-popover.is-centered {
    top: 50% !important;
    left: 50% !important;
    width: 444px;
    transform: translate(-50%, calc(-50% + 4px));
}

.tour-popover.is-centered.is-visible {
    transform: translate(-50%, -50%);
}

.tour-popover-arrow {
    position: absolute;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #ffffff, #f8f6f0);
    border: 1px solid rgba(35, 32, 27, 0.16);
    transform: rotate(45deg);
    z-index: -1;
}

.tour-popover[data-placement="bottom"] .tour-popover-arrow {
    top: -7px;
    border-bottom: none;
    border-right: none;
}

.tour-popover[data-placement="top"] .tour-popover-arrow {
    bottom: -7px;
    border-top: none;
    border-left: none;
}

.tour-popover[data-placement="left"] .tour-popover-arrow {
    right: -7px;
    border-left: none;
    border-bottom: none;
}

.tour-popover[data-placement="right"] .tour-popover-arrow {
    left: -7px;
    border-right: none;
    border-top: none;
}

.tour-popover-accent {
    height: 0;
}

.tour-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem 1.35rem 0.45rem;
    position: relative;
}

.tour-popover-step {
    font-family: var(--luxury-font-secondary, sans-serif);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(55, 49, 40, 0.62);
    letter-spacing: 0;
}

.tour-popover-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    color: var(--luxury-text-secondary, #4a4a4a);
    cursor: pointer;
    padding: 0;
    transition:
        border-color 160ms ease,
        color 160ms ease,
        background-color 160ms ease;
}

.tour-popover-close:hover {
    color: var(--luxury-text-primary, #141414);
    background-color: rgba(35, 32, 27, 0.05);
    border-color: rgba(35, 32, 27, 0.12);
}

.tour-popover-title {
    font-family: var(--luxury-font-primary, sans-serif);
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--luxury-text-primary, #141414);
    padding: 0 1.35rem;
    margin: 0;
    line-height: 1.35;
    letter-spacing: 0;
}

.tour-popover.is-centered .tour-popover-title {
    font-size: 1.12rem;
}

.tour-popover-body {
    min-height: 0;
    overflow-y: auto;
    overflow-wrap: anywhere;
    padding: 0.8rem 1.35rem 1.05rem;
    font-family: var(--luxury-font-secondary, sans-serif);
    font-size: 0.88rem;
    line-height: 1.68;
    color: var(--luxury-text-secondary, #4a4a4a);
}

.tour-popover-body p {
    margin: 0 0 0.62rem;
}

.tour-popover-body p:last-child {
    margin-bottom: 0;
}

.tour-popover-body strong {
    color: var(--luxury-text-primary, #141414);
    font-weight: 650;
}

.tour-popover-body .tour-example {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.15rem 0.46rem;
    background: rgba(35, 32, 27, 0.045);
    border: 1px solid rgba(35, 32, 27, 0.12);
    font-size: 0.76rem;
    font-family: "SF Mono", "Consolas", monospace;
    color: var(--luxury-text-primary, #141414);
    white-space: normal;
}

.tour-popover-body .tour-icon-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    font-size: 0.72rem;
    vertical-align: middle;
}

.tour-popover-body .tour-icon-badge.badge-danger {
    background-color: rgba(154, 54, 54, 0.1);
    color: #9a3636;
}

.tour-popover-body .tour-icon-badge.badge-primary {
    background-color: rgba(43, 83, 131, 0.1);
    color: #2b5383;
}

.tour-popover-body .tour-icon-badge.badge-accent {
    background-color: rgba(146, 116, 67, 0.13);
    color: #80633a;
}

.tour-popover-body .tour-icon-badge.badge-muted {
    background-color: rgba(35, 32, 27, 0.07);
    color: rgba(35, 32, 27, 0.68);
}

.tour-progress {
    height: 1px;
    background: rgba(35, 32, 27, 0.12);
    margin: 0 1.35rem;
}

.tour-progress-bar {
    height: 100%;
    background: #2a261f;
    transition: width 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.tour-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.35rem 0.78rem;
    gap: 0.75rem;
}

.tour-btn {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-family: var(--luxury-font-secondary, sans-serif);
    font-size: 0.75rem;
    font-weight: 650;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.54rem 0.92rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
    white-space: nowrap;
}

.tour-btn:hover {
    transform: translateY(-1px);
}

.tour-btn-skip {
    background: transparent;
    color: var(--luxury-text-secondary, #4a4a4a);
    padding-left: 0;
    padding-right: 0.35rem;
}

.tour-btn-skip:hover {
    color: var(--luxury-text-primary, #141414);
}

.tour-dismiss-permanently {
    appearance: none;
    padding: 0;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 0.2em;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.tour-dismiss-permanently:hover {
    color: var(--luxury-text-primary, #141414);
    text-decoration-color: currentColor;
}

.tour-popover-close:focus-visible,
.tour-btn:focus-visible,
.tour-dismiss-permanently:focus-visible {
    outline: 2px solid var(--luxury-accent, #8f7043);
    outline-offset: 3px;
}

.tour-btn-nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.tour-btn-prev {
    background: rgba(35, 32, 27, 0.045);
    color: var(--luxury-text-primary, #141414);
    border-color: rgba(35, 32, 27, 0.12);
}

.tour-btn-prev:hover {
    background: rgba(35, 32, 27, 0.08);
}

.tour-btn-next,
.tour-btn-finish {
    background: #171512;
    color: #ffffff;
    border-color: #171512;
}

.tour-btn-next:hover,
.tour-btn-finish:hover {
    background: #2b261f;
    border-color: #2b261f;
}

.tour-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.2rem;
    padding: 0 0.28rem;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(35, 32, 27, 0.16);
    border-radius: 2px;
    font-size: 0.62rem;
    font-family: var(--luxury-font-secondary, sans-serif);
    color: rgba(35, 32, 27, 0.62);
    line-height: 1;
}

.tour-popover-keys {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.32rem;
    padding: 0 1.35rem 1.05rem;
    font-size: 0.68rem;
    color: rgba(35, 32, 27, 0.56);
}

@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-blur,
    .tour-spotlight-border,
    .tour-popover,
    .tour-progress-bar,
    .tour-btn,
    .tour-popover-close {
        transition: none !important;
        animation: none !important;
    }
}

.tour-hero-icon {
    display: none;
}

[data-theme="dark"] .tour-blur {
    background: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .tour-popover {
    color: var(--luxury-text-primary, #f6f2e8);
    background:
        linear-gradient(180deg, rgba(28, 26, 23, 0.96), rgba(20, 19, 17, 0.98)),
        var(--luxury-bg-primary, #161513);
    border-color: rgba(224, 200, 154, 0.2);
    box-shadow:
        0 28px 58px rgba(0, 0, 0, 0.42),
        0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

[data-theme="dark"] .tour-popover::before {
    border-color: rgba(224, 200, 154, 0.1);
}

[data-theme="dark"] .tour-popover-arrow {
    background: linear-gradient(135deg, #1c1a17, #141311);
    border-color: rgba(224, 200, 154, 0.18);
}

[data-theme="dark"] .tour-popover-step,
[data-theme="dark"] .tour-popover-keys {
    color: rgba(246, 242, 232, 0.58);
}

[data-theme="dark"] .tour-popover-body {
    color: rgba(246, 242, 232, 0.72);
}

[data-theme="dark"] .tour-progress {
    background: rgba(246, 242, 232, 0.13);
}

[data-theme="dark"] .tour-progress-bar,
[data-theme="dark"] .tour-btn-next,
[data-theme="dark"] .tour-btn-finish {
    background: #e7d3ad;
    border-color: #e7d3ad;
    color: #171512;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .tour-blur {
        background: rgba(0, 0, 0, 0.28);
    }

    :root:not([data-theme="light"]) .tour-popover {
        color: var(--luxury-text-primary, #f6f2e8);
        background:
            linear-gradient(180deg, rgba(28, 26, 23, 0.96), rgba(20, 19, 17, 0.98)),
            var(--luxury-bg-primary, #161513);
        border-color: rgba(224, 200, 154, 0.2);
        box-shadow:
            0 28px 58px rgba(0, 0, 0, 0.42),
            0 1px 0 rgba(255, 255, 255, 0.08) inset;
    }

    :root:not([data-theme="light"]) .tour-popover::before {
        border-color: rgba(224, 200, 154, 0.1);
    }

    :root:not([data-theme="light"]) .tour-popover-arrow {
        background: linear-gradient(135deg, #1c1a17, #141311);
        border-color: rgba(224, 200, 154, 0.18);
    }

    :root:not([data-theme="light"]) .tour-popover-step,
    :root:not([data-theme="light"]) .tour-popover-keys {
        color: rgba(246, 242, 232, 0.58);
    }

    :root:not([data-theme="light"]) .tour-popover-body {
        color: rgba(246, 242, 232, 0.72);
    }

    :root:not([data-theme="light"]) .tour-progress {
        background: rgba(246, 242, 232, 0.13);
    }

    :root:not([data-theme="light"]) .tour-progress-bar,
    :root:not([data-theme="light"]) .tour-btn-next,
    :root:not([data-theme="light"]) .tour-btn-finish {
        background: #e7d3ad;
        border-color: #e7d3ad;
        color: #171512;
    }
}

@media (max-width: 576px) {
    .tour-popover,
    .tour-popover.is-centered {
        width: calc(100vw - 24px);
        max-width: none;
        max-height: min(55dvh, 420px);
    }

    .tour-popover-header {
        padding: 0.35rem 1rem 0;
    }

    .tour-popover-title,
    .tour-popover-body,
    .tour-popover-footer,
    .tour-popover-keys {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tour-progress {
        margin-left: 1rem;
        margin-right: 1rem;
    }

    .tour-popover-footer {
        align-items: stretch;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
        flex-wrap: wrap;
    }

    .tour-btn-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
}

.tour-popover-header,
.tour-popover-title,
.tour-popover-footer,
.tour-popover-keys,
.tour-progress {
    flex-shrink: 0;
}

@media (max-width: 576px) {
    .tour-popover-body {
        padding-top: 0.5rem;
        padding-bottom: 0.65rem;
        line-height: 1.5;
    }

    .datatable-search-help > button,
    .tour-popover-close,
    .tour-btn,
    .tour-dismiss-permanently {
        min-width: 44px;
        min-height: 44px;
    }

    .tour-keyboard-hint,
    .tour-popover-keys > span[aria-hidden] {
        display: none;
    }

    .tour-popover-keys {
        padding-bottom: 0.25rem;
    }
}
