/* ==========================================================================
   SHIMMER / SKELETON LOADING UI — Ablaze Electronics
   Shared CSS for progressive content loading placeholders.
   ========================================================================== */

/* ── Page Entrance Animation ── */
@keyframes page-entrance {
    0%   { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes section-reveal {
    0%   { opacity: 0; transform: translateY(24px); }
    100% { opacity: 1; transform: translateY(0); }
}

body {
    animation: page-entrance 0.4s ease-out forwards;
}

/* Staggered section reveal — each homepage section fades up in sequence */
#header {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.1s forwards;
}
#feature-mini {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.2s forwards;
}
#feature {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.3s forwards;
}
#newsletter {
    opacity: 0;
    animation: section-reveal 0.5s ease-out 0.35s forwards;
}
#process {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.4s forwards;
}
#products {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.45s forwards;
}
#testimonial {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.5s forwards;
}
#contact {
    opacity: 0;
    animation: section-reveal 0.6s ease-out 0.55s forwards;
}

/* ── Shimmer Animation Keyframes ── */
@keyframes shimmer-sweep {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

@keyframes shimmer-fade-out {
    0%   { opacity: 1; }
    100% { opacity: 0; }
}

/* ── Base Shimmer Bone ── */
.shimmer-bone {
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* ── Shape Variants ── */
.shimmer-circle {
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
    border-radius: 50%;
    overflow: hidden;
}

.shimmer-line {
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 10px;
}

.shimmer-line--short { width: 60%; }
.shimmer-line--medium { width: 80%; }
.shimmer-line--full { width: 100%; }
.shimmer-line--xs { height: 10px; }
.shimmer-line--lg { height: 20px; }

/* ── Shimmer Removal (applied by JS) ── */
.shimmer-hide {
    animation: shimmer-fade-out 0.3s ease forwards;
    pointer-events: none;
}

/* After animation completes, remove from layout */
.shimmer-gone {
    display: none !important;
}

/* ── Progressive Image Loading Shimmer Wrapper ── */
.img-shimmer-wrapper {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
}

.img-shimmer-wrapper img {
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
}

.img-shimmer-wrapper.img-loaded {
    animation: none !important;
    background: transparent !important;
}

.img-shimmer-wrapper.img-loaded img,
.img-shimmer-wrapper img.is-loaded {
    opacity: 1 !important;
}

/* ============================================
   NAVBAR SHIMMER SKELETON
   ============================================ */
.shimmer-navbar {
    width: 100%;
    height: 70px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.shimmer-navbar__logo {
    width: 160px;
    height: 38px;
}

.shimmer-navbar__links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.shimmer-navbar__link {
    width: 70px;
    height: 14px;
}

.shimmer-navbar__cta {
    width: 110px;
    height: 36px;
    border-radius: 50px;
}

/* ============================================
   HERO IMAGE SHIMMER
   ============================================ */
.shimmer-hero-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 14px;
}

/* ============================================
   PRODUCT CARD SHIMMER SKELETON
   ============================================ */
.shimmer-product-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.shimmer-product-card__img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
}

.shimmer-product-card__btn {
    width: 120px;
    height: 36px;
    border-radius: 50px;
    margin: 0 auto;
}

/* ============================================
   SERVICES CENTER IMAGE SHIMMER
   ============================================ */
#feature .product-img.img-shimmer-wrapper {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 1 / 1;
    min-height: 320px;
    border-radius: 12px;
    margin: 0 auto;
    display: block;
    position: relative;
    overflow: hidden;
}

#feature .product-img.img-shimmer-wrapper.img-loaded {
    animation: none !important;
    background: transparent !important;
    min-height: auto;
}

@media (max-width: 991.98px) {
    #feature .product-img.img-shimmer-wrapper {
        max-width: 280px;
        min-height: 250px;
        aspect-ratio: 280 / 250;
    }
}

@media (max-width: 767.98px) {
    #feature .product-img.img-shimmer-wrapper {
        max-width: 240px;
        min-height: 180px;
        aspect-ratio: 240 / 180;
    }
}

/* ============================================
   VIDEO THUMBNAIL SHIMMER
   ============================================ */
.shimmer-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
    z-index: 2;
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
    pointer-events: none;
}

.shimmer-video-placeholder .shimmer-video-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ============================================
   CLIENT LOGO SHIMMER (CIRCULAR LOGOS)
   ============================================ */
.cr-item img {
    background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%) !important;
    background-size: 800px 100% !important;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
    transition: background 0.4s ease, filter 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease !important;
}

.cr-item img.is-loaded {
    background: #ffffff !important;
    animation: none !important;
}

/* ============================================
   MAP SHIMMER
   ============================================ */
.shimmer-map {
    width: 100%;
    height: 100%;
    min-height: 300px;
    border-radius: 12px;
}

/* ============================================
   FOOTER SHIMMER SKELETON
   ============================================ */
.shimmer-footer {
    background: #130a24;
    padding: 50px 30px 30px;
    width: 100%;
}

.shimmer-footer__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    max-width: 1140px;
    margin: 0 auto;
}

.shimmer-footer__col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shimmer-footer .shimmer-bone,
.shimmer-footer .shimmer-line {
    background: linear-gradient(90deg, #1b1031 25%, #271e3d 50%, #1b1031 75%);
    background-size: 800px 100%;
    animation: shimmer-sweep 1.5s ease-in-out infinite;
}

.shimmer-footer__bar {
    height: 50px;
    background: #0d061a;
    margin-top: 30px;
    border-radius: 0;
}

/* ============================================
   RESPONSIVE — Tablet
   ============================================ */
@media (max-width: 991.98px) {
    .shimmer-navbar__links {
        display: none;
    }
    .shimmer-navbar__cta {
        display: none;
    }
    .shimmer-navbar::after {
        content: '';
        width: 28px;
        height: 28px;
        border-radius: 4px;
        background: linear-gradient(90deg, #e8e6ee 25%, #f5f4f7 50%, #e8e6ee 75%);
        background-size: 800px 100%;
        animation: shimmer-sweep 1.5s ease-in-out infinite;
    }
    .shimmer-footer__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ============================================
   RESPONSIVE — Mobile
   ============================================ */
@media (max-width: 767.98px) {
    .shimmer-navbar {
        height: 60px;
        padding: 0 16px;
    }
    .shimmer-navbar__logo {
        width: 120px;
        height: 30px;
    }
    .shimmer-logos-row {
        gap: 20px;
    }
    .shimmer-logo {
        width: 70px;
        height: 70px;
    }
    .shimmer-product-card {
        padding: 16px;
    }
    .shimmer-footer {
        padding: 30px 16px 20px;
    }
}

/* ============================================
   ACCESSIBILITY — Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    body,
    #header, #feature-mini, #feature,
    #newsletter, #process, #products,
    #testimonial, #contact {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
