/**
 * Nexura Digital - Dynamic Effects CSS
 * Advanced Glassmorphism, Particle Effects, Animated Backgrounds
 * Version: 1.0
 */

/* ========================================
   ENHANCED GLASSMORPHISM EFFECTS
   ======================================== */

/* Glass panel effect for sections */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 24px;
  box-shadow:
    0 8px 32px rgba(107, 57, 244, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Frosted glass header */
#header,
.header-main,
#header .header-main {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(20px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(150%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#header.scrolled .header-main,
#header .header-main.sticky {
  background: rgba(255, 255, 255, 0.95) !important;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.08) !important;
}

/* Glass card with shimmer */
.glass-card-shimmer {
  position: relative;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  overflow: hidden;
}

.glass-card-shimmer::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 70%
  );
  animation: shimmer 3s infinite linear;
  pointer-events: none;
}

@keyframes shimmer {
  0% { transform: translateX(-50%) translateY(-50%) rotate(45deg); }
  100% { transform: translateX(50%) translateY(50%) rotate(45deg); }
}

/* ========================================
   IMAGE ENHANCEMENTS - BORDERS & GLOW
   ======================================== */

/* Universal image styling */
.page-content img,
.entry-content img,
.wpb_wrapper img,
.vc_column-inner img,
article img {
  border-radius: 16px !important;
  border: 3px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow:
    0 15px 50px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(107, 57, 244, 0.08) !important;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.page-content img:hover,
.entry-content img:hover,
.wpb_wrapper img:hover,
.vc_column-inner img:hover,
article img:hover {
  transform: translateY(-5px) scale(1.02) !important;
  border-color: rgba(107, 57, 244, 0.2) !important;
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.18),
    0 0 40px rgba(107, 57, 244, 0.15),
    0 0 0 1px rgba(107, 57, 244, 0.2) !important;
}

/* Glowing border on hover */
.img-border-glow {
  position: relative;
  display: inline-block;
  border-radius: 20px;
  overflow: hidden;
}

.img-border-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 20px;
  padding: 3px;
  background: linear-gradient(135deg, #6b39f4, #9e17f1, #c5d4fb, #6b39f4);
  background-size: 300% 300%;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: gradient-rotate 4s ease infinite;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.img-border-glow:hover::after {
  opacity: 1;
}

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

/* Split section images - enhanced */
.split-image,
.split-section img {
  position: relative;
}

.split-image img,
.split-section img {
  border-radius: 24px !important;
  border: 4px solid rgba(255, 255, 255, 0.95) !important;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 0 60px rgba(107, 57, 244, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
}

.split-image img:hover,
.split-section img:hover {
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.2),
    0 0 80px rgba(107, 57, 244, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(107, 57, 244, 0.25) !important;
}

/* ========================================
   ANIMATED BACKGROUND PATTERNS
   ======================================== */

/* Gradient mesh background */
.gradient-mesh-bg {
  position: relative;
  overflow: hidden;
}

.gradient-mesh-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(at 40% 20%, rgba(107, 57, 244, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(158, 23, 241, 0.1) 0px, transparent 40%),
    radial-gradient(at 0% 50%, rgba(197, 212, 251, 0.2) 0px, transparent 50%),
    radial-gradient(at 80% 50%, rgba(214, 239, 232, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(107, 57, 244, 0.1) 0px, transparent 40%),
    radial-gradient(at 80% 100%, rgba(158, 23, 241, 0.08) 0px, transparent 40%);
  animation: mesh-float 20s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes mesh-float {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-20px) scale(1.02);
  }
}

/* Animated gradient orbs */
.animated-orbs {
  position: relative;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.4;
  animation: orb-float 15s ease-in-out infinite;
  pointer-events: none;
}

.orb-1 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #6b39f4 0%, #9e17f1 100%);
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, #c5d4fb 0%, #d6efe8 100%);
  bottom: -5%;
  right: -5%;
  animation-delay: -5s;
}

.orb-3 {
  width: 250px;
  height: 250px;
  background: linear-gradient(135deg, #9e17f1 0%, #c5d4fb 100%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -10s;
}

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

/* Particle background container */
#particles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* ========================================
   FLOATING DECORATIVE SHAPES
   ======================================== */

.floating-decorations {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.float-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
}

.float-circle-1 {
  width: 150px;
  height: 150px;
  background: linear-gradient(135deg, #6b39f4, #9e17f1);
  top: 10%;
  left: 5%;
  animation: float-1 8s ease-in-out infinite;
}

.float-circle-2 {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #c5d4fb, #d6efe8);
  top: 60%;
  right: 10%;
  animation: float-2 10s ease-in-out infinite;
}

.float-circle-3 {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #9e17f1, #6b39f4);
  bottom: 20%;
  left: 20%;
  animation: float-3 12s ease-in-out infinite;
}

.float-circle-4 {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #d6efe8, #c5d4fb);
  top: 30%;
  right: 25%;
  animation: float-1 9s ease-in-out infinite reverse;
}

@keyframes float-1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(20px, -30px) rotate(180deg); }
}

@keyframes float-2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-15px, 25px) scale(1.1); }
}

@keyframes float-3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33% { transform: translate(10px, -15px) rotate(120deg); }
  66% { transform: translate(-10px, 10px) rotate(240deg); }
}

/* Morphing blob */
.morph-blob {
  position: absolute;
  width: 300px;
  height: 300px;
  background: linear-gradient(135deg, rgba(107, 57, 244, 0.2), rgba(158, 23, 241, 0.1));
  filter: blur(40px);
  animation: morph 15s ease-in-out infinite;
}

@keyframes morph {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
  }
  50% {
    border-radius: 50% 60% 30% 60% / 70% 30% 60% 40%;
  }
  75% {
    border-radius: 60% 40% 60% 30% / 40% 60% 40% 70%;
  }
}

/* ========================================
   SECTION SPECIFIC BACKGROUNDS
   ======================================== */

/* Hero section animated background */
.hero-section {
  position: relative;
  overflow: hidden;
}

.hero-section .floating-decorations {
  z-index: 1;
}

.hero-section .hero-content {
  position: relative;
  z-index: 10;
}

/* Page header with animated gradient */
.page-header {
  position: relative;
  overflow: hidden;
}

.page-header .gradient-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg,
    transparent 0%,
    #6b39f4 20%,
    #9e17f1 50%,
    #6b39f4 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: gradient-slide 3s linear infinite;
}

@keyframes gradient-slide {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

/* CTA section with animated dots */
.cta-section {
  position: relative;
}

.cta-section .dot-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(rgba(107, 57, 244, 0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.5;
  pointer-events: none;
}

/* ========================================
   ENHANCED CARD HOVER EFFECTS
   ======================================== */

/* 3D Tilt effect */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

.tilt-card:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(10px);
}

/* Ripple effect on click */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(107, 57, 244, 0.3);
  transform: scale(0);
  animation: ripple-animation 0.6s linear;
  pointer-events: none;
}

@keyframes ripple-animation {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* Card spotlight effect */
.spotlight-card {
  position: relative;
  overflow: hidden;
}

.spotlight-card::before {
  content: '';
  position: absolute;
  top: var(--mouse-y, 50%);
  left: var(--mouse-x, 50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(107, 57, 244, 0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.spotlight-card:hover::before {
  opacity: 1;
}

/* ========================================
   ENHANCED BUTTON EFFECTS
   ======================================== */

/* Button with gradient border animation */
.btn-gradient-border {
  position: relative;
  background: white;
  color: #6b39f4 !important;
  border: none;
  padding: 18px 40px;
  border-radius: 35px;
  font-weight: 600;
  overflow: hidden;
  z-index: 1;
}

.btn-gradient-border::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, #6b39f4, #9e17f1, #c5d4fb, #6b39f4);
  background-size: 300% 300%;
  border-radius: 37px;
  z-index: -2;
  animation: gradient-rotate 3s ease infinite;
}

.btn-gradient-border::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: 2px;
  background: white;
  border-radius: 33px;
  z-index: -1;
  transition: background 0.3s ease;
}

.btn-gradient-border:hover::after {
  background: linear-gradient(135deg, #6b39f4, #9e17f1);
}

.btn-gradient-border:hover {
  color: white !important;
}

/* Magnetic button effect */
.btn-magnetic {
  transition: transform 0.2s ease;
}

/* Button shine effect */
.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-shine:hover::before {
  left: 100%;
}

/* ========================================
   SCROLL-TRIGGERED ANIMATIONS
   ======================================== */

/* Fade in variations */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.animated {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.animated {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.animated {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.animated {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
[data-stagger] > *:nth-child(1) { transition-delay: 0s; }
[data-stagger] > *:nth-child(2) { transition-delay: 0.1s; }
[data-stagger] > *:nth-child(3) { transition-delay: 0.2s; }
[data-stagger] > *:nth-child(4) { transition-delay: 0.3s; }
[data-stagger] > *:nth-child(5) { transition-delay: 0.4s; }
[data-stagger] > *:nth-child(6) { transition-delay: 0.5s; }
[data-stagger] > *:nth-child(7) { transition-delay: 0.6s; }
[data-stagger] > *:nth-child(8) { transition-delay: 0.7s; }

/* ========================================
   TEXT ANIMATIONS
   ======================================== */

/* Gradient text animation */
.gradient-text-animated {
  background: linear-gradient(135deg, #6b39f4 0%, #9e17f1 50%, #6b39f4 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-text-flow 3s ease infinite;
}

@keyframes gradient-text-flow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Typewriter effect class */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid #6b39f4;
  animation:
    typing 3s steps(30) 1s 1 normal both,
    blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: #6b39f4; }
}

/* ========================================
   LOADING SKELETON
   ======================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    #f0f0f0 25%,
    #e8e8e8 50%,
    #f0f0f0 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================
   TESTIMONIAL SECTION ENHANCEMENTS
   ======================================== */

.testimonials-section {
  position: relative;
  overflow: hidden;
}

.testimonials-section::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(197, 212, 251, 0.4) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  pointer-events: none;
}

.testimonials-section::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(214, 239, 232, 0.3) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  pointer-events: none;
}

/* ========================================
   FAQ SECTION ENHANCEMENTS
   ======================================== */

.faq-section {
  position: relative;
}

.faq-section .section-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(107, 57, 244, 0.03) 0%, transparent 30%),
    radial-gradient(circle at 80% 80%, rgba(197, 212, 251, 0.05) 0%, transparent 30%);
  pointer-events: none;
}

/* ========================================
   SERVICE CARDS ENHANCED
   ======================================== */

.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    transparent 0%,
    transparent 40%,
    rgba(107, 57, 244, 0.03) 40%,
    rgba(107, 57, 244, 0.03) 60%,
    transparent 60%
  );
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  pointer-events: none;
}

.service-card:hover::after {
  transform: translateX(100%);
}

/* Service card icon glow */
.service-icon {
  position: relative;
}

.service-icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(107, 57, 244, 0.2) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.service-card:hover .service-icon::after {
  opacity: 1;
}

/* ========================================
   STATS SECTION ENHANCED
   ======================================== */

.stats-section {
  position: relative;
  overflow: hidden;
}

.stats-section .stat-item {
  position: relative;
}

.stats-section .stat-number {
  position: relative;
  display: inline-block;
}

/* Number glow effect */
.stat-number::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150%;
  height: 150%;
  background: radial-gradient(circle, rgba(107, 57, 244, 0.15) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  animation: stat-pulse 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes stat-pulse {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

/* ========================================
   CASE STUDIES ENHANCED
   ======================================== */

.case-study-card {
  position: relative;
}

.case-study-card .results-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 20px;
  height: 20px;
  background: linear-gradient(135deg, #6b39f4, #9e17f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.case-study-card .results-list li::after {
  content: '\2713';
  position: absolute;
  left: 4px;
  top: 5px;
  color: white;
  font-size: 12px;
  font-weight: bold;
}

/* ========================================
   LOCATIONS GRID ENHANCED
   ======================================== */

.locations-section {
  position: relative;
}

.province-group {
  position: relative;
  overflow: hidden;
}

.province-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #6b39f4, #9e17f1);
  transition: height 0.4s ease;
}

.province-group:hover::before {
  height: 100%;
}

/* ========================================
   SCROLL PROGRESS INDICATOR
   ======================================== */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #6b39f4, #9e17f1);
  z-index: 99999;
  transition: width 0.1s ease;
}

/* ========================================
   CURSOR EFFECTS (Desktop only)
   ======================================== */

@media (hover: hover) and (pointer: fine) {
  .custom-cursor {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid #6b39f4;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transition: transform 0.15s ease, border-color 0.3s ease;
    transform: translate(-50%, -50%);
  }

  .custom-cursor.hover {
    transform: translate(-50%, -50%) scale(1.5);
    border-color: #9e17f1;
    background: rgba(107, 57, 244, 0.1);
  }

  .custom-cursor-dot {
    position: fixed;
    width: 6px;
    height: 6px;
    background: #6b39f4;
    border-radius: 50%;
    pointer-events: none;
    z-index: 99999;
    transform: translate(-50%, -50%);
  }
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 991px) {
  .floating-decorations,
  .orb,
  .morph-blob,
  .float-circle {
    display: none;
  }

  .gradient-mesh-bg::before {
    opacity: 0.5;
  }

  .custom-cursor,
  .custom-cursor-dot {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .page-content img,
  .entry-content img,
  article img {
    border-radius: 12px !important;
    border-width: 2px !important;
  }

  .glass-panel {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .skeleton {
    animation: none;
    background: #f0f0f0;
  }
}

/* ========================================
   REDUCED MOTION PREFERENCES
   ======================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .floating-decorations,
  .orb,
  .morph-blob,
  .float-circle,
  .gradient-mesh-bg::before {
    animation: none !important;
  }
}
