/**
 * Loading Spinners and Progress Indicators
 * Beautiful loading states for Bangla PDF Editor
 */

/* Main Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(102, 126, 234, 0.2);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner-small {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

.loading-spinner-large {
    width: 80px;
    height: 80px;
    border-width: 8px;
}

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

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
}

.loading-overlay .loading-content {
    text-align: center;
    color: white;
}

.loading-overlay .loading-spinner {
    margin-bottom: 20px;
}

.loading-overlay .loading-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.loading-overlay .loading-subtext {
    font-size: 14px;
    opacity: 0.8;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-button {
    height: 40px;
    width: 120px;
}

/* Dots Loading */
.dots-loading {
    display: inline-flex;
    gap: 8px;
}

.dots-loading span {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: dots-bounce 1.4s infinite ease-in-out both;
}

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

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

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

/* Pulse Loading */
.pulse-loading {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #667eea;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.5;
    }
    100% {
        transform: scale(0.8);
        opacity: 1;
    }
}

/* Upload Progress Card */
.upload-progress-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    min-width: 400px;
    max-width: 500px;
}

.upload-progress-card .icon {
    font-size: 60px;
    text-align: center;
    margin-bottom: 20px;
}

.upload-progress-card .title {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: #2c3e50;
}

.upload-progress-card .subtitle {
    font-size: 14px;
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 20px;
}

.upload-progress-card .progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 14px;
    color: #7f8c8d;
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .upload-progress-card {
        min-width: 90%;
        padding: 20px;
    }
    
    .loading-spinner-large {
        width: 60px;
        height: 60px;
    }
}
