/**
 * ETERON Guided Tour System - Styles
 * ====================================
 * Dark overlay with spotlight, tooltip bubble, floating help button
 */

/* ============================================
   OVERLAY WITH SPOTLIGHT HOLE
   ============================================ */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.tour-overlay.active {
    pointer-events: auto;
}

.tour-overlay-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    transition: clip-path var(--transition-slow);
}

/* Spotlight target highlight */
.tour-spotlight {
    position: absolute;
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    z-index: 10001;
    pointer-events: none;
    transition: all 0.4s ease;
}

.tour-spotlight::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid var(--color-primary-light);
    border-radius: inherit;
    animation: tour-pulse 2s ease-in-out infinite;
}

@keyframes tour-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

/* ============================================
   TOOLTIP BUBBLE
   ============================================ */
.tour-tooltip {
    position: absolute;
    z-index: 10002;
    background: var(--bg-card, #ffffff);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--space-6);
    max-width: 380px;
    min-width: 300px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    border: 1px solid var(--border-light);
}

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

/* Arrow */
.tour-tooltip-arrow {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-light);
    transform: rotate(45deg);
}

/* Arrow positions */
.tour-tooltip[data-position="bottom"] .tour-tooltip-arrow {
    top: -9px;
    left: 50%;
    margin-left: -8px;
    border-right: none;
    border-bottom: none;
}

.tour-tooltip[data-position="top"] .tour-tooltip-arrow {
    bottom: -9px;
    left: 50%;
    margin-left: -8px;
    border-left: none;
    border-top: none;
}

.tour-tooltip[data-position="left"] .tour-tooltip-arrow {
    right: -9px;
    top: 50%;
    margin-top: -8px;
    border-left: none;
    border-bottom: none;
}

.tour-tooltip[data-position="right"] .tour-tooltip-arrow {
    left: -9px;
    top: 50%;
    margin-top: -8px;
    border-right: none;
    border-top: none;
}

/* Tooltip content */
.tour-tooltip-title {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tour-tooltip-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-4);
}

/* Progress indicator */
.tour-progress {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-light);
}

.tour-progress-text {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.tour-progress-dots {
    display: flex;
    gap: 6px;
}

.tour-progress-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--color-gray-300);
    transition: all var(--transition-normal);
}

.tour-progress-dot.active {
    background: var(--color-primary);
    transform: scale(1.25);
}

.tour-progress-dot.completed {
    background: var(--color-primary-light);
}

/* Navigation buttons */
.tour-buttons {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.tour-btn {
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    border: none;
    transition: all var(--transition-fast);
    min-height: 40px;
}

.tour-btn:hover {
    transform: translateY(-1px);
}

.tour-btn-primary {
    background: var(--color-primary);
    color: var(--text-inverse);
}

.tour-btn-primary:hover {
    background: var(--color-primary-dark);
}

.tour-btn-secondary {
    background: var(--color-gray-100);
    color: var(--text-secondary);
}

.tour-btn-secondary:hover {
    background: var(--color-gray-200);
}

.tour-btn-skip {
    background: transparent;
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    padding: var(--space-1) var(--space-2);
    min-height: auto;
}

.tour-btn-skip:hover {
    color: var(--text-secondary);
}

.tour-buttons-right {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

/* ============================================
   WELCOME MODAL
   ============================================ */
.tour-welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.tour-welcome-modal {
    background: var(--bg-card, #ffffff);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-2xl);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.tour-welcome-overlay.visible .tour-welcome-modal {
    transform: scale(1);
}

.tour-welcome-icon {
    font-size: 3rem;
    margin-bottom: var(--space-4);
}

.tour-welcome-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tour-welcome-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-6);
}

.tour-welcome-buttons {
    display: flex;
    gap: var(--space-3);
    justify-content: center;
}

.tour-welcome-buttons .tour-btn {
    min-width: 120px;
    padding: var(--space-3) var(--space-6);
    font-size: var(--font-size-base);
}

/* ============================================
   FLOATING HELP BUTTON
   ============================================ */
.tour-help-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: var(--color-primary);
    color: var(--text-inverse);
    border: none;
    cursor: pointer;
    z-index: 9990;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.tour-help-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.tour-help-btn:active {
    transform: scale(0.95);
}

/* Tooltip label on hover */
.tour-help-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-gray-800);
    color: var(--text-inverse);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

.tour-help-btn:hover::before {
    opacity: 1;
}

/* ============================================
   COMPLETION CELEBRATION
   ============================================ */
.tour-complete-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.tour-complete-modal {
    background: var(--bg-card, #ffffff);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-2xl);
}

.tour-complete-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
    animation: tour-bounce 0.6s ease;
}

@keyframes tour-bounce {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.tour-complete-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.tour-complete-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin-bottom: var(--space-6);
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .tour-tooltip {
        max-width: calc(100vw - 32px);
        min-width: auto;
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }

    .tour-tooltip-arrow {
        display: none;
    }

    .tour-welcome-modal,
    .tour-complete-modal {
        padding: var(--space-6);
        margin: var(--space-4);
    }

    .tour-help-btn {
        bottom: 16px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .tour-help-btn::before {
        display: none;
    }
}

@media (max-width: 576px) {
    .tour-tooltip {
        position: fixed !important;
        bottom: 0 !important;
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        max-width: 100%;
    }

    .tour-welcome-buttons {
        flex-direction: column;
    }
}
