/* Title Animations CSS */

/* Base animate-title class */
.animate-title {
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timing-function: ease-in-out;
}

/* Fade In Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.animate-title[data-animation="fadeIn"] {
  animation-name: fadeIn;
}

/* Slide In Left Animation */
@keyframes slideInLeft {
  from {
    transform: translate3d(-100%, 0, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate-title[data-animation="slideInLeft"] {
  animation-name: slideInLeft;
}

/* Slide In Right Animation */
@keyframes slideInRight {
  from {
    transform: translate3d(100%, 0, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate-title[data-animation="slideInRight"] {
  animation-name: slideInRight;
}

/* Slide In Up Animation */
@keyframes slideInUp {
  from {
    transform: translate3d(0, 100%, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate-title[data-animation="slideInUp"] {
  animation-name: slideInUp;
}

/* Slide In Down Animation */
@keyframes slideInDown {
  from {
    transform: translate3d(0, -100%, 0);
    opacity: 0;
  }
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate-title[data-animation="slideInDown"] {
  animation-name: slideInDown;
}

/* Zoom In Animation */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}
.animate-title[data-animation="zoomIn"] {
  animation-name: zoomIn;
}

/* Bounce In Animation */
@keyframes bounceIn {
  from,
  20%,
  40%,
  60%,
  80%,
  to {
    animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
  }
  0% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  20% {
    transform: scale3d(1.1, 1.1, 1.1);
  }
  40% {
    transform: scale3d(0.9, 0.9, 0.9);
  }
  60% {
    opacity: 1;
    transform: scale3d(1.03, 1.03, 1.03);
  }
  80% {
    transform: scale3d(0.97, 0.97, 0.97);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}
.animate-title[data-animation="bounceIn"] {
  animation-name: bounceIn;
  animation-duration: 0.75s;
}

/* Flip In X Animation */
@keyframes flipInX {
  from {
    transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}
.animate-title[data-animation="flipInX"] {
  animation-name: flipInX;
  backface-visibility: visible !important;
}

/* Flip In Y Animation */
@keyframes flipInY {
  from {
    transform: perspective(400px) rotate3d(0, 1, 0, 90deg);
    animation-timing-function: ease-in;
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotate3d(0, 1, 0, -20deg);
    animation-timing-function: ease-in;
  }
  60% {
    transform: perspective(400px) rotate3d(0, 1, 0, 10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotate3d(0, 1, 0, -5deg);
  }
  to {
    transform: perspective(400px);
  }
}
.animate-title[data-animation="flipInY"] {
  animation-name: flipInY;
  backface-visibility: visible !important;
}

/* Rotate In Animation */
@keyframes rotateIn {
  from {
    transform-origin: center;
    transform: rotate3d(0, 0, 1, -200deg);
    opacity: 0;
  }
  to {
    transform-origin: center;
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}
.animate-title[data-animation="rotateIn"] {
  animation-name: rotateIn;
}

/* Pulse Animation */
@keyframes pulse {
  from {
    transform: scale3d(1, 1, 1);
  }
  50% {
    transform: scale3d(1.05, 1.05, 1.05);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}
.animate-title[data-animation="pulse"] {
  animation-name: pulse;
  animation-iteration-count: infinite;
  animation-duration: 2s;
}

/* Shake Animation */
@keyframes shake {
  from,
  to {
    transform: translate3d(0, 0, 0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translate3d(-10px, 0, 0);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translate3d(10px, 0, 0);
  }
}
.animate-title[data-animation="shake"] {
  animation-name: shake;
  animation-duration: 0.8s;
}

/* Tada Animation */
@keyframes tada {
  from {
    transform: scale3d(1, 1, 1);
  }
  10%,
  20% {
    transform: scale3d(0.9, 0.9, 0.9) rotate3d(0, 0, 1, -3deg);
  }
  30%,
  50%,
  70%,
  90% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg);
  }
  40%,
  60%,
  80% {
    transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg);
  }
  to {
    transform: scale3d(1, 1, 1);
  }
}
.animate-title[data-animation="tada"] {
  animation-name: tada;
  animation-duration: 1.2s;
}

/* Typewriter Animation */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Typewriter cursor animation */
@keyframes blink-cursor {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: currentColor;
  }
}

.animate-title[data-animation="typewriter"] {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid;
  animation: blink-cursor 1s infinite;
}

/* Ensure typewriter content preserves formatting */
.animate-title[data-animation="typewriter"] * {
  display: inline;
  white-space: nowrap;
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .animate-title {
    animation-duration: 0.8s;
  }
  
  .animate-title[data-animation="typewriter"] {
    animation-duration: 2s;
  }
}

/* Performance optimizations */
.animate-title {
  will-change: transform, opacity;
  transform: translateZ(0);
}