/* Loading State Styles */

/* Global Loader Overlay */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.global-loader.show {
    opacity: 1;
    visibility: visible;
}

.global-loader-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 250px;
}

.global-loader-text {
    font-size: 16px;
    color: #333;
    font-weight: 500;
}

/* Button Loading States */
button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

button .spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Inline Loading Spinner */
.inline-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.15em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

/* Progress Bar Styles */
.progress-container {
    margin: 20px 0;
}

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

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

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

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

.progress-text {
    margin-top: 8px;
    font-size: 14px;
    color: #6c757d;
    text-align: center;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    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: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-paragraph {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-paragraph:last-child {
    width: 80%;
}

/* Processing Animation */
.processing-dots::after {
    content: '';
    animation: processing-dots 1.5s steps(4, end) infinite;
}

@keyframes processing-dots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
    100% { content: ''; }
}

/* Pulse Animation for Loading Elements */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Spinner Sizes */
.spinner-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

.spinner-md {
    width: 2rem;
    height: 2rem;
    border-width: 0.2em;
}

.spinner-lg {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
}

/* Disable interactions during loading */
.loading-overlay {
    position: relative;
    pointer-events: none;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
}
