/* SKELETON LOADING - TaskRabbit Style */

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

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton card - for service provider cards */
.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.skeleton-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.skeleton-title {
    height: 24px;
    width: 70%;
    margin: 0 auto 10px;
}

.skeleton-subtitle {
    height: 16px;
    width: 50%;
    margin: 0 auto 8px;
}

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

.skeleton-text-short {
    height: 14px;
    width: 60%;
    margin-bottom: 8px;
}

.skeleton-button {
    height: 40px;
    width: 100%;
    margin-top: 15px;
    border-radius: 8px;
}

/* Skeleton image - for portfolio images */
.skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
}

.skeleton-image-small {
    width: 100%;
    height: 100px;
    border-radius: 8px;
}

/* Skeleton list item */
.skeleton-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.skeleton-list-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 15px;
    flex-shrink: 0;
}

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

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

.skeleton-list-subtitle {
    height: 14px;
    width: 40%;
}

/* Grid layout for skeleton cards */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

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

    .skeleton-avatar {
        width: 60px;
        height: 60px;
    }
}

/* Hide content while loading */
.loading-state .content {
    display: none;
}

.loading-state .skeleton-wrapper {
    display: block;
}

.skeleton-wrapper {
    display: none;
}

/* Skeleton category card - for homepage categories */
.skeleton-category {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.skeleton-category-name {
    height: 18px;
    width: 80%;
    margin: 0 auto;
}

/* Skeleton review card */
.skeleton-review {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.skeleton-review-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.skeleton-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
}

.skeleton-review-info {
    flex: 1;
}

.skeleton-review-name {
    height: 16px;
    width: 120px;
    margin-bottom: 6px;
}

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

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

.skeleton-review-text:last-child {
    width: 70%;
}

/* Pulsing effect variant */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

/* Shimmer effect for images */
.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}

.skeleton-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .skeleton {
        background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
        background-size: 200% 100%;
    }

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

    .skeleton-shimmer {
        background-color: #2a2a2a;
    }
}
