/* ==========================================================================
   (#320) NivaasMart motion PRO — the whole WEBSITE feels alive, not static.
   Website only: every rule is under body:not(.capacitor-app) (app untouched).
   Works with nm-motion.css (#290) — that one moves the cards, this one adds:
     • soft page-open fade + hero text rising in
     • every section / block / heading slides up as you scroll (nm-motion-pro.js)
     • header turns glassy on scroll, menus drop in smoothly
     • click ripple on buttons, arrow nudge, light sweep on main buttons
     • photos fade in when they finish loading
     • numbers count up, back-to-top button with scroll-progress ring
     • pop-ups, accordions, form fields, footer links: smooth feedback
   Nothing is hidden unless the script is running (html.mp-on), and all of it
   is switched off for people who ask their device for less motion.
   ========================================================================== */
body:not(.capacitor-app) { --mp-ease: cubic-bezier(.2, .8, .2, 1); --mp-blue: #2563EB; }

/* (#322) No hide-then-show on scroll any more (it looked like blinking): the page-open fade,
   hero rise, section scroll-in and photo fade were removed. Cards from nm-motion.css (#290) no
   longer fade either on the website — they stay fully visible and only settle a few pixels. */
html.nm-mo body:not(.capacitor-app) .nm-rv { opacity: 1 !important; translate: 0 10px; }
html.nm-mo body:not(.capacitor-app) .nm-rv.nm-rv-in { translate: 0 0; transition: translate .45s cubic-bezier(.2, .8, .2, 1); transition-delay: 0s; }
body:not(.capacitor-app) .hv2-reveal, body:not(.capacitor-app) .hv2-reveal-stagger > * { opacity: 1 !important; transform: none !important; }
body:not(.capacitor-app) img.nmp-img { opacity: 1 !important; transition: none !important; } /* photos show at once, no fade */

/* ---------- header ---------- */
@media (min-width: 993px) {
    body:not(.capacitor-app) .site-header.nmh-white { transition: background-color .3s ease, box-shadow .3s ease, backdrop-filter .3s ease; }
    body:not(.capacitor-app) .site-header.nmh-white:is(.hv2-scrolled, .is-scrolled) {
        background: rgba(255, 255, 255, .86) !important;
        -webkit-backdrop-filter: saturate(160%) blur(14px); backdrop-filter: saturate(160%) blur(14px);
        box-shadow: 0 8px 28px -14px rgba(15, 40, 120, .35) !important;
    }
    /* menus drop in */
    body:not(.capacitor-app) .site-header .mega-item:hover > .mega-panel,
    body:not(.capacitor-app) .site-header .mega-item.nmh-hold > .mega-panel,
    body:not(.capacitor-app) .site-header .mega-item.open > .mega-panel { animation: mpDrop .26s var(--mp-ease) both; transform-origin: top center; }
    @keyframes mpDrop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }
    body:not(.capacitor-app) .site-header .mega-panel a { transition: background-color .18s ease, color .18s ease, translate .2s var(--mp-ease); }
    body:not(.capacitor-app) .site-header .mega-panel a:hover { translate: 3px 0; }
    body:not(.capacitor-app) .site-header .nmh-caret { transition: transform .25s var(--mp-ease); display: inline-block; }
    body:not(.capacitor-app) .site-header .mega-item:hover .nmh-caret { transform: rotate(180deg); }
}
body:not(.capacitor-app) .site-header .logo img { transition: transform .35s var(--mp-ease); }
body:not(.capacitor-app) .site-header .logo:hover img { transform: scale(1.04); }
body:not(.capacitor-app) .site-header :is(.hv2-nav-wishlist, .hv2-login-btn, .btn-postproperty) { transition: transform .22s var(--mp-ease), box-shadow .22s ease, background-color .2s ease, color .2s ease; }
body:not(.capacitor-app) .site-header :is(.hv2-nav-wishlist, .hv2-login-btn, .btn-postproperty):hover { transform: translateY(-2px); }
body:not(.capacitor-app) .site-header .hv2-nav-bell:hover svg { animation: mpBell .6s ease; transform-origin: 50% 0; }
@keyframes mpBell { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 50% { transform: rotate(-11deg); } 75% { transform: rotate(6deg); } }

/* ---------- buttons: ripple, arrow nudge, sweep ---------- */
body:not(.capacitor-app) .mp-rip-host { position: relative; overflow: hidden; }
body:not(.capacitor-app) .mp-ripple {
    position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .22;
    transform: scale(0); animation: mpRipple .6s ease-out forwards;
}
@keyframes mpRipple { to { transform: scale(1); opacity: 0; } }
@media (hover: hover) and (pointer: fine) {
    body:not(.capacitor-app) :is(.hv2-viewall-btn, .hv2-cta-btn, .bkr-cta-btn, .lst-card-cta a, .prj-card-cta a, .bkr-viewprofile-btn, .hv2-fp-explore-btn, .btn, .hv2-btn, .nm-btn) svg:last-child { transition: transform .25s var(--mp-ease); }
    body:not(.capacitor-app) :is(.hv2-viewall-btn, .hv2-cta-btn, .bkr-cta-btn, .lst-card-cta a, .prj-card-cta a, .bkr-viewprofile-btn, .hv2-fp-explore-btn, .btn, .hv2-btn, .nm-btn):hover svg:last-child { transform: translateX(4px); }
    body:not(.capacitor-app) :is(.hv2-search-btn, .lst-searchbar button[type="submit"], .lst-apply-btn, .hv2-login-btn) { position: relative; overflow: hidden; }
    body:not(.capacitor-app) :is(.hv2-search-btn, .lst-searchbar button[type="submit"], .lst-apply-btn, .hv2-login-btn)::after {
        content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%; pointer-events: none;
        background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent); transform: skewX(-20deg); transition: left .75s var(--mp-ease);
    }
    body:not(.capacitor-app) :is(.hv2-search-btn, .lst-searchbar button[type="submit"], .lst-apply-btn, .hv2-login-btn):hover::after { left: 130%; }

    /* blocks that had no hover life yet */
    body:not(.capacitor-app) :is(.pt-card, .hv2-stat-item, .lst-poster, .lst-pcard, .pd2-side-card, .nmpd-pcard, .nmpd-shot-card, .of-m, .hv2-auth-card, .blog-card, .nm-news-card, .news-card) { transition: translate .35s var(--mp-ease), box-shadow .35s var(--mp-ease), border-color .3s ease; }
    body:not(.capacitor-app) :is(.pt-card, .hv2-stat-item, .lst-poster, .lst-pcard, .nmpd-pcard, .nmpd-shot-card, .of-m, .blog-card, .nm-news-card, .news-card):hover { translate: 0 -5px; box-shadow: 0 22px 40px -22px rgba(37, 99, 235, .4), 0 2px 6px rgba(15, 23, 42, .05); }
    body:not(.capacitor-app) :is(.blog-card, .nm-news-card, .news-card, .nmpd-shot-card, .lst-pcard) img { transition: scale .8s var(--mp-ease); }
    body:not(.capacitor-app) :is(.blog-card, .nm-news-card, .news-card, .nmpd-shot-card, .lst-pcard):hover img { scale: 1.05; }
    body:not(.capacitor-app) .hv2-stat-item:hover .hv2-fic { animation: mpPop .5s cubic-bezier(.3, 1.6, .5, 1); }
    @keyframes mpPop { 0% { transform: scale(1); } 50% { transform: scale(1.18) rotate(-6deg); } 100% { transform: scale(1); } }
    /* chips / tags / pagination */
    body:not(.capacitor-app) :is(.lst-quickchips a, .hv2-trending a, .dvr-tag, .lst-pagination a, .dvr-page-num, .nm-popsearch a) { transition: translate .2s var(--mp-ease), background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; }
    body:not(.capacitor-app) :is(.lst-quickchips a, .hv2-trending a, .lst-pagination a, .dvr-page-num):hover { translate: 0 -2px; }
    body:not(.capacitor-app) .nm-popsearch a:hover { translate: 3px 0; color: var(--mp-blue); }
}

/* ---------- form fields ---------- */
body:not(.capacitor-app) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea) { transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease; }
body:not(.capacitor-app) :is(.lst-check, label) > input:is([type="checkbox"], [type="radio"]) { transition: scale .18s var(--mp-ease); }
body:not(.capacitor-app) :is(.lst-check, label) > input:is([type="checkbox"], [type="radio"]):active { scale: .85; }

/* ---------- pop-ups & accordions ---------- */
@media (prefers-reduced-motion: no-preference) {
    body:not(.capacitor-app) .popup-overlay { animation: mpFade .3s ease both; }
    body:not(.capacitor-app) .popup-overlay > .popup-box, body:not(.capacitor-app) :is(.pd-modal-box, .pd-vmodal-box, .pd-fpv-box) { animation: mpPopIn .42s cubic-bezier(.2, 1.2, .3, 1) both; }
    body:not(.capacitor-app) details[open] > *:not(summary) { animation: mpAcc .35s var(--mp-ease) both; }
    @keyframes mpFade { from { opacity: 0; } to { opacity: 1; } }
    @keyframes mpPopIn { from { opacity: 0; transform: translateY(18px) scale(.95); } to { opacity: 1; transform: none; } }
    @keyframes mpAcc { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
}
body:not(.capacitor-app) summary { transition: color .2s ease; }
body:not(.capacitor-app) .popup-close { transition: transform .3s var(--mp-ease), background-color .2s ease; }
body:not(.capacitor-app) .popup-close:hover { transform: rotate(90deg); }

/* ---------- footer ---------- */
body:not(.capacitor-app) .nmf-news-row button { transition: transform .2s var(--mp-ease), box-shadow .2s ease; }
body:not(.capacitor-app) .nmf-news-row button:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -8px rgba(37, 99, 235, .9); }
body:not(.capacitor-app) .nmf-logo img { transition: transform .4s var(--mp-ease); }
body:not(.capacitor-app) .nmf-logo:hover img { transform: scale(1.04); }

/* ---------- back to top + scroll progress ---------- */
body:not(.capacitor-app) #mpTop {
    position: fixed; left: 24px; bottom: 24px; z-index: 900; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer;
    background: #fff; color: var(--mp-blue); box-shadow: 0 10px 24px -8px rgba(15, 40, 120, .4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; translate: 0 14px; transition: opacity .3s ease, translate .35s var(--mp-ease), visibility .3s, background-color .2s, color .2s;
}
body:not(.capacitor-app) #mpTop.on { opacity: 1; visibility: visible; translate: 0 0; }
body:not(.capacitor-app) #mpTop:hover { background: var(--mp-blue); color: #fff; }
body:not(.capacitor-app) #mpTop svg.mp-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
body:not(.capacitor-app) #mpTop svg.mp-ring circle { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; opacity: .9; }
body:not(.capacitor-app) #mpTop svg.mp-ring circle.bg { opacity: .15; }
body:not(.capacitor-app) #mpTop:hover svg.mp-arrow { animation: mpUp .7s ease infinite; }
@keyframes mpUp { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (max-width: 768px) { body:not(.capacitor-app) #mpTop { left: 14px; bottom: 18px; width: 40px; height: 40px; } } /* (#323) bottom-left: the chat helper's bubble sits above the chat button on the right */
body.capacitor-app #mpTop { display: none !important; }

/* ---------- less motion if the device asks for it ---------- */
@media (prefers-reduced-motion: reduce) {
    body .mp-ripple { display: none !important; }
    body #mpTop { transition: none !important; }
}
