/**
 * Product Customizer - Onboarding Tour Styles
 */

/* ============================================
   Overlay
   ============================================ */
.pc-onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.pc-onboarding-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================
   Spotlight cutout
   ============================================ */
.pc-onboarding-spotlight {
    position: absolute;
    z-index: 99991;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
.pc-onboarding-spotlight.pc-spotlight-center {
    /* center on screen when no target */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}

/* ============================================
   Tooltip bubble
   ============================================ */
.pc-onboarding-tooltip {
    position: absolute;
    z-index: 99992;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 24px 28px;
    max-width: 380px;
    min-width: 260px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pc-onboarding-tooltip.active {
    opacity: 1;
    transform: translateY(0);
}

/* Arrow */
.pc-onboarding-tooltip::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    transform: rotate(45deg);
}
.pc-onboarding-tooltip.pc-arrow-top::before {
    bottom: -6px;
    left: 50%;
    margin-left: -7px;
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.06);
}
.pc-onboarding-tooltip.pc-arrow-bottom::before {
    top: -6px;
    left: 50%;
    margin-left: -7px;
    box-shadow: -3px -3px 5px rgba(0, 0, 0, 0.06);
}
.pc-onboarding-tooltip.pc-arrow-left::before {
    right: -6px;
    top: 50%;
    margin-top: -7px;
    box-shadow: 3px -3px 5px rgba(0, 0, 0, 0.06);
}
.pc-onboarding-tooltip.pc-arrow-right::before {
    left: -6px;
    top: 50%;
    margin-top: -7px;
    box-shadow: -3px 3px 5px rgba(0, 0, 0, 0.06);
}

/* ============================================
   Tooltip content
   ============================================ */
.pc-onboarding-step-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    color: #ff9500;
    background: rgba(255, 149, 0, 0.1);
}
.pc-onboarding-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}
.pc-onboarding-body {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin: 0 0 20px 0;
}
.pc-onboarding-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Buttons */
.pc-onboarding-btn {
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.pc-onboarding-btn-primary {
    background: linear-gradient(135deg, #ff9500 0%, #ff7700 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.25);
}
.pc-onboarding-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 149, 0, 0.35);
}
.pc-onboarding-btn-secondary {
    background: #f5f5f5;
    color: #666;
}
.pc-onboarding-btn-secondary:hover {
    background: #e8e8e8;
}
.pc-onboarding-btn-skip {
    background: none;
    color: #999;
    font-weight: 500;
    font-size: 13px;
    padding: 10px 12px;
}
.pc-onboarding-btn-skip:hover {
    color: #666;
}

/* Step dots */
.pc-onboarding-dots {
    display: flex;
    gap: 6px;
    justify-content: flex-start;
    margin-bottom: 16px;
}
.pc-onboarding-dots .pc-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s ease;
}
.pc-onboarding-dots .pc-dot.active {
    background: #ff9500;
    width: 18px;
    border-radius: 3px;
}
.pc-onboarding-dots .pc-dot.done {
    background: #2ecc71;
}

/* ============================================
   Welcome center modal (step 1)
   ============================================ */
.pc-onboarding-welcome {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99993;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 36px 32px 28px;
    max-width: 440px;
    width: 90%;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.pc-onboarding-welcome.active {
    opacity: 1;
    visibility: visible;
}
.pc-onboarding-welcome-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #ff9500 0%, #ff7700 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pc-onboarding-welcome-icon svg {
    width: 32px;
    height: 32px;
    color: #fff;
}
.pc-onboarding-welcome .pc-onboarding-title {
    font-size: 24px;
    margin-bottom: 12px;
}
.pc-onboarding-welcome .pc-onboarding-body {
    font-size: 15px;
    margin-bottom: 24px;
}
.pc-onboarding-welcome .pc-onboarding-dots {
    justify-content: center;
    margin-bottom: 20px;
}

/* ============================================
   Replay tour button (P2)
   ============================================ */
.pc-replay-tour-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.95);
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: all 0.25s ease;
}
.pc-replay-tour-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    border-color: #ff9500;
}
.pc-replay-tour-btn svg {
    width: 18px;
    height: 18px;
    color: #666;
    transition: color 0.25s ease;
}
.pc-replay-tour-btn:hover svg {
    color: #ff9500;
}
.pc-replay-tour-label {
    position: absolute;
    top: 50%;
    right: 44px;
    transform: translateY(-50%);
    background: #333;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}
.pc-replay-tour-btn:hover .pc-replay-tour-label {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Animations
   ============================================ */
@keyframes pcPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 149, 0, 0); }
}
.pc-onboarding-spotlight.pulse {
    animation: pcPulse 2s ease-in-out infinite;
}

/* ============================================
   Mobile: hotspot + floating bubble
   Replaces the old bottom-sheet card approach
   ============================================ */

/* Hotspot — pulsing dot on target element */
.pc-mobile-hotspot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ff9500;
    z-index: 99991;
    pointer-events: none;
    animation: pcHotspotPulse 1.8s ease-in-out infinite;
    transform: translate(-50%, -50%);
}
.pc-mobile-hotspot::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 36px; height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    background: rgba(255, 149, 0, 0.25);
    animation: pcHotspotRipple 1.8s ease-in-out infinite;
}
@keyframes pcHotspotPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(0.85); }
}
@keyframes pcHotspotRipple {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(2.2); opacity: 0; }
}

/* Floating bubble — simplified for mobile: always bottom-center */
.pc-mobile-bubble {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 99992;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 36px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 18px 20px;
    width: calc(100% - 40px);
    max-width: 360px;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}
.pc-mobile-bubble.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
/* Remove old arrow styles — bubble doesn't need arrow at bottom */
.pc-mobile-bubble-arrow { display: none; }

/* Bubble content — compact */
.pc-mobile-bubble .pc-onboarding-step-badge {
    font-size: 10px;
    padding: 1px 8px;
    margin-bottom: 8px;
}
.pc-mobile-bubble .pc-onboarding-title {
    font-size: 17px;
    margin-bottom: 4px;
}
.pc-mobile-bubble .pc-onboarding-body {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 14px;
}
.pc-mobile-bubble-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.pc-mobile-bubble .pc-onboarding-btn {
    padding: 8px 18px;
    font-size: 13px;
    min-height: 40px;
}
.pc-mobile-bubble-dots {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 10px;
}
.pc-mobile-bubble-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    transition: all 0.3s;
}
.pc-mobile-bubble-dot.active {
    background: #ff9500;
    width: 16px;
    border-radius: 3px;
}
.pc-mobile-bubble-dot.done {
    background: #2ecc71;
}

/* Swipe hint on bubble */
.pc-mobile-bubble-swipe {
    text-align: center;
    font-size: 10px;
    color: #bbb;
    margin-bottom: 6px;
}

/* Target element highlight ring */
.pc-onboarding-highlight {
    animation: pcHighlightPulse 2s ease-in-out infinite;
    z-index: 99989 !important;
    position: relative;
}
.pc-onboarding-highlight::after {
    content: '';
    position: absolute;
    top: -4px; left: -4px; right: -4px; bottom: -4px;
    border-radius: inherit;
    border: 3px solid rgba(255, 149, 0, 0.6);
    pointer-events: none;
    animation: pcRingPulse 2s ease-in-out infinite;
}
@keyframes pcRingPulse {
    0%, 100% { border-color: rgba(255, 149, 0, 0.3); }
    50% { border-color: rgba(255, 149, 0, 0.8); }
}

/* ============================================
   Mobile responsive
   ============================================ */
@media (max-width: 768px) {

    /* Hide desktop elements */
    .pc-onboarding-spotlight {
        display: none !important;
    }
    .pc-onboarding-tooltip {
        display: none !important;
    }

    /* Overlay: darker on mobile, click-through to dismiss */
    .pc-onboarding-overlay {
        background: rgba(0, 0, 0, 0.6);
    }

    /* Welcome modal: tighter */
    .pc-onboarding-welcome {
        max-width: calc(100% - 32px);
        padding: 28px 24px 24px;
        border-radius: 20px;
    }
    .pc-onboarding-welcome .pc-onboarding-title {
        font-size: 20px;
    }
    .pc-onboarding-welcome .pc-onboarding-body {
        font-size: 14px;
    }
    .pc-onboarding-welcome-icon {
        width: 56px;
        height: 56px;
        margin-bottom: 16px;
    }
    .pc-onboarding-welcome-icon svg {
        width: 28px;
        height: 28px;
    }

    /* Buttons: touch-friendly */
    .pc-onboarding-btn {
        min-height: 44px;
        font-size: 14px;
    }
    .pc-replay-tour-btn {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .pc-onboarding-welcome {
        max-width: calc(100% - 24px);
        padding: 24px 20px 20px;
    }
    .pc-mobile-bubble {
        width: calc(100% - 32px);
        padding: 16px 16px;
    }
}
