/* Modern Loading Animations */

/* Pulsing Dots Loader */
.loading-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: pulse-dot 1.4s ease-in-out infinite;
}

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

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

.loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pulse-dot {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Wave Loader (Alternative) */
.loading-wave {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
}

.loading-wave span {
    width: 6px;
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: wave-bar 1.2s ease-in-out infinite;
}

.loading-wave span:nth-child(1) {
    animation-delay: 0s;
}

.loading-wave span:nth-child(2) {
    animation-delay: 0.1s;
}

.loading-wave span:nth-child(3) {
    animation-delay: 0.2s;
}

.loading-wave span:nth-child(4) {
    animation-delay: 0.3s;
}

.loading-wave span:nth-child(5) {
    animation-delay: 0.4s;
}

@keyframes wave-bar {
    0%, 40%, 100% {
        transform: scaleY(0.4);
    }
    20% {
        transform: scaleY(1);
    }
}

/* Bouncing Balls Loader */
.loading-bounce {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
}

.loading-bounce span {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    animation: bounce-ball 1.4s ease-in-out infinite;
}

.loading-bounce span:nth-child(1) {
    animation-delay: 0s;
}

.loading-bounce span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-bounce span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce-ball {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
}

/* Gradient Spinner (Modern circular) */
.loading-spinner-modern {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent, #667eea, #764ba2, transparent);
    animation: spin-modern 1s linear infinite;
    position: relative;
}

.loading-spinner-modern::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--bg-primary, #fff);
}

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

/* Small inline loader */
.loading-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.loading-inline span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse-dot 1.4s ease-in-out infinite;
}

.loading-inline span:nth-child(1) {
    animation-delay: 0s;
}

.loading-inline span:nth-child(2) {
    animation-delay: 0.2s;
}

.loading-inline span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Loading State Container */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    gap: 16px;
}

.loading-state p {
    color: var(--text-secondary, #666);
    font-size: 14px;
    margin: 0;
}

.loading-state small {
    color: var(--text-tertiary, #999);
    font-size: 12px;
}

/* AI Loading specific */
.ai-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.ai-loading-text {
    color: var(--text-secondary, #666);
    font-size: 14px;
    font-weight: 500;
}

/* Replace old spinner classes */
.loading-spinner,
.ai-loading-spinner,
.spinner-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Small spinner for buttons */
.loading-spinner-small {
    display: inline-flex;
    margin-right: 8px;
}
