/* PourSpeak - Celebrations & Achievements Styles */
/* Apple-quality animations and micro-interactions */

/* ============================================
   CONFETTI
   ============================================ */

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 2s ease-out forwards;
}

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

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

.streak-stat {
    position: relative;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.streak-stat.streak-pulse {
    animation: streak-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes streak-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.streak-floater {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #FF9500, #FF6B00);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    animation: float-up 1.5s ease-out forwards;
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.4);
}

.streak-floater .fire-icon {
    margin-right: 2px;
}

@keyframes float-up {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(-20px);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-40px);
    }
}

/* ============================================
   MILESTONE MODAL
   ============================================ */

.milestone-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-appear 0.3s ease-out;
}

@keyframes modal-appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.milestone-content {
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    animation: content-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes content-bounce {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.milestone-fire {
    font-size: 64px;
    animation: fire-glow 1s ease-in-out infinite alternate;
}

@keyframes fire-glow {
    from {
        filter: drop-shadow(0 0 20px rgba(255, 149, 0, 0.5));
        transform: scale(1);
    }
    to {
        filter: drop-shadow(0 0 40px rgba(255, 149, 0, 0.8));
        transform: scale(1.1);
    }
}

.milestone-number {
    font-size: 72px;
    font-weight: 800;
    background: linear-gradient(180deg, #FF9500, #FF6B00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-top: 8px;
}

.milestone-label {
    font-size: 24px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.milestone-message {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
}

.milestone-btn {
    margin-top: 24px;
    background: linear-gradient(135deg, #FF9500, #FF6B00);
    border: none;
    color: white;
    padding: 14px 48px;
    border-radius: 25px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.milestone-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(255, 107, 0, 0.4);
}

/* ============================================
   XP PARTICLES
   ============================================ */

.xp-particle {
    position: absolute;
    font-size: 18px;
    animation: particle-rise 1s ease-out forwards;
    pointer-events: none;
}

@keyframes particle-rise {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.5);
    }
}

/* ============================================
   ACHIEVEMENT TOASTS
   ============================================ */

.achievement-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #1a1a2e, #252540);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10001;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: toast-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 90%;
}

@keyframes toast-enter {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.achievement-toast.toast-exit {
    animation: toast-exit 0.3s ease-in forwards;
}

@keyframes toast-exit {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.95);
    }
}

.achievement-icon {
    font-size: 40px;
    animation: icon-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes icon-pop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.achievement-info {
    text-align: left;
}

.achievement-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #10b981;
    font-weight: 600;
}

.achievement-name {
    font-size: 17px;
    font-weight: 700;
    color: white;
    margin-top: 2px;
}

.achievement-desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* ============================================
   DAILY GOAL CELEBRATION
   ============================================ */

.daily-goal.goal-complete {
    animation: goal-pulse 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-color: #10b981 !important;
}

@keyframes goal-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.goal-complete-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #10b981;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: badge-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

@keyframes badge-pop {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

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

.heart-stat.heart-lost {
    animation: heart-shake 0.4s ease-in-out;
}

@keyframes heart-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.broken-heart {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: heart-break 0.6s ease-out forwards;
}

@keyframes heart-break {
    0% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.5);
    }
}

.heart-stat.heart-gained {
    animation: heart-grow 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heart-grow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.new-heart {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: heart-appear 0.6s ease-out forwards;
}

@keyframes heart-appear {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(0.8);
    }
}

/* ============================================
   LEVEL UP MODAL
   ============================================ */

.levelup-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-appear 0.3s ease-out;
}

.levelup-content {
    position: relative;
    background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
    border-radius: 28px;
    padding: 48px 40px;
    text-align: center;
    max-width: 300px;
    width: 85%;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    animation: content-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.levelup-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
    animation: glow-rotate 4s linear infinite;
}

@keyframes glow-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.levelup-badge {
    position: relative;
    font-size: 56px;
    animation: badge-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

@keyframes badge-bounce {
    from {
        transform: scale(0) translateY(20px);
    }
    to {
        transform: scale(1) translateY(0);
    }
}

.levelup-title {
    position: relative;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #6366f1;
    font-weight: 700;
    margin-top: 12px;
}

.levelup-level {
    position: relative;
    font-size: 42px;
    font-weight: 800;
    color: white;
    margin-top: 4px;
}

.levelup-btn {
    position: relative;
    margin-top: 28px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    color: white;
    padding: 14px 44px;
    border-radius: 25px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.levelup-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* ============================================
   CORRECT/INCORRECT FEEDBACK
   ============================================ */

.feedback-correct {
    animation: correct-pulse 0.4s ease-out;
}

@keyframes correct-pulse {
    0% { background-color: rgba(16, 185, 129, 0.3); }
    100% { background-color: transparent; }
}

.feedback-incorrect {
    animation: incorrect-shake 0.4s ease-out;
}

@keyframes incorrect-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

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

.progress-fill {
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.daily-goal-fill {
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Shimmer effect for loading states */
.shimmer {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
