/* ============================================
   ANIMATIONS
   ============================================ */

/* Text Shake Animation for Intro */
@keyframes textShake {

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

    25% {
        transform: translateX(-3px) rotate(-1deg);
    }

    50% {
        transform: translateX(3px) rotate(1deg);
    }

    75% {
        transform: translateX(-2px) rotate(-0.5deg);
    }
}

/* Snowfall Animation */
@keyframes snowfall {
    0% {
        transform: translateY(-10px) translateX(0) rotate(0deg);
        opacity: 1;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(110vh) translateX(50px) rotate(360deg);
        opacity: 0;
        visibility: hidden;
    }
}

/* Card Sway Animation */
@keyframes cardSway {

    0%,
    100% {
        transform: rotate(var(--rotation, 0deg)) translateX(0);
    }

    25% {
        transform: rotate(calc(var(--rotation, 0deg) + 3deg)) translateX(2px);
    }

    75% {
        transform: rotate(calc(var(--rotation, 0deg) - 3deg)) translateX(-2px);
    }
}

.tree-card {
    animation: cardSway 3s ease-in-out infinite;
    animation-delay: var(--sway-delay, 0s);
}

/* Tree Wobble Animation */
@keyframes treeWobble {

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

    50% {
        transform: rotate(var(--wobble-amount, 0deg)) scale(1.01);
    }
}

/* Halo Glow Animation */
@keyframes haloGlow {

    0%,
    100% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Golden Wave Animation */
@keyframes goldenWave {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(200%) rotate(45deg);
    }
}

/* Card Zoom In Animation */
@keyframes cardZoomIn {
    0% {
        transform: translate(var(--start-x, 0), var(--start-y, 0)) scale(0.1) rotate(var(--start-rotation, 0deg));
        opacity: 0.5;
    }

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

/* Card Zoom Out Animation */
@keyframes cardZoomOut {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate(var(--end-x, 0), var(--end-y, 0)) scale(0.1) rotate(var(--end-rotation, 0deg));
        opacity: 0.5;
    }
}

/* Card Appear on Tree Animation */
@keyframes cardAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
        opacity: 0;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.2) rotate(180deg);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* Modal Fade In */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal.active {
    animation: modalFadeIn 0.3s ease-out;
}

/* Modal Content Scale In */
@keyframes modalScaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

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

.modal.active .modal-content {
    animation: modalScaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Card Selection Golden Wave Effect */
.card-types-grid.golden-wave .card-type-option {
    animation: cardAppearGolden 0.6s ease-out forwards;
    opacity: 0;
}

.card-types-grid.golden-wave .card-type-option:nth-child(1) {
    animation-delay: 0.1s;
}

.card-types-grid.golden-wave .card-type-option:nth-child(2) {
    animation-delay: 0.2s;
}

.card-types-grid.golden-wave .card-type-option:nth-child(3) {
    animation-delay: 0.3s;
}

.card-types-grid.golden-wave .card-type-option:nth-child(4) {
    animation-delay: 0.4s;
}

@keyframes cardAppearGolden {
    0% {
        transform: translateY(30px) scale(0.8);
        opacity: 0;
    }

    50% {
        box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    }

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

/* Card Opening Animation */
@keyframes cardOpen {
    0% {
        transform: scale(1) rotateY(0deg);
    }

    50% {
        transform: scale(1.1) rotateY(90deg);
    }

    100% {
        transform: scale(1) rotateY(180deg);
    }
}

/* Pulse Animation for FAB */
@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 215, 0, 0.7);
    }
}

.floating-action-btn {
    animation: pulse 2s ease-in-out infinite;
}

/* Sparkle Effect */
@keyframes sparkle {

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

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

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkle 1.5s ease-in-out infinite;
}

/* Light Refraction Effect */
@keyframes lightRefraction {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(360deg);
    }
}

#tree-glow {
    animation: haloGlow 4s ease-in-out infinite, lightRefraction 10s linear infinite;
}

/* Smooth Transitions */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Flip Animation */
@keyframes cardFlip {
    0% {
        transform: rotateY(0deg);
    }

    100% {
        transform: rotateY(180deg);
    }
}

/* Success Animation */
@keyframes successPulse {

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

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

/* Shimmer Effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

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

.shimmer {
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 215, 0, 0.3) 50%,
            transparent 100%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* FAB Rotation Animation */
@keyframes fabRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(180deg);
    }
}

@keyframes fabButtonRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(90deg) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) rotate(180deg);
    }
}

.fab-rotating {
    animation: fabRotate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.fab-button-rotating {
    animation: fabButtonRotate 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Stop Button Rotation Animation */
@keyframes stopButtonRotate {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    50% {
        transform: translate(-50%, -50%) rotate(90deg) scale(1.1);
    }

    100% {
        transform: translate(-50%, -50%) rotate(180deg);
    }
}

@keyframes stopContainerRotate {
    0% {
        transform: translateX(-50%) rotate(0deg);
    }

    100% {
        transform: translateX(-50%) rotate(180deg);
    }
}

/* Christmas Glow Animation for Navigation Buttons */
@keyframes christmasGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3),
            0 0 20px rgba(255, 215, 0, 0.2);
    }

    25% {
        box-shadow: 0 4px 25px rgba(255, 64, 129, 0.5),
            0 0 30px rgba(255, 64, 129, 0.3);
    }

    50% {
        box-shadow: 0 4px 25px rgba(77, 208, 225, 0.5),
            0 0 30px rgba(77, 208, 225, 0.3);
    }

    75% {
        box-shadow: 0 4px 25px rgba(255, 215, 0, 0.5),
            0 0 30px rgba(255, 215, 0, 0.3);
    }
}

/* Progress Bar Shrink Animation */
@keyframes progressShrink {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

/* Neon Pulse Animation (Slow) */
@keyframes neonPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3),
            0 0 10px rgba(255, 215, 0, 0.2);
        border-color: rgba(255, 215, 0, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(255, 215, 0, 0.6),
            0 0 20px rgba(255, 215, 0, 0.4),
            0 0 30px rgba(255, 215, 0, 0.2);
        border-color: rgba(255, 215, 0, 0.7);
    }
}

/* Neon Pulse Animation (Fast - for hover) */
@keyframes neonPulseFast {

    0%,
    100% {
        box-shadow: 0 6px 40px rgba(255, 215, 0, 0.6),
            0 0 20px rgba(255, 215, 0, 0.4),
            0 0 30px rgba(255, 215, 0, 0.3);
        border-color: rgba(255, 215, 0, 0.7);
    }

    50% {
        box-shadow: 0 6px 50px rgba(255, 215, 0, 0.8),
            0 0 30px rgba(255, 215, 0, 0.6),
            0 0 40px rgba(255, 215, 0, 0.4),
            0 0 50px rgba(255, 215, 0, 0.2);
        border-color: rgba(255, 215, 0, 0.9);
    }
}

/* SVG Neon Pulse Animation (Slow) - Professional glyph-only glow */
@keyframes neonPulseSVG {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.2));
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.7)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.4)) drop-shadow(0 0 25px rgba(255, 215, 0, 0.2));
    }
}

/* SVG Neon Pulse Animation (Fast - for hover) */
@keyframes neonPulseSVG-Fast {

    0%,
    100% {
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9)) drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 35px rgba(255, 215, 0, 0.4));
    }
}