/* Global Loading Spinner */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.global-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.global-loading-spinner .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(168, 85, 247, 0.2);
    border-top-color: #a855f7;
    border-radius: 50%;
    animation: globalSpin 0.8s linear infinite;
}

.global-loading-spinner .loading-text {
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 500;
}

@keyframes globalSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Button Loading State */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

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

.btn-loading .btn-text {
    visibility: hidden;
}

/* Inline Spinner for smaller elements */
.inline-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: globalSpin 0.6s linear infinite;
    margin-right: 0.5em;
}
