/**
 * Interactive Tour CSS - Beautiful animations for guided tours
 */

/* =========================================================================
   OVERLAY & BACKDROP
   ========================================================================= */

.interactive-tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10100;
    pointer-events: none;
}

.interactive-tour-overlay > * {
    pointer-events: auto;
}

.tour-backdrop-animated {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    transition: all 0.5s ease;
}

.backdrop-fill {
    transition: all 0.4s ease;
}

.spotlight-hole {
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* =========================================================================
   SPOTLIGHT RING
   ========================================================================= */

.tour-spotlight-ring {
    position: fixed;
    border-radius: var(--ct-radius, 2px);
    pointer-events: none;
    z-index: 10101;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-spotlight-ring .ring-inner {
    position: absolute;
    inset: 0;
    border: 3px solid var(--ct-accent, #5B4FC4);
    border-radius: var(--ct-radius, 2px);
    animation: ringPulseInner 2s ease-in-out infinite;
}

.tour-spotlight-ring .ring-outer {
    position: absolute;
    inset: -6px;
    border: 2px solid rgba(91, 79, 196, 0.5);
    border-radius: calc(var(--ct-radius, 2px) + 4px);
    animation: ringPulseOuter 2s ease-in-out infinite 0.3s;
}

.tour-spotlight-ring .ring-pulse {
    position: absolute;
    inset: -12px;
    border: 1px solid rgba(91, 79, 196, 0.3);
    border-radius: calc(var(--ct-radius, 2px) + 8px);
    animation: ringExpand 2s ease-out infinite;
}

@keyframes ringPulseInner {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(91, 79, 196, 0.6), inset 0 0 10px rgba(91, 79, 196, 0.2);
    }
    50% { 
        box-shadow: 0 0 30px rgba(91, 79, 196, 0.8), inset 0 0 15px rgba(91, 79, 196, 0.3);
    }
}

@keyframes ringPulseOuter {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.02); }
}

@keyframes ringExpand {
    0% { opacity: 0.5; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.3); }
}

/* =========================================================================
   TOOLTIP STYLES
   ========================================================================= */

.tour-tooltip-interactive {
    background: linear-gradient(180deg, #2A2A2A 0%, #1E1E1E 100%);
    border: 1px solid rgba(91, 79, 196, 0.3);
    border-radius: var(--ct-radius, 2px);
    padding: 28px;
    width: 420px;
    max-width: calc(100vw - 40px);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(91, 79, 196, 0.2),
        0 0 60px rgba(91, 79, 196, 0.1);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 10102;
    overflow: hidden;
}

.tour-tooltip-interactive::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(91, 79, 196, 0.5), transparent);
}

/* Progress Bar */
.tour-progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(91, 79, 196, 0.15);
    border-radius: var(--ct-radius, 2px) var(--ct-radius, 2px) 0 0;
    overflow: hidden;
}

.tour-progress-fill {
    height: 100%;
    background: var(--ct-accent, #5B4FC4);
    border-radius: var(--ct-radius, 2px);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 16px rgba(91, 79, 196, 0.4);
}

/* Step Info */
.tour-step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-top: 8px;
}

.step-number {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    letter-spacing: 0.5px;
}

.tour-name {
    font-size: 11px;
    color: var(--ct-accent, #5B4FC4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Title */
.tour-tooltip-interactive .tour-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

/* Content */
.tour-tooltip-interactive .tour-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 20px;
}

.tour-tooltip-interactive .tour-content p {
    margin: 0 0 8px 0;
}

.tour-tooltip-interactive .tour-content p:last-child {
    margin-bottom: 0;
}

/* =========================================================================
   ACTION STEP STYLES
   ========================================================================= */

.action-step {
    border-color: rgba(236, 72, 153, 0.5);
}

.action-step::before {
    background: linear-gradient(90deg, transparent, rgba(236, 72, 153, 0.6), transparent);
}

.action-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(91, 79, 196, 0.1);
    border: 1px solid rgba(91, 79, 196, 0.25);
    border-radius: var(--ct-radius, 2px);
    margin-bottom: 20px;
    animation: hintPulse 2s ease-in-out infinite;
}

.action-hint .hint-icon {
    font-size: 20px;
    animation: pointBounce 1s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes pointBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.action-completed {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--ct-radius, 2px);
    margin-bottom: 20px;
    color: #10B981;
    font-weight: 600;
    animation: completedPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.action-completed .check-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #10B981;
    color: #fff;
    border-radius: 50%;
    font-size: 16px;
    font-weight: bold;
}

@keyframes completedPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* =========================================================================
   CELEBRATION STEP STYLES
   ========================================================================= */

.celebration-step {
    border-color: rgba(16, 185, 129, 0.5);
}

.feature-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 24px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--ct-radius, 2px);
    animation: featureSlideIn 0.5s ease backwards;
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(91, 79, 196, 0.08);
    border-color: rgba(91, 79, 196, 0.25);
    transform: translateX(4px);
}

@keyframes featureSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feature-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.feature-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.feature-text strong {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
}

.feature-text span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.feature-check {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10B981, #059669);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    animation: checkPop 0.3s ease backwards;
    animation-delay: inherit;
}

@keyframes checkPop {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* =========================================================================
   NAVIGATION BUTTONS
   ========================================================================= */

.tour-navigation {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    padding: 14px 28px;
    border-radius: var(--ct-radius, 2px);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.nav-btn.back {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.nav-btn.back:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nav-btn.next {
    flex: 1;
    background: var(--ct-accent, #5B4FC4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(91, 79, 196, 0.35);
}

.nav-btn.next:hover:not(.disabled) {
    filter: brightness(1.15);
    box-shadow: 0 6px 24px rgba(91, 79, 196, 0.45);
}

.nav-btn.next.disabled {
    background: rgba(91, 79, 196, 0.3);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    box-shadow: none;
}

.skip-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.skip-btn:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Choice Buttons */
.choice-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.choice-btn {
    padding: 16px 24px;
    border-radius: var(--ct-radius, 2px);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.choice-btn.primary {
    background: var(--ct-accent, #5B4FC4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(91, 79, 196, 0.35);
}

.choice-btn.primary:hover {
    filter: brightness(1.15);
    box-shadow: 0 6px 24px rgba(91, 79, 196, 0.45);
}

.choice-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.choice-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* =========================================================================
   ANIMATIONS
   ========================================================================= */

.tour-transitioning .tour-tooltip-interactive {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
}

.tour-anim-default .tour-tooltip-interactive {
    animation: tooltipFadeIn 0.4s ease-out;
}

.tour-anim-fade-zoom .tour-tooltip-interactive {
    animation: fadeZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-anim-slide-zoom .tour-tooltip-interactive {
    animation: slideZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-anim-spotlight .tour-spotlight-ring {
    animation: spotlightAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-anim-pulse .tour-spotlight-ring {
    animation: pulseAppear 0.5s ease;
}

.tour-anim-bounce .tour-tooltip-interactive {
    animation: bounceIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tour-anim-celebrate .tour-tooltip-interactive {
    animation: celebrateIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeZoomIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes slideZoomIn {
    from { opacity: 0; transform: translateX(30px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes spotlightAppear {
    0% { opacity: 0; transform: scale(0.5); }
    70% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}

@keyframes pulseAppear {
    0% { opacity: 0; }
    50% { opacity: 1; }
    75% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.3) translateY(20px); }
    50% { transform: scale(1.05) translateY(-5px); }
    70% { transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes celebrateIn {
    0% { opacity: 0; transform: scale(0.5) rotate(-5deg); }
    60% { transform: scale(1.05) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

/* =========================================================================
   CONFETTI EFFECT
   ========================================================================= */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 10103;
}

.confetti {
    position: absolute;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* =========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================= */

@media (max-width: 480px) {
    .tour-tooltip-interactive {
        width: calc(100vw - 32px);
        padding: 20px;
        margin: 16px;
        position: fixed !important;
        bottom: 16px !important;
        top: auto !important;
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
    }

    .tour-tooltip-interactive .tour-title {
        font-size: 18px;
    }

    .tour-tooltip-interactive .tour-content {
        font-size: 14px;
    }

    .tour-navigation {
        flex-wrap: wrap;
    }

    .nav-btn {
        padding: 12px 20px;
        font-size: 14px;
    }
}
