/* Modern Dark Purple Theme - Spinner */
:root {
    --primary-bg: #0a0a0f;
    --secondary-bg: #1a1a2e;
    --accent-purple: #8b5cf6;
    --accent-purple-light: #a78bfa;
    --accent-purple-dark: #7c3aed;
    --text-primary: #f8fafc;
    --shadow: 0 10px 25px rgba(139, 92, 246, 0.2);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main Spinner Container */
.spinner-container {
    text-align: center;
    padding: 2rem;
}

/* Modern Purple Spinner */
.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(139, 92, 246, 0.1);
    border-left: 4px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border: 2px solid transparent;
    border-top: 2px solid var(--accent-purple-light);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid transparent;
    border-bottom: 1px solid var(--accent-purple-dark);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Text */
.loading-text {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.loading-subtext {
    color: var(--accent-purple-light);
    font-size: 0.95rem;
    font-weight: 500;
    opacity: 0.8;
}

/* Pulse Animation */
.spinner-pulse {
    width: 60px;
    height: 60px;
    background: var(--accent-purple);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: pulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

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

/* Bounce Animation */
.spinner-bounce {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.bounce-dot {
    width: 12px;
    height: 12px;
    background: var(--accent-purple);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.bounce-dot:nth-child(1) { animation-delay: -0.32s; }
.bounce-dot:nth-child(2) { animation-delay: -0.16s; }
.bounce-dot:nth-child(3) { animation-delay: 0s; }

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

/* Wave Animation */
.spinner-wave {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 1.5rem;
}

.wave-bar {
    width: 4px;
    height: 20px;
    background: var(--accent-purple);
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: -1.2s; }
.wave-bar:nth-child(2) { animation-delay: -1.1s; }
.wave-bar:nth-child(3) { animation-delay: -1.0s; }
.wave-bar:nth-child(4) { animation-delay: -0.9s; }
.wave-bar:nth-child(5) { animation-delay: -0.8s; }

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

/* Ring Animation */
.spinner-ring {
    width: 60px;
    height: 60px;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-purple);
    border-right: 3px solid var(--accent-purple-light);
    border-bottom: 3px solid var(--accent-purple-dark);
    border-radius: 50%;
    animation: ring 1.5s linear infinite;
    margin: 0 auto 1.5rem;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.3);
}

@keyframes ring {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cube Animation */
.spinner-cube {
    width: 50px;
    height: 50px;
    margin: 0 auto 1.5rem;
    position: relative;
    transform-style: preserve-3d;
    animation: cube 2s linear infinite;
}

.cube-face {
    position: absolute;
    width: 50px;
    height: 50px;
    background: var(--accent-purple);
    border: 2px solid var(--accent-purple-light);
    border-radius: 4px;
    opacity: 0.8;
}

.cube-face:nth-child(1) { transform: rotateY(0deg) translateZ(25px); }
.cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(25px); }
.cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(25px); }
.cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(25px); }
.cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(25px); }
.cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(25px); }

@keyframes cube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

/* Progress Bar */
.progress-spinner {
    width: 200px;
    height: 6px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 3px;
    margin: 0 auto 1.5rem;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple-light));
    border-radius: 3px;
    animation: progress 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 0%; }
}

/* Inline Spinner */
.spinner-inline {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.1);
    border-left: 2px solid var(--accent-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Small Spinner */
.spinner-sm {
    width: 30px;
    height: 30px;
    border-width: 2px;
}

/* Large Spinner */
.spinner-lg {
    width: 120px;
    height: 120px;
    border-width: 6px;
}

/* Colored Variants */
.spinner-success {
    border-left-color: #10b981;
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.spinner-danger {
    border-left-color: #ef4444;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.3);
}

.spinner-warning {
    border-left-color: #f59e0b;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .spinner {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }
    
    .spinner-lg {
        width: 80px;
        height: 80px;
        border-width: 4px;
    }
    
    .loading-text {
        font-size: 1rem;
    }
    
    .loading-subtext {
        font-size: 0.85rem;
    }
    
    .progress-spinner {
        width: 150px;
    }
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.spinner-container {
    animation: fadeIn 0.5s ease-out;
}
