﻿/* =========================================================
   IBSB Technologies - Animation Layer (v1)
   Lagane ka tarika: css/ibsb-modern.css ke BAAD, </head> se pehle
   <link href="css/ibsb-animations.css" rel="stylesheet">
   Hatana ho to sirf ye line hata dein.
   ========================================================= */

/* ---------- FIX: card hover lift chalne ke liye ----------
   ibsb-modern.css mein reveal animation "both" fill use karti hai,
   jo hover ke transform ko dabaa deti hai. "backwards" se hover bhi chalega. */
@supports (animation-timeline: view()) {
    html body .erp-intro-section .erp-card,
    html body .erp-industry-section .erp-card,
    html body .why-card,
    html body .service-card,
    html body .step-card,
    html body .industry-card .card,
    html body .about-content {
        animation-fill-mode: backwards;
    }
}

/* ---------- 1. Top scroll progress bar ---------- */
@supports (animation-timeline: scroll()) {
    html body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        height: 4px;
        width: 100%;
        z-index: 100000;
        background: linear-gradient(90deg, #38bdf8, #1d5fd1, #ffb400);
        transform-origin: left;
        transform: scaleX(0);
        animation: ibsbProgress linear both;
        animation-timeline: scroll(root);
    }
}

@keyframes ibsbProgress {
    to {
        transform: scaleX(1);
    }
}

/* ---------- 2. Hero: page load par sequence mein aana ---------- */
@keyframes ibsbRiseIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

html body h1.top-left {
    animation: ibsbRiseIn .9s var(--ease, ease) .1s both, ibsbGradientMove 6s ease-in-out 1s infinite;
    background-size: 200% 100%;
}

html body .p {
    animation: ibsbRiseIn .9s var(--ease, ease) .35s both;
}

html body #trialSection {
    animation: ibsbRiseIn .9s var(--ease, ease) .6s both;
}

@keyframes ibsbGradientMove {
    0%, 100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ---------- 3. Hero icons: halka tairna (float) ---------- */
@keyframes ibsbFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-9px);
    }
}

/* Float tabhi shuru hoga jab icons apni jagah par pahunch jayein (~1.8s baad) */
html body #slide td i {
    animation: ibsbFloat 3.6s ease-in-out 1.8s infinite;
}

html body #slide td:nth-child(2) i {
    animation-delay: 2.2s;
}

html body #slide td:nth-child(3) i {
    animation-delay: 2.6s;
}

html body #slide td:nth-child(4) i {
    animation-delay: 3s;
}

/* ---------- 3b. Page load par icons CHAARO TARAF se aate hain ----------
   Sirf "from" keyframe hai, isliye end mein icon apni original jagah par rukta hai.
   Har icon ki direction --fx (left/right) aur --fy (up/down) se set hoti hai. */
@keyframes ibsbFly {
    from {
        opacity: 0;
        transform: translate(var(--fx, 0), var(--fy, 0)) scale(.3) rotate(var(--fr, 0deg));
    }

    60% {
        opacity: 1;
    }
}

html body #slide td {
    animation: ibsbFly 1s cubic-bezier(.2, .9, .3, 1.15) backwards;
    animation-delay: var(--fd, 0s);
}

/* Row 1: upar se (corners se tirchi) */
html body #slide tr:nth-child(1) td:nth-child(1) {
    --fx: -70vw;
    --fy: -60vh;
    --fr: -180deg;
    --fd: .00s;
}

html body #slide tr:nth-child(1) td:nth-child(2) {
    --fx: -15vw;
    --fy: -80vh;
    --fr: 120deg;
    --fd: .10s;
}

html body #slide tr:nth-child(1) td:nth-child(3) {
    --fx: 15vw;
    --fy: -80vh;
    --fr: -120deg;
    --fd: .20s;
}

html body #slide tr:nth-child(1) td:nth-child(4) {
    --fx: 70vw;
    --fy: -60vh;
    --fr: 180deg;
    --fd: .30s;
}

/* Row 2: bahar wale left/right se, beech wale kone se */
html body #slide tr:nth-child(2) td:nth-child(1) {
    --fx: -90vw;
    --fy: 0;
    --fr: -240deg;
    --fd: .15s;
}

html body #slide tr:nth-child(2) td:nth-child(2) {
    --fx: -40vw;
    --fy: 70vh;
    --fr: 160deg;
    --fd: .25s;
}

html body #slide tr:nth-child(2) td:nth-child(3) {
    --fx: 40vw;
    --fy: -70vh;
    --fr: -160deg;
    --fd: .35s;
}

html body #slide tr:nth-child(2) td:nth-child(4) {
    --fx: 90vw;
    --fy: 0;
    --fr: 240deg;
    --fd: .45s;
}

/* Row 3: neeche se */
html body #slide tr:nth-child(3) td:nth-child(1) {
    --fx: -70vw;
    --fy: 60vh;
    --fr: 180deg;
    --fd: .30s;
}

html body #slide tr:nth-child(3) td:nth-child(2) {
    --fx: -15vw;
    --fy: 80vh;
    --fr: -120deg;
    --fd: .40s;
}

html body #slide tr:nth-child(3) td:nth-child(3) {
    --fx: 15vw;
    --fy: 80vh;
    --fr: 120deg;
    --fd: .50s;
}

html body #slide tr:nth-child(3) td:nth-child(4) {
    --fx: 70vw;
    --fy: 60vh;
    --fr: -180deg;
    --fd: .60s;
}

html body #slide td:hover i {
    animation-play-state: paused;
}

/* ---------- 4. Trial button: glow pulse ---------- */
@keyframes ibsbGlow {
    0%, 100% {
        box-shadow: 0 12px 28px rgba(11, 42, 107, .38), 0 0 0 0 rgba(29, 95, 209, .45);
    }

    50% {
        box-shadow: 0 12px 28px rgba(11, 42, 107, .38), 0 0 0 16px rgba(29, 95, 209, 0);
    }
}

html body #trialBtn {
    animation: ibsbGlow 2.6s ease-in-out infinite;
}

    html body #trialBtn:hover {
        animation-play-state: paused;
    }

/* ---------- 5. Section heading ki line: draw hoti hui ---------- */
@keyframes ibsbLineGrow {
    from {
        width: 0;
    }

    to {
        width: 64px;
    }
}

@supports (animation-timeline: view()) {
    html body .section-header .section-title::after {
        animation: ibsbLineGrow linear both;
        animation-timeline: view();
        animation-range: entry 10% entry 60%;
    }
}

/* ---------- 6. Dark sections: tairte glow orbs ---------- */
@keyframes ibsbOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.15);
    }

    66% {
        transform: translate(-30px, 25px) scale(.92);
    }
}

html body .erp-industry-section,
html body .other-services-section,
html body .erp-steps-section {
    overflow: hidden;
}

    html body .erp-industry-section::after,
    html body .other-services-section::after,
    html body .erp-steps-section::after {
        content: "";
        position: absolute;
        top: 10%;
        right: -80px;
        width: 320px;
        height: 320px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(56, 189, 248, .32), transparent 70%);
        filter: blur(6px);
        pointer-events: none;
        z-index: 0;
        animation: ibsbOrb 14s ease-in-out infinite;
    }

    html body .other-services-section::after {
        right: auto;
        left: -90px;
        top: 40%;
        background: radial-gradient(circle, rgba(255, 180, 0, .20), transparent 70%);
        animation-duration: 18s;
    }

/* ---------- 7. Icons ki halki dhadkan ---------- */
@keyframes ibsbBeat {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.07);
    }
}

html body .why-icon,
html body .service-icon {
    animation: ibsbBeat 3s ease-in-out infinite;
}

html body .why-card:hover .why-icon,
html body .service-card:hover .service-icon,
html body .erp-industry-section .erp-card:hover .erp-icon {
    animation-play-state: paused;
}

/* ---------- 8. Steps ke number: ripple ring ---------- */
@keyframes ibsbRing {
    0% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, .6);
    }

    100% {
        box-shadow: 0 0 0 18px rgba(56, 189, 248, 0);
    }
}

html body .step-number {
    animation: ibsbRing 2.2s ease-out infinite;
}

/* ---------- 9. Buttons: shine sweep on hover ---------- */
html body .service-btn,
html body .erp-btn,
html body .learn-btn {
    position: relative;
    overflow: hidden;
}

    html body .service-btn::after,
    html body .erp-btn::after,
    html body .learn-btn::after {
        content: "";
        position: absolute;
        top: 0;
        left: -90%;
        width: 60%;
        height: 100%;
        background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .45), transparent);
        transform: skewX(-20deg);
        transition: left .6s ease;
        pointer-events: none;
    }

    html body .service-btn:hover::after,
    html body .erp-btn:hover::after,
    html body .learn-btn:hover::after {
        left: 140%;
    }

/* ---------- 10. Industry cards: icon bounce on hover ---------- */
@keyframes ibsbPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(10deg);
    }

    100% {
        transform: scale(1.1) rotate(10deg);
    }
}

html body .industry-card:hover .industry-icon {
    animation: ibsbPop .45s ease forwards;
}

/* ---------- 11. Counters: pop-in + label glow ---------- */
@keyframes ibsbNumberPulse {
    0%, 100% {
        filter: drop-shadow(0 0 0 rgba(56, 189, 248, 0));
    }

    50% {
        filter: drop-shadow(0 0 14px rgba(56, 189, 248, .6));
    }
}

html body #new-section .colorlib-counter {
    animation: ibsbNumberPulse 3s ease-in-out infinite;
}

/* ---------- 12. Floating call button: halka hilna ---------- */
@keyframes ibsbWiggle {
    0%, 88%, 100% {
        transform: rotate(0);
    }

    91% {
        transform: rotate(-14deg);
    }

    94% {
        transform: rotate(12deg);
    }

    97% {
        transform: rotate(-8deg);
    }
}

html body #footer .floating-buttons a:last-child i {
    animation: ibsbWiggle 5s ease-in-out infinite;
    transform-origin: center;
}

/* ---------- 13. JS fallback reveal (Firefox / purane browsers) ----------
   ibsb-animations.js ye classes lagata hai. */
.ibsb-pre {
    opacity: 0;
    transform: translateY(36px) scale(.97);
    transition: opacity .7s var(--ease, ease), transform .7s var(--ease, ease);
}

    .ibsb-pre.ibsb-in {
        opacity: 1;
        transform: none;
    }

/* ---------- Reduced motion: sab band ---------- */
@media (prefers-reduced-motion: reduce) {
    html body::before {
        display: none;
    }

    .ibsb-pre {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
