/*
  =======================================================
  MWG Real Estate – ANIMATION ONLY CSS
  Adds micro-interactions and scroll reveals.
  Does NOT override any design from style.css.
  =======================================================
*/

/* -------------------------------------------------------
   Respect reduced motion preference
------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-up, .reveal-scale, .reveal-img { opacity: 1 !important; transform: none !important; }
}

/* -------------------------------------------------------
   Scroll Progress Bar
------------------------------------------------------- */
#scroll-progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: #C89B3C;
  z-index: 99999;
  transition: width 0.08s linear;
  box-shadow: 0 0 8px rgba(200, 155, 60,0.7);
  pointer-events: none;
}

/* -------------------------------------------------------
   Back to Top Button
------------------------------------------------------- */
#back-to-top-btn {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 48px;
  height: 48px;
  background: rgba(29,29,29,0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease, background 0.25s ease;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
#back-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top-btn:hover {
  background: #C89B3C;
  border-color: #C89B3C;
  transform: translateY(-4px);
}
#back-to-top-btn:active {
  transform: scale(0.95) translateY(-2px);
}

/* -------------------------------------------------------
   WhatsApp Floating Button
------------------------------------------------------- */
#whatsapp-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 54px;
  height: 54px;
  background: #25D366;
  color: #fff;
  border-radius: 50%;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: 0 8px 25px rgba(37,211,102,0.45);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
  animation: wa-float 3.5s ease-in-out infinite;
  text-decoration: none;
}
#whatsapp-float:hover {
  transform: scale(1.12) translateY(-3px);
  box-shadow: 0 14px 35px rgba(37,211,102,0.6);
  animation: none;
}
@keyframes wa-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* -------------------------------------------------------
   HERO ANIMATIONS – Page Load
------------------------------------------------------- */
.anim-hero-tag {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.7s cubic-bezier(0.22,1,0.36,1) 0.2s forwards;
}
.anim-hero-title {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s cubic-bezier(0.22,1,0.36,1) 0.4s forwards;
}
.anim-hero-desc {
  opacity: 0;
  transform: translateY(25px);
  animation: fadeUp 0.7s cubic-bezier(0.22,1,0.36,1) 0.6s forwards;
}
.anim-hero-btns {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.65s cubic-bezier(0.22,1,0.36,1) 0.8s forwards;
}
.anim-hero-search {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.75s cubic-bezier(0.22,1,0.36,1) 1.0s forwards;
}

/* Hero background subtle scale on load */
.hero-bg {
  animation: heroBgScale 6s ease-out forwards;
  transform-origin: center;
}
@keyframes heroBgScale {
  from { transform: scale(1.07); }
  to   { transform: scale(1); }
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* -------------------------------------------------------
   SCROLL REVEAL – Base States
   (JS adds .revealed class via IntersectionObserver)
------------------------------------------------------- */
.reveal-up {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.65s cubic-bezier(0.22,1,0.36,1), transform 0.65s cubic-bezier(0.22,1,0.36,1);
}
.reveal-up.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(1.03) translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1), transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.reveal-scale.revealed {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.reveal-img {
  opacity: 0;
  transform: translateY(28px) scale(1.03);
  transition: opacity 0.75s cubic-bezier(0.22,1,0.36,1), transform 0.75s cubic-bezier(0.22,1,0.36,1);
}
.reveal-img.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Mobile: reduce distances */
@media (max-width: 768px) {
  .reveal-up   { transform: translateY(20px); }
  .reveal-img  { transform: translateY(16px) scale(1.02); }
  .reveal-scale{ transform: scale(1.02) translateY(12px); }
}

/* -------------------------------------------------------
   IMAGE HOVER – subtle zoom (non-touch)
------------------------------------------------------- */
.img-hover-wrap {
  overflow: hidden;
}
.img-hover-wrap img {
  transition: transform 0.55s cubic-bezier(0.22,1,0.36,1);
  will-change: transform;
}
@media (hover: hover) {
  .img-hover-wrap:hover img {
    transform: scale(1.05);
  }
}

/* -------------------------------------------------------
   PROPERTY CARD HOVER
------------------------------------------------------- */
.anim-prop-card {
  transition: transform 0.5s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.5s cubic-bezier(0.22,1,0.36,1);
}
@media (hover: hover) {
  .anim-prop-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(0,0,0,0.14);
  }
  .anim-prop-card:hover .prop-img img {
    transform: scale(1.05);
  }
}
.anim-prop-card:active {
  transform: translateY(-2px) scale(0.99);
}

/* -------------------------------------------------------
   WHY CHOOSE CARD HOVER
------------------------------------------------------- */
.anim-why-card {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.4s ease;
}
@media (hover: hover) {
  .anim-why-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  }
}

/* -------------------------------------------------------
   ICON HOVER – subtle scale
------------------------------------------------------- */
.anim-icon {
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), border-color 0.35s ease;
}
@media (hover: hover) {
  .anim-why-card:hover .anim-icon {
    transform: scale(1.12);
    border-color: #C89B3C;
  }
}

/* -------------------------------------------------------
   BUTTON HOVER
   These ADD to existing button styles without overriding
------------------------------------------------------- */
.anim-btn {
  transition: transform 0.28s cubic-bezier(0.22,1,0.36,1),
              box-shadow 0.28s ease,
              background 0.28s ease !important;
  display: inline-flex;
  align-items: center;
  gap: inherit;
}
@media (hover: hover) {
  .anim-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(0,0,0,0.18);
  }
  /* If button has an arrow icon, nudge it right */
  .anim-btn:hover .fa-arrow-up,
  .anim-btn:hover .fa-arrow-right,
  .anim-btn:hover .right-rotate {
    transform: translateX(4px);
    transition: transform 0.28s ease;
  }
}
.anim-btn:active {
  transform: scale(0.97) translateY(0) !important;
  box-shadow: none !important;
}

/* -------------------------------------------------------
   NAV LINK ANIMATED UNDERLINE
------------------------------------------------------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0%;
  height: 2px;
  background: #C89B3C;
  border-radius: 2px;
  transition: width 0.28s cubic-bezier(0.22,1,0.36,1);
}
@media (hover: hover) {
  .nav-link:hover::after {
    width: 100%;
  }
}

/* -------------------------------------------------------
   SOCIAL ICONS HOVER
------------------------------------------------------- */
.socials a {
  transition: background 0.25s ease, color 0.25s ease, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@media (hover: hover) {
  .socials a:hover {
    transform: translateY(-3px) scale(1.1);
  }
}

/* -------------------------------------------------------
   COMMUNITY CARD HOVER
------------------------------------------------------- */
.comm-card {
  transition: transform 0.4s cubic-bezier(0.22,1,0.36,1);
}
@media (hover: hover) {
  .comm-card:hover {
    transform: translateY(-5px);
  }
  .comm-card:hover img {
    transform: scale(1.05);
  }
}

/* -------------------------------------------------------
   COUNTING ANIMATION – number rolls up
   (managed by JS, these styles just smooth the visual)
------------------------------------------------------- */
.counter {
  display: inline-block;
  transition: all 0.1s linear;
}

/* -------------------------------------------------------
   NAVBAR SCROLL STATE – solid dark bg when scrolled
------------------------------------------------------- */
.navbar {
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}
.navbar.navbar-solid {
  background: rgba(29,29,29,0.96);
  backdrop-filter: blur(20px);
  box-shadow: 0 2px 30px rgba(0,0,0,0.4);
  position: fixed;
}
