/* --------------------------------------------------
   Loading Animations - AI Platform Style
   -------------------------------------------------- */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--ai-gray-200);
    border-top-color: var(--ai-primary-500);
    border-radius: 50%;
    animation: aiSpin 0.8s linear infinite;
}

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

.page-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--ai-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease;
}

.page-loading.loaded {
    opacity: 0;
    pointer-events: none;
}

.page-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--ai-gray-200);
    border-top-color: var(--ai-primary-500);
    border-radius: 50%;
    animation: aiSpin 1s linear infinite;
}

.ai-skeleton {
    background: linear-gradient(
        90deg,
        var(--ai-bg-secondary) 25%,
        var(--ai-bg-card) 50%,
        var(--ai-bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: aiSkeleton 1.5s ease-in-out infinite;
    border-radius: var(--ai-radius);
}

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

.ai-loading-dots {
    display: inline-flex;
    gap: var(--ai-space-1);
}

.ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--ai-primary-500);
    border-radius: 50%;
    animation: aiLoadingDot 1.4s ease-in-out infinite both;
}

.ai-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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