/**
 * Skeleton Loading Placeholders
 * Academia Design System Component
 * 
 * Usage:
 * <div class="skeleton skeleton--text"></div>
 * <div class="skeleton skeleton--avatar"></div>
 * <div class="skeleton skeleton--card"></div>
 * <div class="skeleton skeleton--button"></div>
 * 
 * Sizes: skeleton--sm, skeleton--md, skeleton--lg
 */

/* ========================================
   Skeleton Base
   ======================================== */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.12) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm, 8px);
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    pointer-events: none;
    user-select: none;
}

/* ========================================
   Skeleton Variants
   ======================================== */

/* Text skeleton - single line */
.skeleton--text {
    height: 1em;
    width: 100%;
    max-width: 200px;
    border-radius: 4px;
}

.skeleton--text.skeleton--sm {
    max-width: 100px;
    height: 0.8em;
}

.skeleton--text.skeleton--md {
    max-width: 200px;
    height: 1em;
}

.skeleton--text.skeleton--lg {
    max-width: 300px;
    height: 1.2em;
}

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

/* Title skeleton */
.skeleton--title {
    height: 1.5em;
    width: 60%;
    max-width: 300px;
    border-radius: 4px;
}

/* Paragraph skeleton */
.skeleton--paragraph {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton--paragraph .skeleton--text:last-child {
    width: 75%;
}

/* Avatar skeleton - circular */
.skeleton--avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton--avatar.skeleton--sm {
    width: 32px;
    height: 32px;
}

.skeleton--avatar.skeleton--md {
    width: 48px;
    height: 48px;
}

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

.skeleton--avatar.skeleton--xl {
    width: 96px;
    height: 96px;
}

/* Card skeleton */
.skeleton--card {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-lg, 16px);
}

.skeleton--card.skeleton--sm {
    height: 100px;
}

.skeleton--card.skeleton--md {
    height: 160px;
}

.skeleton--card.skeleton--lg {
    height: 240px;
}

/* Button skeleton */
.skeleton--button {
    width: 120px;
    height: 44px;
    border-radius: var(--radius-md, 12px);
}

.skeleton--button.skeleton--sm {
    width: 80px;
    height: 36px;
}

.skeleton--button.skeleton--lg {
    width: 160px;
    height: 52px;
}

/* Image skeleton */
.skeleton--image {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg, 16px);
}

.skeleton--image.skeleton--square {
    aspect-ratio: 1/1;
}

.skeleton--image.skeleton--portrait {
    aspect-ratio: 3/4;
}

/* Icon skeleton */
.skeleton--icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

.skeleton--icon.skeleton--sm {
    width: 16px;
    height: 16px;
}

.skeleton--icon.skeleton--lg {
    width: 32px;
    height: 32px;
}

/* ========================================
   Compound Skeletons
   ======================================== */

/* User row (avatar + text) */
.skeleton-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.skeleton-user-row .skeleton--text {
    flex: 1;
}

/* Card with content */
.skeleton-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: var(--color-glass-bg, rgba(255, 255, 255, 0.05));
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--color-glass-border, rgba(255, 255, 255, 0.1));
}

/* List of items */
.skeleton-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--color-glass-bg, rgba(255, 255, 255, 0.05));
    border-radius: var(--radius-md, 12px);
    border: 1px solid var(--color-glass-border, rgba(255, 255, 255, 0.1));
}

/* ========================================
   Shimmer Animation
   ======================================== */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

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

/* ========================================
   Reduced Motion
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
        background: rgba(255, 255, 255, 0.1);
    }
}

/* ========================================
   Light Mode Overrides
   ======================================== */
[data-theme="light"] .skeleton {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.05) 0%,
            rgba(0, 0, 0, 0.1) 50%,
            rgba(0, 0, 0, 0.05) 100%);
    background-size: 200% 100%;
}