/* ========================================
   ADVANCED MODERN ENHANCEMENTS
   Premium UI/UX Features
   ======================================== */

/* Animated Background Particles */
.particles-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: rgba(0, 85, 164, 0.1);
  border-radius: 50%;
  animation: floatParticle 20s infinite linear;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 25s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 20s; }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 28s; }
.particle:nth-child(4) { left: 40%; animation-delay: 0s; animation-duration: 22s; }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 26s; }
.particle:nth-child(6) { left: 60%; animation-delay: 1s; animation-duration: 24s; }
.particle:nth-child(7) { left: 70%; animation-delay: 5s; animation-duration: 21s; }
.particle:nth-child(8) { left: 80%; animation-delay: 2s; animation-duration: 27s; }
.particle:nth-child(9) { left: 90%; animation-delay: 4s; animation-duration: 23s; }

@keyframes floatParticle {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100vh) scale(1.5);
    opacity: 0;
  }
}

/* Magnetic Button Effect */
.btn-magnetic {
  position: relative;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-magnetic::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-magnetic:hover::before {
  width: 300px;
  height: 300px;
}

/* Text Reveal Animation */
.text-reveal {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.text-reveal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #003366, #0055a4);
  animation: textReveal 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transform-origin: left;
}

@keyframes textReveal {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

/* Morphing Blob Background */
.blob-bg {
  position: absolute;
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.1), rgba(0, 85, 164, 0.1));
  border-radius: 50%;
  filter: blur(80px);
  animation: morphBlob 20s ease-in-out infinite;
  z-index: 0;
}

@keyframes morphBlob {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    transform: translate(50px, -50px) rotate(90deg);
  }
  50% {
    border-radius: 50% 60% 30% 60% / 30% 40% 70% 60%;
    transform: translate(-30px, 30px) rotate(180deg);
  }
  75% {
    border-radius: 40% 60% 70% 30% / 60% 40% 60% 30%;
    transform: translate(20px, -20px) rotate(270deg);
  }
}

/* 3D Card Flip Effect */
.card-3d {
  perspective: 1000px;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.card-3d:hover {
  transform: rotateY(10deg) rotateX(10deg);
}

/* Gradient Border Animation */
.gradient-border-animated {
  position: relative;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.gradient-border-animated::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  background: linear-gradient(45deg, #003366, #0055a4, #0077cc, #0055a4, #003366);
  background-size: 400% 400%;
  border-radius: inherit;
  z-index: -1;
  animation: gradientBorder 3s ease infinite;
}

@keyframes gradientBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Typing Effect */
.typing-effect {
  overflow: hidden;
  border-right: 3px solid #0055a4;
  white-space: nowrap;
  animation: typing 3.5s steps(40, end), 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: #0055a4; }
}

/* Parallax Layers */
.parallax-layer {
  transition: transform 0.3s ease-out;
}

.parallax-layer-deep {
  transition: transform 0.5s ease-out;
}

/* Neon Glow Effect */
.neon-glow {
  text-shadow: 
    0 0 10px rgba(0, 85, 164, 0.8),
    0 0 20px rgba(0, 85, 164, 0.6),
    0 0 30px rgba(0, 85, 164, 0.4),
    0 0 40px rgba(0, 85, 164, 0.2);
  animation: neonPulse 2s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  from {
    text-shadow: 
      0 0 10px rgba(0, 85, 164, 0.8),
      0 0 20px rgba(0, 85, 164, 0.6),
      0 0 30px rgba(0, 85, 164, 0.4);
  }
  to {
    text-shadow: 
      0 0 20px rgba(0, 85, 164, 1),
      0 0 30px rgba(0, 85, 164, 0.8),
      0 0 40px rgba(0, 85, 164, 0.6),
      0 0 50px rgba(0, 85, 164, 0.4);
  }
}

/* Liquid Fill Button */
.btn-liquid {
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-liquid::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0;
  background: linear-gradient(135deg, #0055a4, #0077cc);
  transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  border-radius: 50% 50% 0 0;
}

.btn-liquid:hover::before {
  height: 180%;
}

/* Scroll-Triggered Counter Animation */
.counter-animate {
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.counter-animate.visible {
  opacity: 1;
  transform: scale(1);
}

/* Holographic Effect */
.holographic {
  background: linear-gradient(
    135deg,
    rgba(255, 0, 0, 0.1) 0%,
    rgba(255, 154, 0, 0.1) 10%,
    rgba(208, 222, 33, 0.1) 20%,
    rgba(79, 220, 74, 0.1) 30%,
    rgba(63, 218, 216, 0.1) 40%,
    rgba(47, 201, 255, 0.1) 50%,
    rgba(28, 127, 255, 0.1) 60%,
    rgba(95, 21, 242, 0.1) 70%,
    rgba(186, 12, 248, 0.1) 80%,
    rgba(251, 7, 217, 0.1) 90%,
    rgba(255, 0, 0, 0.1) 100%
  );
  background-size: 200% 200%;
  animation: holographicShift 3s ease infinite;
}

@keyframes holographicShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Wave Animation */
.wave-container {
  position: relative;
  overflow: hidden;
}

.wave {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 200%;
  height: 100px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%230055a4' fill-opacity='0.1' d='M0,160L48,154.7C96,149,192,139,288,149.3C384,160,480,192,576,197.3C672,203,768,181,864,154.7C960,128,1056,96,1152,101.3C1248,107,1344,149,1392,170.7L1440,192L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 50% 100%;
  animation: waveMove 10s linear infinite;
}

.wave:nth-child(2) {
  animation-delay: -5s;
  opacity: 0.5;
}

@keyframes waveMove {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Rotating Border */
.rotating-border {
  position: relative;
}

.rotating-border::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: conic-gradient(from 0deg, #003366, #0055a4, #0077cc, #0055a4, #003366);
  border-radius: inherit;
  animation: rotateBorder 3s linear infinite;
  z-index: -1;
}

@keyframes rotateBorder {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Staggered Grid Animation */
.grid-stagger > * {
  opacity: 0;
  transform: translateY(30px);
  animation: staggerFadeIn 0.6s ease forwards;
}

.grid-stagger > *:nth-child(1) { animation-delay: 0.1s; }
.grid-stagger > *:nth-child(2) { animation-delay: 0.2s; }
.grid-stagger > *:nth-child(3) { animation-delay: 0.3s; }
.grid-stagger > *:nth-child(4) { animation-delay: 0.4s; }
.grid-stagger > *:nth-child(5) { animation-delay: 0.5s; }
.grid-stagger > *:nth-child(6) { animation-delay: 0.6s; }
.grid-stagger > *:nth-child(7) { animation-delay: 0.7s; }
.grid-stagger > *:nth-child(8) { animation-delay: 0.8s; }

@keyframes staggerFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 3D Text Shadow */
.text-3d {
  text-shadow: 
    1px 1px 0 rgba(0, 51, 102, 0.4),
    2px 2px 0 rgba(0, 51, 102, 0.3),
    3px 3px 0 rgba(0, 51, 102, 0.2),
    4px 4px 0 rgba(0, 51, 102, 0.1),
    5px 5px 10px rgba(0, 0, 0, 0.2);
}

/* Kinetic Typography */
.kinetic-text {
  display: inline-block;
  animation: kineticMove 2s ease-in-out infinite;
}

@keyframes kineticMove {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-5px) rotate(-2deg); }
  75% { transform: translateY(5px) rotate(2deg); }
}

/* Aurora Background */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background: 
    radial-gradient(ellipse at 20% 50%, rgba(0, 51, 102, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(0, 85, 164, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 119, 204, 0.08) 0%, transparent 50%);
  animation: auroraMove 15s ease-in-out infinite alternate;
}

@keyframes auroraMove {
  0% {
    background-position: 0% 0%, 100% 100%, 50% 50%;
  }
  100% {
    background-position: 100% 100%, 0% 0%, 75% 25%;
  }
}

/* Interactive Cursor Trail */
.cursor-trail {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 85, 164, 0.3), transparent);
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.1s;
  mix-blend-mode: screen;
}

/* Premium Card Hover */
.premium-card {
  position: relative;
  overflow: hidden;
}

.premium-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.premium-card:hover::before {
  opacity: 1;
}

/* Animated Underline */
.underline-animated {
  position: relative;
  display: inline-block;
}

.underline-animated::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #003366, #0055a4);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.underline-animated:hover::after {
  width: 100%;
}

/* Glowing Border Pulse */
.glow-pulse {
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 85, 164, 0.3);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 85, 164, 0.6), 0 0 60px rgba(0, 85, 164, 0.3);
  }
}

/* Morphing Shape Background */
.morph-shape {
  position: absolute;
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, rgba(0, 51, 102, 0.05), rgba(0, 85, 164, 0.05));
  animation: morphShape 15s ease-in-out infinite;
  z-index: 0;
}

@keyframes morphShape {
  0%, 100% {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transform: rotate(0deg) scale(1);
  }
  33% {
    border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    transform: rotate(120deg) scale(1.1);
  }
  66% {
    border-radius: 50% 60% 30% 60% / 30% 40% 70% 60%;
    transform: rotate(240deg) scale(0.9);
  }
}

/* Smooth Page Transitions */
.page-transition {
  animation: pageEnter 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes pageEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Floating Label Input */
.input-floating {
  position: relative;
}

.input-floating label {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
  pointer-events: none;
  background: white;
  padding: 0 5px;
}

.input-floating input:focus + label,
.input-floating input:not(:placeholder-shown) + label {
  top: 0;
  font-size: 0.75rem;
  color: #0055a4;
}

/* Ribbon Badge */
.ribbon {
  position: absolute;
  top: 20px;
  right: -35px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #003366, #0055a4);
  color: white;
  padding: 8px 40px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Spotlight Effect */
.spotlight {
  position: relative;
  overflow: hidden;
}

.spotlight::before {
  content: '';
  position: absolute;
  top: var(--y, 50%);
  left: var(--x, 50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 85, 164, 0.15), transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.spotlight:hover::before {
  opacity: 1;
}
