/* ============================================================
   home-motion.css — Motion, effects & micro-interactions
   Brand: --v3-p: #2b6bff  |  --v3-violet: #00c2ff
   ============================================================ */

/* ----------------------------------------------------------
   0. Keyframes
   ---------------------------------------------------------- */
@keyframes acPageIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes acFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-18px) rotate(2deg); }
}

@keyframes acDrift {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -20px) scale(1.05); }
  66%  { transform: translate(-20px, 15px) scale(0.97); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes marqueeScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@keyframes acGradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes acBtnShine {
  0%   { left: -75%; }
  100% { left: 125%; }
}

@keyframes acPulseGlow {
  0%, 100% { opacity: 0.45; }
  50%      { opacity: 0.75; }
}

/* RTL marquee */
@keyframes marqueeScrollRTL {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}

/* ----------------------------------------------------------
   1. Smooth page load
   ---------------------------------------------------------- */
.home-v3 {
  animation: acPageIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ----------------------------------------------------------
   2. Reveal system (existing — preserved)
   ---------------------------------------------------------- */
.home-v3 [data-ac-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.15rem, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--ac-reveal-delay, 0ms);
}

.home-v3 [data-ac-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ----------------------------------------------------------
   3. Reduced-motion (existing — extended)
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .home-v3 [data-ac-reveal],
  .home-v3 [data-ac-reveal].is-visible {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .home-v3 .hero-v3__bg-move,
  .home-v3 .hero-v3__grid,
  .home-v3 .hero-v3__shape {
    animation: none !important;
  }

  .home-v3,
  .ac-marquee__track,
  .hero-v3__illus,
  .ac-glow-orb,
  .hero-v3__btn--primary::after {
    animation: none !important;
  }

  .ac-glow-orb {
    display: none !important;
  }
}

/* ----------------------------------------------------------
   4. Language toggle (existing — preserved)
   ---------------------------------------------------------- */
.ac-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-inline-end: 0.35rem;
  padding: 0.25rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ac-lang-toggle button {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}

.ac-lang-toggle button:hover {
  color: #fff;
}

.ac-lang-toggle button[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.95);
  color: var(--v3-p, #2b6bff);
}

/* ----------------------------------------------------------
   5. Marquee ticker strip
   ---------------------------------------------------------- */
.ac-marquee {
  overflow: hidden;
  padding: 0.75rem 0;
  background: linear-gradient(
    135deg,
    var(--v3-p, #2b6bff) 0%,
    var(--v3-violet, #00c2ff) 50%,
    var(--v3-p, #2b6bff) 100%
  );
  background-size: 200% 200%;
  animation: acGradientShift 8s ease infinite;
  white-space: nowrap;
  position: relative;
  user-select: none;
}

.ac-marquee::before,
.ac-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4rem;
  z-index: 2;
  pointer-events: none;
}

.ac-marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--v3-p, #2b6bff), transparent);
}

.ac-marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--v3-p, #2b6bff), transparent);
}

.ac-marquee__track {
  display: inline-flex;
  align-items: center;
  gap: 2.5rem;
  animation: marqueeScroll 28s linear infinite;
  will-change: transform;
}

.ac-marquee:hover .ac-marquee__track {
  animation-play-state: paused;
}

.ac-marquee__track span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  opacity: 0.92;
}

.ac-marquee__track span i,
.ac-marquee__track span svg {
  font-size: 1rem;
  opacity: 0.8;
}

html[dir="rtl"] .ac-marquee__track {
  animation-name: marqueeScrollRTL;
}

/* ----------------------------------------------------------
   6. Floating SVG illustrations (hero)
   ---------------------------------------------------------- */
.hero-v3__illus {
  position: absolute;
  pointer-events: none;
  z-index: 1;
  opacity: 0.12;
  animation: acFloat 6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  will-change: transform;
}

.hero-v3__illus--1 {
  width: clamp(80px, 12vw, 180px);
  top: 8%;
  inset-inline-end: 6%;
  animation-delay: 0s;
  animation-duration: 6s;
  opacity: 0.10;
}

.hero-v3__illus--2 {
  width: clamp(60px, 8vw, 130px);
  bottom: 14%;
  inset-inline-start: 4%;
  animation-delay: -2s;
  animation-duration: 7.5s;
  opacity: 0.08;
}

.hero-v3__illus--3 {
  width: clamp(50px, 6vw, 100px);
  top: 55%;
  inset-inline-end: 18%;
  animation-delay: -4s;
  animation-duration: 9s;
  opacity: 0.06;
}

/* ----------------------------------------------------------
   7. Glow orbs
   ---------------------------------------------------------- */
.ac-glow-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  will-change: transform, opacity;
  animation: acDrift 18s cubic-bezier(0.45, 0, 0.55, 1) infinite,
             acPulseGlow 6s ease-in-out infinite;
}

.ac-glow-orb--1 {
  width: clamp(200px, 30vw, 500px);
  height: clamp(200px, 30vw, 500px);
  background: radial-gradient(circle, rgba(43, 107, 255, 0.35) 0%, transparent 70%);
  top: -5%;
  inset-inline-start: -8%;
  animation-delay: 0s, 0s;
}

.ac-glow-orb--2 {
  width: clamp(160px, 22vw, 400px);
  height: clamp(160px, 22vw, 400px);
  background: radial-gradient(circle, rgba(0, 194, 255, 0.30) 0%, transparent 70%);
  top: 40%;
  inset-inline-end: -6%;
  animation-delay: -6s, -2s;
  animation-duration: 22s, 7s;
}

.ac-glow-orb--3 {
  width: clamp(120px, 18vw, 320px);
  height: clamp(120px, 18vw, 320px);
  background: radial-gradient(circle, rgba(43, 107, 255, 0.22) 0%, rgba(0, 194, 255, 0.15) 50%, transparent 70%);
  bottom: 5%;
  inset-inline-start: 20%;
  animation-delay: -12s, -4s;
  animation-duration: 25s, 8s;
}

/* ----------------------------------------------------------
   8. Card hover glow border
   ---------------------------------------------------------- */
.home-v3 .card-v3 {
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-v3 .card-v3::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 40%,
    rgba(43, 107, 255, 0.45) 50%,
    rgba(0, 194, 255, 0.45) 60%,
    transparent 70%,
    transparent 100%
  );
  background-size: 300% 300%;
  background-position: 100% 100%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              background-position 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 1;
}

.home-v3 .card-v3:hover {
  transform: translateY(-4px);
  box-shadow:
    0 8px 30px rgba(43, 107, 255, 0.10),
    0 2px 8px rgba(0, 0, 0, 0.06);
}

.home-v3 .card-v3:hover::before {
  opacity: 1;
  background-position: 0% 0%;
}

/* ----------------------------------------------------------
   9. Alternating section backgrounds
   ---------------------------------------------------------- */
.sec-v3--alt {
  background-color: #F1F5F9;
  position: relative;
}

.sec-v3--alt::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(43, 107, 255, 0.04) 0%, transparent 100%),
    radial-gradient(ellipse 50% 50% at 80% 100%, rgba(0, 194, 255, 0.03) 0%, transparent 100%);
  pointer-events: none;
}

/* ----------------------------------------------------------
   10. Animated gradient text for section titles
   ---------------------------------------------------------- */
.sec-v3__title--gradient {
  background: linear-gradient(
    135deg,
    var(--v3-p, #2b6bff) 0%,
    var(--v3-violet, #00c2ff) 40%,
    var(--v3-p, #2b6bff) 80%,
    var(--v3-violet, #00c2ff) 100%
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: acGradientShift 6s ease infinite;
}

/* ----------------------------------------------------------
   11. Pill badges
   ---------------------------------------------------------- */
.ac-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--v3-p, #2b6bff);
  background: rgba(43, 107, 255, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid transparent;
  background-clip: padding-box;
  position: relative;
  isolation: isolate;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.ac-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(43, 107, 255, 0.5),
    rgba(0, 194, 255, 0.5)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
  pointer-events: none;
}

.ac-pill i,
.ac-pill svg {
  font-size: 0.85rem;
  opacity: 0.85;
}

.ac-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(43, 107, 255, 0.12);
}

/* ----------------------------------------------------------
   12. Stats counter glow
   ---------------------------------------------------------- */
.home-v3 .stats-v3__num {
  text-shadow:
    0 0 20px rgba(43, 107, 255, 0.35),
    0 0 40px rgba(0, 194, 255, 0.15);
  transition: text-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-v3 .stats-v3__num:hover {
  text-shadow:
    0 0 24px rgba(43, 107, 255, 0.55),
    0 0 56px rgba(0, 194, 255, 0.25),
    0 0 80px rgba(43, 107, 255, 0.10);
}

/* ----------------------------------------------------------
   13. Button shine effect
   ---------------------------------------------------------- */
.hero-v3__btn--primary {
  position: relative;
  overflow: hidden;
}

.hero-v3__btn--primary::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.30) 45%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 55%,
    transparent 100%
  );
  animation: acBtnShine 4s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: 1.5s;
  pointer-events: none;
  z-index: 1;
}

/* ----------------------------------------------------------
   14. LTR overrides (existing — preserved)
   ---------------------------------------------------------- */
html[dir="ltr"] .home-v3 .navbar-nav {
  text-align: left;
}

html[dir="ltr"] .home-v3 .dropdown-menu.text-end {
  text-align: left !important;
}

/* ----------------------------------------------------------
   15. RTL refinements
   ---------------------------------------------------------- */
html[dir="rtl"] .hero-v3__btn--primary::after {
  animation-direction: reverse;
}

html[dir="rtl"] .ac-marquee::before {
  left: auto;
  right: 0;
  background: linear-gradient(to left, var(--v3-p, #2b6bff), transparent);
}

html[dir="rtl"] .ac-marquee::after {
  right: auto;
  left: 0;
  background: linear-gradient(to right, var(--v3-p, #2b6bff), transparent);
}

/* ----------------------------------------------------------
   16. Responsive tweaks
   ---------------------------------------------------------- */
@media (max-width: 767.98px) {
  .hero-v3__illus {
    display: none;
  }

  .ac-glow-orb {
    filter: blur(60px);
    opacity: 0.5;
  }

  .ac-glow-orb--3 {
    display: none;
  }

  .ac-marquee__track {
    gap: 1.5rem;
    animation-duration: 18s;
  }

  .ac-marquee__track span {
    font-size: 0.75rem;
  }

  .home-v3 .card-v3:hover {
    transform: none;
  }
}

@media (max-width: 479.98px) {
  .ac-glow-orb--2 {
    display: none;
  }

  .ac-pill {
    font-size: 0.7rem;
    padding: 0.28rem 0.65rem;
  }
}
