/*--------------------------------------------------------------
# Animation Styles
--------------------------------------------------------------*/

/* Fade Animations
-------------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

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

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

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

/* Scale Animations
-------------------------------------------------------------- */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.9);
  }
}

/* Pulse Animation
-------------------------------------------------------------- */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
  }
}

/* Slide Animations
-------------------------------------------------------------- */
@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Typewriter Effect
-------------------------------------------------------------- */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blinkCursor {
  from {
    border-right-color: var(--color-primary);
  }
  to {
    border-right-color: transparent;
  }
}

/* Parallax Animation for Backgrounds
-------------------------------------------------------------- */
@keyframes backgroundParallax {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}

/* Count Animation
-------------------------------------------------------------- */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Gradient Animation
-------------------------------------------------------------- */
@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Rotate Animation
-------------------------------------------------------------- */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake Animation
-------------------------------------------------------------- */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Bounce Animation
-------------------------------------------------------------- */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-20px);
  }
  60% {
    transform: translateY(-10px);
  }
}

/* Utility Classes For Animations
-------------------------------------------------------------- */
.animate {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.animate-delay-100 {
  animation-delay: 0.1s;
}

.animate-delay-200 {
  animation-delay: 0.2s;
}

.animate-delay-300 {
  animation-delay: 0.3s;
}

.animate-delay-400 {
  animation-delay: 0.4s;
}

.animate-delay-500 {
  animation-delay: 0.5s;
}

.animate-infinite {
  animation-iteration-count: infinite;
}

.fade-in {
  animation-name: fadeIn;
}

.fade-in-up {
  animation-name: fadeInUp;
}

.fade-in-down {
  animation-name: fadeInDown;
}

.fade-in-left {
  animation-name: fadeInLeft;
}

.fade-in-right {
  animation-name: fadeInRight;
}

.scale-in {
  animation-name: scaleIn;
}

.pulse {
  animation-name: pulse;
  animation-iteration-count: infinite;
  animation-duration: 2s;
}

.typewriter {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid var(--color-primary);
  animation: 
    typewriter 4s steps(40) 1s forwards,
    blinkCursor 0.75s step-end infinite;
  width: 0;
  max-width: 100%;
  color: var(--color-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.2;
}

.gradient-animate {
  background-size: 400% 400% !important;
  animation: gradientFlow 15s ease infinite !important;
}

.rotate {
  animation: rotate 2s linear infinite;
}

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

.bounce {
  animation: bounce 2s ease infinite;
}

/* Intersection Observer Animation Classes
   (These will be toggled by JS when elements enter viewport)
-------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-in-out;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.6s ease-in-out;
}

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

.reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.6s ease-in-out;
}

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

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.6s ease-in-out;
}

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

/* Media Query for Mobile Animations
-------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 767px) {
  .typewriter {
    font-size: 2rem;
  }
}

/* Fade In Animations
-------------------------------------------------------------- */
.fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease forwards;
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
  opacity: 0;
  animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
  opacity: 0;
  animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
  opacity: 0;
  animation: fadeInRight 0.8s ease forwards;
}

/* Animation Delays
-------------------------------------------------------------- */
.delay-1 {
  animation-delay: 0.2s;
}

.delay-2 {
  animation-delay: 0.4s;
}

.delay-3 {
  animation-delay: 0.6s;
}

.delay-4 {
  animation-delay: 0.8s;
}

.delay-5 {
  animation-delay: 1s;
}

/* Scroll-triggered Animations
-------------------------------------------------------------- */
[data-aos] {
  opacity: 0;
  transition: all 0.8s ease;
}

.animated {
  opacity: 1;
}

.animated.fade-up {
  transform: translateY(0);
}

.animated.fade-down {
  transform: translateY(0);
}

.animated.fade-left {
  transform: translateX(0);
}

.animated.fade-right {
  transform: translateX(0);
}

.animated.zoom-in {
  transform: scale(1);
}

[data-aos="fade-up"] {
  transform: translateY(30px);
}

[data-aos="fade-down"] {
  transform: translateY(-30px);
}

[data-aos="fade-left"] {
  transform: translateX(-30px);
}

[data-aos="fade-right"] {
  transform: translateX(30px);
}

[data-aos="zoom-in"] {
  transform: scale(0.9);
}

/* Hover Animations
-------------------------------------------------------------- */
.btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

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

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

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

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(131, 66, 229, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(131, 66, 229, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(131, 66, 229, 0);
  }
}

/* Spinner Animation
-------------------------------------------------------------- */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

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

/* Form Success Animation
-------------------------------------------------------------- */
.form-success {
  text-align: center;
  padding: var(--spacing-lg);
  animation: scaleIn 0.5s ease forwards;
}

.success-icon {
  font-size: 3rem;
  color: #28a745;
  margin-bottom: var(--spacing-md);
}

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