/**
 * Kýros Tour System Styles
 * Estilos para o sistema de tour interativo
 */

/* Tour Overlay */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.tour-overlay.show {
    opacity: 1;
}

.tour-spotlight {
    position: absolute;
    background: transparent;
    border-radius: var(--radius-lg);
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.7),
        0 0 0 4px var(--color-accent-cta),
        inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    animation: tourSpotlightPulse 2s infinite;
    z-index: 1;
}

.tour-spotlight.moving {
    animation: tourSpotlightMove 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Garantir que o elemento em destaque não tenha blur */
.tour-highlighted,
.tour-highlighted *,
.tour-highlighted *::before,
.tour-highlighted *::after {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

/* Forçar remoção de blur em todos os contextos */
body.tour-active .tour-highlighted,
body.tour-active .tour-highlighted *,
body.tour-active .tour-highlighted *::before,
body.tour-active .tour-highlighted *::after {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

/* Override específico para elementos com backdrop-filter */
.tour-highlighted[style*="backdrop-filter"],
.tour-highlighted *[style*="backdrop-filter"] {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

/* Específico para elementos do VS Code */
.tour-highlighted .vscode-container,
.tour-highlighted .vscode-header,
.tour-highlighted .vscode-content,
.tour-highlighted .sidebar,
.tour-highlighted .editor-area,
.tour-highlighted .code-editor,
.tour-highlighted .code-content,
.tour-highlighted .floating-panel,
.tour-highlighted .panel-header,
.tour-highlighted .panel-content,
.tour-highlighted .form-textarea {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

/* Forçar remoção de blur em todos os elementos destacados */
body.tour-active .tour-highlighted,
body.tour-active .tour-highlighted * {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

/* Remover blur do overlay quando há elemento destacado */
body.tour-active .tour-overlay:has(.tour-highlighted) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* CSS mais específico para quando está destacando */
body.tour-highlighting .tour-highlighted,
body.tour-highlighting .tour-highlighted *,
body.tour-highlighting .tour-highlighted *::before,
body.tour-highlighting .tour-highlighted *::after {
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

body.tour-highlighting .tour-overlay {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    -moz-backdrop-filter: none !important;
}

@keyframes tourSpotlightPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.7),
            0 0 0 4px var(--color-accent-cta),
            inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.7),
            0 0 0 6px var(--color-accent-cta),
            inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    }
}

/* Tour Tooltip */
.tour-tooltip {
    position: fixed;
    background: var(--color-glass-fill);
    border: 1px solid var(--color-glass-stroke);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    z-index: 100000;
    max-width: min(400px, calc(100vw - 40px));
    min-width: min(320px, calc(100vw - 40px));
    display: none;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    transform: scale(1) translateY(0);
}

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

.tour-tooltip.slide-in {
    animation: slideInTooltip 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.tour-tooltip.slide-out {
    animation: slideOutTooltip 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tourTooltipIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes slideInTooltip {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px) translateX(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0) translateX(0);
    }
}

@keyframes slideOutTooltip {
    from {
        opacity: 1;
        transform: scale(1) translateY(0) translateX(0);
    }
    to {
        opacity: 0;
        transform: scale(0.8) translateY(-20px) translateX(20px);
    }
}

@keyframes tourSpotlightMove {
    0% {
        transform: scale(1);
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.7),
            0 0 0 4px var(--color-accent-cta),
            inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.7),
            0 0 0 6px var(--color-accent-cta),
            inset 0 0 0 2px rgba(255, 255, 255, 0.2);
    }
    100% {
        transform: scale(1);
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.7),
            0 0 0 4px var(--color-accent-cta),
            inset 0 0 0 2px rgba(255, 255, 255, 0.1);
    }
}

.tour-tooltip-content {
    padding: var(--spacing-lg);
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.tour-tooltip-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.tour-close-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.tour-close-btn:hover {
    background: var(--color-glass-stroke);
    color: var(--color-text-primary);
}

.tour-tooltip-body {
    margin-bottom: var(--spacing-md);
}

.tour-tooltip-text {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--spacing-md) 0;
}

.tour-tooltip-actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
}

.tour-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.tour-btn-primary {
    background: var(--color-accent-cta);
    color: var(--color-bg-primary);
}

.tour-btn-primary:hover {
    background: var(--color-gradient-kyros-start);
    transform: translateY(-1px);
}

.tour-btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-glass-stroke);
}

.tour-btn-secondary:hover {
    background: var(--color-glass-fill);
    color: var(--color-text-primary);
    border-color: var(--color-accent-cta);
}

.tour-tooltip-footer {
    border-top: 1px solid var(--color-glass-stroke);
    padding-top: var(--spacing-sm);
}

.tour-progress-text {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-align: center;
}

.tour-current-step {
    font-weight: 700;
    color: var(--color-accent-cta);
}

/* Tour Arrow */
.tour-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--color-glass-fill);
    border: 1px solid var(--color-glass-stroke);
    transform: rotate(45deg);
}

.tour-arrow-top {
    border-right: none;
    border-bottom: none;
}

.tour-arrow-bottom {
    border-left: none;
    border-top: none;
}

.tour-arrow-left {
    border-top: none;
    border-right: none;
}

.tour-arrow-right {
    border-bottom: none;
    border-left: none;
}

/* Progress Bar */
.tour-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    z-index: 100001;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-gradient-kyros-start), var(--color-accent-cta));
    transition: width 0.3s ease;
    width: 0%;
}



/* Floating Tour Button */
.tour-floating-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100003;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--color-accent-cta);
    color: var(--color-bg-primary);
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 166, 251, 0.3);
    animation: tourFloatPulse 2s infinite;
}

.tour-floating-btn:hover {
    background: var(--color-gradient-kyros-start);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 166, 251, 0.4);
}

.tour-floating-btn svg {
    width: 20px;
    height: 20px;
}

.tour-btn-text {
    font-size: 12px;
    font-weight: 700;
}

@keyframes tourFloatPulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(0, 166, 251, 0.3);
    }
    50% {
        box-shadow: 0 4px 20px rgba(0, 166, 251, 0.5);
    }
}

/* Completion Message */
.tour-completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--color-glass-fill);
    border: 1px solid var(--color-glass-stroke);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-xl);
    z-index: 100004;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tour-completion-message.show {
    opacity: 1;
}

.tour-completion-content {
    padding: var(--spacing-xl);
    text-align: center;
    max-width: 400px;
}

.tour-completion-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

.tour-completion-content h3 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 var(--spacing-md) 0;
}

.tour-completion-content p {
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0 0 var(--spacing-lg) 0;
}

/* Tour Active State */
body.tour-active {
    overflow: hidden;
}


/* Garantir que o tour tenha prioridade sobre outros elementos */
body.tour-active * {
    z-index: auto !important;
}

body.tour-active .tour-overlay {
    z-index: 99999 !important;
}

body.tour-active .tour-tooltip {
    z-index: 100000 !important;
}


body.tour-active .tour-floating-btn {
    z-index: 100002 !important;
}

body.tour-active .tour-completion-message {
    z-index: 100003 !important;
}

/* Esconder outros modais durante o tour */
body.tour-active .modal:not(.tour-tooltip):not(.tour-completion-message),
body.tour-active .popup:not(.tour-tooltip):not(.tour-completion-message),
body.tour-active .dialog:not(.tour-tooltip):not(.tour-completion-message),
body.tour-active .overlay:not(.tour-overlay),
body.tour-active .floating-panel:not(.tour-tooltip):not(.tour-completion-message) {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: calc(100vw - 40px);
        min-width: 280px;
        margin: 0 20px;
    }
    
    .tour-tooltip-content {
        padding: var(--spacing-md);
    }
    
    .tour-tooltip-title {
        font-size: 16px;
    }
    
    .tour-tooltip-text {
        font-size: 14px;
    }
    
    .tour-nav-content {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
}

/* Accessibility */
.tour-tooltip:focus-within {
    outline: 2px solid var(--color-accent-cta);
    outline-offset: 2px;
}

.tour-btn:focus {
    outline: 2px solid var(--color-accent-cta);
    outline-offset: 2px;
}