/* ========================================
   Generic Loading Indicator Styles
   ======================================== */

/* Loading Overlay - Full Screen */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}

.loading-overlay.active {
    display: flex;
}

/* Loading Container */
.loading-container {
    background: white;
    border-radius: 10px;
    padding: 30px 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    min-width: 300px;
}

/* Loading Spinner */
.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 6px solid #f3f3f3;
    border-top: 6px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Message */
.loading-message {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.loading-submessage {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

/* Loading Timer Wrapper */
.loading-timer-wrapper {
    margin: 15px 0;
    text-align: center;
}

/* Loading Timer - Prominent display under message */
.loading-timer {
    font-size: 28px;
    font-weight: 700;
    color: #0d6efd;
    font-family: 'Courier New', 'Monaco', monospace;
    margin: 0;
    padding: 10px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 8px;
    border: 2px solid #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}

.loading-timer-label {
    font-size: 12px;
    font-weight: 400;
    color: #666;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
    color: #666;
    display: block;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Loading Progress Bar */
.loading-progress {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    margin: 15px 0;
    overflow: hidden;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd 0%, #0dcaf0 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Loading Progress Bar Animation */
.loading-progress-bar.indeterminate {
    width: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #0d6efd 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: loading-slide 1.5s ease-in-out infinite;
}

@keyframes loading-slide {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading Steps (Optional) */
.loading-steps {
    text-align: left;
    margin-top: 15px;
    font-size: 13px;
    color: #666;
}

.loading-step {
    padding: 5px 0;
    display: flex;
    align-items: center;
}

.loading-step.completed::before {
    content: '✓';
    color: #198754;
    margin-right: 8px;
    font-weight: bold;
}

.loading-step.active::before {
    content: '⟳';
    color: #0d6efd;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

.loading-step.pending::before {
    content: '○';
    color: #adb5bd;
    margin-right: 8px;
}

/* Cancel Button (Optional) */
.loading-cancel-btn {
    margin-top: 20px;
    padding: 8px 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.loading-cancel-btn:hover {
    background-color: #c82333;
}

/* Inline Loading (for specific sections) */
.loading-inline {
    display: none;
    padding: 20px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.loading-inline.active {
    display: block;
}

.loading-inline .loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 15px;
    border-width: 4px;
}

/* 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 #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* Responsive Design */
@media (max-width: 576px) {
    .loading-container {
        max-width: 90%;
        min-width: unset;
        padding: 20px;
    }
    
    .loading-message {
        font-size: 16px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
    }
}
