/* ========================================
   LOADERS & SPINNERS
======================================== */

.loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

/* Full Page Loader */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: var(--z-tooltip);
}

.page-loader-text {
    margin-top: var(--space-lg);
    color: var(--text-muted);
}

/* Skeleton loader */
.skeleton {
    background: linear-gradient(
            90deg,
            var(--bg-secondary) 25%,
            var(--bg-tertiary) 50%,
            var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 16px;
    margin-bottom: var(--space-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-title {
    height: 24px;
    width: 50%;
    margin-bottom: var(--space-md);
}

.skeleton-image {
    height: 180px;
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Progress bar */
.progress {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-bar.success {
    background: var(--success);
}

.progress-bar.warning {
    background: var(--warning);
}

.progress-bar.error {
    background: var(--error);
}