/**
 * Skeleton Loading Effects
 * Beautiful placeholder animations while content loads
 */

/* Base skeleton styles */
.skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeletonPulse 1.5s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes skeletonPulse {
    0% {
        background-position: 200% 0;
    }

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

/* Dark mode skeleton */
body.dark-mode .skeleton {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}

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

.skeleton-text.short {
    width: 40%;
}

.skeleton-text.medium {
    width: 70%;
}

.skeleton-text.long {
    width: 100%;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 12px;
    width: 60%;
}

.skeleton-image {
    width: 100%;
    height: 120px;
    border-radius: 12px;
}

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

.skeleton-button {
    height: 44px;
    width: 100%;
    border-radius: 10px;
}

.skeleton-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

body.dark-mode .skeleton-card {
    background: #1e293b;
    border-color: #334155;
}

/* Product Card Skeleton */
.product-card-skeleton {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    padding: 16px;
}

.product-card-skeleton .skeleton-image {
    height: 100px;
    margin-bottom: 16px;
}

.product-card-skeleton .skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 8px;
}

.product-card-skeleton .skeleton-text {
    height: 14px;
}

.product-card-skeleton .skeleton-price {
    height: 28px;
    width: 50%;
    margin: 16px 0;
}

body.dark-mode .product-card-skeleton {
    background: #1e293b;
    border-color: #334155;
}

/* Stats Skeleton */
.stat-skeleton {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.stat-skeleton .skeleton-number {
    height: 32px;
    width: 60%;
    margin: 0 auto 8px;
}

.stat-skeleton .skeleton-label {
    height: 14px;
    width: 80%;
    margin: 0 auto;
}

body.dark-mode .stat-skeleton {
    background: #1e293b;
}

/* Dashboard Skeleton */
.dashboard-skeleton {
    display: grid;
    gap: 20px;
}

.dashboard-skeleton-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
}

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

.dashboard-skeleton-header .skeleton-info {
    flex: 1;
}

body.dark-mode .dashboard-skeleton-header {
    background: #1e293b;
}

/* Table skeleton */
.table-skeleton {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
}

.table-skeleton-row {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr 1fr;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
}

.table-skeleton-row:last-child {
    border-bottom: none;
}

body.dark-mode .table-skeleton {
    background: #1e293b;
}

body.dark-mode .table-skeleton-row {
    border-color: #334155;
}

/* Loading container */
.skeleton-container {
    display: none;
}

.skeleton-container.loading {
    display: block;
}

.content-container.loading {
    display: none;
}

/* Fade in animation when content loads */
.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Product grid skeleton layout */
.products-grid-skeleton {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1024px) {
    .products-grid-skeleton {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .products-grid-skeleton {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-card-skeleton {
        border-radius: 12px;
    }

    .table-skeleton-row {
        grid-template-columns: 1fr 1fr;
    }
}