/* ========================================
   ANIMACIONES Y TRANSICIONES PROFESIONALES
   Calculadora Laboral - Pytyvorã
   ======================================== */

/* ========================================
   1. KEYFRAMES - Animaciones Base
   ======================================== */

/* Entrada suave desde arriba */
@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Entrada suave desde abajo */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Entrada suave desde izquierda */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Entrada suave desde derecha */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Fade In - Aparición suave */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Fade Out - Desaparición suave */
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

/* Zoom In - Ampliación suave */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Zoom Out - Reducción suave */
@keyframes zoomOut {
  from {
    opacity: 1;
    transform: scale(1);
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}

/* Pulse - Latido suave */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Bounce - Rebote suave */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Shake - Temblor suave */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Glow - Brillo suave */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(196, 30, 58, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(196, 30, 58, 0.6);
  }
}

/* Rotate - Rotación suave */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Flip - Volteo suave */
@keyframes flip {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}

/* Swing - Balanceo suave */
@keyframes swing {
  20% {
    transform: rotate(15deg);
  }
  40% {
    transform: rotate(-10deg);
  }
  60% {
    transform: rotate(5deg);
  }
  80% {
    transform: rotate(-5deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Gradient Shift - Cambio de gradiente */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Loading Spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Skeleton Loading */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* ========================================
   2. CLASES DE UTILIDAD - Animaciones Reutilizables
   ======================================== */

/* Entrada */
.animate-slide-in-down {
  animation: slideInDown 0.5s ease-out;
}

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

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

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

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

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

/* Salida */
.animate-fade-out {
  animation: fadeOut 0.4s ease-in;
}

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

/* Efectos continuos */
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

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

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

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

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

/* ========================================
   3. TRANSICIONES - Cambios suaves
   ======================================== */

/* Transición rápida */
.transition-fast {
  transition: all 0.15s ease;
}

/* Transición normal */
.transition-normal {
  transition: all 0.3s ease;
}

/* Transición lenta */
.transition-slow {
  transition: all 0.5s ease;
}

/* Transiciones específicas */
.transition-colors {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s ease;
}

.transition-opacity {
  transition: opacity 0.3s ease;
}

.transition-shadow {
  transition: box-shadow 0.3s ease;
}

.transition-all {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================
   4. FORMULARIOS - Animaciones de campos
   ======================================== */

/* Input focus animation */
input:focus,
textarea:focus,
select:focus {
  animation: glow 0.3s ease-out;
}

/* Label animation en focus */
.form-group label {
  transition: all 0.3s ease;
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group select:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  transform: translateY(-1.5rem) scale(0.85);
  color: #C41E3A;
}

/* Input underline animation */
.form-group input,
.form-group textarea,
.form-group select {
  position: relative;
  border-bottom: 2px solid #E8E3DE;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-bottom-color: #C41E3A;
}

/* Input error animation */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
  animation: shake 0.3s ease-in-out;
  border-bottom-color: #EF4444;
}

/* Input success animation */
.form-group.success input,
.form-group.success textarea,
.form-group.success select {
  border-bottom-color: #22C55E;
}

/* ========================================
   5. BOTONES - Animaciones interactivas
   ======================================== */

/* Botón base */
button,
.btn,
[role="button"] {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

/* Hover effect - Elevación */
button:hover,
.btn:hover,
[role="button"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Active effect - Presión */
button:active,
.btn:active,
[role="button"]:active {
  transform: translateY(0);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Ripple effect - Ondas al hacer clic */
button::after,
.btn::after,
[role="button"]::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;
}

button:active::after,
.btn:active::after,
[role="button"]:active::after {
  animation: ripple 0.6s ease-out;
}

@keyframes ripple {
  to {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* ========================================
   6. TARJETAS Y CONTENEDORES
   ======================================== */

/* Card hover effect */
.card,
.calculator-section,
.result-card {
  transition: all 0.3s ease;
}

.card:hover,
.calculator-section:hover,
.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Card entrance animation */
.card-enter {
  animation: slideInUp 0.5s ease-out;
}

/* ========================================
   7. RESULTADOS - Animaciones de visualización
   ======================================== */

/* Result appearance */
.result-container {
  animation: slideInUp 0.5s ease-out;
}

/* Result number animation - Contador */
.result-number {
  animation: fadeIn 0.5s ease-out;
}

/* Result chart animation */
.result-chart {
  animation: zoomIn 0.6s ease-out;
}

/* ========================================
   8. NOTIFICACIONES Y ALERTAS
   ======================================== */

/* Toast notification */
.toast {
  animation: slideInUp 0.4s ease-out;
  transition: all 0.3s ease;
}

.toast.hide {
  animation: slideInDown 0.4s ease-in;
}

/* Alert entrance */
.alert {
  animation: slideInDown 0.4s ease-out;
}

/* Alert success */
.alert.success {
  border-left: 4px solid #22C55E;
  animation: slideInDown 0.4s ease-out;
}

/* Alert error */
.alert.error {
  border-left: 4px solid #EF4444;
  animation: shake 0.3s ease-in-out;
}

/* Alert warning */
.alert.warning {
  border-left: 4px solid #EAB308;
  animation: slideInDown 0.4s ease-out;
}

/* ========================================
   9. LOADING STATES
   ======================================== */

/* Spinner */
.spinner {
  animation: spin 1s linear infinite;
}

/* Skeleton loading */
.skeleton {
  background: linear-gradient(
    90deg,
    #F5F0EB 0%,
    #FFFBF8 50%,
    #F5F0EB 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Loading bar */
.loading-bar {
  animation: slideInRight 0.6s ease-out;
}

/* ========================================
   10. EFECTOS ESPECIALES
   ======================================== */

/* Gradient animated background */
.gradient-animated {
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

/* Floating animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

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

/* Fade in on scroll */
.fade-in-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   11. RESPONSIVE ANIMATIONS
   ======================================== */

/* Reducir animaciones en dispositivos móviles */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Animaciones más rápidas en móvil */
@media (max-width: 768px) {
  .animate-slide-in-down,
  .animate-slide-in-up,
  .animate-slide-in-left,
  .animate-slide-in-right {
    animation-duration: 0.3s;
  }

  button:hover,
  .btn:hover,
  [role="button"]:hover {
    transform: translateY(-1px);
  }
}

/* ========================================
   12. TRANSICIONES DE PÁGINA
   ======================================== */

/* Page transition in */
.page-enter {
  animation: fadeIn 0.4s ease-out;
}

/* Page transition out */
.page-exit {
  animation: fadeOut 0.3s ease-in;
}

/* Section transition */
.section-enter {
  animation: slideInUp 0.5s ease-out;
}

/* ========================================
   13. EFECTOS DE TEXTO
   ======================================== */

/* Text highlight animation */
@keyframes textHighlight {
  0% {
    background-color: transparent;
  }
  50% {
    background-color: rgba(196, 30, 58, 0.2);
  }
  100% {
    background-color: transparent;
  }
}

.text-highlight {
  animation: textHighlight 1s ease-in-out;
}

/* Typing effect */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

.typing {
  animation: typing 3s steps(40, end);
  overflow: hidden;
  white-space: nowrap;
  border-right: 3px solid #C41E3A;
}

/* ========================================
   14. PERFORMANCE OPTIMIZATION
   ======================================== */

/* Use GPU acceleration */
.animate-gpu {
  transform: translateZ(0);
  will-change: transform;
}

/* Optimize animations */
@media (prefers-reduced-motion: no-preference) {
  .smooth-animation {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
}

/* ========================================
   15. DARK MODE ANIMATIONS
   ======================================== */

@media (prefers-color-scheme: dark) {
  .glow {
    animation: glowDark 2s ease-in-out infinite;
  }

  @keyframes glowDark {
    0%, 100% {
      box-shadow: 0 0 5px rgba(255, 107, 122, 0.3);
    }
    50% {
      box-shadow: 0 0 20px rgba(255, 107, 122, 0.6);
    }
  }
}

/* ========================================
   DOCUMENTACIÓN DE CLASES
   ======================================== */

/*
CÓMO USAR ESTAS ANIMACIONES:

1. ENTRADA SUAVE:
   <div class="animate-slide-in-up">Contenido</div>
   <div class="animate-fade-in">Contenido</div>
   <div class="animate-zoom-in">Contenido</div>

2. TRANSICIONES:
   <button class="transition-normal">Botón</button>
   <input class="transition-colors" type="text">

3. FORMULARIOS:
   <div class="form-group">
     <input type="text" placeholder=" ">
     <label>Email</label>
   </div>

4. BOTONES:
   <button class="btn">Calcular</button>

5. TARJETAS:
   <div class="card card-enter">Contenido</div>

6. NOTIFICACIONES:
   <div class="toast">Mensaje</div>
   <div class="alert alert.success">Éxito</div>

7. LOADING:
   <div class="spinner"></div>
   <div class="skeleton"></div>

8. EFECTOS ESPECIALES:
   <div class="gradient-animated">Fondo animado</div>
   <div class="animate-float">Flotante</div>

9. SCROLL ANIMATION:
   <div class="fade-in-on-scroll">Contenido</div>
   (Requiere JavaScript para detectar scroll)

10. TEXTO:
    <span class="text-highlight">Destacado</span>
    <p class="typing">Efecto de escritura</p>
*/
