/* Advanced Animations & Interactive Elements */

/* Simplified Particle Background Animation */
.particle-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  background: var(--secondary-color);
  border-radius: 50%;
  opacity: 0.08;
  animation: floatParticle 25s infinite linear;
}

.particle:nth-child(1) { width: 4px; height: 4px; left: 15%; animation-delay: 0s; }
.particle:nth-child(2) { width: 5px; height: 5px; left: 35%; animation-delay: 8s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 65%; animation-delay: 16s; }
.particle:nth-child(4) { width: 6px; height: 6px; left: 85%; animation-delay: 4s; }

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 0.1;
  }
  90% {
    opacity: 0.1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* Typewriter Effect */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--secondary-color);
  white-space: nowrap;
  animation: typewriter 4s steps(40, end), blink-caret 0.75s step-end infinite;
}

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

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--secondary-color); }
}

/* Simplified Morphing Background Shapes */
.morphing-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

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

.morph-shape {
  position: absolute;
  background: linear-gradient(45deg, rgba(10, 29, 46, 0.04), rgba(244, 196, 48, 0.04));
  border-radius: 50%;
  animation: morphing 20s ease-in-out infinite;
}

.morph-shape:nth-child(1) {
  width: 200px;
  height: 200px;
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.morph-shape:nth-child(2) {
  width: 150px;
  height: 150px;
  top: 60%;
  right: -30px;
  animation-delay: 8s;
}

@keyframes morphing {
  0%, 100% {
    border-radius: 50% 50% 50% 50%;
    transform: rotate(0deg) scale(1);
  }
  25% {
    border-radius: 60% 40% 60% 40%;
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    border-radius: 40% 60% 40% 60%;
    transform: rotate(180deg) scale(0.9);
  }
  75% {
    border-radius: 70% 30% 70% 30%;
    transform: rotate(270deg) scale(1.2);
  }
}

/* Enhanced Card Hover Effects */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

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

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

.card-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--secondary-color), transparent);
  animation: rotate-glow 3s linear infinite;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-glow:hover::before {
  opacity: 0.1;
}

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

@keyframes rotate-glow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Liquid Loading Animation */
.liquid-loader {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.liquid-loader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient);
  border-radius: 50%;
  animation: liquid 2s ease-in-out infinite;
}

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

/* Parallax Scrolling Elements */
.parallax-element {
  transition: transform 0.2s ease-out;
}

/* Enhanced Button Animations */
.btn-magnetic {
  transition: transform 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.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, height 0.6s;
}

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

/* Stagger Animation for Lists */
.stagger-fade-in {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s ease forwards;
}

.stagger-fade-in:nth-child(1) { animation-delay: 0.1s; }
.stagger-fade-in:nth-child(2) { animation-delay: 0.2s; }
.stagger-fade-in:nth-child(3) { animation-delay: 0.3s; }
.stagger-fade-in:nth-child(4) { animation-delay: 0.4s; }
.stagger-fade-in:nth-child(5) { animation-delay: 0.5s; }
.stagger-fade-in:nth-child(6) { animation-delay: 0.6s; }

/* Loading Skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

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

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--secondary-color);
  animation: text-reveal 2s ease forwards;
}

@keyframes text-reveal {
  0% { transform: translateX(0); }
  50% { transform: translateX(0); }
  100% { transform: translateX(100%); }
}

/* Image Hover Effects */
.image-container {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  cursor: pointer;
}

.image-zoom {
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.320, 1);
}

.image-container:hover .image-zoom {
  transform: scale(1.1);
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(21, 51, 87, 0.8), rgba(220, 178, 102, 0.8));
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  color: white;
  font-weight: 600;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

/* Gradient Animation */
.gradient-animate {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color), var(--accent-color));
  background-size: 300% 300%;
  animation: gradient-shift 6s ease infinite;
}

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

/* Bounce Animation */
.bounce-in {
  animation: bounceIn 1s ease;
}

@keyframes bounceIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  70% {
    transform: scale(0.9);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Slide and Fade Animations */
.slide-in-left {
  animation: slideInLeft 1s ease forwards;
}

.slide-in-right {
  animation: slideInRight 1s ease forwards;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale Animation */
.scale-in {
  animation: scaleIn 0.8s ease forwards;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Rotation Animation */
.rotate-in {
  animation: rotateIn 1s ease forwards;
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg);
  }
  to {
    opacity: 1;
    transform: rotate(0deg);
  }
}

/* Progress Bar Animation */
.progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(21, 51, 87, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: 2px;
  animation: progressFill 2s ease forwards;
  transform-origin: left;
}

@keyframes progressFill {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

/* Hover Lift Effect */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(21, 51, 87, 0.2);
}

/* Pulse Effect */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 178, 102, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(220, 178, 102, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(220, 178, 102, 0);
  }
}

/* Shake Animation */
.shake {
  animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Icon Animations */
.icon-spin {
  animation: spin 2s linear infinite;
}

.icon-bounce {
  animation: bounce 2s infinite;
}

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

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% { transform: translate3d(0,-4px,0); }
}