/* Loading States and Skeleton Screens */

/* Skeleton Animation */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.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;
}

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 12px;
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-image {
    width: 60px;
    height: 40px;
    border-radius: 4px;
}

/* Table Skeleton Rows */
.skeleton-row td {
    padding: 16px;
    border-bottom: 1px solid #eee;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3949ab;
    animation: spin 0.8s ease-in-out infinite;
}

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

.loading-spinner.centered {
    display: block;
    margin: 40px auto;
    width: 40px;
    height: 40px;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay.dark {
    background: rgba(0, 0, 0, 0.5);
}

/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s ease-in-out infinite;
}

/* Content Loading State */
.content-loading {
    position: relative;
    min-height: 200px;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50px;
    height: 50px;
    margin-left: -25px;
    margin-top: -25px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3949ab;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

.content-loading::after {
    content: 'Loading...';
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -30px;
    margin-top: 35px;
    font-size: 12px;
    color: #666;
}

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

.table-loading tbody::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin-left: -20px;
    margin-top: -20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3949ab;
    border-radius: 50%;
    animation: spin 0.8s ease-in-out infinite;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3949ab, #1a237e);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-bar-fill.indeterminate {
    width: 50%;
    animation: indeterminate-progress 1.5s ease-in-out infinite;
}

@keyframes indeterminate-progress {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(300%); }
}

/* Inline Loading Indicator */
.inline-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.inline-loading .loading-spinner {
    width: 16px;
    height: 16px;
}
