﻿/* /css/home-skeleton.css */

@keyframes home-skeleton-shimmer {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.skeleton-block,
.home-skeleton-surface,
.skeleton-badge-placeholder,
.skeleton-like-button {
    background: linear-gradient(90deg, #e7e9ef 25%, #f7f8fb 37%, #e7e9ef 63%);
    background-size: 400% 100%;
    animation: home-skeleton-shimmer 1.35s ease-in-out infinite;
}

.home-skeleton-host.is-skeleton-loading {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.skeleton-block {
    display: block;
    width: 100%;
    height: 16px;
    border-radius: 999px;
}

    .skeleton-block.short {
        width: 72%;
    }

    .skeleton-block.medium {
        width: 86%;
    }

.hero-swiper .swiper-wrapper.is-skeleton-loading,
.services-scrollable-list.is-skeleton-loading,
.sellers-swiper .swiper-wrapper.is-skeleton-loading,
#core-features.is-skeleton-loading,
.steps-wrap.is-skeleton-loading {
    pointer-events: none;
}

/* ---------------- Hero ---------------- */

.hero-skeleton-slide {
    pointer-events: none;
}

    .hero-skeleton-slide .slide-left {
        align-items: center;
    }

    .hero-skeleton-slide .slide-text {
        width: 100%;
    }

.skeleton-eyebrow {
    width: 220px;
    height: 18px;
}

.skeleton-hero-title {
    width: min(650px, 100%);
    height: 44px;
    border-radius: 14px;
}

    .skeleton-hero-title.short {
        width: 58%;
    }

.skeleton-hero-desc {
    width: min(720px, 100%);
    height: 20px;
}

    .skeleton-hero-desc.short {
        width: 75%;
    }

.skeleton-hero-button {
    width: 210px;
    height: 56px;
    border-radius: 999px;
}

.hero-skeleton-image {
    width: min(800px, 100%);
    aspect-ratio: 1 / 0.72;
    border-radius: 32px;
}

.home-skeleton-scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

    .home-skeleton-scroll .scroll-line {
        width: 1.6px;
        height: 168px;
        background: rgba(0, 12, 33, 0.15);
    }

.skeleton-scroll-text {
    width: 16px;
    height: 120px;
    border-radius: 999px;
}

.skeleton-scroll-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
}

/* ---------------- Generic text blocks ---------------- */

.skeleton-title-lg {
    width: 52%;
    height: 28px;
    border-radius: 12px;
}

.skeleton-title-md {
    width: 62%;
    height: 24px;
    border-radius: 12px;
}

.skeleton-paragraph-line {
    height: 18px;
}

    .skeleton-paragraph-line.short {
        width: 74%;
    }

/* ---------------- Core Features ---------------- */

.skeleton-feature {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.skeleton-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    flex: 0 0 auto;
}

.skeleton-feature-title {
    width: 210px;
    height: 20px;
    border-radius: 10px;
    margin-bottom: 10px;
}

.skeleton-feature-line {
    height: 16px;
    border-radius: 999px;
}

    .skeleton-feature-line.short {
        width: 78%;
    }

/* ---------------- How it works ---------------- */

.skeleton-badge-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.skeleton-step .step-card {
    box-shadow: 0px 20px 30px 0px rgba(145, 145, 145, 0.1);
}

.skeleton-step-title {
    width: 72%;
    height: 20px;
    border-radius: 10px;
}

.skeleton-step-line {
    height: 16px;
    border-radius: 999px;
}

    .skeleton-step-line.short {
        width: 84%;
    }

/* ---------------- Services ---------------- */

.services-scrollable-list.is-skeleton-loading {
    overflow: hidden;
}

.service-skeleton {
    pointer-events: none;
}

.skeleton-service-title {
    width: 78%;
    height: 18px;
    border-radius: 10px;
}

.skeleton-service-meta {
    width: 110px;
    height: 14px;
    border-radius: 999px;
}

.skeleton-service-desc {
    height: 16px;
    border-radius: 999px;
}

    .skeleton-service-desc.short {
        width: 82%;
    }

.skeleton-service-price {
    width: 140px;
    height: 18px;
    border-radius: 999px;
}

.skeleton-service-btn {
    width: 120px;
    height: 40px;
    border-radius: 999px;
}

/* ---------------- Providers ---------------- */

.provider-card-skeleton {
    pointer-events: none;
}

    .provider-card-skeleton .provider-like {
        box-shadow: none;
        background: transparent;
        padding: 0;
    }

.skeleton-like-button {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.skeleton-provider-title {
    width: 68%;
    height: 20px;
    border-radius: 10px;
}

.skeleton-provider-meta {
    width: 84%;
    height: 16px;
    border-radius: 999px;
}

.skeleton-provider-btn {
    width: 120px;
    height: 40px;
    border-radius: 999px;
}

.skeleton-provider-rating {
    width: 58px;
    height: 18px;
    border-radius: 999px;
}

/* ---------------- Wrapper image skeleton ---------------- */

.home-image-skeleton {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    border-radius: 24px;
}

    .home-image-skeleton.is-skeleton-loading::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, #e7e9ef 25%, #f7f8fb 37%, #e7e9ef 63%);
        background-size: 400% 100%;
        animation: home-skeleton-shimmer 1.35s ease-in-out infinite;
        z-index: 1;
    }

    .home-image-skeleton.is-skeleton-loaded::before {
        display: none;
    }

.home-image-skeleton__img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.home-image-skeleton.is-skeleton-loaded .home-image-skeleton__img {
    opacity: 1;
}

#CoreFeaturesImageSkeleton {
    min-height: 280px;
}

#ServicesImageSkeleton {
    min-height: 260px;
}

#ContactUsImageSkeleton {
    min-height: 320px;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
    .hero-skeleton-slide .slide-left {
        align-items: flex-start;
    }

    .hero-skeleton-image {
        aspect-ratio: 1 / 0.8;
    }

    .skeleton-hero-title {
        height: 36px;
    }

    .skeleton-hero-button {
        width: 180px;
        height: 50px;
    }
}

@media (max-width: 768px) {
    .home-skeleton-scroll {
        display: none;
    }

    .skeleton-title-lg,
    .skeleton-title-md {
        width: 78%;
    }

    .skeleton-hero-title {
        width: 100%;
        height: 30px;
    }

    .skeleton-hero-desc {
        height: 16px;
    }

    .hero-skeleton-image {
        aspect-ratio: 1 / 0.9;
        border-radius: 24px;
    }

    #CoreFeaturesImageSkeleton,
    #ServicesImageSkeleton,
    #ContactUsImageSkeleton {
        min-height: 220px;
    }
}

/* ---------------- Shared page skeletons ---------------- */
.skeleton-page-root.is-skeleton-loading,
.listing-skeleton.is-skeleton-loading,
.content-skeleton.is-skeleton-loading,
.accordion-group.is-skeleton-loading {
    pointer-events: none;
}

.listing-skeleton[hidden] {
    display: none !important;
}

.listing-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.pagination-elements.listing-skeleton-grid {
    display: grid;
}

.listing-card-skeleton,
.detail-card-skeleton,
.faq-skeleton-item,
.content-page-skeleton,
.location-card-skeleton,
.review-card-skeleton,
.gallery-card-skeleton {
    background: rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    box-shadow: 0 18px 36px rgba(145, 145, 145, 0.10);
    overflow: hidden;
}

.listing-card-skeleton {
    min-height: 390px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.listing-card-skeleton__media {
    width: 100%;
    aspect-ratio: 1 / 0.72;
    border-radius: 18px;
}

.listing-card-skeleton__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 2px 4px;
}

.listing-card-skeleton__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 8px;
}

.skeleton-card-title {
    width: 72%;
    height: 20px;
    border-radius: 10px;
}

.skeleton-card-meta {
    width: 88%;
    height: 16px;
}

.skeleton-card-meta.short {
    width: 55%;
}

.skeleton-card-price {
    width: 92px;
    height: 18px;
}

.skeleton-card-button {
    width: 108px;
    height: 40px;
    border-radius: 999px;
}

.content-page-skeleton {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: none;
}

.content-page-skeleton .skeleton-block {
    height: 18px;
}

.faq-skeleton-item {
    min-height: 86px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
}

.skeleton-faq-title {
    width: 70%;
    height: 20px;
}

.skeleton-faq-line {
    width: 92%;
    height: 14px;
}

.skeleton-faq-line.short {
    width: 64%;
}

.detail-title-skeleton {
    width: min(420px, 82%);
    height: 30px;
    border-radius: 12px;
}

.detail-line-skeleton {
    height: 18px;
    border-radius: 999px;
}

.detail-line-skeleton.short {
    width: 68%;
}

.detail-line-skeleton.tiny {
    width: 120px;
}

.detail-price-skeleton {
    width: 150px;
    height: 24px;
    border-radius: 999px;
}

.detail-description-skeleton {
    padding: 20px;
}

.detail-description-skeleton .skeleton-block {
    height: 18px;
    margin-bottom: 14px;
}

.home-image-skeleton.service-photo,
.home-image-skeleton.provider-photo {
    background: #eef1f6;
}

.provider-header .home-image-skeleton.provider-photo,
.service-header .home-image-skeleton.service-photo {
    display: block;
}

.location-card-skeleton,
.review-card-skeleton {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: none;
}

.gallery-card-skeleton {
    aspect-ratio: 1 / 0.8;
    border-radius: 18px;
}

@media (max-width: 1280px) {
    .listing-skeleton-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .listing-skeleton-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .listing-skeleton-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .listing-card-skeleton {
        min-height: 330px;
    }

    .content-page-skeleton,
    .faq-skeleton-item,
    .location-card-skeleton,
    .review-card-skeleton {
        padding: 18px;
    }
}


/* ---------------- Template image skeletons ---------------- */

.template-image-skeleton {
    position: relative;
    overflow: hidden;
    background: #eef1f6;
}

.template-image-skeleton.home-image-skeleton {
    display: block;
}

.template-image-skeleton .home-image-skeleton__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Cards rendered from /Views/Templates */
.provider-media .template-image-skeleton.provider-photo,
.service-media .template-image-skeleton.service-photo,
.specialist-media .template-image-skeleton.specialist-photo,
.gallery-card .template-image-skeleton.gallery-photo,
.card-photo.template-image-skeleton {
    width: 100%;
    height: 100%;
    display: block;
}

.provider-media .template-image-skeleton.provider-photo .home-image-skeleton__img,
.service-media .template-image-skeleton.service-photo .home-image-skeleton__img,
.specialist-media .template-image-skeleton.specialist-photo .home-image-skeleton__img,
.gallery-card .template-image-skeleton.gallery-photo .home-image-skeleton__img,
.card-photo.template-image-skeleton .home-image-skeleton__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Small provider image inside service cards */
.service-body .my-provider .provider-details .provider-img.template-image-skeleton {
    width: 21px;
    height: 21px;
    min-width: 21px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.service-body .my-provider .provider-details .provider-img.template-image-skeleton .home-image-skeleton__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* Feature icon templates */
.feature-icon-skeleton.template-image-skeleton {
    border-radius: 12px;
}

.feature-icon-skeleton.template-image-skeleton .home-image-skeleton__img {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

/* Hero slide templates */
.slide-content .slide-right .hero-template-image-skeleton {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
}

.slide-content .slide-right .hero-template-image-skeleton .home-image-skeleton__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
