/* ======================================================================
   HomeForte — Enhanced Visual Effects & Animations
   ====================================================================== */

/* ======================== PAGE LOAD ANIMATION ======================== */
body {
  opacity: 0;
  transition: opacity 0.6s ease;
}

body.loaded {
  opacity: 1;
}

/* ======================== SCROLL PROGRESS BAR ======================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient-accent);
  z-index: 9999;
  transition: width 0.05s linear;
  box-shadow: 0 0 10px var(--accent-glow-strong), 0 0 20px var(--accent-glow);
}

/* ======================== PARTICLES ======================== */
.particles-container {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  background: var(--accent);
  border-radius: 50%;
  animation: particle-float linear infinite;
}

@keyframes particle-float {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(var(--drift, 50px)), -120vh) rotate(720deg);
    opacity: 0;
  }
}

.particle:nth-child(odd) { --drift: 80px; }
.particle:nth-child(even) { --drift: -60px; }
.particle:nth-child(3n) { --drift: 120px; }
.particle:nth-child(5n) { --drift: -100px; }
.particle:nth-child(7n) { --drift: 40px; }

/* ======================== ANIMATED MESH GRADIENT ======================== */
.hero-mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-mesh::before,
.hero-mesh::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  animation: mesh-move 15s ease-in-out infinite;
}

.hero-mesh::before {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(212,160,58,0.15) 0%, transparent 70%);
  top: -10%;
  right: -10%;
  animation-delay: 0s;
}

.hero-mesh::after {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(46,204,113,0.08) 0%, transparent 70%);
  bottom: -10%;
  left: 10%;
  animation-delay: -7s;
}

@keyframes mesh-move {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(40px, 20px) scale(1.05); }
}

/* ======================== ANIMATED GRADIENT TEXT ======================== */
.gradient-text {
  background: linear-gradient(
    135deg, 
    var(--accent) 0%, 
    #f0d78c 25%,
    var(--accent) 50%, 
    #f0d78c 75%,
    var(--accent) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-text-shine 4s linear infinite;
}

@keyframes gradient-text-shine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ======================== TYPING CURSOR ======================== */
.typing-text {
  border-right: 3px solid var(--accent);
  animation: blink-cursor 0.8s step-end infinite;
  padding-right: 4px;
}

@keyframes blink-cursor {
  0%, 100% { border-color: var(--accent); }
  50% { border-color: transparent; }
}

/* ======================== ENHANCED SCROLL ANIMATIONS ======================== */
.fade-in, .slide-left, .slide-right, .scale-in, .blur-in {
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.fade-in {
  transform: translateY(40px);
}

.slide-left {
  transform: translateX(-60px);
}

.slide-right {
  transform: translateX(60px);
}

.scale-in {
  transform: scale(0.85);
}

.blur-in {
  transform: translateY(20px);
  filter: blur(10px);
}

.fade-in.visible,
.slide-left.visible,
.slide-right.visible,
.scale-in.visible,
.blur-in.visible {
  opacity: 1;
  transform: translate(0, 0) scale(1);
  filter: blur(0);
}

/* ======================== 3D TILT CARDS ======================== */
.service-card,
.pricing-card,
.feature-card {
  transition: all 0.15s ease !important;
  transform-style: preserve-3d;
  will-change: transform;
}

/* ======================== RIPPLE EFFECT ======================== */
.btn {
  position: relative;
  overflow: hidden;
}

.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  animation: ripple-anim 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes ripple-anim {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* ======================== SHAKE ANIMATION (form validation) ======================== */
.shake {
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ======================== LOADING SPINNER ======================== */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(10,22,40,0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ======================== GLOW CARD EFFECT ======================== */
.glow-card {
  position: relative;
  overflow: hidden;
}

.glow-card::after {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent-glow-strong) 0%, transparent 70%);
  border-radius: 50%;
  top: var(--glow-y, 50%);
  left: var(--glow-x, 50%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 0;
}

.glow-card:hover::after {
  opacity: 1;
}

.glow-card > * {
  position: relative;
  z-index: 1;
}

/* ======================== ANIMATED GRADIENT BORDERS ======================== */
.pricing-card.featured {
  position: relative;
  border: none !important;
}

.pricing-card.featured::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  padding: 2px;
  background: linear-gradient(
    var(--gradient-angle, 135deg), 
    var(--accent), 
    #f0d78c, 
    var(--accent), 
    #2ecc71,
    var(--accent)
  );
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-border-spin 4s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes gradient-border-spin {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ======================== PULSING BADGE ======================== */
.pricing-card.featured::before {
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 12px 4px var(--accent-glow); }
}

/* ======================== HERO ENHANCEMENTS ======================== */
.hero-bg img {
  transition: transform 0.3s ease;
  transform: scale(1.05);
}

.hero-content {
  transition: transform 0.3s ease;
}

.hero-shape {
  transition: transform 0.3s ease;
}

/* Animated line under section labels */
.section-label::before {
  animation: label-line-pulse 2s ease-in-out infinite;
}

@keyframes label-line-pulse {
  0%, 100% { width: 24px; opacity: 1; }
  50% { width: 40px; opacity: 0.7; }
}

/* ======================== ENHANCED SERVICE CARDS ======================== */
.service-card-img::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(10,22,40,0.8) 100%);
  z-index: 1;
  opacity: 0;
  transition: opacity 0.4s;
}

.service-card:hover .service-card-img::before {
  opacity: 1;
}

.service-card .price-badge {
  z-index: 2;
  position: relative;
  transition: all 0.3s ease;
}

.service-card:hover .price-badge {
  transform: scale(1.1);
  box-shadow: 0 4px 16px var(--accent-glow);
}

/* ======================== STEP NUMBER GLOW ======================== */
.step-number {
  position: relative;
}

.step-number::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--gradient-accent);
  opacity: 0;
  z-index: -1;
  filter: blur(12px);
  transition: opacity 0.4s;
}

.step-card:hover .step-number::after {
  opacity: 0.4;
}

/* ======================== TESTIMONIAL CARD HOVER ======================== */
.testimonial-card {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.testimonial-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.testimonial-card:hover .testimonial-avatar {
  transform: scale(1.15);
  box-shadow: 0 0 20px var(--accent-glow);
}

.testimonial-avatar {
  transition: all 0.4s ease;
}

/* ======================== AREA TAGS ANIMATION ======================== */
.area-tag {
  animation: tag-float 6s ease-in-out infinite;
}

.area-tag:nth-child(1) { animation-delay: 0s; }
.area-tag:nth-child(2) { animation-delay: 0.3s; }
.area-tag:nth-child(3) { animation-delay: 0.6s; }
.area-tag:nth-child(4) { animation-delay: 0.9s; }
.area-tag:nth-child(5) { animation-delay: 1.2s; }
.area-tag:nth-child(6) { animation-delay: 1.5s; }
.area-tag:nth-child(7) { animation-delay: 1.8s; }
.area-tag:nth-child(8) { animation-delay: 0.2s; }
.area-tag:nth-child(9) { animation-delay: 0.5s; }
.area-tag:nth-child(10) { animation-delay: 0.8s; }
.area-tag:nth-child(11) { animation-delay: 1.1s; }
.area-tag:nth-child(12) { animation-delay: 1.4s; }
.area-tag:nth-child(13) { animation-delay: 1.7s; }
.area-tag:nth-child(14) { animation-delay: 2.0s; }

@keyframes tag-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ======================== CTA SECTION ANIMATED BG ======================== */
.cta-section::before {
  animation: cta-pulse 4s ease-in-out infinite;
}

@keyframes cta-pulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.1); }
}

/* ======================== FORM FOCUS EFFECTS ======================== */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 20px rgba(212,160,58,0.1);
  background: var(--surface-hover);
  transform: translateY(-1px);
}

/* ======================== FOOTER SOCIAL HOVER ======================== */
.footer-social a {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.footer-social a:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 8px 20px rgba(212,160,58,0.3);
}

/* ======================== FLOATING CTA ANIMATION ======================== */
.floating-cta {
  animation: float-cta-in 0.5s ease-out;
}

@keyframes float-cta-in {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ======================== FAQ ENHANCED ANIMATION ======================== */
.faq-answer {
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s ease;
}

.faq-item {
  transition: all 0.3s ease;
}

.faq-item:hover {
  border-color: var(--border-light);
}

.faq-item.active {
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(212,160,58,0.1);
}

/* ======================== SMOOTH IMAGE REVEAL ======================== */
.service-card-img img,
.ps-image img {
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-card-img img {
  transform: scale(1.1);
}

/* ======================== WAVE SECTION DIVIDER ======================== */
.wave-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  z-index: 2;
}

.wave-divider svg {
  display: block;
  width: calc(100% + 1.3px);
  height: 60px;
}

.wave-divider .shape-fill {
  fill: var(--primary-light);
}

.wave-divider.flip {
  top: -1px;
  bottom: auto;
  transform: rotate(180deg);
}

.wave-divider.flip .shape-fill {
  fill: var(--primary);
}

/* ======================== INCLUDED ITEM HOVER ======================== */
.included-item {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.included-item:hover {
  transform: translateX(8px);
  border-color: var(--accent);
  box-shadow: -4px 0 0 var(--accent);
}

/* ======================== NAV LINK ENHANCED ======================== */
.nav-links a {
  transition: all 0.3s ease;
}

.nav-links a:hover {
  transform: translateY(-1px);
}

/* ======================== HERO STATS COUNTER STYLE ======================== */
.hero-stat .number {
  transition: all 0.3s ease;
}

.hero-stat:hover .number {
  transform: scale(1.1);
  text-shadow: 0 0 20px var(--accent-glow);
}

/* ======================== TRUST BAR SCROLL ANIMATION ======================== */
.trust-bar {
  overflow: hidden;
  position: relative;
}

.trust-badge {
  transition: all 0.3s ease;
}

.trust-badge:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.trust-badge:hover .icon {
  transform: scale(1.2);
  transition: transform 0.3s ease;
}

.trust-badge .icon {
  display: inline-block;
  transition: transform 0.3s ease;
}
