/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Presentation-style slide up animation */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Presentation-style animate-in class with stagger support */
.animate-in {
    animation: fadeSlideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in[style*="animation-delay"] {
    opacity: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes cursorBlink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

@keyframes cursorBounce {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-3px, -3px);
    }
}

@keyframes bounceDown {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    50% {
        transform: translateY(6px);
        opacity: 1;
    }
}

/* Utility Classes for Animations */
.animate-fade-in {
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-slide-in {
    animation: fadeSlideIn var(--duration-normal) var(--ease-out);
}

.animate-scale-in {
    animation: scaleIn var(--duration-normal) var(--ease-out);
}

.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

.delay-500 {
    animation-delay: 500ms;
}

/* Typing cursor for chat demos */
.typing-cursor {
    animation: cursorBlink 0.8s infinite;
    color: var(--teal-400);
    font-weight: bold;
}

/* Pulse border for clickable highlights */
@keyframes pulse-border {
    0%, 100% {
        border-color: var(--pink-400);
        box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.4);
    }
    50% {
        border-color: var(--pink-300);
        box-shadow: 0 0 20px 4px rgba(236, 72, 153, 0.3);
    }
}

/* Quiz answer button selection animations */
@keyframes answerPop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes answerCorrect {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 20px 8px rgba(34, 197, 94, 0.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

@keyframes answerWrong {
    0%, 100% {
        transform: translateX(0);
    }
    20%, 60% {
        transform: translateX(-4px);
    }
    40%, 80% {
        transform: translateX(4px);
    }
}

/* Quiz question card transitions */
@keyframes questionFadeOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.98);
    }
}

@keyframes questionFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Quiz transition utility classes */
.quiz-question-enter {
    animation: questionFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.quiz-question-exit {
    animation: questionFadeOut 0.25s ease-out both;
}

.quiz-answer-pop {
    animation: answerPop 0.15s ease-out;
}

.quiz-answer-correct {
    animation: answerCorrect 0.5s ease-out;
}

.quiz-answer-wrong {
    animation: answerWrong 0.4s ease-out;
}

/* Feedback animations */
@keyframes feedbackPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes contentFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.quiz-feedback-enter {
    animation: feedbackPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.quiz-content-exit {
    animation: contentFadeOut 0.2s ease-out both;
    pointer-events: none;
}

/* Smooth card background/border transition */
.quiz-card-animated {
    transition: border-color 0.3s ease, background 0.3s ease;
}

/* Pro Tips intro animations - pure vibrant orange */
@keyframes proTipGridPulse {
    0%, 100% {
        opacity: 0.6;
        background-size: 60px 60px;
    }
    50% {
        opacity: 0.9;
        background-size: 62px 62px;
    }
}

@keyframes proTipLightningGlow {
    0%, 100% {
        filter: drop-shadow(0 0 40px rgba(255, 107, 0, 0.7))
                drop-shadow(0 0 80px rgba(139, 92, 246, 0.3));
        transform: scale(1);
    }
    33% {
        filter: drop-shadow(0 0 50px rgba(255, 140, 50, 0.8))
                drop-shadow(0 0 90px rgba(168, 85, 247, 0.4));
        transform: scale(1.02);
    }
    66% {
        filter: drop-shadow(0 0 45px rgba(255, 107, 0, 0.75))
                drop-shadow(0 0 85px rgba(99, 102, 241, 0.35));
        transform: scale(1.01);
    }
}

@keyframes proTipBadgePulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 0, 0.25), 0 0 40px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 0, 0.4), 0 0 50px rgba(139, 92, 246, 0.2);
    }
}

.pro-tip-animated-grid {
    animation: proTipGridPulse 4s ease-in-out infinite;
}

.pro-tip-lightning {
    animation: proTipLightningGlow 2.5s ease-in-out infinite;
}

.pro-tip-badge-animated {
    animation: proTipBadgePulse 2s ease-in-out infinite;
}

/* Pro Tips instruction overlay animated border - vibrant orange glow */
@keyframes proTipOverlayBorder {
    0%, 100% {
        border-color: rgba(255, 107, 0, 0.5);
        box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(255, 107, 0, 0.25);
    }
    50% {
        border-color: rgba(255, 140, 50, 0.7);
        box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 35px rgba(255, 107, 0, 0.4);
    }
}

.pro-tip-overlay-animated {
    animation: proTipOverlayBorder 2s ease-in-out infinite;
}

/* Pro Tip Hero Card - subtle entrance animation */
.pro-tip-hero-card {
    animation: heroCardFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes heroCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================
   n8n-Style Animated Borders & Effects
   ========================================== */

/* Flowing gradient border animation */
@keyframes n8nBorderFlow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Electric tracer effect - flows around border */
@keyframes n8nBorderTracer {
    0% {
        --angle: 0deg;
    }
    100% {
        --angle: 360deg;
    }
}

/* Pulsing glow effect */
@keyframes n8nGlow {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 107, 0, 0.3),
            0 0 40px rgba(255, 107, 0, 0.15),
            0 0 60px rgba(255, 107, 0, 0.05),
            inset 0 0 60px rgba(255, 107, 0, 0.03);
    }
    50% {
        box-shadow:
            0 0 30px rgba(255, 140, 50, 0.4),
            0 0 60px rgba(255, 107, 0, 0.25),
            0 0 90px rgba(255, 107, 0, 0.1),
            inset 0 0 80px rgba(255, 107, 0, 0.05);
    }
}

/* Intense glow for hero elements */
@keyframes n8nGlowIntense {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(255, 107, 0, 0.6))
                drop-shadow(0 0 40px rgba(255, 140, 50, 0.3))
                drop-shadow(0 0 60px rgba(139, 92, 246, 0.15));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(255, 140, 50, 0.8))
                drop-shadow(0 0 60px rgba(255, 107, 0, 0.4))
                drop-shadow(0 0 80px rgba(139, 92, 246, 0.25));
    }
}

/* Lightning bolt float animation */
@keyframes n8nLightningFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-8px) rotate(1deg);
    }
    75% {
        transform: translateY(4px) rotate(-1deg);
    }
}

/* Ambient particle float */
@keyframes n8nParticleFloat {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.7;
    }
}

/* Smoke/mist effect */
@keyframes n8nSmoke {
    0% {
        transform: translateY(0) scale(1);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-30px) scale(1.3);
        opacity: 0.2;
    }
    100% {
        transform: translateY(-60px) scale(1.6);
        opacity: 0;
    }
}

/* Border gradient shimmer */
@keyframes n8nBorderShimmer {
    0% {
        border-color: rgba(255, 107, 0, 0.3);
    }
    25% {
        border-color: rgba(255, 140, 50, 0.5);
    }
    50% {
        border-color: rgba(251, 146, 60, 0.4);
    }
    75% {
        border-color: rgba(255, 107, 0, 0.5);
    }
    100% {
        border-color: rgba(255, 107, 0, 0.3);
    }
}

/* n8n-style card with animated gradient border */
.n8n-card {
    position: relative;
    background: linear-gradient(160deg, rgba(30, 25, 35, 0.95) 0%, rgba(20, 18, 25, 0.98) 100%);
    border-radius: 24px;
    overflow: hidden;
}

.n8n-card::before {
    content: '';
    position: absolute;
    inset: 0;
    padding: 2px;
    border-radius: 24px;
    background: linear-gradient(
        135deg,
        rgba(255, 107, 0, 0.6),
        rgba(255, 140, 50, 0.3),
        rgba(139, 92, 246, 0.2),
        rgba(255, 107, 0, 0.4),
        rgba(251, 146, 60, 0.5)
    );
    background-size: 300% 300%;
    animation: n8nBorderFlow 4s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.n8n-card-glow {
    animation: n8nGlow 3s ease-in-out infinite;
}

/* Lightning bolt container */
.n8n-lightning {
    animation: n8nLightningFloat 4s ease-in-out infinite, n8nGlowIntense 2s ease-in-out infinite;
}

/* Gradient text effect */
.n8n-gradient-text {
    background: linear-gradient(135deg, #ff6b00 0%, #ff8a3d 50%, #ffb366 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Ambient glow spots */
.n8n-ambient-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    animation: n8nParticleFloat 6s ease-in-out infinite;
}

/* Tip card animated border */
.n8n-tip-card {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 30, 32, 0.95), rgba(20, 20, 22, 0.98));
    border: 2px solid transparent;
    border-radius: 16px;
    animation: n8nBorderShimmer 3s ease-in-out infinite;
}

.n8n-tip-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 18px;
    background: linear-gradient(
        135deg,
        rgba(255, 107, 0, 0.5),
        rgba(255, 140, 50, 0.2),
        rgba(100, 150, 255, 0.15),
        rgba(255, 107, 0, 0.4)
    );
    background-size: 200% 200%;
    animation: n8nBorderFlow 3s ease infinite;
    z-index: -1;
}