/* =============================================
   WYD_X - MOBILE ANIMATIONS
   Animações otimizadas para dispositivos móveis
   ============================================= */

/* =============================================
   PERFORMANCE OPTIMIZED ANIMATIONS
   ============================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =============================================
   FADE ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  @keyframes fadeOut {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
  }
  
  @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);
    }
  }
}

/* =============================================
   SLIDE ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes slideInLeft {
    from {
      transform: translateX(-100%);
    }
    to {
      transform: translateX(0);
    }
  }
  
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
    }
    to {
      transform: translateX(0);
    }
  }
  
  @keyframes slideInUp {
    from {
      transform: translateY(100%);
    }
    to {
      transform: translateY(0);
    }
  }
  
  @keyframes slideInDown {
    from {
      transform: translateY(-100%);
    }
    to {
      transform: translateY(0);
    }
  }
  
  @keyframes slideOutLeft {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(-100%);
    }
  }
  
  @keyframes slideOutRight {
    from {
      transform: translateX(0);
    }
    to {
      transform: translateX(100%);
    }
  }
}

/* =============================================
   SCALE ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @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);
    }
  }
  
  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
    100% {
      transform: scale(1);
    }
  }
  
  @keyframes heartbeat {
    0%, 100% {
      transform: scale(1);
    }
    10%, 30% {
      transform: scale(1.1);
    }
    20%, 40% {
      transform: scale(1);
    }
  }
}

/* =============================================
   ROTATE ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes rotate {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  @keyframes rotateIn {
    from {
      opacity: 0;
      transform: rotate(-180deg) scale(0.5);
    }
    to {
      opacity: 1;
      transform: rotate(0deg) scale(1);
    }
  }
  
  @keyframes wiggle {
    0%, 100% {
      transform: rotate(0deg);
    }
    25% {
      transform: rotate(-5deg);
    }
    75% {
      transform: rotate(5deg);
    }
  }
}

/* =============================================
   BOUNCE ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
      transform: translateY(0);
    }
    40% {
      transform: translateY(-15px);
    }
    60% {
      transform: translateY(-8px);
    }
  }
  
  @keyframes bounceIn {
    0% {
      opacity: 0;
      transform: scale(0.3);
    }
    50% {
      opacity: 1;
      transform: scale(1.05);
    }
    70% {
      transform: scale(0.9);
    }
    100% {
      transform: scale(1);
    }
  }
}

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

/* =============================================
   GLOW ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes glow {
    0%, 100% {
      box-shadow: 0 0 5px rgba(249, 115, 22, 0.2);
    }
    50% {
      box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
    }
  }
  
  @keyframes glowText {
    0%, 100% {
      text-shadow: 0 0 5px rgba(249, 115, 22, 0.2);
    }
    50% {
      text-shadow: 0 0 15px rgba(249, 115, 22, 0.8);
    }
  }
}

/* =============================================
   SHIMMER ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes shimmer {
    0% {
      background-position: -200% 0;
    }
    100% {
      background-position: 200% 0;
    }
  }
  
  .shimmer-effect {
    background: linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.1) 50%,
      rgba(255, 255, 255, 0) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
  }
}

/* =============================================
   LOADING ANIMATIONS
   ============================================= */
@media (max-width: 768px) {
  @keyframes spin {
    from {
      transform: rotate(0deg);
    }
    to {
      transform: rotate(360deg);
    }
  }
  
  @keyframes dots {
    0%, 20% {
      content: '.';
    }
    40% {
      content: '..';
    }
    60%, 100% {
      content: '...';
    }
  }
  
  .loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(249, 115, 22, 0.2);
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  
  .loading-dots::after {
    content: '.';
    animation: dots 1.5s steps(1, end) infinite;
  }
}

/* =============================================
   RIPPLE EFFECT
   ============================================= */
@media (max-width: 768px) {
  @keyframes ripple {
    0% {
      transform: scale(0);
      opacity: 1;
    }
    100% {
      transform: scale(2);
      opacity: 0;
    }
  }
  
  .ripple-container {
    position: relative;
    overflow: hidden;
  }
  
  .ripple-container::after {
    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%);
    pointer-events: none;
  }
  
  .ripple-container:active::after {
    width: 100%;
    padding-top: 100%;
    animation: ripple 0.6s ease-out;
  }
}

/* =============================================
   SKELETON LOADING
   ============================================= */
@media (max-width: 768px) {
  @keyframes skeleton-loading {
    0% {
      background-position: -200px 0;
    }
    100% {
      background-position: calc(200px + 100%) 0;
    }
  }
  
  .skeleton {
    background: linear-gradient(
      90deg,
      rgba(249, 115, 22, 0.05) 0%,
      rgba(249, 115, 22, 0.15) 50%,
      rgba(249, 115, 22, 0.05) 100%
    );
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
  }
  
  .skeleton-text {
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
  }
  
  .skeleton-title {
    height: 20px;
    margin-bottom: 12px;
    border-radius: 4px;
    width: 60%;
  }
  
  .skeleton-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
  }
  
  .skeleton-image {
    width: 100%;
    height: 200px;
    border-radius: 8px;
  }
}

/* =============================================
   PAGE TRANSITIONS
   ============================================= */
@media (max-width: 768px) {
  .page-enter {
    animation: fadeInUp 0.3s ease-out;
  }
  
  .page-exit {
    animation: fadeOut 0.2s ease-in;
  }
  
  .modal-enter {
    animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  
  .modal-exit {
    animation: scaleOut 0.2s ease-in;
  }
}

/* =============================================
   UTILITY ANIMATION CLASSES
   ============================================= */
@media (max-width: 768px) {
  /* Fade animations */
  .animate-fadeIn {
    animation: fadeIn 0.3s ease-out;
  }
  
  .animate-fadeOut {
    animation: fadeOut 0.3s ease-in;
  }
  
  .animate-fadeInUp {
    animation: fadeInUp 0.4s ease-out;
  }
  
  .animate-fadeInDown {
    animation: fadeInDown 0.4s ease-out;
  }
  
  /* Slide animations */
  .animate-slideInLeft {
    animation: slideInLeft 0.3s ease-out;
  }
  
  .animate-slideInRight {
    animation: slideInRight 0.3s ease-out;
  }
  
  /* Scale animations */
  .animate-scaleIn {
    animation: scaleIn 0.3s ease-out;
  }
  
  .animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
  }
  
  /* Bounce animations */
  .animate-bounce {
    animation: bounce 1s ease-in-out infinite;
  }
  
  .animate-bounceIn {
    animation: bounceIn 0.5s ease-out;
  }
  
  /* Shake animations */
  .animate-shake {
    animation: shake 0.5s ease-in-out;
  }
  
  /* Rotate animations */
  .animate-rotate {
    animation: rotate 2s linear infinite;
  }
  
  .animate-wiggle {
    animation: wiggle 0.5s ease-in-out;
  }
  
  /* Glow animations */
  .animate-glow {
    animation: glow 2s ease-in-out infinite;
  }
  
  /* Loading */
  .animate-spin {
    animation: spin 1s linear infinite;
  }
}

/* =============================================
   ANIMATION DELAYS
   ============================================= */
@media (max-width: 768px) {
  .delay-100 {
    animation-delay: 0.1s;
  }
  
  .delay-200 {
    animation-delay: 0.2s;
  }
  
  .delay-300 {
    animation-delay: 0.3s;
  }
  
  .delay-400 {
    animation-delay: 0.4s;
  }
  
  .delay-500 {
    animation-delay: 0.5s;
  }
}

/* =============================================
   ANIMATION DURATIONS
   ============================================= */
@media (max-width: 768px) {
  .duration-fast {
    animation-duration: 0.2s !important;
  }
  
  .duration-normal {
    animation-duration: 0.3s !important;
  }
  
  .duration-slow {
    animation-duration: 0.5s !important;
  }
}

/* =============================================
   TRANSITION CLASSES
   ============================================= */
@media (max-width: 768px) {
  .transition-all {
    transition: all 0.3s ease;
  }
  
  .transition-colors {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
  }
  
  .transition-transform {
    transition: transform 0.3s ease;
  }
  
  .transition-opacity {
    transition: opacity 0.3s ease;
  }
  
  .transition-fast {
    transition-duration: 0.2s !important;
  }
  
  .transition-slow {
    transition-duration: 0.5s !important;
  }
}

/* =============================================
   HOVER EFFECTS (for devices that support hover)
   ============================================= */
@media (hover: hover) and (max-width: 768px) {
  .hover-scale:hover {
    transform: scale(1.05);
  }
  
  .hover-glow:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
  }
  
  .hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
}

/* =============================================
   ACTIVE STATES (for touch devices)
   ============================================= */
@media (max-width: 768px) {
  .active-scale:active {
    transform: scale(0.95);
  }
  
  .active-opacity:active {
    opacity: 0.7;
  }
  
  .active-glow:active {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.6);
  }
}

/* =============================================
   PAUSE ANIMATIONS WHEN TAB IS NOT VISIBLE
   ============================================= */
@media (max-width: 768px) {
  .animations-paused,
  .animations-paused * {
    animation-play-state: paused !important;
  }
}

/* =============================================
   HARDWARE ACCELERATION
   ============================================= */
@media (max-width: 768px) {
  .gpu-accelerated {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
  }
}

/* =============================================
   END OF MOBILE ANIMATIONS
   ============================================= */

