/* Mejoras de UX/UI para la sección de Agendar */

/* Animación de entrada para las tarjetas de citas */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#proximasCitas > div {
  animation: slideInUp 0.4s ease-out forwards;
}

#proximasCitas > div:nth-child(1) { animation-delay: 0.1s; }
#proximasCitas > div:nth-child(2) { animation-delay: 0.2s; }
#proximasCitas > div:nth-child(3) { animation-delay: 0.3s; }
#proximasCitas > div:nth-child(4) { animation-delay: 0.4s; }
#proximasCitas > div:nth-child(5) { animation-delay: 0.5s; }

/* Animación suave para toggle del calendario */
#calendario-contenido {
  transition: all 0.3s ease-in-out;
  overflow: hidden;
}

#toggle-icon {
  transition: transform 0.3s ease;
}

/* Efecto pulse sutil para badges de estado */
@keyframes pulse-subtle {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.badge-estado-pendiente {
  animation: pulse-subtle 2s ease-in-out infinite;
}

/* Mejora de accesibilidad - focus states */
button:focus,
a:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Transiciones suaves para hover states */
.cita-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Botón VER DETALLES destacado */
a[href*="cita.php"] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

a[href*="cita.php"]:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Skeleton loading para cuando cargan las citas */
@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    #f3f4f6 25%,
    #e5e7eb 50%,
    #f3f4f6 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 0.5rem;
}

/* Iconos con animación suave */
.icon-animated {
  transition: transform 0.2s ease;
}

.icon-animated:hover {
  transform: scale(1.1);
}

/* Mejora de contraste para textos pequeños */
.text-xs {
  font-weight: 500;
}

/* Estados de botones mejorados */
.btn-primary {
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Responsive improvements */
@media (max-width: 640px) {
  #proximasCitas > div {
    font-size: 0.9rem;
  }
  
  .cita-card svg {
    width: 1.25rem;
    height: 1.25rem;
  }
  
  /* Botón VER DETALLES más compacto en móvil */
  a[href*="cita.php"] {
    padding: 0.75rem 1rem;
    font-size: 1rem;
  }
}

/* Toast notification para feedback */
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-1rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Gradientes sutiles para separadores */
.gradient-separator {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(209, 213, 219, 0.5) 50%,
    transparent
  );
  height: 1px;
}

/* Badge con glow effect para estados importantes */
.badge-glow-orange {
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.1);
}

.badge-glow-yellow {
  box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}

.badge-glow-green {
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Loading state para slots */
#ag-slots:empty::before {
  content: '';
  display: block;
  width: 100%;
  height: 40px;
  margin: 0.5rem 0;
}

/* Pulse para botón de toggle cuando hay citas */
@keyframes subtle-bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

#toggle-calendario.has-citas {
  animation: subtle-bounce 2s ease-in-out infinite;
}

/* Accessibilidad - reducir animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
