/* Tutorial Popup Styles - Force above all other elements */
.tutorial-popup {
    position: absolute !important;
    background: linear-gradient(135deg, var(--white, #ffffff) 0%, var(--light-blue, #E7F3FC) 100%) !important;
    border: 3px solid !important;
    border-image: linear-gradient(135deg, #667eea 0%, var(--dark-blue, #16145D) 50%, #f093fb 100%) 1 !important;
    border-radius: 16px !important;
    padding: 20px 24px !important;
    min-width: 280px !important;
    max-width: 350px !important;
    box-shadow: var(--box-shadow-lg, 0 10px 25px rgba(0, 0, 0, 0.3)), 0 10px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    z-index: 99999 !important;
    opacity: 0 !important;
    transform: scale(0.8) translateY(-10px) !important;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    font-family: var(--normal_font, 'Abhaya Libre', system-ui, -apple-system, sans-serif) !important;
    color: var(--dark-gray, #333) !important;
    text-align: center !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}

/* Force visibility when active */
.tutorial-popup.visible {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    visibility: visible !important;
    animation: tutorialPulse 0.6s ease-out, pulse 2s infinite 2s !important;
}

/* Arrow styles with higher specificity - only for desktop */
.tutorial-popup:not(.mobile-popup)::before {
    content: '' !important;
    position: absolute !important;
    top: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 12px solid transparent !important;
    border-right: 12px solid transparent !important;
    border-bottom: 12px solid #667eea !important;
    z-index: 100000 !important;
}

.tutorial-popup:not(.mobile-popup)::after {
    content: '' !important;
    position: absolute !important;
    top: -9px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 9px solid transparent !important;
    border-right: 9px solid transparent !important;
    border-bottom: 9px solid #ffffff !important;
    z-index: 100001 !important;
}

/* Remove any arrows from mobile popups by default */
.tutorial-popup.mobile-popup::before,
.tutorial-popup.mobile-popup::after {
    display: none !important;
}

/* Desktop specific positioning */
.tutorial-popup.desktop-popup {
    top: calc(100% + 15px) !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.8) translateY(-10px) !important;
}

.tutorial-popup.desktop-popup.visible {
    transform: translateX(-50%) scale(1) translateY(0) !important;
}

.tutorial-popup.desktop-popup::after {
    top: -9px !important;
    left: 50% !important;
}

/* Mobile specific positioning with transparency */
.tutorial-popup.mobile-popup {
    position: absolute !important;
    /* JavaScript will set top and left via style attribute */
    transform: translateY(10px) scale(0.8) !important;
    z-index: 99999 !important;
    margin-top: 10px !important;
    /* Glassmorphism effect for mobile */
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-image: none !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.tutorial-popup.mobile-popup.visible {
    transform: translateY(0) scale(1) !important;
}

/* Enhanced text contrast for mobile transparency */
.tutorial-popup.mobile-popup p {
    color: var(--dark-blue, #16145D) !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.6) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

/* Special mobile menu popup positioning */
.side-nav-links .free-consultation-wrapper .tutorial-popup.mobile-popup {
    position: absolute !important;
    top: auto !important;
    bottom: calc(100% + 15px) !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.8) !important;
    /* Glassmorphism effect for mobile menu consultation */
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(20px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    border-image: none !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 4px 16px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

.side-nav-links .free-consultation-wrapper .tutorial-popup.mobile-popup.visible {
    transform: translateX(-50%) scale(1) !important;
}

/* Enhanced text for mobile menu consultation popup */
.side-nav-links .free-consultation-wrapper .tutorial-popup.mobile-popup p {
    color: var(--dark-blue, #16145D) !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
    background: rgba(255, 255, 255, 0.6) !important;
    padding: 8px 12px !important;
    border-radius: 8px !important;
    margin: 0 !important;
}

/* Semi-transparent arrows for mobile menu consultation popup */
.side-nav-links .free-consultation-wrapper .tutorial-popup.mobile-popup::before {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    bottom: -12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 12px solid transparent !important;
    border-right: 12px solid transparent !important;
    border-top: 12px solid rgba(255, 255, 255, 0.3) !important;
    border-bottom: none !important;
    z-index: 100000 !important;
}

.side-nav-links .free-consultation-wrapper .tutorial-popup.mobile-popup::after {
    display: block !important;
    content: '' !important;
    position: absolute !important;
    bottom: -9px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 9px solid transparent !important;
    border-right: 9px solid transparent !important;
    border-top: 9px solid rgba(255, 255, 255, 0.85) !important;
    border-bottom: none !important;
    z-index: 100001 !important;
}

/* Close button with high contrast */
.tutorial-popup .close-tutorial {
    position: absolute !important;
    top: 8px !important;
    right: 12px !important;
    background: none !important;
    border: none !important;
    font-size: var(--fs-18, 1.8rem) !important;
    font-weight: bold !important;
    color: var(--dark-gray, #666) !important;
    cursor: pointer !important;
    z-index: 100001 !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    transition: all var(--transition-fast, 0.3s ease) !important;
    font-family: var(--normal_font, 'Abhaya Libre', system-ui, -apple-system, sans-serif) !important;
    line-height: 1 !important;
    min-width: 24px !important;
    min-height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* Accessibility */
    outline: none !important;
}

.tutorial-popup .close-tutorial:hover {
    background: rgba(22, 20, 93, 0.1) !important;
    color: var(--dark-blue, #16145D) !important;
    transform: scale(1.1) !important;
}

.tutorial-popup .close-tutorial:focus {
    background: rgba(22, 20, 93, 0.1) !important;
    color: var(--dark-blue, #16145D) !important;
    outline: 2px solid var(--dark-blue, #16145D) !important;
    outline-offset: 2px !important;
}

/* Text content with maximum contrast */
.tutorial-popup p {
    margin: 0 !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #1a202c !important;
    font-weight: 700 !important;
    text-align: center !important;
    padding-right: 32px !important;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important;
}

/* Animation keyframes */
@keyframes tutorialPulse {
    0% {
        transform: scale(0.8) translateY(-10px);
        opacity: 0;
    }
    50% {
        transform: scale(1.05) translateY(0);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Mobile-specific animation that preserves the translateY positioning */
@keyframes tutorialPulseMobile {
    0% {
        transform: translateY(10px) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translateY(0) scale(1.05);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.tutorial-popup.visible {
    animation: tutorialPulse 0.6s ease-out, pulse 2s infinite 2s !important;
}

/* Use different animation for mobile popups */
.tutorial-popup.mobile-popup.visible {
    animation: tutorialPulseMobile 0.6s ease-out, pulse 2s infinite 2s !important;
}

/* Wrapper specific positioning */
.free-consultation-wrapper {
    position: relative !important;
}

.free-consultation-wrapper .tutorial-popup.desktop-popup {
    position: absolute !important;
    top: calc(100% + 15px) !important;
    left: 50% !important;
    transform: translateX(-50%) scale(0.8) translateY(-10px) !important;
    z-index: 99999 !important;
}

.free-consultation-wrapper .tutorial-popup.desktop-popup.visible {
    transform: translateX(-50%) scale(1) translateY(0) !important;
}

.free-consultation-wrapper .tutorial-popup.desktop-popup::after {
    top: -9px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-bottom: 9px solid #ffffff !important;
    border-top: none !important;
}

/* Pulse animation for the element */
@keyframes pulse {
    0% {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 0 rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 10px rgba(102, 126, 234, 0.2);
    }
    100% {
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 10px 20px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Highlight pulse animation for menu items */
@keyframes highlightPulse {
    0% {
        background: rgba(102, 126, 234, 0.15);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.5);
    }
    50% {
        background: rgba(102, 126, 234, 0.25);
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0.15);
    }
    100% {
        background: rgba(102, 126, 234, 0.15);
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

/* Highlight item styling */
.highlight-item {
    position: relative !important;
    animation: highlightPulse 2s infinite !important;
}

/* Mobile responsive adjustments */
@media (max-width: 767px) {
    .tutorial-popup {
        min-width: 260px !important;
        max-width: 90vw !important;
        padding: 18px 20px !important;
    }
    
    .tutorial-popup p {
        font-size: 15px !important;
        padding-right: 28px !important;
    }
    
    .tutorial-popup .close-tutorial {
        width: 26px !important;
        height: 26px !important;
        font-size: 14px !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tutorial-popup {
        background: #ffffff !important;
        border: 4px solid #000000 !important;
        border-image: none !important;
    }
    
    .tutorial-popup::before {
        border-bottom-color: #000000 !important;
    }
    
    .tutorial-popup::after {
        border-bottom-color: #ffffff !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .tutorial-popup {
        transition: opacity 0.3s ease !important;
        animation: none !important;
    }
    
    .tutorial-popup.visible {
        animation: none !important;
    }
    
    .highlight-item {
        animation: none !important;
        background: rgba(102, 126, 234, 0.2) !important;
    }
}

/* Force above slide cart and all other elements */
.tutorial-popup {
    z-index: 99999 !important;
}

.tutorial-popup::before,
.tutorial-popup::after {
    z-index: 100000 !important;
}

.tutorial-popup .close-tutorial {
    z-index: 100001 !important;
}

/* Ensure proper stacking context */
body .tutorial-popup:not(.mobile-popup),
html .tutorial-popup:not(.mobile-popup),
* .tutorial-popup:not(.mobile-popup) {
    z-index: 99999 !important;
    position: absolute !important;
}

/* Mobile popups should allow JavaScript positioning */
body .tutorial-popup.mobile-popup,
html .tutorial-popup.mobile-popup,
* .tutorial-popup.mobile-popup {
    z-index: 99999 !important;
    /* Don't force position for mobile - let JavaScript handle it */
}

/* Override any conflicting positioning - except for mobile popups */
.tutorial-popup:not(.mobile-popup)[style*="position"] {
    position: absolute !important;
}

/* Force font styling to match website */
.tutorial-popup,
.tutorial-popup * {
    font-family: var(--normal_font, 'Abhaya Libre', system-ui, -apple-system, sans-serif) !important;
}

.tutorial-popup p {
    color: var(--dark-gray, #333) !important;
    font-weight: 500 !important;
    font-size: var(--fs-16, 1.6rem) !important;
    line-height: 1.5 !important;
    max-width: none !important;
}

/* Enhanced close button for mobile popups */
.tutorial-popup.mobile-popup .close-tutorial {
    background: rgba(255, 255, 255, 0.8) !important;
    color: var(--dark-blue, #16145D) !important;
    font-weight: bold !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.tutorial-popup.mobile-popup .close-tutorial:hover {
    background: rgba(255, 255, 255, 0.95) !important;
    color: var(--dark-blue, #16145D) !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
} 