/**
 * Progress Indicator Styles
 */

/* Global overlay */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.progress-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Progress indicator */
.progress-indicator {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    min-width: 300px;
    max-width: 500px;
    animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-indicator.progress-fade-out {
    animation: scaleOut 0.2s ease-out forwards;
}

.progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* Progress message */
.progress-message {
    font-size: 16px;
    font-weight: 500;
    color: #374151;
    text-align: center;
}

/* Spinner */
.progress-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #e11d48;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Dots */
.progress-dots {
    display: flex;
    gap: 8px;
}

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

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

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

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #e11d48, #be123c);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0;
}

.progress-percent {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
}

/* Cancel button */
.progress-cancel {
    margin-top: 8px;
    padding: 8px 16px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.progress-cancel:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Element-specific progress */
.progress-element-indicator {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

.progress-loading {
    pointer-events: none;
    opacity: 0.6;
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
    .progress-indicator {
        background: #1f2937;
    }

    .progress-message {
        color: #f3f4f6;
    }

    .progress-spinner {
        border-color: #374151;
        border-top-color: #fb7185;
    }

    .progress-dots span {
        background: #fb7185;
    }

    .progress-bar {
        background: #374151;
    }

    .progress-percent {
        color: #9ca3af;
    }

    .progress-element-indicator {
        background: rgba(31, 41, 55, 0.95);
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .progress-indicator {
        min-width: 280px;
        padding: 24px;
    }

    .progress-spinner {
        width: 40px;
        height: 40px;
    }

    .progress-message {
        font-size: 14px;
    }
}

/* Utility classes for button loading states */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn-loading.btn-outline-primary::after,
.btn-loading.btn-light::after {
    border-color: #e11d48;
    border-top-color: transparent;
}
