/**
 * Skeleton Loading Styles
 * أنماط لعناصر Skeleton Loading
 */

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

    100% {
        background-position: calc(200px + 100%) 0;
    }
}

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

/* Skeleton Product Card */
.skeleton-product-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.skeleton-product-card .skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-product-card .skeleton-content {
    padding: 1rem;
}

.skeleton-product-card .skeleton-title {
    height: 20px;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-product-card .skeleton-title.short {
    width: 60%;
}

.skeleton-product-card .skeleton-price {
    height: 24px;
    width: 80px;
    margin-bottom: 1rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-product-card .skeleton-button {
    height: 40px;
    width: 100%;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* Skeleton Carousel */
.skeleton-carousel {
    display: flex;
    gap: 1.5rem;
    overflow: hidden;
}

.skeleton-carousel .skeleton-product-card {
    min-width: 280px;
    flex-shrink: 0;
}

/* Skeleton Category Card */
.skeleton-category-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.skeleton-category-card .skeleton-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-category-card .skeleton-title {
    height: 20px;
    width: 80%;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-category-card .skeleton-text {
    height: 16px;
    width: 100%;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-category-card .skeleton-text.short {
    width: 70%;
}

/* Skeleton List Item */
.skeleton-list-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.skeleton-list-item .skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-list-item .skeleton-content {
    flex: 1;
}

.skeleton-list-item .skeleton-title {
    height: 18px;
    width: 60%;
    margin-bottom: 0.5rem;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

.skeleton-list-item .skeleton-text {
    height: 14px;
    width: 80%;
    background: linear-gradient(90deg,
            #f0f0f0 0px,
            #f8f8f8 40px,
            #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Dark Mode Support */
.dark-mode .skeleton-base,
.dark-mode .skeleton-product-card .skeleton-image,
.dark-mode .skeleton-product-card .skeleton-title,
.dark-mode .skeleton-product-card .skeleton-price,
.dark-mode .skeleton-product-card .skeleton-button,
.dark-mode .skeleton-category-card .skeleton-icon,
.dark-mode .skeleton-category-card .skeleton-title,
.dark-mode .skeleton-category-card .skeleton-text,
.dark-mode .skeleton-list-item .skeleton-avatar,
.dark-mode .skeleton-list-item .skeleton-title,
.dark-mode .skeleton-list-item .skeleton-text {
    background: linear-gradient(90deg,
            #2a2a2a 0px,
            #3a3a3a 40px,
            #2a2a2a 80px);
    background-size: 200px 100%;
}

.dark-mode .skeleton-product-card,
.dark-mode .skeleton-category-card,
.dark-mode .skeleton-list-item {
    background: #1e1e1e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .skeleton-carousel .skeleton-product-card {
        min-width: 240px;
    }

    .skeleton-product-card .skeleton-image {
        height: 150px;
    }
}

/* Fade In Animation */
.skeleton-container {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}