/* =============================================================================
   TOUR DE ONBOARDING - CSS
   ============================================================================= */

/* Overlay do tour */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(1px);
    pointer-events: none;
}

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

/* Highlight do elemento focado */
.tour-highlight {
    position: relative;
    z-index: 10001;
    border-radius: 12px;
    box-shadow: 
        0 0 0 8px rgba(255, 107, 53, 0.9),
        0 0 0 16px rgba(255, 107, 53, 0.6),
        0 0 0 24px rgba(255, 107, 53, 0.3),
        0 0 0 32px rgba(255, 107, 53, 0.1),
        0 0 80px rgba(255, 107, 53, 0.7),
        inset 0 0 30px rgba(255, 107, 53, 0.15);
    animation: tour-pulse 2s infinite;
    transform: scale(1.08);
    transition: all 0.3s ease;
    background: rgba(255, 107, 53, 0.15);
    backdrop-filter: blur(5px);
    border: 3px solid rgba(255, 107, 53, 0.8);
}

/* Highlight mais forte para seções importantes */
.tour-highlight.section-highlight {
    box-shadow: 
        0 0 0 10px rgba(255, 107, 53, 1.0),
        0 0 0 20px rgba(255, 107, 53, 0.8),
        0 0 0 30px rgba(255, 107, 53, 0.5),
        0 0 0 40px rgba(255, 107, 53, 0.2),
        0 0 100px rgba(255, 107, 53, 0.8),
        inset 0 0 40px rgba(255, 107, 53, 0.2);
    transform: scale(1.12);
    background: rgba(255, 107, 53, 0.2);
    border: 4px solid rgba(255, 107, 53, 1.0);
    border-radius: 20px;
    position: relative;
}

/* Efeito de brilho para seções importantes */
.tour-highlight.section-highlight::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    background: linear-gradient(45deg, 
        rgba(255, 107, 53, 0.3) 0%,
        rgba(255, 107, 53, 0.1) 25%,
        rgba(255, 107, 53, 0.3) 50%,
        rgba(255, 107, 53, 0.1) 75%,
        rgba(255, 107, 53, 0.3) 100%);
    border-radius: 20px;
    z-index: -1;
    animation: tour-glow 3s ease-in-out infinite;
}

@keyframes tour-glow {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

@keyframes tour-pulse {
    0%, 100% {
        box-shadow: 
            0 0 0 8px rgba(255, 107, 53, 0.9),
            0 0 0 16px rgba(255, 107, 53, 0.6),
            0 0 0 24px rgba(255, 107, 53, 0.3),
            0 0 0 32px rgba(255, 107, 53, 0.1),
            0 0 80px rgba(255, 107, 53, 0.7),
            inset 0 0 30px rgba(255, 107, 53, 0.15);
        transform: scale(1.08);
    }
    50% {
        box-shadow: 
            0 0 0 10px rgba(255, 107, 53, 1.0),
            0 0 0 20px rgba(255, 107, 53, 0.7),
            0 0 0 30px rgba(255, 107, 53, 0.4),
            0 0 0 40px rgba(255, 107, 53, 0.2),
            0 0 100px rgba(255, 107, 53, 0.8),
            inset 0 0 40px rgba(255, 107, 53, 0.2);
        transform: scale(1.1);
    }
}

/* Tooltip do tour */
.tour-tooltip {
    position: fixed;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid #ff6b35;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    min-width: 300px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(255, 107, 53, 0.1);
    z-index: 10002;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    /* Garantir que não saia da tela */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

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

.tour-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

/* Posicionamento das setas */
.tour-tooltip.top::before {
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-top-color: #ff6b35;
}

.tour-tooltip.bottom::before {
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom-color: #ff6b35;
}

.tour-tooltip.left::before {
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-left-color: #ff6b35;
}

.tour-tooltip.right::before {
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    border-right-color: #ff6b35;
}

/* Conteúdo do tooltip */
.tour-tooltip-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 107, 53, 0.2);
}

.tour-tooltip-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 12px;
    color: white;
    font-weight: bold;
}

.tour-tooltip-title {
    color: #ff6b35;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.tour-tooltip-close {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tour-tooltip-close:hover {
    background: rgba(255, 107, 53, 0.1);
    color: #ff6b35;
}

.tour-tooltip-content {
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

/* Banner de demo */
.tour-demo-banner {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.tour-tooltip-content p {
    margin: 0 0 8px 0;
}

.tour-tooltip-content ul {
    margin: 8px 0;
    padding-left: 20px;
}

.tour-tooltip-content li {
    margin-bottom: 4px;
    color: #ccc;
}

/* Ações do tooltip */
.tour-tooltip-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

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

.tour-tooltip-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tour-tooltip-btn-primary {
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    color: white;
}

.tour-tooltip-btn-primary:hover {
    background: linear-gradient(135deg, #e55a2b, #e67a35);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.tour-tooltip-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tour-tooltip-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.tour-tooltip-btn-skip {
    background: none;
    color: #888;
    border: none;
    padding: 8px 12px;
}

.tour-tooltip-btn-skip:hover {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

/* Indicador de progresso */
.tour-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.tour-progress-bar {
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b35, #ff8c42);
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Botão de iniciar tour */
.tour-start-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b35, #ff8c42);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 107, 53, 0.3);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tour-start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 107, 53, 0.4);
}

.tour-start-btn.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

/* Tour Mobile Simplificado */
@media (max-width: 768px) {
    /* Ocultar tour desktop no mobile */
    .tour-start-btn,
    .btn-tour,
    .btn-tour-header,
    #startTourBtn {
        display: none !important;
    }
    
    .tour-tooltip,
    .tour-overlay {
        display: none !important;
    }
    
    /* Botão de tour mobile simplificado */
    .mobile-tour-start-btn {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        background: linear-gradient(135deg, #ff6b35, #ff8c42);
        border: none;
        border-radius: 50%;
        color: white;
        font-size: 18px;
        cursor: pointer;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
        transition: all 0.3s ease;
        z-index: 9999;
        opacity: 0;
        transform: scale(0.8);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-tour-start-btn.show {
        opacity: 1;
        transform: scale(1);
    }
    
    .mobile-tour-start-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    }
    
    /* Overlay mobile simplificado */
    .mobile-tour-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.2);
        z-index: 10000;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .mobile-tour-overlay.show {
        opacity: 1;
    }
    
    /* Tooltip mobile simplificado */
    .mobile-tour-tooltip {
        position: fixed;
        bottom: 100px;
        left: 20px;
        right: 20px;
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
        border: 2px solid #ff6b35;
        border-radius: 12px;
        padding: 16px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
        z-index: 10001;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
        max-width: calc(100vw - 40px);
    }
    
    .mobile-tour-tooltip.show {
        opacity: 1;
        transform: translateY(0);
    }
    
    .mobile-tooltip-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
        padding-bottom: 8px;
        border-bottom: 1px solid rgba(255, 107, 53, 0.2);
    }
    
    .mobile-tooltip-header h3 {
        color: #ff6b35;
        font-size: 16px;
        font-weight: 600;
        margin: 0;
    }
    
    .mobile-tooltip-close {
        background: none;
        border: none;
        color: #888;
        font-size: 20px;
        cursor: pointer;
        padding: 0;
        width: 24px;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: all 0.2s ease;
    }
    
    .mobile-tooltip-close:hover {
        background: rgba(255, 107, 53, 0.1);
        color: #ff6b35;
    }
    
    .mobile-tooltip-content {
        color: #e0e0e0;
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 12px;
    }
    
    .mobile-tooltip-progress {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: 12px;
        color: #888;
    }
    
    .mobile-progress-bar {
        width: 60px;
        height: 4px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 2px;
        overflow: hidden;
        margin-left: 10px;
    }
    
    .mobile-progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #ff6b35, #ff8c42);
        border-radius: 2px;
        transition: width 0.3s ease;
    }
    
    /* Mensagem de sucesso mobile */
    .mobile-tour-success {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        z-index: 10002;
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
    }
    
    .mobile-tour-success.show {
        opacity: 1;
        transform: translateY(0);
    }
    
    .mobile-success-content {
        background: linear-gradient(135deg, #00B04F, #00D05A);
        color: white;
        padding: 12px 16px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        font-weight: 500;
        box-shadow: 0 4px 15px rgba(0, 176, 79, 0.3);
    }
    
    .mobile-success-content i {
        font-size: 16px;
    }
}

/* Animações especiais */
.tour-tooltip.entering {
    animation: tour-tooltip-enter 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tour-tooltip-enter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tour-tooltip.exiting {
    animation: tour-tooltip-exit 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tour-tooltip-exit {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

/* Estados especiais */
.tour-tooltip.welcome {
    border-color: #00B04F;
}

.tour-tooltip.welcome .tour-tooltip-icon {
    background: linear-gradient(135deg, #00B04F, #00D05A);
}

.tour-tooltip.welcome .tour-tooltip-title {
    color: #00B04F;
}

.tour-tooltip.feature {
    border-color: #4A90E2;
}

.tour-tooltip.feature .tour-tooltip-icon {
    background: linear-gradient(135deg, #4A90E2, #6BA3F0);
}

.tour-tooltip.feature .tour-tooltip-title {
    color: #4A90E2;
}

/* Efeito de partículas no fundo */
.tour-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(255, 107, 53, 0.03) 0%, transparent 50%);
    animation: tour-particles 8s ease-in-out infinite;
}

/* Melhorar visibilidade da tela principal */
.tour-overlay.active {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(0.2px);
}

/* Efeito de spotlight removido para manter tela principal visível */

/* Manter tela principal totalmente visível */
body.tour-active .app-container {
    opacity: 1;
    transition: opacity 0.3s ease;
    filter: none;
}

body.tour-active .app-container * {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.tour-highlight {
    opacity: 1 !important;
    z-index: 10001 !important;
    filter: none !important;
}

.tour-highlight * {
    opacity: 1 !important;
}

/* Highlight específico para sidebar */
.tour-highlight.sidebar,
.tour-highlight.sidebar-content,
.tour-highlight.sidebar-header,
.tour-highlight.sidebar-tabs {
    z-index: 10002 !important;
    position: relative !important;
}

/* Garantir que a sidebar seja visível quando destacada */
.tour-highlight.sidebar {
    transform: scale(1.05) !important;
    box-shadow: 
        0 0 0 10px rgba(255, 107, 53, 1.0),
        0 0 0 20px rgba(255, 107, 53, 0.8),
        0 0 0 30px rgba(255, 107, 53, 0.5),
        0 0 0 40px rgba(255, 107, 53, 0.2),
        0 0 100px rgba(255, 107, 53, 0.8),
        inset 0 0 40px rgba(255, 107, 53, 0.2) !important;
}

@keyframes tour-particles {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}
