/**
 * Variation View Tutorial Styles
 * Styles for the 3-step tutorial overlay and speech bubbles
 * 
 * @package MisterMobile
 * @subpackage ProductCategoryV2
 */

/* Tutorial Overlay */
.mm-tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* Tutorial Sidebar Overlay - for mobile */
.mm-tutorial-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    pointer-events: none;
    z-index: 9998 !important;
}

/* Tutorial Bubble */
.mm-tutorial-bubble {
    position: relative;
    z-index: 9999;
    max-width: 400px;
    min-width: 300px;
    background: #FFEB00;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    animation: mmTutorialBubbleAppear 0.3s ease-out;
    margin-bottom: 20px;
}

/* Absolute positioned bubble - positioned absolutely to avoid layout disruption */
.mm-tutorial-bubble-absolute {
    position: absolute;
    z-index: 9999;
    margin: 0;
    display: block;
}

.mm-tutorial-bubble::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border: 15px solid transparent;
    border-top-color: #FFEB00;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
}

/* Arrow for absolute positioned bubbles - pointing down to target */
.mm-tutorial-bubble.mm-tutorial-bubble-absolute::before {
    border-top-color: #FFEB00;
    border-bottom-color: transparent;
    top: auto;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
}

/* Arrow for bubbles positioned below target - pointing up to target */
.mm-tutorial-bubble-below::before {
    border-top-color: transparent;
    border-bottom-color: #FFEB00;
    top: -30px;
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
}

/* Custom arrow positioning - uses CSS variable set by JS */
.mm-tutorial-bubble.mm-tutorial-arrow-custom::before {
    left: var(--arrow-left, 50%);
}

/* For below-positioned bubbles with custom arrow */
.mm-tutorial-bubble-below.mm-tutorial-arrow-custom::before {
    left: var(--arrow-left, 50%);
}

/* Tutorial Bubble Content */
.mm-tutorial-bubble-content {
    padding: 25px;
    position: relative;
}

.mm-tutorial-icon {
    text-align: center;
    margin-bottom: 15px;
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: #FFEB00;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mm-tutorial-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mm-tutorial-text {
    margin-top: 10px;
}

.mm-tutorial-text h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #000;
    line-height: 1.3;
}

.mm-tutorial-text p {
    /* margin: 0 0 20px 0; */
    font-size: 14px;
    color: #000;
    line-height: 1.4;
}

/* Tutorial Navigation */
.mm-tutorial-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mm-tutorial-step {
    font-size: 12px;
    color: #000;
    font-weight: 500;
}

.mm-tutorial-buttons {
    display: flex;
    gap: 10px;
}

.mm-tutorial-next,
.mm-tutorial-done {
    background: #000;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.mm-tutorial-next:hover,
.mm-tutorial-done:hover {
    background: #000;
    transform: translateY(-1px);
}

.mm-tutorial-done {
    background: #28a745;
}

.mm-tutorial-done:hover {
    background: #218838;
}

/* Tutorial Highlight */
.mm-tutorial-highlight {
    position: relative;
    z-index: 10002 !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    /* box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6); */
    outline: 3px solid #FFEB00;
    outline-offset: 4px;
    animation: mmTutorialPulse 2s ease-in-out infinite;

    outline: 3px solid #FFEB00;
    outline-offset: 0;
    animation: mmTutorialPulse 1.6s ease-in-out infinite;
}

@keyframes mmTutorialPulse {
    0%, 100% {
        outline-color: #FFEB00;
        outline-offset: 0;
        filter: drop-shadow(0 0 0px #FFEB00);
    }
    50% {
        outline-color: #FFD700;
        outline-offset: 6px;
        filter: drop-shadow(0 0 6px #FFD700);
    }
}

/* Optional marker class if needed for debugging */
.mm-tutorial-elevated { position: relative; }

/* Remove transform on the elevated product card to avoid creating its own stacking context */
.mm-product-item.mm-tutorial-elevated {
    transform: none !important;
}

/* Ensure the toggle switch container can be elevated above the overlay in step 1 */
.toggleSwitch.mm-tutorial-elevated {
    position: relative !important;
    z-index: 10002 !important;
}
/* Body state when tutorial is active */
body.mm-tutorial-active {
    overflow: hidden;
}

/* Animation for bubble appearance */
@keyframes mmTutorialBubbleAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mm-tutorial-bubble {
        max-width: 90%;
        min-width: 280px;
    }
    
    .mm-tutorial-bubble-content {
        padding: 20px;
    }
    
    .mm-tutorial-text h3 {
        font-size: 14px;
    }
    
    .mm-tutorial-text p {
        font-size: 13px;
    }
    
    .mm-tutorial-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .mm-tutorial-next,
    .mm-tutorial-done {
        width: 100%;
        padding: 10px 16px;
    }
}

/* Ensure proper stacking order */
.mm-tutorial-overlay { z-index: 9998 !important; }
.mm-tutorial-bubble { z-index: 9999 !important; }
.mm-tutorial-highlight { z-index: 10002 !important; }

/* Prevent interaction with elements behind overlay */
.mm-tutorial-overlay ~ * {
    pointer-events: none;
}

.mm-tutorial-bubble,
.mm-tutorial-highlight {
    pointer-events: auto;
}
