/* Loading Animations for Daiark Pose Analysis */

/* Spinner for buttons */
.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Analysis loading container */
.analysis-loading {
    text-align: center;
    padding: 3rem 2rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Bouncing dots */
.loading-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.loading-dots .dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    } 
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

.analysis-loading p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.loading-subtext {
    font-size: 0.9rem !important;
    color: var(--text-secondary) !important;
    font-weight: 400 !important;
}

/* Success animation */
.analysis-success {
    text-align: center;
    padding: 2rem;
    animation: fadeInScale 0.5s ease-out;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--success) 0%, #34d399 100%);
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    animation: successPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}

.analysis-success p {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--success);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes successPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

/* Error message */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error);
    color: #fca5a5;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Progress bar pulse */
@keyframes progressPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.progress-fill {
    animation: progressPulse 1.5s ease-in-out infinite;
}
