/* 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);
    }
}