/* ==========================================================================
   Loading Skeleton - Perceived Performance Enhancement
   Animated placeholders shown during content loading
   ========================================================================== */

/* Base skeleton styling */
.skeleton {
    background: linear-gradient(90deg,
            var(--color-bg-secondary) 25%,
            var(--color-bg-primary) 50%,
            var(--color-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Skeleton variants for different content types */
.skeleton-text {
    height: 1em;
    width: 80%;
    margin-bottom: var(--space-sm);
}

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

.skeleton-text-full {
    width: 100%;
}

.skeleton-heading {
    height: 1.5em;
    width: 60%;
    margin-bottom: var(--space-md);
}

/* Stat card skeleton */
.skeleton-stat-card {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl);
}

.skeleton-stat-value {
    height: 2rem;
    width: 60%;
}

.skeleton-stat-label {
    height: 0.75rem;
    width: 80%;
}

/* Table skeleton */
.skeleton-table-row {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-border);
}

.skeleton-table-cell {
    flex: 1;
    height: 1rem;
}

.skeleton-table-cell:first-child {
    flex: 2;
}

.skeleton-table-cell:last-child {
    flex: 0.5;
}

/* Chart skeleton */
.skeleton-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: var(--space-sm);
    padding: var(--space-md);
}

.skeleton-bar {
    flex: 1;
    background: var(--color-bg-secondary);
    border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}

/* Varying bar heights for visual interest */
.skeleton-bar:nth-child(1) {
    height: 70%;
}

.skeleton-bar:nth-child(2) {
    height: 40%;
}

.skeleton-bar:nth-child(3) {
    height: 90%;
}

.skeleton-bar:nth-child(4) {
    height: 55%;
}

.skeleton-bar:nth-child(5) {
    height: 75%;
}

.skeleton-bar:nth-child(6) {
    height: 35%;
}