/* ═══════════════════════════════════════════════════════════
   FRONTEND 3D ENHANCEMENT — Modern Premium Layer
   3D effects, micro-animations, depth, performance
   ═══════════════════════════════════════════════════════════ */

/* ─── GPU ACCELERATION & PERFORMANCE ─── */
.glass-card,
.hero-3d-card,
.plan-glass,
.saas-glass,
.quote-glass,
.service-glass,
.industry-premium-card,
.tech-item,
.cta-glass,
.about-band,
.solution-card {
  will-change: transform;
  transform: translateZ(0);
  -webkit-font-smoothing: antialiased;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── ENHANCED 3D CARD PERSPECTIVE ─── */
.glass-card {
  transform-style: preserve-3d;
  perspective: 1000px;
}

.glass-card:hover {
  transform: perspective(1000px) rotateX(2deg) rotateY(-2deg) translateY(-8px);
  box-shadow:
    0 25px 50px rgba(99, 102, 241, 0.12),
    0 10px 20px rgba(0, 0, 0, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ─── REMOVE 3D FROM SOLUTIONS SECTION ─── */
.solution-card:hover,
.solution-image-wrap:hover {
  transform: translateY(-8px) !important;
  perspective: none !important;
}

/* ─── 3D DEPTH BORDER GLOW ON HOVER ─── */
.glass-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0),
    rgba(20, 184, 166, 0)
  );
  z-index: -1;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}
.glass-card:hover::after {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(20, 184, 166, 0.15)
  );
  opacity: 1;
  filter: blur(12px);
}

/* ─── HERO 3D CARD ENHANCED ─── */
.hero-3d-card {
  transform-style: preserve-3d;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}
.hero-3d-card:hover {
  transform: perspective(800px) rotateY(10deg) rotateX(-5deg) translateY(-10px)
    scale(1.05);
  box-shadow:
    -20px 20px 60px rgba(99, 102, 241, 0.25),
    0 0 80px rgba(99, 102, 241, 0.1);
}
.hero-3d-card .material-icons {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.3));
}
.hero-3d-card:hover .material-icons {
  transform: translateZ(30px) scale(1.15);
}

/* ─── SERVICE CARDS — 3D FLIP REVEAL ─── */
.service-glass {
  position: relative;
  overflow: hidden;
}
.service-glass::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  transition: left 0.7s ease;
}
.service-glass:hover::before {
  left: 100%;
}
.service-glass:hover {
  transform: perspective(800px) rotateY(-5deg) translateY(-6px);
  box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.service-icon-wrap {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.service-glass:hover .service-icon-wrap {
  transform: translateY(-5px) scale(1.12) rotate(-3deg);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* ─── PRICING CARDS — FLOATING 3D ─── */
.plan-glass {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
}
.plan-glass:hover {
  transform: perspective(800px) rotateX(-3deg) translateY(-12px) scale(1.02);
  box-shadow:
    0 30px 60px rgba(99, 102, 241, 0.18),
    0 0 0 1px rgba(99, 102, 241, 0.1);
}
.plan-featured {
  animation: featuredFloat 4s ease-in-out infinite;
}
@keyframes featuredFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}
.plan-featured:hover {
  animation: none;
}

/* Price line gradient text */
.price-line {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-featured .price-line {
  background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* Plan icon 3D spin on hover */
.plan-icon-wrap {
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.plan-glass:hover .plan-icon-wrap {
  transform: rotateY(180deg) scale(1.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

/* ─── SAAS PRODUCT CARDS — DEPTH PARALLAX ─── */
.saas-glass {
  position: relative;
}
.saas-glass::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--fx-brand), var(--fx-teal));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 0 20px 20px;
  z-index: 2;
}
.saas-glass:hover::before {
  transform: scaleX(1);
}
.saas-glass:hover {
  transform: perspective(1000px) rotateY(2deg) translateY(-8px) scale(1.01);
}

/* Image zoom with color overlay */
.saas-img-wrap {
  position: relative;
  overflow: hidden;
}
.saas-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0),
    rgba(20, 184, 166, 0)
  );
  transition: background 0.5s;
  z-index: 1;
}
.saas-glass:hover .saas-img-wrap::after {
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.15),
    rgba(20, 184, 166, 0.1)
  );
}

/* ─── TESTIMONIALS — TILT + GLOW ─── */
.quote-glass {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}
.quote-glass::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.06),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.5s;
}
.quote-glass:hover::before {
  opacity: 1;
}
.quote-glass:hover {
  transform: perspective(800px) rotateX(-2deg) rotateY(3deg) translateY(-6px);
  box-shadow: 0 25px 50px rgba(99, 102, 241, 0.12);
}

/* Quote avatar pulse ring */
.quote-avatar {
  position: relative;
}
.quote-avatar::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(
      135deg,
      rgba(99, 102, 241, 0.4),
      rgba(20, 184, 166, 0.4)
    )
    border-box;
  -webkit-mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) padding-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.4s;
}
.quote-glass:hover .quote-avatar::after {
  opacity: 1;
  transform: scale(1);
}

/* ─── INDUSTRY CARDS — 3D DEPTH ENHANCEMENT ─── */
.industry-premium-card {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
}
.industry-premium-card:hover {
  transform: perspective(1000px) rotateX(-3deg) translateY(-10px) scale(1.02);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
}

/* Industry visual parallax icon glow */
.industry-visual::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  filter: blur(30px);
  transition: all 0.5s;
  opacity: 0;
}
.industry-premium-card:hover .industry-visual::before {
  opacity: 1;
  transform: scale(1.5);
}

/* ─── CTA SECTION — ENHANCED 3D GLOW ─── */
.cta-glass {
  transition: all 0.4s;
  position: relative;
}
.cta-glass:hover {
  transform: perspective(800px) rotateX(2deg) translateY(-5px);
  box-shadow: 0 30px 80px rgba(99, 102, 241, 0.35);
}

/* Animated gradient shimmer on CTA */
.cta-glass::before {
  width: 300px !important;
  height: 300px !important;
  animation: ctaOrb 8s ease-in-out infinite;
}
@keyframes ctaOrb {
  0%,
  100% {
    transform: translate(-60px, -60px) scale(1);
  }
  50% {
    transform: translate(-30px, -30px) scale(1.3);
  }
}

/* ─── STAT COUNTER — ENHANCED DEPTH ─── */
.stat-item {
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}
.stat-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--fx-gradient-1);
  transform: scaleX(0);
  transition: transform 0.4s;
  transform-origin: left;
}
.stat-item:hover::before {
  transform: scaleX(1);
}
.stat-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(99, 102, 241, 0.12);
}

/* ─── ABOUT SECTION — ENHANCED ─── */
.about-band {
  position: relative;
  overflow: hidden;
}
.about-band::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.06),
    transparent 70%
  );
  border-radius: 50%;
  pointer-events: none;
}

/* About list items — staggered reveal */
.about-list li {
  position: relative;
  padding-left: 8px;
  transition: all 0.3s;
}
.about-list li:hover {
  transform: translateX(6px);
  color: var(--fx-brand);
}
.about-list li::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fx-brand);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}
.about-list li:hover::before {
  opacity: 1;
}

/* ─── TECH STACK — ENHANCED 3D GLOW ─── */
.tech-item {
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  position: relative;
  overflow: hidden;
}
.tech-item::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.2), transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.5s;
}
.tech-item:hover::before {
  width: 200px;
  height: 200px;
}
.tech-item:hover {
  transform: perspective(600px) rotateX(-5deg) translateY(-8px) scale(1.05);
  box-shadow:
    0 15px 35px rgba(99, 102, 241, 0.25),
    0 0 20px rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.5);
}
.tech-item:hover .tech-icon {
  transform: scale(1.25) rotate(-5deg);
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.5));
}
.tech-item:hover .tech-label {
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ─── NAVBAR GLASSMORPHISM ENHANCEMENT ─── */
.navbar.scrolled {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

/* ─── BUTTON MICRO-INTERACTIONS ─── */
.btn-primary,
.btn-outline-primary {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.btn-primary::before,
.btn-outline-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition:
    width 0.5s,
    height 0.5s;
}
.btn-primary:hover::before,
.btn-outline-primary:hover::before {
  width: 300px;
  height: 300px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}
.btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.15);
}

/* ─── ACCORDION 3D ENHANCEMENT ─── */
.solution-accordion .accordion-item {
  transition: all 0.3s;
}
.solution-accordion .accordion-item:has(.accordion-button:not(.collapsed)) {
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
  border-color: rgba(99, 102, 241, 0.2);
}
.solution-accordion .accordion-button {
  transition: all 0.3s;
}
.solution-accordion .accordion-button:hover {
  padding-left: 1.5rem;
}

/* ─── SECTION DIVIDER — ANIMATED ─── */
.section-head::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--fx-gradient-1);
  margin: 12px auto 0;
  border-radius: 99px;
  animation: lineGrow 1.5s ease-out;
}
@keyframes lineGrow {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 60px;
    opacity: 1;
  }
}

/* ─── IMAGE HOVER EFFECTS ─── */
.feature-service-card .service-img-container img,
.solution-image,
.saas-img {
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.feature-service-card:hover .service-img-container img {
  transform: scale(1.08);
  filter: brightness(1.05) contrast(1.02);
}
.solution-image-wrap:hover .solution-image {
  transform: scale(1.04);
  filter: brightness(1.05) saturate(1.1);
}

/* Image gradient overlay enhanced */
.img-overlay-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent 60%);
  opacity: 0.7;
  transition: opacity 0.4s;
}
.feature-service-card:hover .img-overlay-grad {
  opacity: 0.4;
}

/* ─── FLOATING PARTICLES — MICRO DECORATION ─── */
@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.3;
  }
  50% {
    transform: translateY(-20px) rotate(180deg);
    opacity: 0.7;
  }
}

.agency-hero::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--fx-brand);
  border-radius: 50%;
  top: 30%;
  right: 15%;
  opacity: 0.3;
  animation: particleFloat 5s ease-in-out infinite;
  pointer-events: none;
}

/* ─── SMOOTH SCROLL BEHAVIOR ─── */
html {
  scroll-behavior: smooth;
}

/* ─── SELECTION COLOR ─── */
::selection {
  background: rgba(99, 102, 241, 0.2);
  color: var(--fx-ink);
}

/* ─── CUSTOM SCROLLBAR ─── */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--fx-brand), var(--fx-teal));
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--fx-brand);
}

/* ─── FOCUS VISIBLE FOR ACCESSIBILITY ─── */
:focus-visible {
  outline: 2px solid var(--fx-brand);
  outline-offset: 2px;
}

/* ─── LOADING OPTIMIZATION — IMAGES ─── */
img {
  content-visibility: auto;
}

/* ─── RESPONSIVE 3D ADJUSTMENTS ─── */
@media (max-width: 991px) {
  .glass-card:hover {
    transform: translateY(-5px);
  }
  .plan-glass:hover {
    transform: translateY(-8px) scale(1.01);
  }
  .hero-3d-card:hover {
    transform: scale(1.03);
  }
}
@media (max-width: 767px) {
  .glass-card:hover,
  .service-glass:hover,
  .plan-glass:hover,
  .quote-glass:hover {
    transform: translateY(-4px);
  }
}
