/* Smart Loading States CSS */

.smart-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smart-loading-overlay.show {
    opacity: 1;
}

.loading-content {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

/* Spinner Animation */
.loading-spinner {
    margin: 0 auto 20px;
    width: 50px;
    height: 50px;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Loading Message */
.loading-message {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    transition: opacity 0.3s ease;
    min-height: 25px;
}

.loading-subtext {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Button Loading State */
.button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

button.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

/* Modal Loading Overlay */
.modal-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: inherit;
}

.modal-loading .loading-content {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    padding: 20px;
}

.modal-loading .loading-message {
    color: #333;
}

.modal-loading .loading-subtext {
    color: #666;
}

/* Mobile Optimization */
@media (max-width: 768px) {
    .loading-content {
        margin: 20px;
        padding: 20px;
    }
    
    .loading-message {
        font-size: 16px;
    }
    
    .loading-subtext {
        font-size: 13px;
    }
}