/* ========================================
   SKELETON LOADERS - Modern Shimmer Effect
   Instagram/Facebook/YouTube Style
   ======================================== */

/* ========== SHIMMER ANIMATION ========== */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== BASE SKELETON ========== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 0%,
        var(--card-bg-hover) 50%,
        var(--bg-secondary) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite linear;
    border-radius: var(--radius-sm);
    position: relative;
    overflow: hidden;
}

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

/* ========== DARK THEME ========== */
body.dark .skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.05) 0%,
        rgba(255,255,255,0.1) 50%,
        rgba(255,255,255,0.05) 100%
    );
    background-size: 1000px 100%;
}

body.dark .skeleton::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255,255,255,0.1) 50%,
        transparent 100%
    );
}

/* ========== SKELETON POST CARD ========== */
.skeleton-post {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: 12px;
}

.skeleton-category {
    height: 14px;
    width: 100px;
    margin-bottom: 8px;
}

.skeleton-price {
    height: 18px;
    width: 120px;
    margin-bottom: 12px;
}

.skeleton-description {
    height: 14px;
    width: 100%;
    margin-bottom: 6px;
}

.skeleton-description.short {
    width: 80%;
}

.skeleton-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

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

.skeleton-author {
    height: 12px;
    width: 100px;
}

.skeleton-stats {
    height: 12px;
    width: 80px;
}

/* ========== SKELETON NEWS CARD ========== */
.skeleton-news {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 12px;
}

.skeleton-news-image {
    width: 100px;
    height: 100px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

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

.skeleton-news-title {
    height: 18px;
    width: 90%;
    margin-bottom: 8px;
}

.skeleton-news-excerpt {
    height: 14px;
    width: 100%;
    margin-bottom: 6px;
}

.skeleton-news-date {
    height: 12px;
    width: 120px;
    margin-top: 8px;
}

/* ========== SKELETON CHAT MESSAGE ========== */
.skeleton-message {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 16px;
}

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

.skeleton-message-bubble {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 12px;
    flex: 1;
    max-width: 70%;
}

.skeleton-message-name {
    height: 12px;
    width: 80px;
    margin-bottom: 8px;
}

.skeleton-message-text {
    height: 14px;
    width: 100%;
    margin-bottom: 4px;
}

.skeleton-message-text.short {
    width: 60%;
}

/* ========== CONTAINER ========== */
.skeleton-container {
    padding: 0;
}

/* ========== FADE IN ANIMATION FOR REAL CONTENT ========== */
.fade-in {
    animation: fadeIn 0.4s ease-out;
}

.fade-in-slow {
    animation: fadeIn 0.6s ease-out;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .skeleton-post {
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .skeleton-news {
        padding: 12px;
    }
    
    .skeleton-news-image {
        width: 80px;
        height: 80px;
    }
}

/* ========== VARIANTS ========== */
.skeleton.skeleton-circle {
    border-radius: 50%;
}

.skeleton.skeleton-rect {
    border-radius: 4px;
}

.skeleton.skeleton-round {
    border-radius: var(--radius);
}
