/**
 * Skeleton Loader Styles
 * Smooth loading placeholder animations
 */

/* Base skeleton animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* Base skeleton element */
.skeleton {
    background: linear-gradient(
        90deg,
        #e2e8f0 0%,
        #f1f5f9 50%,
        #e2e8f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton container */
.skeleton-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
}

/* Text skeleton */
.skeleton-text {
    height: 1rem;
    width: 100%;
    margin: 0.5rem 0;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-text.xs {
    width: 30%;
    height: 0.75rem;
}

/* Title skeleton */
.skeleton-title {
    height: 1.5rem;
    width: 80%;
    margin: 0.75rem 0;
}

/* Image skeleton */
.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

.skeleton-image.small {
    height: 100px;
}

.skeleton-image.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

/* Button skeleton */
.skeleton-button {
    height: 40px;
    width: 120px;
    border-radius: 8px;
}

/* Card skeleton */
.skeleton-card {
    background: var(--bg-light, #ffffff);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex: 1 1 250px;
    max-width: 350px;
}

/* Table row skeleton */
.skeleton-row td {
    padding: 1rem 0.5rem;
}

/* Book grid skeleton */
.skeleton-book-card {
    background: var(--bg-light, #ffffff);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.skeleton-book-card .skeleton-image {
    height: 180px;
    border-radius: 0;
}

.skeleton-book-card .skeleton-content {
    padding: 1rem;
}

/* Profile stats skeleton */
.skeleton-stat {
    text-align: center;
    padding: 1rem;
}

.skeleton-stat .skeleton-text {
    margin: 0 auto;
}

/* Notification skeleton */
.skeleton-notification {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.skeleton-notification .skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
}

.skeleton-notification .skeleton-content {
    flex: 1;
}

/* Loading placeholder upgrade */
.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
}

.loading-placeholder::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 0.75rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Smooth fade in when content loads */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pulse animation for loading states */
.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}
