/* ============================================
   LOADING SKELETONS - REUSABLE COMPONENTS
   ============================================ */

/* Base Skeleton Animation */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    animation: skeleton-pulse 2s infinite;
}

/* Skeleton Shapes */
.skeleton-text {
    width: 100%;
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-text-short {
    width: 85%;
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-text-medium {
    width: 70%;
    height: 16px;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    width: 70%;
    height: 32px;
    margin-bottom: 1rem;
}

.skeleton-subtitle {
    width: 50%;
    height: 24px;
    margin-bottom: 1rem;
}

.skeleton-image {
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
    border-radius: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

.skeleton-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
}

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

.skeleton-badge {
    width: 80px;
    height: 28px;
    border-radius: 20px;
    display: inline-block;
    margin-right: 0.5rem;
}

/* Skeleton Cards */
.skeleton-card {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e0e0e0;
    border-radius: 16px;
    background: white;
}

.skeleton-blog-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.skeleton-stat-card {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
}

/* Skeleton Layouts */
.skeleton-grid {
    display: grid;
    gap: 1.5rem;
}

.skeleton-flex {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Blog List Skeleton */
.skeleton-blog-list {
    display: grid;
    gap: 2rem;
}

.skeleton-blog-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.skeleton-blog-content {
    padding: 2rem;
}

/* Settings Page Skeleton */
.skeleton-settings-section {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Profile Page Skeleton */
.skeleton-profile-header {
    background: white;
    padding: 3rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* Comment Skeleton */
.skeleton-comment {
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Loading Container */
.loading-container {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.loading-container.loaded {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    z-index: -1;
}

.content-container {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.content-container.loaded {
    opacity: 1;
}

/* Specific Skeleton Components */

/* Blog Card Skeleton */
.skeleton-blog-card-complete {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.skeleton-blog-card-complete .skeleton-image {
    height: 280px;
    border-radius: 0;
    margin-bottom: 0;
}

.skeleton-blog-card-complete .skeleton-blog-content {
    padding: 2rem;
}

/* Stats Grid Skeleton */
.skeleton-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skeleton-stat-item {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    text-align: center;
}

.skeleton-stat-number {
    width: 80px;
    height: 48px;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
}

.skeleton-stat-label {
    width: 120px;
    height: 20px;
    margin: 0 auto;
    border-radius: 8px;
}

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

    .skeleton-card,
    .skeleton-blog-card,
    .skeleton-stat-card,
    .skeleton-settings-section,
    .skeleton-profile-header,
    .skeleton-comment {
        background: #1a202c;
        border-color: #2d3748;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .skeleton-image {
        height: 200px;
    }

    .skeleton-blog-card-complete .skeleton-image {
        height: 200px;
    }

    .skeleton-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}
