/* 🎉 CELEBRATION ANIMATION CSS 🎉 */

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 9999;
    pointer-events: none;
}

.confetti:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: 50%;
}

/* Different confetti colors */
.confetti-1 { background: #ff6b6b; }
.confetti-2 { background: #4ecdc4; }
.confetti-3 { background: #45b7d1; }
.confetti-4 { background: #96ceb4; }
.confetti-5 { background: #feca57; }
.confetti-6 { background: #ff9ff3; }
.confetti-7 { background: #54a0ff; }
.confetti-8 { background: #5f27cd; }

/* Confetti falling animation */
@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Success Popup */
.celebration-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    z-index: 10000;
    text-align: center;
    min-width: 300px;
    opacity: 0;
    animation: popupAppear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes popupAppear {
    0% {
        transform: translate(-50%, -50%) scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1) rotate(-90deg);
        opacity: 0.8;
    }
    100% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
}

.celebration-popup.hide {
    animation: popupDisappear 0.4s ease-in forwards;
}

@keyframes popupDisappear {
    0% {
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0) rotate(180deg);
        opacity: 0;
    }
}

.celebration-popup .celebration-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.celebration-popup h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.celebration-popup p {
    margin: 0 0 1rem 0;
    font-size: 1.1rem;
}

.celebration-popup .savings-amount {
    font-size: 2rem;
    font-weight: bold;
    color: #feca57;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 10px #feca57;
    }
    to {
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3), 0 0 20px #feca57, 0 0 30px #feca57;
    }
}

/* Fireworks Animation */
.firework {
    position: fixed;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    z-index: 9998;
    pointer-events: none;
}

.firework:before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: inherit;
    animation: firework-explosion 1s ease-out forwards;
}

@keyframes firework-explosion {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* Money Rain Animation */
.money-rain {
    position: fixed;
    font-size: 2rem;
    z-index: 9997;
    pointer-events: none;
    animation: money-fall 3s linear forwards;
}

@keyframes money-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(360deg);
        opacity: 0;
    }
}

/* Sparkle Effect */
.sparkle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    z-index: 9996;
    pointer-events: none;
    animation: sparkle-twinkle 1.5s ease-in-out infinite;
}

@keyframes sparkle-twinkle {
    0%, 100% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1) rotate(180deg);
        opacity: 1;
    }
}

/* Pulse Ring Effect */
.pulse-ring {
    position: fixed;
    border: 3px solid #4ecdc4;
    border-radius: 50%;
    z-index: 9995;
    pointer-events: none;
    animation: pulse-expand 1s ease-out forwards;
}

@keyframes pulse-expand {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
    100% {
        width: 200px;
        height: 200px;
        opacity: 0;
    }
}

/* Success Checkmark Animation */
.success-checkmark {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #2ecc71;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: checkmark-appear 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.success-checkmark:after {
    content: '✓';
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

@keyframes checkmark-appear {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(-90deg);
        opacity: 0.8;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Celebration Background Overlay */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
    z-index: 9990;
    pointer-events: none;
    opacity: 0;
    animation: overlay-fade 0.5s ease-in-out forwards;
}

@keyframes overlay-fade {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .celebration-popup {
        min-width: 280px;
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .celebration-popup .celebration-icon {
        font-size: 2.5rem;
    }
    
    .celebration-popup h3 {
        font-size: 1.3rem;
    }
    
    .celebration-popup .savings-amount {
        font-size: 1.8rem;
    }
}
