/* ===== ANIMATIONS CSS ===== */

/* ===== FADE ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

.fade-out {
  animation: fadeOut 0.3s ease-in;
}

/* ===== SLIDE ANIMATIONS ===== */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

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

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

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

.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

.slide-in-left {
  animation: slideInLeft 0.3s ease-out;
}

.slide-in-up {
  animation: slideInUp 0.3s ease-out;
}

.slide-in-down {
  animation: slideInDown 0.3s ease-out;
}

.slide-out-up {
  animation: slideOutUp 0.3s ease-in;
}

.slide-out-down {
  animation: slideOutDown 0.3s ease-in;
}

/* ===== BOUNCE ANIMATIONS ===== */
@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
  70% {
    transform: scale(0.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes bounceOut {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  30% {
    opacity: 1;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(0.3);
  }
}

.bounce-in {
  animation: bounceIn 0.5s ease-out;
}

.bounce-out {
  animation: bounceOut 0.3s ease-in;
}

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

.shake {
  animation: shake 0.5s ease-in-out;
}

/* ===== PULSE ANIMATIONS ===== */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0);
  }
}

.pulse {
  animation: pulse 1s infinite;
}

.pulse-glow {
  animation: pulseGlow 2s infinite;
}

/* ===== SPIN ANIMATIONS ===== */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

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

.spin {
  animation: spin 1s linear infinite;
}

.spin-reverse {
  animation: spinReverse 1s linear infinite;
}

/* ===== WOBBLE ANIMATIONS ===== */
@keyframes wobble {
  0% {
    transform: translateX(0%);
  }
  15% {
    transform: translateX(-25%) rotate(-5deg);
  }
  30% {
    transform: translateX(20%) rotate(3deg);
  }
  45% {
    transform: translateX(-15%) rotate(-3deg);
  }
  60% {
    transform: translateX(10%) rotate(2deg);
  }
  75% {
    transform: translateX(-5%) rotate(-1deg);
  }
  100% {
    transform: translateX(0%);
  }
}

.wobble {
  animation: wobble 1s ease-in-out;
}

/* ===== RUBBER BAND ANIMATION ===== */
@keyframes rubberBand {
  0% {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}

.rubber-band {
  animation: rubberBand 1s ease-in-out;
}

/* ===== JELLO ANIMATION ===== */
@keyframes jello {
  0%, 100% {
    transform: scale3d(1, 1, 1);
  }
  30% {
    transform: scale3d(1.25, 0.75, 1);
  }
  40% {
    transform: scale3d(0.75, 1.25, 1);
  }
  50% {
    transform: scale3d(1.15, 0.85, 1);
  }
  65% {
    transform: scale3d(0.95, 1.05, 1);
  }
  75% {
    transform: scale3d(1.05, 0.95, 1);
  }
  90% {
    transform: scale3d(0.98, 1.02, 1);
  }
  100% {
    transform: scale3d(1, 1, 1);
  }
}

.jello {
  animation: jello 1s ease-in-out;
}

/* ===== FLIP ANIMATIONS ===== */
@keyframes flipInX {
  0% {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }
  40% {
    transform: perspective(400px) rotateX(-20deg);
  }
  60% {
    transform: perspective(400px) rotateX(10deg);
    opacity: 1;
  }
  80% {
    transform: perspective(400px) rotateX(-5deg);
  }
  100% {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
}

@keyframes flipOutX {
  0% {
    transform: perspective(400px) rotateX(0deg);
    opacity: 1;
  }
  100% {
    transform: perspective(400px) rotateX(90deg);
    opacity: 0;
  }
}

.flip-in-x {
  animation: flipInX 0.6s ease-out;
}

.flip-out-x {
  animation: flipOutX 0.6s ease-in;
}

/* ===== ZOOM ANIMATIONS ===== */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  50% {
    opacity: 1;
  }
}

@keyframes zoomOut {
  from {
    opacity: 1;
  }
  50% {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  to {
    opacity: 0;
  }
}

@keyframes zoomInUp {
  from {
    opacity: 0;
    transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0);
    animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  }
  60% {
    opacity: 1;
    transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0);
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
}

.zoom-in {
  animation: zoomIn 0.6s ease-out;
}

.zoom-out {
  animation: zoomOut 0.6s ease-in;
}

.zoom-in-up {
  animation: zoomInUp 0.6s ease-out;
}

/* ===== ROLL ANIMATIONS ===== */
@keyframes rollIn {
  0% {
    opacity: 0;
    transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes rollOut {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg);
  }
}

.roll-in {
  animation: rollIn 0.6s ease-out;
}

.roll-out {
  animation: rollOut 0.6s ease-in;
}

/* ===== LIGHT SPEED ANIMATIONS ===== */
@keyframes lightSpeedIn {
  0% {
    transform: translate3d(100%, 0, 0) skewX(-30deg);
    opacity: 0;
  }
  60% {
    transform: skewX(20deg);
    opacity: 1;
  }
  80% {
    transform: skewX(-5deg);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

@keyframes lightSpeedOut {
  0% {
    opacity: 1;
  }
  100% {
    transform: translate3d(100%, 0, 0) skewX(30deg);
    opacity: 0;
  }
}

.light-speed-in {
  animation: lightSpeedIn 0.6s ease-out;
}

.light-speed-out {
  animation: lightSpeedOut 0.6s ease-in;
}

/* ===== SPECIAL ANIMATIONS ===== */
@keyframes heartbeat {
  0% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.3);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(1);
  }
}

.heartbeat {
  animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes flash {
  0%, 50%, 100% {
    opacity: 1;
  }
  25%, 75% {
    opacity: 0;
  }
}

.flash {
  animation: flash 1s ease-in-out;
}

@keyframes flashColor {
  0%, 100% {
    background-color: inherit;
    color: inherit;
  }
  50% {
    background-color: var(--primary-color);
    color: white;
  }
}

.flash-color {
  animation: flashColor 0.5s ease-in-out;
}

/* ===== LOADING ANIMATIONS ===== */
@keyframes dotPulse {
  0% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.4;
  }
}

.dot-pulse {
  animation: dotPulse 1.4s ease-in-out infinite;
}

.dot-pulse:nth-child(2) {
  animation-delay: 0.2s;
}

.dot-pulse:nth-child(3) {
  animation-delay: 0.4s;
}

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

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

.typing {
  overflow: hidden;
  border-right: 0.1em solid var(--primary-color);
  white-space: nowrap;
  animation: typing 2s steps(40, end), blinkCursor 0.75s step-end infinite;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
  transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.hover-scale {
  transition: transform 0.2s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-rotate {
  transition: transform 0.2s ease;
}

.hover-rotate:hover {
  transform: rotate(5deg);
}

.hover-glow {
  transition: box-shadow 0.2s ease;
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(79, 70, 229, 0.4);
}

/* ===== COMPLETION ANIMATIONS ===== */
@keyframes checkMark {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.check-mark {
  animation: checkMark 0.4s ease-out;
}

@keyframes todoComplete {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
}

.todo-complete {
  animation: todoComplete 0.4s ease-out;
}

/* ===== SWIPE ANIMATIONS ===== */
@keyframes swipeInLeft {
  0% {
    transform: translateX(-100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes swipeOutRight {
  0% {
    transform: translateX(0);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

.swipe-in-left {
  animation: swipeInLeft 0.3s ease-out;
}

.swipe-out-right {
  animation: swipeOutRight 0.3s ease-in;
}

/* ===== PROGRESS ANIMATIONS ===== */
@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: var(--progress-width, 100%);
  }
}

.progress-fill {
  animation: progressFill 0.5s ease-out;
}

/* ===== RESPONSIVE ANIMATIONS ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hover-lift:hover,
  .hover-scale:hover,
  .hover-rotate:hover,
  .hover-glow:hover {
    transform: none;
  }
}

/* ===== UTILITY CLASSES ===== */
.animate-faster {
  animation-duration: 0.1s !important;
}

.animate-fast {
  animation-duration: 0.2s !important;
}

.animate-slow {
  animation-duration: 0.5s !important;
}

.animate-slower {
  animation-duration: 1s !important;
}

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

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

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

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

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

/* ===== INFINITE ANIMATIONS ===== */
.infinite {
  animation-iteration-count: infinite;
}

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

.infinite-pulse {
  animation: pulse 2s infinite;
}

.infinite-spin {
  animation: spin 2s linear infinite;
}

.infinite-heartbeat {
  animation: heartbeat 2s infinite;
}

/* ===== DELAY ANIMATIONS ===== */
@keyframes delayFadeIn {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-fade-in {
  animation: delayFadeIn 0.3s ease-out;
}

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

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

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

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

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