/* WishWell Onboarding Tour Styles */

/* Tour Overlay and Backdrop */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.tour-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s ease;
}

.tour-spotlight {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.95);
    border: 3px solid #4CAF50;
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.3),
        0 0 25px rgba(76, 175, 80, 0.9),
        inset 0 0 0 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    z-index: 10000;
    animation: tourSpotlightPulse 2s infinite;
    pointer-events: none;
}

@keyframes tourSpotlightPulse {
    0%, 100% {
        border-color: #4CAF50;
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.3),
            0 0 25px rgba(76, 175, 80, 0.9),
            inset 0 0 0 2px rgba(255, 255, 255, 0.8);
        background-color: rgba(255, 255, 255, 0.95);
    }
    50% {
        border-color: #66BB6A;
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.35),
            0 0 35px rgba(102, 187, 106, 1),
            inset 0 0 0 2px rgba(255, 255, 255, 0.9);
        background-color: rgba(255, 255, 255, 0.98);
    }
}

/* Tour Tooltip */
.tour-tooltip {
    position: fixed;
    max-width: 380px;
    min-width: 300px;
    background: var(--card-background, #ffffff);
    color: var(--text-color, #333);
    border-radius: 12px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 8px 25px rgba(0, 0, 0, 0.2);
    z-index: 10001;
    pointer-events: auto;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: tourTooltipShow 0.4s ease forwards;
}

@keyframes tourTooltipShow {
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tour-tooltip-content {
    position: relative;
}

.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.tour-tooltip-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tour-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tour-close-btn:hover {
    background-color: #f8f9fa;
    color: #34495e;
}

.tour-tooltip-body {
    padding: 16px 24px;
}

.tour-tooltip-text {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 20px 0;
}

.tour-tooltip-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tour-step-counter {
    font-size: 13px;
    color: #7f8c8d;
    font-weight: 500;
}

.tour-progress-bar {
    height: 4px;
    background-color: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
}

.tour-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #66BB6A);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.tour-tooltip-footer {
    padding: 16px 24px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
}

.tour-navigation {
    display: flex;
    gap: 12px;
}

.tour-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.tour-skip-btn {
    background: none;
    color: #95a5a6;
    border: 1px solid #ecf0f1;
}

.tour-skip-btn:hover {
    color: #7f8c8d;
    border-color: #bdc3c7;
    background-color: #f8f9fa;
}

.tour-prev-btn {
    background: #ecf0f1;
    color: #2c3e50;
}

.tour-prev-btn:hover {
    background: #d5dbdb;
}

.tour-prev-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tour-next-btn,
.tour-finish-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.tour-next-btn:hover,
.tour-finish-btn:hover {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transform: translateY(-1px);
}

.tour-finish-btn {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.tour-finish-btn:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

/* Tour Active State */
body.tour-active .tour-tooltip {
    pointer-events: auto;
}

/* Welcome step with no backdrop darkening */
.tour-overlay.welcome-step .tour-backdrop {
    background-color: transparent;
}

.tour-overlay.welcome-step .tour-spotlight {
    display: none;
}

/* Ensure highlighted elements remain interactive and visible */
.tour-spotlight {
    /* Create a "window" effect by using border instead of background */
    background: transparent !important;
}

/* Alternative approach: create an outline effect */
.tour-spotlight::after {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border: 2px solid rgba(76, 175, 80, 0.4);
    border-radius: inherit;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: 90vw;
        min-width: 280px;
        margin: 0 5vw;
    }
    
    .tour-tooltip-header,
    .tour-tooltip-body,
    .tour-tooltip-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .tour-tooltip-title {
        font-size: 16px;
    }
    
    .tour-tooltip-text {
        font-size: 14px;
    }
    
    .tour-navigation {
        flex-direction: column;
        gap: 8px;
    }
    
    .tour-btn {
        width: 100%;
    }
    
    .tour-tooltip-footer {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .tour-tooltip {
        max-width: 95vw;
        margin: 0 2.5vw;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .tour-spotlight {
        animation: none;
    }
    
    .tour-tooltip {
        transition: opacity 0.2s ease;
        animation: none;
    }
    
    .tour-backdrop,
    .tour-spotlight,
    .tour-progress-fill {
        transition: none;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tour-spotlight {
        border-width: 4px;
        border-color: #000;
    }
    
    .tour-tooltip {
        border: 2px solid #000;
    }
    
    .tour-tooltip-header,
    .tour-tooltip-footer {
        border-color: #000;
    }
}

/* Tour hint for elements that should be highlighted */
.tour-highlight {
    position: relative;
    z-index: 10001;
}

/* Animation for tour elements when they appear */
@keyframes tourElementFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tour-element-enter {
    animation: tourElementFadeIn 0.3s ease-out;
}