/**
 * Pixva.in - AI-Powered SaaS Portal
 * Custom Animations & Effects
 */

/* ===== NAV MENU - Unique Hover Effects ===== */
.nav-link {
  position: relative;
  overflow: hidden;
  padding: 0.5rem 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Sliding gradient underline - appears from center */
.nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899);
  transform: translateX(-50%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover::before {
  width: 100%;
}

/* Glow text effect on hover */
.nav-link:hover {
  color: #06b6d4 !important;
  text-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
  transform: translateY(-2px);
}

/* Magnetic-like subtle movement */
.nav-link:active {
  transform: scale(0.98);
}

/* Active nav link (current section) */
.nav-link.active {
  color: #06b6d4 !important;
}

.nav-link.active::before {
  width: 100%;
}

/* ===== Hero Typing/Cursor Effect ===== */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1em;
  background: linear-gradient(180deg, #06b6d4, #ec4899);
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* ===== Floating Orbs Background ===== */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  animation: floatOrb 20s ease-in-out infinite;
}

.floating-orb:nth-child(1) { animation-delay: 0s; }
.floating-orb:nth-child(2) { animation-delay: -5s; }
.floating-orb:nth-child(3) { animation-delay: -10s; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* ===== Hero Video Background ===== */
.hero-video-section {
  position: relative;
  background: #0f172a;
}

.hero-video-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.92) 0%,
    rgba(30, 58, 95, 0.85) 50%,
    rgba(15, 23, 42, 0.92) 100%
  );
  z-index: 1;
}

/* ===== Icon Hover Card - Smooth Background Animation ===== */
.icon-hover-card {
  position: relative;
  overflow: hidden;
}

.icon-hover-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.12) 0%,
    rgba(139, 92, 246, 0.12) 50%,
    rgba(236, 72, 153, 0.12) 100%
  );
  background-size: 200% 200%;
  background-position: 0% 0%;
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.34, 1.56, 0.64, 1), background-position 0.8s ease;
  z-index: 0;
}

.icon-hover-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.3),
    rgba(139, 92, 246, 0.3),
    rgba(236, 72, 153, 0.3),
    rgba(6, 182, 212, 0.3)
  );
  background-size: 300% 300%;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  animation: gradientShift 4s ease infinite;
}

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

.icon-hover-card:hover::before {
  opacity: 1;
  background-position: 100% 100%;
}

.icon-hover-card:hover::after {
  opacity: 1;
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.25), 0 0 60px rgba(139, 92, 246, 0.15);
}

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

/* ===== Icon Hover - Scale & Glow ===== */
.icon-hover-icon {
  display: inline-block;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.icon-hover-card:hover .icon-hover-icon {
  transform: scale(1.15);
  filter: drop-shadow(0 0 12px currentColor);
}

/* ===== Image Hover - Smooth Zoom & Overlay ===== */
.image-hover-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
}

.image-hover {
  transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.image-hover-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-hover-wrapper:hover .image-hover {
  transform: scale(1.05);
}

.image-hover-wrapper:hover::after {
  opacity: 1;
}

/* ===== Card Hover - 3D Tilt & Glow ===== */
.card-hover {
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.card-hover:hover {
  transform: translateY(-8px) rotateX(2deg);
  box-shadow: 0 25px 50px -12px rgba(6, 182, 212, 0.25),
              0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* ===== Gradient Border Animation ===== */
.gradient-border {
  position: relative;
  background: linear-gradient(#0f172a, #0f172a) padding-box,
              linear-gradient(135deg, #06b6d4, #8b5cf6, #ec4899, #06b6d4) border-box;
  border: 1px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
  animation: gradientRotate 8s linear infinite;
}

@keyframes gradientRotate {
  0% { --angle: 0deg; }
  100% { --angle: 360deg; }
}

/* ===== Process Step Connector Line ===== */
.process-line {
  position: relative;
}

.process-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, rgba(6, 182, 212, 0.5), transparent);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.process-step:hover .process-line::after {
  opacity: 1;
}

/* ===== Counter Number Animation ===== */
.counter-value {
  display: inline-block;
  transition: transform 0.3s ease;
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #8b5cf6, #ec4899);
  z-index: 9999;
  transform-origin: left;
  transition: transform 0.1s ease-out;
}

/* ===== Stagger Animation Delays ===== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* ===== Pulse Glow for CTA ===== */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(6, 182, 212, 0.3); }
  50% { box-shadow: 0 0 40px rgba(6, 182, 212, 0.6); }
}

/* ===== Text Reveal Animation ===== */
.text-reveal {
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  animation: textRevealUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes textRevealUp {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Mobile Menu Slide ===== */
.mobile-menu {
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  transform: translateX(0);
}

/* ===== Tech Stack Badge Hover ===== */
.tech-badge {
  transition: all 0.3s ease;
}

.tech-badge:hover {
  transform: scale(1.05);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
}

/* ===== Form Input Focus Glow ===== */
.input-glow:focus {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

/* ===== Nav Bar - Transparent at Top, Solid when Scrolled (Always Visible) ===== */
.nav-bar {
  background: transparent;
  border: none;
  backdrop-filter: none;
  transition: background 0.35s ease,
              backdrop-filter 0.35s ease,
              box-shadow 0.35s ease;
}

.nav-bar.scrolled {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

/* ===== Smooth Page Load ===== */
.page-load {
  animation: pageLoad 1s ease-out forwards;
}

@keyframes pageLoad {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== Mesh Gradient Background ===== */
.mesh-bg {
  background-image: 
    radial-gradient(at 40% 20%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
    radial-gradient(at 80% 0%, rgba(139, 92, 246, 0.1) 0px, transparent 50%),
    radial-gradient(at 0% 50%, rgba(236, 72, 153, 0.08) 0px, transparent 50%);
}
