/* ============================================
   ANIMATIONS.CSS - Bold & Playful Animations
   ============================================ */

/* Keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

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

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

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }

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

    70% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

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

@keyframes pulse {

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

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

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-25px);
    }
}

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

    100% {
        background-position: 1000px 0;
    }
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

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

/* Animation Classes - Initially hidden, animate on scroll */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
}

.fade-in-up.animated {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    opacity: 0;
    transform: translateY(-30px);
}

.fade-in-down.animated {
    opacity: 1;
    transform: translateY(0);
    animation: fadeInDown 0.8s ease forwards;
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
}

.scale-in.animated {
    opacity: 1;
    transform: scale(1);
    animation: scaleIn 0.6s ease forwards;
}

/* Initially hide bounce-in elements */
.bounce-in {
    opacity: 0;
    transform: scale(0.3) translateY(50px);
}

/* Animate only when scrolled into view */
.bounce-in.animated {
    opacity: 1;
    transform: scale(1) translateY(0);
    animation: bounceIn 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
}

.slide-in-left.animated {
    opacity: 1;
    transform: translateX(0);
    animation: slideInLeft 0.8s ease forwards;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
}

.slide-in-right.animated {
    opacity: 1;
    transform: translateX(0);
    animation: slideInRight 0.8s ease forwards;
}

/* Stagger delays for multiple items */
.stagger-1 {
    animation-delay: 0.1s;
}

.stagger-2 {
    animation-delay: 0.2s;
}

.stagger-3 {
    animation-delay: 0.3s;
}

.stagger-4 {
    animation-delay: 0.4s;
}

.stagger-5 {
    animation-delay: 0.5s;
}

.stagger-6 {
    animation-delay: 0.6s;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hover-lift:hover {
    transform: translateY(-10px);
}

.hover-bounce:hover {
    animation: pulse 0.5s ease;
}

.hover-wiggle:hover {
    animation: wiggle 0.5s ease;
}

.hover-float {
    transition: transform 0.3s ease;
}

.hover-float:hover {
    animation: float 2s ease-in-out infinite;
}

/* Button Animations */
.btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-animated:hover::before {
    left: 100%;
}

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

/* Card Flip */
.flip-card {
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner,
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(200, 147, 91, 0.2);
    border-top-color: #edc01f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Success Checkmark */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    animation: checkmark 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #edc01f, #d4a817);
    border-radius: 10px;
    transition: width 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: shimmer 2s infinite;
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
    animation: countUp 0.5s ease;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Typing Animation Cursor */
@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

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

.typing-cursor {
    display: inline-block;
    margin-left: 2px;
    color: #edc01f;
    font-weight: 400;
    animation: blink 1s step-end infinite;
}

/* Ensure typed text maintains proper spacing */
.typed-text {
    display: inline-block;
    min-height: 1em;
    width: 120%;
}

/* Prevent layout shift during typing */
h1[data-typing-words] {
    min-height: 1.2em;
}

/* Prevent the dynamic word and cursor from wrapping to a new line */
.typed-text,
.typing-cursor {
    white-space: nowrap;
}

/* Keep "none of the [word]" together on one line */
.no-wrap-group {
    white-space: nowrap;
    display: inline-block;
}

.static-text-end {
    white-space: nowrap;
}