/* ============================================
   Skeleton Loader Styles — FairyAurora v3.0
   Better perceived performance during loading
   ============================================ */

/* Base Skeleton — Aurora-Shimmer mit Token-Farben */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--surface-2) 0%,
        var(--primary-tint) 50%,
        var(--surface-2) 100%
    );
    background-size: 200% 100%;
    animation: fa-skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--r-sm);
}

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

@media (prefers-reduced-motion: reduce) {
    .skeleton { animation: none; background: var(--surface-2); }
}

/* Skeleton Elements */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: var(--r-sm);
}

.skeleton-text-sm {
    height: 12px;
    margin-bottom: 6px;
}

.skeleton-text-lg {
    height: 20px;
    margin-bottom: 10px;
}

.skeleton-heading {
    height: 28px;
    width: 60%;
    margin-bottom: 16px;
    border-radius: var(--r-sm);
}

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

.skeleton-avatar-lg {
    width: 64px;
    height: 64px;
}

.skeleton-button {
    height: 38px;
    width: 100px;
    border-radius: var(--r-sm);
}

.skeleton-card {
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
}

.skeleton-badge {
    height: 24px;
    width: 60px;
    border-radius: var(--r-xl);
    display: inline-block;
}

/* KPI Card Skeleton */
.skeleton-kpi-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--surface);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--border);
}

.skeleton-kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
}

.skeleton-kpi-content {
    flex: 1;
}

/* Table Skeleton */
.skeleton-table {
    width: 100%;
}

.skeleton-table-row {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border);
}

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

/* List Skeleton */
.skeleton-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--border);
}

/* Grid Skeleton */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

/* Error State */
.skeleton-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    text-align: center;
    color: var(--fg-3);
}

.skeleton-error i {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    color: var(--danger);
}

.skeleton-error p {
    margin: 0 0 var(--spacing-md) 0;
    font-size: 16px;
}

/* Pulse Animation (alternative to shimmer) */
.skeleton-pulse {
    animation: fa-skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes fa-skeleton-pulse {
    0%, 100% { opacity: .9;  }
    50%      { opacity: .55; }
}

/* Variants */
.skeleton-primary {
    background: linear-gradient(
        90deg,
        rgb(44, 62, 80, 0.1) 0%,
        rgb(44, 62, 80, 0.05) 50%,
        rgb(44, 62, 80, 0.1) 100%
    );
    background-size: 200% 100%;
}

.skeleton-light {
    background: linear-gradient(
        90deg,
        var(--surface) 0%,
        var(--bg) 50%,
        var(--surface) 100%
    );
    background-size: 200% 100%;
}

/* Responsive */
@media (max-width: 767.98px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
    }
}
