/* Page Loader Styles */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loader-content {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #a136aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.loader-text {
    color: #a136aa;
    font-weight: 600;
    font-size: 1.1rem;
}

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

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

/* Form Loading Overlay */
.form-loading {
    position: relative;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

/* Card Loading State */
.card-loading {
    position: relative;
    overflow: hidden;
}

.card-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: loading-shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes loading-shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Table Row Loading */
.table-loading tr {
    opacity: 0.6;
    pointer-events: none;
}

/* Custom Spinner for Different Button Types */
.btn-primary.btn-loading .spinner-border-sm {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.btn-success.btn-loading .spinner-border-sm {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.btn-warning.btn-loading .spinner-border-sm {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

.btn-danger.btn-loading .spinner-border-sm {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* Loading Animation for Cards */
.card-loading-animation {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
