/* Loading Animation Styles */
.scan-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(76, 175, 80, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.scan-loading-content {
    text-align: center;
    color: white;
    max-width: 600px;
    padding: 2rem;
}

.dancing-animals {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.dancing-animal {
    font-size: 3rem;
    animation: animal-dance 2s ease-in-out infinite !important;
    transform-origin: center bottom !important;
    display: inline-block !important;
}

.dancing-animal:nth-child(1) { animation-delay: 0s !important; }
.dancing-animal:nth-child(2) { animation-delay: 0.2s !important; }
.dancing-animal:nth-child(3) { animation-delay: 0.4s !important; }
.dancing-animal:nth-child(4) { animation-delay: 0.6s !important; }
.dancing-animal:nth-child(5) { animation-delay: 0.8s !important; }

@keyframes animal-dance {
    0%, 100% { 
        transform: translateY(0) rotate(0deg) scale(1); 
    }
    20% { 
        transform: translateY(-15px) rotate(-3deg) scale(1.05); 
    }
    40% { 
        transform: translateY(-25px) rotate(2deg) scale(1.1); 
    }
    60% { 
        transform: translateY(-10px) rotate(-2deg) scale(0.95); 
    }
    80% { 
        transform: translateY(-20px) rotate(1deg) scale(1.08); 
    }
}

.loading-progress {
    width: 100% !important;
    max-width: 400px !important;
    height: 8px !important;
    background: rgba(255, 255, 255, 0.3) !important;
    border-radius: 20px !important;
    overflow: hidden !important;
    margin: 2rem auto !important;
    position: relative !important;
    display: block !important;
}

#loading-progress-bar {
    background: linear-gradient(90deg, #ffeb3b, #4caf50, #2196f3) !important;
    border: none;
    border-radius: 20px;
}

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

.loading-messages {
    margin: 2rem 0;
    min-height: 60px;
}

.loading-message {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0;
    animation: fade-in-out 3s ease-in-out infinite;
}

.loading-message:nth-child(1) { animation-delay: 0s; }
.loading-message:nth-child(2) { animation-delay: 3s; }
.loading-message:nth-child(3) { animation-delay: 6s; }
.loading-message:nth-child(4) { animation-delay: 9s; }

@keyframes fade-in-out {
    0%, 100% { opacity: 0; transform: translateY(10px); }
    10%, 90% { opacity: 1; transform: translateY(0); }
}

.scanning-icon {
    font-size: 4rem;
    animation: scan-pulse 2s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes scan-pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .dancing-animal {
        font-size: 2.5rem;
    }
    
    .scan-loading-content {
        padding: 1rem;
    }
    
    .dancing-animals {
        gap: 15px;
    }
    
    .loading-message {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .dancing-animal {
        font-size: 2rem;
    }
    
    .dancing-animals {
        gap: 10px;
    }
    
    .loading-message {
        font-size: 1rem;
    }
}

/* Cancel button styling */
#cancel-analysis-btn {
    transition: all 0.3s ease;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
}

#cancel-analysis-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.8);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

#cancel-analysis-btn:active {
    transform: translateY(0);
}

#cancel-analysis-btn i {
    width: 16px;
    height: 16px;
}