/* Congratulations Modal Styles */
.congratulations-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.congratulations-modal {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* Celebration Effects */
.celebration-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 20px;
}

.fireworks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.firework {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #ffeb3b 0%, #ff9800 50%, transparent 70%);
    border-radius: 50%;
    animation: fireworkExplode 2s ease-out infinite;
}

.firework:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.firework:nth-child(2) { top: 30%; left: 80%; animation-delay: 0.2s; }
.firework:nth-child(3) { top: 60%; left: 20%; animation-delay: 0.4s; }
.firework:nth-child(4) { top: 40%; left: 90%; animation-delay: 0.6s; }
.firework:nth-child(5) { top: 80%; left: 60%; animation-delay: 0.8s; }
.firework:nth-child(6) { top: 15%; left: 50%; animation-delay: 1s; }
.firework:nth-child(7) { top: 70%; left: 40%; animation-delay: 1.2s; }
.firework:nth-child(8) { top: 25%; left: 75%; animation-delay: 1.4s; }
.firework:nth-child(9) { top: 85%; left: 15%; animation-delay: 1.6s; }
.firework:nth-child(10) { top: 45%; left: 65%; animation-delay: 1.8s; }

@keyframes fireworkExplode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.confetti-rain {
    position: absolute;
    width: 100%;
    height: 100%;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    background: #ffeb3b;
    animation: confettiFall 3s ease-in infinite;
}

.confetti-piece:nth-child(odd) { background: #e91e63; }
.confetti-piece:nth-child(3n) { background: #2196f3; }
.confetti-piece:nth-child(5n) { background: #4caf50; }
.confetti-piece:nth-child(7n) { background: #ff9800; }

.confetti-piece:nth-child(1) { left: 5%; animation-delay: 0s; }
.confetti-piece:nth-child(2) { left: 15%; animation-delay: 0.1s; }
.confetti-piece:nth-child(3) { left: 25%; animation-delay: 0.2s; }
.confetti-piece:nth-child(4) { left: 35%; animation-delay: 0.3s; }
.confetti-piece:nth-child(5) { left: 45%; animation-delay: 0.4s; }
.confetti-piece:nth-child(6) { left: 55%; animation-delay: 0.5s; }
.confetti-piece:nth-child(7) { left: 65%; animation-delay: 0.6s; }
.confetti-piece:nth-child(8) { left: 75%; animation-delay: 0.7s; }
.confetti-piece:nth-child(9) { left: 85%; animation-delay: 0.8s; }
.confetti-piece:nth-child(10) { left: 95%; animation-delay: 0.9s; }

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Modal Content */
.congratulations-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
}

.congratulations-icon {
    margin-bottom: 30px;
}

.trophy-container {
    position: relative;
    display: inline-block;
}

.trophy-icon {
    width: 80px;
    height: 80px;
    color: #ffd700;
    filter: drop-shadow(0 5px 15px rgba(255, 215, 0, 0.5));
    animation: trophyBounce 2s ease-in-out infinite;
}

.trophy-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 2s ease-in-out infinite;
}

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

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.congratulations-header {
    margin-bottom: 30px;
}

.congratulations-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffeb3b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.congratulations-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.reward-display {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.reward-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.reward-amount-large {
    font-size: 4rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 3px 15px rgba(255, 215, 0, 0.5);
    line-height: 1;
}

.reward-currency-large {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    opacity: 0.9;
}

.reward-description {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

.success-message {
    background: rgba(76, 175, 80, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(76, 175, 80, 0.3);
    display: flex;
    align-items: center;
    gap: 15px;
    text-align: left;
}

.success-icon {
    flex-shrink: 0;
}

.success-icon svg {
    width: 30px;
    height: 30px;
    color: #4caf50;
}

.congratulations-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    min-width: 120px;
    justify-content: center;
}

.modal-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.modal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.modal-btn.secondary svg {
    width: 18px;
    height: 18px;
}

.collect-rewards-btn {
    position: relative;
    background: linear-gradient(135deg, #ffd700 0%, #ff9800 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 15px;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    min-width: 180px;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
}

.collect-rewards-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.4);
}

.collect-rewards-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.collect-rewards-btn .btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.collect-rewards-btn .btn-icon {
    width: 20px;
    height: 20px;
}

.collect-rewards-btn .btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.collect-rewards-btn.collecting {
    background: linear-gradient(135deg, #ccc 0%, #999 100%);
    color: #666;
}

.btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .congratulations-modal {
        padding: 20px;
        margin: 10px;
    }

    .congratulations-title {
        font-size: 2rem;
    }

    .reward-amount-large {
        font-size: 3rem;
    }

    .congratulations-actions {
        flex-direction: column;
    }

    .modal-btn,
    .collect-rewards-btn {
        width: 100%;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .congratulations-modal {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
}
