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

:root {
    --tour-primary: #405189;
    /* Cor primária SoulClinic (exemplo) */
    --tour-primary-rgb: 64, 81, 137;
    --tour-bg: rgba(255, 255, 255, 0.82);
    --tour-border: #e9ecef;
    --tour-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --tour-pulse: rgba(64, 81, 137, 0.4);
}

.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
    z-index: 9999998 !important;
    display: none;
    pointer-events: none;
}

/* Tooltip base */
.tour-tooltip {
    max-width: 340px;
    background: var(--tour-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--tour-border);
    border-radius: 1rem;
    box-shadow: var(--tour-shadow);
    padding: 1.5rem;
    position: fixed;
    z-index: 9999999 !important;
    font-family: "Inter", var(--bs-body-font-family, "Public Sans", sans-serif);
    animation: tourFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.2s ease-in-out;
    pointer-events: auto;
    color: #333;
}

.tour-tooltip.has-image {
    max-width: 550px;
}

/* Seta (flecha) do tooltip com suporte a glassmorphism */
.tour-tooltip::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--tour-bg);
    border: inherit;
    z-index: -1;
}

.tour-top::after {
    bottom: -8px;
    left: calc(50% - 8px);
    transform: rotate(45deg);
    border-top: none !important;
    border-left: none !important;
}

.tour-bottom::after {
    top: -8px;
    left: calc(50% - 8px);
    transform: rotate(45deg);
    border-bottom: none !important;
    border-right: none !important;
}

.tour-left::after {
    right: -8px;
    top: calc(50% - 8px);
    transform: rotate(45deg);
    border-bottom: none !important;
    border-left: none !important;
}

.tour-right::after {
    left: -8px;
    top: calc(50% - 8px);
    transform: rotate(45deg);
    border-top: none !important;
    border-right: none !important;
}

/* Cabeçalho */
.tour-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.tour-header strong {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1e21;
    letter-spacing: -0.01em;
}

.tour-step-counter {
    font-size: 0.8rem;
    font-weight: 600;
    color: #878a99;
    background: #f3f3f9;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Corpo */
.tour-body {
    font-size: 0.925rem;
    line-height: 1.6;
    color: #495057;
    margin-bottom: 1.25rem;
    max-height: 40vh;
    overflow-y: auto;
}

/* Custom scrollbar para tour-body */
.tour-body::-webkit-scrollbar {
    width: 5px;
}

.tour-body::-webkit-scrollbar-track {
    background: transparent;
}

.tour-body::-webkit-scrollbar-thumb {
    background: #e2e5ec;
    border-radius: 10px;
}

/* Rodapé */
.tour-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 1.25rem;
}

.tour-footer button {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 0.6rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tour-footer button:active {
    transform: scale(0.96);
}

.tour-btn-prev {
    background: #ffffff;
    color: #495057;
    border: 1px solid #dcdfe6 !important;
}

.tour-btn-prev:hover {
    background: #f8f9fa;
    border-color: var(--tour-primary) !important;
    color: var(--tour-primary);
}

.tour-btn-next {
    background: var(--tour-primary);
    color: #ffffff;
}

.tour-btn-next:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(var(--tour-primary-rgb), 0.3);
}

.tour-btn-cancel {
    background: transparent;
    color: #f06548;
    border: 1px solid rgba(240, 101, 72, 0.4) !important;
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    margin-right: auto;
    opacity: 0.8;
}

.tour-btn-cancel:hover {
    background: #f06548;
    color: #ffffff;
    border-color: #f06548 !important;
}

/* Destaque do elemento */
.tour-highlighted {
    position: relative;
    z-index: 9999998 !important;
    outline: 4px solid var(--tour-pulse);
    border-radius: 0.5rem;
    box-shadow: 0 0 0 0 var(--tour-pulse);
    animation: tourPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    pointer-events: auto !important;
}

/* Lightbox de Mídia */
#tour-lightbox,
#tour-video-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000000 !important;
}

#tour-lightbox img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#tour-video-lightbox iframe {
    width: 80vw;
    height: 45vw;
    max-width: 900px;
    max-height: 506px;
    border-radius: 1rem;
    background: #000;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Animações */
@keyframes tourFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

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

@keyframes tourPulse {
    0% {
        outline-offset: 0;
        box-shadow: 0 0 0 0 var(--tour-pulse);
    }

    70% {
        outline-offset: 4px;
        box-shadow: 0 0 0 10px rgba(var(--tour-primary-rgb), 0);
    }

    100% {
        outline-offset: 0;
        box-shadow: 0 0 0 0 rgba(var(--tour-primary-rgb), 0);
    }
}

@keyframes pulseHelp {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--tour-primary-rgb), 0.7);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(var(--tour-primary-rgb), 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--tour-primary-rgb), 0);
    }
}

.pulse-help {
    animation: pulseHelp 2s infinite !important;
}

/* Responsividade */
@media (max-width: 576px) {
    .tour-tooltip {
        max-width: 90vw;
        left: 5vw !important;
        right: 5vw !important;
        bottom: 20px !important;
        top: auto !important;
    }

    .tour-tooltip::after {
        display: none;
    }
}

/* Garantir que o dropdown do Select2 apareça acima do overlay do tour */
.select2-container--open {
    z-index: 9999999 !important;
}

.custom-select2-dropdown {
    z-index: 9999999 !important;
}