/**
 * Premium Skeleton Loaders
 * Shimmer effect loading placeholders
 */

/* Base Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    display: inline-block;
}

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

/* Skeleton Variants */
.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-text-lg {
    height: 24px;
    margin-bottom: 12px;
}

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

.skeleton-title {
    height: 32px;
    width: 60%;
    margin-bottom: 16px;
    border-radius: 6px;
}

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

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

.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

.skeleton-card {
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

/* Skeleton Message Bubble */
.skeleton-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-message-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Skeleton Table Row */
.skeleton-table-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
}

/* Skeleton List Item */
.skeleton-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
}

/* Skeleton Conversation */
.skeleton-conversation {
    padding: 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

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

/* Skeleton Stats Card */
.skeleton-stats-card {
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(
            90deg,
            #2d3748 0%,
            #374151 50%,
            #2d3748 100%
        );
        background-size: 200% 100%;
    }

    .skeleton-card,
    .skeleton-stats-card {
        background: #1f2937;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

/* Pulse Animation (alternative to shimmer) */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Hide real content while loading */
.loading .hide-while-loading {
    display: none;
}

/* Show skeleton only while loading */
.skeleton-wrapper:not(.loading) .skeleton {
    display: none;
}
