/* ============================================
   ANIMATIONS.CSS - Motion & Visual Effects
   Keyframes, Parallax, Hover Effects
   ============================================ */

/* === PRELOADER === */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-preloader);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

@media (max-width:400px) {
  .preloader {
    margin: auto;
    width: 100%;
    height: 100%;
    text-align: center;
  }
}

.preloader-content {
  text-align: center;
}

.preloader-logo {
  width: 120px;
  height: 120px;
  margin: 0 auto var(--spacing-lg);
  animation: pulse-glow 2s ease-in-out infinite;
}



.preloader-text {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: var(--gradient-animated);
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 3s ease infinite;
}

.loading-bar {
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin: var(--spacing-lg) auto 0;
}

.loading-progress {
  height: 100%;
  background: var(--gradient-stage);
  border-radius: var(--border-radius-full);
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { width: 0%; }
  50% { width: 100%; }
  100% { width: 0%; }
}

@keyframes pulse-glow {
  0%, 100% {
    filter: drop-shadow(0 0 20px var(--color-cyan)) brightness(1);
    transform: scale(1);
  }
  50% {
    filter: drop-shadow(0 0 40px var(--color-red)) brightness(1.2);
    transform: scale(1.05);
  }
}

/* === HERO ANIMATIONS === */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--color-dark);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.hero-gradient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  animation: float-slow 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px;
  height: 500px;
  background: var(--color-cyan);
  top: -250px;
  left: -250px;
  animation-delay: 0s;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: var(--color-red);
  bottom: -200px;
  right: -200px;
  animation-delay: 5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: var(--color-yellow);
  top: 50%;
  right: 10%;
  animation-delay: 10s;
}

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

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

/* Animated Text Clip Effect */
.text-clip-animated {
  background: var(--gradient-animated);
  background-size: 400% 400%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-flow 8s ease infinite;
}

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

/* === FLOATING ANIMATION === */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
}

.float-element {
  animation: float 3s ease-in-out infinite;
}

/* === PARALLAX SCROLL EFFECT === */
.parallax-section {
  position: relative;
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

/* === 3D CARD TILT EFFECT === */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

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

.card-3d-inner {
  transform: translateZ(40px);
}

/* === GLITCH EFFECT (for headers) === */
.glitch {
  position: relative;
  animation: glitch-skew 3s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--color-red);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--color-cyan);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate;
}

@keyframes glitch-anim {
  0% { clip: rect(10px, 9999px, 50px, 0); transform: skew(0.3deg); }
  10% { clip: rect(70px, 9999px, 90px, 0); transform: skew(0.2deg); }
  20% { clip: rect(30px, 9999px, 60px, 0); transform: skew(0.1deg); }
  30% { clip: rect(90px, 9999px, 120px, 0); transform: skew(0.4deg); }
  40% { clip: rect(20px, 9999px, 40px, 0); transform: skew(0.2deg); }
  50% { clip: rect(60px, 9999px, 80px, 0); transform: skew(0.3deg); }
  60% { clip: rect(40px, 9999px, 70px, 0); transform: skew(0.1deg); }
  70% { clip: rect(80px, 9999px, 100px, 0); transform: skew(0.2deg); }
  80% { clip: rect(50px, 9999px, 90px, 0); transform: skew(0.4deg); }
  90% { clip: rect(10px, 9999px, 30px, 0); transform: skew(0.3deg); }
  100% { clip: rect(70px, 9999px, 110px, 0); transform: skew(0.2deg); }
}

@keyframes glitch-skew {
  0% { transform: skew(0deg); }
  10% { transform: skew(1deg); }
  20% { transform: skew(-1deg); }
  30% { transform: skew(0deg); }
  40% { transform: skew(-1deg); }
  50% { transform: skew(1deg); }
  60% { transform: skew(0deg); }
  70% { transform: skew(1deg); }
  80% { transform: skew(-1deg); }
  90% { transform: skew(0deg); }
  100% { transform: skew(0deg); }
}

/* === RIPPLE EFFECT === */
.ripple {
  position: relative;
  overflow: hidden;
}

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

.ripple:hover::before {
  width: 300px;
  height: 300px;
}

/* === FADE IN ANIMATIONS === */
.fade-in {
  animation: fadeIn 1s ease-in;
}

.fade-in-up {
  animation: fadeInUp 1s ease-out;
}

.fade-in-down {
  animation: fadeInDown 1s ease-out;
}

.fade-in-left {
  animation: fadeInLeft 1s ease-out;
}

.fade-in-right {
  animation: fadeInRight 1s ease-out;
}

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

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* === SCALE ANIMATIONS === */
.scale-in {
  animation: scaleIn 0.5s ease-out;
}

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

/* === ROTATE ANIMATION === */
.rotate-in {
  animation: rotateIn 1s ease-out;
}

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

/* === TYPING EFFECT === */
.typewriter {
  overflow: hidden;
  border-right: 3px solid var(--color-cyan);
  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: var(--color-cyan); }
}

/* === HOVER LIFT EFFECT === */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

/* === SHIMMER EFFECT === */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* === PULSE ANIMATION === */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* === BOUNCE ANIMATION === */
.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-25%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

/* === STAGGER ANIMATION FOR LISTS === */
.stagger-item {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

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

/* === NEON GLOW EFFECT === */
.neon-glow {
  text-shadow:
    0 0 5px var(--color-cyan),
    0 0 10px var(--color-cyan),
    0 0 20px var(--color-cyan),
    0 0 40px var(--color-cyan);
  animation: neon-flicker 3s infinite alternate;
}

@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow:
      0 0 5px var(--color-cyan),
      0 0 10px var(--color-cyan),
      0 0 20px var(--color-cyan),
      0 0 40px var(--color-cyan);
  }
  20%, 24%, 55% {
    text-shadow: none;
  }
}

/* === BORDER GLOW ANIMATION === */
.border-glow {
  position: relative;
  border: 2px solid transparent;
  background: linear-gradient(var(--color-darker), var(--color-darker)) padding-box,
              var(--gradient-stage) border-box;
  animation: border-rotate 3s linear infinite;
}

@keyframes border-rotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}
/* ============================================
   END OF ANIMATIONS.CSS
   ============================================ */
