/* Advanced Loader Styles */
.advanced-loader {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.advanced-loader.entering {
    opacity: 0;
    transform: scale(0.95);
}

.advanced-loader.entered {
    opacity: 1;
    transform: scale(1);
}

.advanced-loader.exiting {
    opacity: 0;
    transform: scale(0.95);
}

/* Pulse Animation Enhancement */
@keyframes pulse-advanced {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

.animate-pulse-advanced {
    animation: pulse-advanced 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce Enhancement */
@keyframes bounce-advanced {
    0%, 20%, 53%, 80%, 100% {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -8px, 0);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.animate-bounce-advanced {
    animation: bounce-advanced 1.5s infinite;
}

/* Spin with easing */
@keyframes spin-smooth {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.animate-spin-smooth {
    animation: spin-smooth 1.5s linear infinite;
}

/* Network Speed Indicator */
.network-speed-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.network-bar {
    width: 4px;
    height: 12px;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.network-bar.active {
    animation: network-pulse 1.5s ease-in-out infinite;
}

@keyframes network-pulse {
    0%, 100% {
        opacity: 1;
        transform: scaleY(1);
    }
    50% {
        opacity: 0.7;
        transform: scaleY(0.8);
    }
}

/* Progress Bar Animation */
.progress-bar-animated {
    position: relative;
    overflow: hidden;
}

.progress-bar-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Upload Animation Enhancement */
.upload-cloud {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.upload-arrow {
    animation: upload-bounce 1.5s ease-in-out infinite;
}

@keyframes upload-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* Dots Animation */
.loading-dots {
    display: inline-block;
}

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

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

/* Backdrop Blur Enhancement */
.backdrop-blur-advanced {
    backdrop-filter: blur(8px) saturate(150%);
    -webkit-backdrop-filter: blur(8px) saturate(150%);
}

/* Glass Effect */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
}

/* Dark mode glass effect */
.dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Responsive Design */
@media (max-width: 640px) {
    .advanced-loader .loading-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .advanced-loader .loading-animation {
        width: 4rem;
        height: 4rem;
    }

    .advanced-loader .loading-message {
        font-size: 0.875rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .advanced-loader *,
    .advanced-loader *::before,
    .advanced-loader *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .advanced-loader {
        border: 2px solid;
    }

    .loading-animation {
        border-width: 3px;
    }
}

/* Focus styles for accessibility */
.advanced-loader:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
