/**
 * Global Loading Animation Styles
 * Orbital dots animation inspired by Material Design
 */

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: none !important;
    transform: none !important;
}

.loading-overlay.active {
    display: flex;
}

/* Loading Spinner Container */
.loading-spinner {
    padding: 3rem;
    text-align: center;
    min-width: 280px;
    transform: none !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Custom animated loader - inspired by Material Design */
.loading-animation {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    position: relative;
}

/* Orbiting dots animation */
.orbit-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -6px 0 0 -6px;
}

.orbit-dot:nth-child(1) {
    background: #667eea;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite;
}

.orbit-dot:nth-child(2) {
    background: #764ba2;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.3s;
}

.orbit-dot:nth-child(3) {
    background: #f093fb;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.6s;
}

.orbit-dot:nth-child(4) {
    background: #4facfe;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.9s;
}

.orbit-dot:nth-child(5) {
    background: #43e97b;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 1.2s;
}

@keyframes orbit {
    0% {
        transform: rotate(0deg) translateX(40px) rotate(0deg);
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        transform: rotate(360deg) translateX(40px) rotate(-360deg);
        opacity: 1;
    }
}

/* Pulsing center circle */
.loading-animation::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Loading text animation */
.loading-spinner p {
    color: white;
    font-weight: 500;
    margin: 0 0 1.5rem 0;
    font-size: 1.1rem;
    animation: fadeInOut 2s ease-in-out infinite;
    display: inline-block;
    transform: none !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Reflection Animation - Upside down at bottom */
.loading-animation-reflection {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    position: relative;
    transform: rotate(180deg) scaleX(-1);
    opacity: 0.3;
    filter: blur(1px);
}

/* Reflection orbiting dots */
.loading-animation-reflection .orbit-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -6px 0 0 -6px;
}

.loading-animation-reflection .orbit-dot:nth-child(1) {
    background: #667eea;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite;
}

.loading-animation-reflection .orbit-dot:nth-child(2) {
    background: #764ba2;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.3s;
}

.loading-animation-reflection .orbit-dot:nth-child(3) {
    background: #f093fb;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.6s;
}

.loading-animation-reflection .orbit-dot:nth-child(4) {
    background: #4facfe;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 0.9s;
}

.loading-animation-reflection .orbit-dot:nth-child(5) {
    background: #43e97b;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    animation: orbit 1.5s linear infinite 1.2s;
}

/* Reflection pulsing center circle */
.loading-animation-reflection::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Loading dots after text */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Search Loading Spinner (Bootstrap compatible) */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}
