/* Poly Liga Animation Styles */

/* Vote button pulse animation */
.vote-pulse {
    animation: votePulse 0.6s ease-out;
}

@keyframes votePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Points earned animation */
.points-earned {
    animation: pointsFloat 1.5s ease-out forwards;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-weight: bold;
    font-size: 1.5rem;
}

@keyframes pointsFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(1.5);
    }
}

/* Achievement unlock animation */
.achievement-unlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.achievement-unlock-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    animation: achievementPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid gold;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.achievement-unlock-card .achievement-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconShine 1s ease-in-out infinite;
}

@keyframes achievementPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes iconShine {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 1));
    }
}

/* Confetti canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

/* Streak fire animation */
.streak-fire-animation {
    animation: fireGlow 1s ease-in-out infinite;
}

@keyframes fireGlow {
    0%, 100% {
        text-shadow: 0 0 10px #ff6b35, 0 0 20px #f7931e;
    }
    50% {
        text-shadow: 0 0 20px #ff6b35, 0 0 40px #f7931e, 0 0 60px #ff6b35;
    }
}

/* Rank up celebration */
.rank-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    animation: fadeIn 0.3s ease-out;
}

.rank-up-card {
    text-align: center;
    animation: rankUpBounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rank-up-card .rank-badge {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: rankShine 1.5s ease-in-out infinite;
}

@keyframes rankUpBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(100px);
    }
    50% {
        transform: scale(1.1) translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes rankShine {
    0%, 100% {
        filter: drop-shadow(0 0 20px currentColor);
    }
    50% {
        filter: drop-shadow(0 0 40px currentColor) brightness(1.3);
    }
}

/* Vote success toast */
.vote-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    z-index: 9999;
    animation: toastSlideIn 0.5s ease-out, toastFadeOut 0.5s ease-out 2.5s forwards;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.vote-toast.success {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.vote-toast.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

@keyframes toastSlideIn {
    0% {
        opacity: 0;
        transform: translateX(100px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* General utility animations */
@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

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

/* Win celebration particles */
.win-particle {
    position: fixed;
    pointer-events: none;
    font-size: 2rem;
    animation: particleFly 1s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.5) rotate(360deg);
    }
}

/* Milestone reached overlay */
.milestone-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    animation: fadeIn 0.3s ease-out;
}

.milestone-card {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f23 100%);
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    max-width: 450px;
    position: relative;
    animation: milestonePopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #f7931e;
    box-shadow: 0 0 50px rgba(247, 147, 30, 0.6);
    overflow: hidden;
}

.milestone-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 193, 7, 0.15) 0%, transparent 60%);
    animation: milestoneGlowPulse 2s ease-in-out infinite;
}

.milestone-icon {
    position: relative;
    z-index: 1;
    animation: fireIconBounce 1s ease-in-out infinite;
}

.milestone-burst {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(247, 147, 30, 0.3) 0%, transparent 70%);
    animation: burstPulse 1.5s ease-in-out infinite;
    pointer-events: none;
}

.milestone-title {
    position: relative;
    z-index: 1;
}

@keyframes milestonePopIn {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-15deg);
    }
    50% {
        transform: scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes milestoneGlowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: rotate(180deg);
    }
}

@keyframes fireIconBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-10px) scale(1.1);
    }
}

@keyframes burstPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.6;
    }
}

/* Daily reward overlay */
.daily-reward-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10003;
    animation: fadeIn 0.3s ease-out;
}

.daily-reward-card {
    background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    max-width: 420px;
    animation: rewardBounceIn 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #2ecc71;
    box-shadow: 0 0 40px rgba(46, 204, 113, 0.5);
}

.reward-coin-animation {
    font-size: 5rem;
    animation: coinSpin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

.reward-points {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

@keyframes rewardBounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes coinSpin {
    0% {
        transform: rotateY(0deg);
    }
    100% {
        transform: rotateY(360deg);
    }
}

/* Coin shower container */
.coin-shower-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10002;
    overflow: hidden;
}

.shower-coin {
    position: absolute;
    top: -50px;
    animation: coinFall linear forwards;
}

@keyframes coinFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0.5;
    }
}

/* Weekly challenge overlay */
.weekly-challenge-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10004;
    animation: fadeIn 0.3s ease-out;
}

.weekly-challenge-card {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f08 100%);
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    max-width: 450px;
    animation: weeklyPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #f1c40f;
    box-shadow: 0 0 50px rgba(241, 196, 15, 0.5);
}

.challenge-crown {
    font-size: 4rem;
    animation: crownFloat 2s ease-in-out infinite;
    margin-bottom: 10px;
}

.challenge-icon {
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes weeklyPopIn {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(30px);
    }
    60% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes crownFloat {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px currentColor);
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 25px currentColor);
    }
}

/* Combo toast */
.combo-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    animation: comboAppear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-toast-exit {
    animation: comboExit 0.5s ease-in forwards;
}

.combo-content {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-radius: 20px;
    padding: 30px 50px;
    text-align: center;
    border: 3px solid #e74c3c;
    box-shadow: 0 0 30px rgba(155, 89, 182, 0.7);
}

.combo-multiplier {
    font-size: 3rem;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 0 0 10px #f39c12;
    animation: comboScale 0.5s ease-in-out infinite alternate;
}

.combo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    margin: 5px 0;
}

.combo-streak {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes comboAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes comboExit {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

@keyframes comboScale {
    0% {
        transform: scale(1);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Share modal overlay */
.share-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10005;
    animation: fadeIn 0.3s ease-out;
}

.share-modal-card {
    background: var(--card-bg, #fff);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    animation: shareModalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.share-modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.share-modal-body {
    padding: 30px;
}

.share-preview {
    border: 1px solid var(--card-border, #e0e0e0);
    direction: rtl;
    text-align: right;
}

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

/* Daily reward popup (initial check on page load) */
.daily-reward-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10006;
    animation: fadeIn 0.3s ease-out;
}

.daily-reward-popup-card {
    background: linear-gradient(135deg, #1a472a 0%, #0d3320 100%);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: rewardPopupBounce 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 3px solid #2ecc71;
    box-shadow: 0 0 60px rgba(46, 204, 113, 0.4);
}

.reward-gift-icon {
    font-size: 4rem;
    animation: giftBounce 1s ease-in-out infinite;
    margin-bottom: 15px;
}

.reward-day-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4);
}

.reward-day-circle .day-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.reward-points-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reward-points-preview .points-value {
    font-size: 3rem;
    font-weight: bold;
    color: #2ecc71;
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.reward-points-preview .points-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes rewardPopupBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) translateY(50px);
    }
    50% {
        transform: scale(1.05) translateY(-15px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes giftBounce {
    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }
    50% {
        transform: translateY(-15px) rotate(5deg);
    }
}
