/**
 * Progress Indicators Styling
 * AI Trade King - Professional Trading Platform
 */

/* Progress Container */
.progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.progress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.progress-modal {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.8);
    animation: scaleIn 0.3s ease forwards;
}

.progress-content {
    padding: 0;
}

.progress-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 15px 15px 0 0;
}

.progress-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.progress-title i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-close::before {
    content: "×";
    font-size: 20px;
    font-weight: bold;
}

.progress-body {
    padding: 30px;
}

/* Progress Steps */
.progress-steps {
    margin-bottom: 25px;
}

.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    border: 2px solid transparent;
}

.progress-step.active {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: #2196f3;
    transform: translateX(5px);
}

.progress-step.completed {
    background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
    border-color: #4caf50;
}

.progress-step i {
    font-size: 1rem;
    margin-right: 10px;
    min-width: 20px;
}

.progress-step span {
    font-weight: 500;
    color: #2c3e50;
}

/* Progress Bar */
.progress-bar-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

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

.progress-percentage {
    font-weight: 600;
    color: #2c3e50;
    min-width: 40px;
    text-align: right;
}

.progress-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    margin-top: 10px;
    min-height: 20px;
}

/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    to {
        transform: scale(1);
    }
}

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

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

/* Processing State */
.progress-overlay.processing .progress-modal {
    animation: pulse 2s infinite;
}

.progress-overlay.processing .progress-fill {
    animation: shimmer 1.5s infinite;
}

/* Error State */
.progress-overlay.error .progress-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.progress-overlay.error .progress-fill {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.progress-overlay.error .progress-message {
    color: #e17055;
    font-weight: 600;
}

/* Success State */
.progress-overlay.success .progress-header {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.progress-overlay.success .progress-fill {
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
}

.progress-overlay.success .progress-message {
    color: #00b894;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .progress-modal {
        width: 95%;
        margin: 0 10px;
    }
    
    .progress-header {
        padding: 15px;
    }
    
    .progress-body {
        padding: 20px;
    }
    
    .progress-title {
        font-size: 1.1rem;
    }
    
    .progress-step {
        padding: 8px 12px;
        margin-bottom: 12px;
    }
    
    .progress-bar-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .progress-percentage {
        align-self: flex-end;
    }
}

/* Compact Mode */
.progress-overlay.compact .progress-modal {
    max-width: 400px;
}

.progress-overlay.compact .progress-steps {
    display: none;
}

.progress-overlay.compact .progress-body {
    padding: 20px;
}

/* Mini Progress Indicator (for inline use) */
.mini-progress {
    position: relative;
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
}

.mini-progress .spinner {
    width: 100%;
    height: 100%;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #2196f3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Button Integration */
.btn-with-progress {
    position: relative;
    overflow: hidden;
}

.btn-with-progress .progress-overlay-btn {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 255, 255, 0.3);
    transition: width 0.3s ease;
    pointer-events: none;
}

.btn-with-progress.processing .progress-overlay-btn {
    width: 100%;
    animation: shimmer 2s infinite;
}