/* assets/admin/plugins/tour/tour.css */

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999998 !important; /* Abaixo do tooltip mas acima de tudo */
    display: none;
    pointer-events: none;

    /* máscara “fura” o retângulo na posição do elemento */
    mask: url(#tour-mask);
    mask-repeat: no-repeat;
    -webkit-mask: url(#tour-mask);
    -webkit-mask-repeat: no-repeat;
}

.tour-tooltip .tour-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

.tour-step-counter {
    font-size: 0.85rem;
    color: #666;
    margin-left: 0.5rem;
}

/* Tooltip base */
.tour-tooltip {
    max-width: 320px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.75rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
    position: fixed;
    z-index: 9999999 !important; /* Z-index muito alto para ficar acima de TUDO */
    font-family: var(--bs-body-font-family, "Public Sans", sans-serif);
    animation: fadeIn 0.25s ease-out;
    transition: all 0.2s ease-in-out;
    pointer-events: auto; /* Garantir que o tooltip não bloqueie interações */
}

/* Garantir que elementos destacados tenham z-index maior que o tooltip quando necessário */
.tour-highlighted {
    position: relative;
    z-index: 10000 !important; /* Maior que o tooltip para permitir interação */
}

/* Seta (flecha) do tooltip */
.tour-tooltip::after {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Posições da seta */
.tour-top::after {
    bottom: -10px;
    left: calc(50% - 8px);
    border-width: 8px 8px 0 8px;
    border-color: #fff transparent transparent transparent;
}

.tour-bottom::after {
    top: -10px;
    left: calc(50% - 8px);
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent #fff transparent;
}

.tour-left::after {
    right: -10px;
    top: calc(50% - 8px);
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #fff;
}

.tour-right::after {
    left: -10px;
    top: calc(50% - 8px);
    border-width: 8px 8px 8px 0;
    border-color: transparent #fff transparent transparent;
}

/* posições diagonais */
.tour-left-top::after {
    right: -10px;
    top: 12px;
    border-width: 8px 0 8px 8px;
    border-color: transparent transparent transparent #fff;
}

.tour-right-top::after {
    left: -10px;
    top: 12px;
    border-width: 8px 8px 8px 0;
    border-color: transparent #fff transparent transparent;
}

/* Cabeçalho (título do passo) */
.tour-header {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #212529;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.25rem;
}

/* Corpo (descrição do passo) */
.tour-body {
    font-size: 0.875rem;
    color: #495057;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Rodapé com botões */
.tour-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* Botões */
.tour-footer button {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    white-space: nowrap;
    min-width: 80px;
}

/* Anterior */
.tour-btn-prev {
    background-color: #e9ecef;
    color: #495057;
}

.tour-btn-prev:hover {
    background-color: #d3d9df;
}

/* Próximo */
.tour-btn-next {
    background-color: #0d6efd;
    color: #fff;
}

.tour-btn-next:hover {
    background-color: #0b5ed7;
}

/* Cancelar */
.tour-btn-cancel {
    background-color: #fff;
    color: #dc3545;
    border: 1px solid #dc3545;
    margin-right: auto;
}

.tour-btn-cancel:hover {
    background-color: #f8d7da;
}

/* Destaque do elemento ativo */
.tour-highlighted {
    outline: 3px solid rgba(79, 152, 207, 0.6);
    border-radius: 6px;
    position: relative;
    z-index: 9999998 !important; /* Abaixo do tooltip mas acima de outros elementos */
    animation: pulseSoulClinic 1.6s ease-in-out infinite;
    pointer-events: auto !important; /* Garantir que o elemento possa receber cliques */
}

/* Garantir que inputs dentro de elementos destacados possam ser clicados */
.tour-highlighted input,
.tour-highlighted select,
.tour-highlighted textarea,
.tour-highlighted button {
    position: relative;
    z-index: 9999998 !important; /* Abaixo do tooltip mas acima de outros elementos */
    pointer-events: auto !important;
}

/* Garantir que o calendário do Flatpickr apareça acima de outros elementos mas abaixo do tooltip */
.flatpickr-calendar.open {
    z-index: 9999997 !important; /* Abaixo do tooltip mas acima de outros elementos */
}

/* dentro do seu stylesheet global */
.tour-tooltip {
    max-width: 320px;
    /* valor padrão */
}

.tour-tooltip.has-image {
    max-width: 600px;
    /* quando tiver imagem, aumenta */
}

.tour-tooltip .tour-body img {
    max-width: 100%;
    height: auto;
    cursor: zoom-in;
}

/* lightbox simples */
.tour-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999998 !important; /* Abaixo do tooltip mas acima de tudo */
}

.tour-lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
}

#tour-video-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999998 !important; /* Abaixo do tooltip mas acima de tudo */
}

#tour-video-lightbox iframe {
    width: 80vw;
    height: 45vw;
    max-width: 800px;
    max-height: 450px;
}

.tour-tooltip .tour-body {
    max-height: 35rem;     /* ou o que fizer sentido pra você */
    overflow-y: auto;
    padding-right: 0.5rem; /* espaço pra a barra de scroll não sobrepor o texto */
  }

/* Animação de pulso para o destaque */
@keyframes pulseSoulClinic {
    0% {
        outline-color: rgba(79, 152, 207, 0.6);
        box-shadow: 0 0 0 0 rgba(79, 152, 207, 0.3);
    }

    50% {
        outline-color: rgba(79, 152, 207, 0.3);
        box-shadow: 0 0 0 6px rgba(79, 152, 207, 0.15);
    }

    100% {
        outline-color: rgba(79, 152, 207, 0.6);
        box-shadow: 0 0 0 0 rgba(79, 152, 207, 0);
    }
}

/* Animação de entrada das tooltips */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}