/**
 * ID Shipping - Advanced Animations
 * Modern hover effects, transitions and micro-interactions
 */

/* ========================================
   1. ADVANCED HERO ANIMATIONS
   ======================================== */

/* Animated Gradient Background */
.hero-animated-bg {
  background: linear-gradient(-45deg, #001F3F, #0066CC, #00D4FF, #004C99);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

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

/* Floating Particles Effect */
.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-particles::before,
.hero-particles::after {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.15) 0%, transparent 70%);
  animation: floatParticle 20s ease-in-out infinite;
}

.hero-particles::before {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.hero-particles::after {
  bottom: 20%;
  right: 15%;
  width: 200px;
  height: 200px;
  animation-delay: -10s;
}

@keyframes floatParticle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.5;
  }
  25% {
    transform: translate(50px, -30px) scale(1.1);
    opacity: 0.7;
  }
  50% {
    transform: translate(20px, 50px) scale(0.9);
    opacity: 0.4;
  }
  75% {
    transform: translate(-30px, 20px) scale(1.05);
    opacity: 0.6;
  }
}

/* Hero Title Animation */
.hero-title-animated {
  display: block;
  position: relative;
}

.hero-title-animated .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(50px);
  animation: wordReveal 0.8s ease forwards;
}

.hero-title-animated .word:nth-child(1) { animation-delay: 0.1s; }
.hero-title-animated .word:nth-child(2) { animation-delay: 0.15s; }
.hero-title-animated .word:nth-child(3) { animation-delay: 0.2s; }
.hero-title-animated .word:nth-child(4) { animation-delay: 0.25s; }
.hero-title-animated .word:nth-child(5) { animation-delay: 0.3s; }
.hero-title-animated .word:nth-child(6) { animation-delay: 0.35s; }
.hero-title-animated .word:nth-child(7) { animation-delay: 0.4s; }
.hero-title-animated .word:nth-child(8) { animation-delay: 0.45s; }
.hero-title-animated .word:nth-child(9) { animation-delay: 0.5s; }
.hero-title-animated .word:nth-child(10) { animation-delay: 0.55s; }
.hero-title-animated .word:nth-child(11) { animation-delay: 0.6s; }
.hero-title-animated .word:nth-child(12) { animation-delay: 0.65s; }

@keyframes wordReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Typing Effect for Subtitle */
.typing-effect {
  border-right: 2px solid var(--accent);
  white-space: nowrap;
  overflow: hidden;
  animation: typing 3s steps(40) forwards, blinkCursor 0.75s step-end infinite;
}

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

@keyframes blinkCursor {
  50% { border-color: transparent; }
}

/* Scroll Indicator Pulse */
.scroll-indicator-animated {
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(10px);
    opacity: 0.5;
  }
}

/* ========================================
   2. CARD HOVER EFFECTS
   ======================================== */

/* 3D Card Tilt Effect */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

.card-3d:hover {
  transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

/* Card Shine Effect */
.card-shine {
  position: relative;
  overflow: hidden;
}

.card-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s ease;
}

.card-shine:hover::before {
  transform: translateX(100%) rotate(45deg);
}

/* Glow Effect */
.card-glow {
  transition: box-shadow 0.3s ease;
}

.card-glow:hover {
  box-shadow: 
    0 0 20px rgba(0, 102, 204, 0.3),
    0 0 40px rgba(0, 102, 204, 0.2),
    0 0 60px rgba(0, 102, 204, 0.1);
}

/* Border Animation */
.card-border-animate {
  position: relative;
  background: var(--white);
  z-index: 1;
}

.card-border-animate::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 200%;
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  animation: borderGradient 3s ease infinite;
}

.card-border-animate:hover::before {
  opacity: 1;
}

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

/* ========================================
   3. BUTTON EFFECTS
   ======================================== */

/* Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:hover::after {
  width: 300px;
  height: 300px;
}

/* Magnetic Button Effect */
.btn-magnetic {
  transition: transform 0.3s ease;
}

/* Gradient Slide */
.btn-gradient-slide {
  position: relative;
  background: var(--primary);
  z-index: 1;
  overflow: hidden;
}

.btn-gradient-slide::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: left 0.4s ease;
  z-index: -1;
}

.btn-gradient-slide:hover::before {
  left: 0;
}

/* Icon Slide Effect */
.btn-icon-slide i {
  transition: transform 0.3s ease;
}

.btn-icon-slide:hover i {
  transform: translateX(5px);
}

/* ========================================
   4. IMAGE EFFECTS
   ======================================== */

/* Zoom with Overlay */
.img-zoom-overlay {
  position: relative;
  overflow: hidden;
}

.img-zoom-overlay img {
  transition: transform 0.5s ease;
}

.img-zoom-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.7) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.img-zoom-overlay:hover img {
  transform: scale(1.1);
}

.img-zoom-overlay:hover::after {
  opacity: 1;
}

/* Parallax Image */
.img-parallax {
  overflow: hidden;
}

.img-parallax img {
  transition: transform 0.1s ease-out;
}

/* Ken Burns Effect */
.img-ken-burns {
  overflow: hidden;
}

.img-ken-burns img {
  animation: kenBurns 20s ease infinite alternate;
}

@keyframes kenBurns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.2) translate(-5%, -5%);
  }
}

/* ========================================
   5. TEXT EFFECTS
   ======================================== */

/* Gradient Text */
.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Underline Animation */
.text-underline-animate {
  position: relative;
  display: inline-block;
}

.text-underline-animate::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.text-underline-animate:hover::after {
  width: 100%;
}

/* Character Reveal */
.text-reveal {
  display: inline-block;
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  animation: charReveal 0.5s ease forwards;
}

@keyframes charReveal {
  to {
    transform: translateY(0);
  }
}

/* ========================================
   6. ICON EFFECTS
   ======================================== */

/* Icon Bounce */
.icon-bounce {
  transition: transform 0.3s ease;
}

.icon-bounce:hover {
  animation: iconBounce 0.5s ease;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  25% { transform: translateY(-10px); }
  50% { transform: translateY(-5px); }
  75% { transform: translateY(-8px); }
}

/* Icon Rotate */
.icon-rotate {
  transition: transform 0.3s ease;
}

.icon-rotate:hover {
  transform: rotate(360deg);
}

/* Icon Pulse */
.icon-pulse {
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* ========================================
   7. SCROLL ANIMATIONS
   ======================================== */

/* Stagger Animation Classes */
.stagger-item {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.stagger-item.active {
  opacity: 1;
  transform: translateY(0);
}

.stagger-item:nth-child(1) { transition-delay: 0.1s; }
.stagger-item:nth-child(2) { transition-delay: 0.2s; }
.stagger-item:nth-child(3) { transition-delay: 0.3s; }
.stagger-item:nth-child(4) { transition-delay: 0.4s; }
.stagger-item:nth-child(5) { transition-delay: 0.5s; }
.stagger-item:nth-child(6) { transition-delay: 0.6s; }
.stagger-item:nth-child(7) { transition-delay: 0.7s; }
.stagger-item:nth-child(8) { transition-delay: 0.8s; }

/* Zoom In */
.reveal-zoom {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease;
}

.reveal-zoom.active {
  opacity: 1;
  transform: scale(1);
}

/* Slide from Left */
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.6s ease;
}

.reveal-left.active {
  opacity: 1;
  transform: translateX(0);
}

/* Slide from Right */
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.6s ease;
}

.reveal-right.active {
  opacity: 1;
  transform: translateX(0);
}

/* Flip In */
.reveal-flip {
  opacity: 0;
  transform: perspective(1000px) rotateY(-90deg);
  transition: all 0.6s ease;
}

.reveal-flip.active {
  opacity: 1;
  transform: perspective(1000px) rotateY(0);
}

/* ========================================
   8. NAVBAR EFFECTS
   ======================================== */

/* Dropdown Slide */
.dropdown-menu-animated {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: block !important;
  visibility: hidden;
}

.dropdown:hover .dropdown-menu-animated {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

/* Menu Item Underline */
.nav-link-animated {
  position: relative;
}

.nav-link-animated::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

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

/* ========================================
   9. LOADING ANIMATIONS
   ======================================== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
}

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

/* Spinner Dots */
.spinner-dots {
  display: flex;
  gap: 8px;
}

.spinner-dots span {
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
  animation: spinnerDots 1.4s ease-in-out infinite;
}

.spinner-dots span:nth-child(1) { animation-delay: 0s; }
.spinner-dots span:nth-child(2) { animation-delay: 0.2s; }
.spinner-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes spinnerDots {
  0%, 100% { transform: scale(0.5); opacity: 0.5; }
  50% { transform: scale(1); opacity: 1; }
}

/* ========================================
   10. SOCIAL ICON EFFECTS
   ======================================== */

.social-icon-animated {
  transition: all 0.3s ease;
}

.social-icon-animated:hover {
  transform: translateY(-5px) rotate(5deg);
}

/* Social Icon Specific Colors */
.social-icon-linkedin:hover { background: #0077B5 !important; color: white !important; }
.social-icon-facebook:hover { background: #1877F2 !important; color: white !important; }
.social-icon-instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888) !important; color: white !important; }
.social-icon-twitter:hover { background: #1DA1F2 !important; color: white !important; }

/* ========================================
   11. COUNTER ANIMATION
   ======================================== */

.counter-animated {
  font-variant-numeric: tabular-nums;
}

/* ========================================
   12. FORM EFFECTS
   ======================================== */

.input-animated {
  position: relative;
}

.input-animated input,
.input-animated textarea {
  border: 2px solid var(--gray-200);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-animated input:focus,
.input-animated textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  outline: none;
}

.input-animated label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  padding: 0 5px;
  color: var(--gray-500);
  transition: all 0.3s ease;
  pointer-events: none;
}

.input-animated input:focus + label,
.input-animated input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 12px;
  color: var(--primary);
}
