/**
 * MuleCube Tour Guide Styles
 * Step-by-step walkthrough with spotlight highlighting
 */

/* ============================================
   Tour Overlay
   ============================================ */

.tour-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    height: max(100%, 100vh);
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* Backdrop - very subtle darkening */
.tour-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    /* No blur - keeps content readable */
}

/* Highlight cutout */
.tour-highlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 
        0 0 0 9999px rgba(0, 0, 0, 0.35),
        0 0 0 4px rgba(34, 197, 94, 0.7),
        0 0 25px rgba(34, 197, 94, 0.5);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    animation: tourPulse 2s ease-in-out infinite;
}

@keyframes tourPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.35),
            0 0 0 4px rgba(34, 197, 94, 0.7),
            0 0 25px rgba(34, 197, 94, 0.5);
    }
    50% {
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.35),
            0 0 0 6px rgba(34, 197, 94, 0.9),
            0 0 35px rgba(34, 197, 94, 0.7);
    }
}

/* ============================================
   Tour Tooltip
   ============================================ */

.tour-tooltip {
    position: absolute;
    z-index: 9999;
    width: 320px;
    max-width: calc(100vw - 32px);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
}

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

[data-theme="light"] .tour-tooltip,
[data-display-mode="day"] .tour-tooltip {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* ============================================
   Tooltip Header
   ============================================ */

.tour-tooltip-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 0;
}

.tour-icon {
    display: flex;
    flex-shrink: 0;
    color: #22c55e;
}

.tour-icon svg {
    width: 24px;
    height: 24px;
}

.tour-title {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    margin: 0;
    line-height: 1.3;
}

[data-theme="light"] .tour-title,
[data-display-mode="day"] .tour-title {
    color: #0f172a;
}

/* ============================================
   Tooltip Content
   ============================================ */

.tour-content {
    font-size: 14px;
    color: #94a3b8;
    margin: 12px 0 0;
    padding: 0 20px;
    line-height: 1.6;
}

[data-theme="light"] .tour-content,
[data-display-mode="day"] .tour-content {
    color: #64748b;
}

/* ============================================
   Tooltip Footer
   ============================================ */

.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .tour-footer,
[data-display-mode="day"] .tour-footer {
    background: rgba(0, 0, 0, 0.03);
    border-top-color: rgba(0, 0, 0, 0.05);
}

.tour-progress {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.tour-buttons {
    display: flex;
    gap: 8px;
}

/* ============================================
   Tour Buttons
   ============================================ */

.tour-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}

[data-theme="light"] .tour-btn,
[data-display-mode="day"] .tour-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #64748b;
}

.tour-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f8fafc;
}

[data-theme="light"] .tour-btn:hover,
[data-display-mode="day"] .tour-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #0f172a;
}

/* Skip button */
.tour-skip {
    background: transparent;
    color: #64748b;
}

.tour-skip:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Primary (Next) button */
.tour-btn.primary {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.tour-btn.primary:hover {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    box-shadow: 0 6px 16px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

/* ============================================
   Tooltip Arrow
   ============================================ */

.tour-tooltip::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-right: none;
    border-bottom: none;
    transform: rotate(45deg);
}

[data-theme="light"] .tour-tooltip::before,
[data-display-mode="day"] .tour-tooltip::before {
    border-color: rgba(0, 0, 0, 0.1);
}

/* Position variants */
.tour-tooltip.position-bottom::before {
    top: -9px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
}

.tour-tooltip.position-top::before {
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%) rotate(225deg);
}

.tour-tooltip.position-left::before {
    right: -9px;
    top: 50%;
    transform: translateY(-50%) rotate(135deg);
}

.tour-tooltip.position-right::before {
    left: -9px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
}

.tour-tooltip.position-center::before {
    display: none;
}

/* ============================================
   Tour Trigger Button
   ============================================ */

.tour-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tour-trigger:hover {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.3);
}

.tour-trigger svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 480px) {
    .tour-tooltip {
        position: fixed;
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        bottom: 24px !important;
        top: auto !important;
    }
    
    .tour-tooltip::before {
        display: none;
    }
    
    .tour-tooltip-header {
        padding: 16px 16px 0;
    }
    
    .tour-content {
        padding: 0 16px;
    }
    
    .tour-footer {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .tour-buttons {
        width: 100%;
        justify-content: space-between;
    }
    
    .tour-btn.primary {
        flex: 1;
    }
    
    .tour-btn {
        padding: 12px 16px;
        min-height: 44px;
    }
}

/* Safe area */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    @media (max-width: 480px) {
        .tour-tooltip {
            bottom: calc(24px + env(safe-area-inset-bottom)) !important;
        }
    }
}

/* ============================================
   Reduced Motion
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    .tour-overlay,
    .tour-tooltip,
    .tour-highlight,
    .tour-btn {
        transition: none;
        animation: none;
    }
    
    .tour-highlight {
        box-shadow: 
            0 0 0 9999px rgba(0, 0, 0, 0.75),
            0 0 0 4px rgba(34, 197, 94, 0.5);
    }
}

/* ============================================
   Focus States
   ============================================ */

.tour-btn:focus {
    outline: none;
}

.tour-btn:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}
