/* ============================================
   ANIMACIONES Y TRANSICIONES MEJORADAS
   Sistema de animaciones para mejor UX
   ============================================ */

/* === ANIMACIONES BASE === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* === CLASES DE ANIMACIÓN === */
.animate-fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

.animate-fade-out {
  animation: fadeOut var(--transition-base) ease-out;
}

.animate-slide-in-right {
  animation: slideInRight var(--transition-base) ease-out;
}

.animate-slide-in-left {
  animation: slideInLeft var(--transition-base) ease-out;
}

.animate-scale-in {
  animation: scaleIn var(--transition-base) cubic-bezier(0.34, 1.56, 0.64, 1);
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* === TRANSICIONES MEJORADAS === */
.card {
  transition: all var(--transition-slow);
}

.card:hover {
  transform: translateY(-2px);
}

.action-btn,
.icon-btn {
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.action-btn::before,
.icon-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.action-btn:hover::before,
.icon-btn:hover::before {
  width: 300px;
  height: 300px;
}

.action-btn-primary::before {
  background: rgba(0, 0, 0, 0.1);
}

/* === LOADING STATES === */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* === SKELETON LOADING === */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--bg-surface) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--border-radius-md);
}

.skeleton-text {
  height: 1em;
  margin: 0.5em 0;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* === TOAST NOTIFICATIONS MEJORADAS === */
.toast {
  min-width: 300px;
  max-width: 400px;
  background: var(--bg-panel);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-md) var(--spacing-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  animation: slideInRight var(--transition-base) ease-out;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
}

.toast.success::before {
  background: var(--status-success);
}

.toast.error::before {
  background: var(--status-error);
}

.toast.warning::before {
  background: var(--status-warning);
}

.toast.info::before {
  background: var(--status-info);
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--accent-primary);
}

.toast.success .toast-icon {
  color: var(--status-success);
}

.toast.error .toast-icon {
  color: var(--status-error);
}

.toast.warning .toast-icon {
  color: var(--status-warning);
}

.toast.info .toast-icon {
  color: var(--status-info);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.toast-message {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-close:hover {
  background: var(--glass-highlight);
  color: var(--text-primary);
}

/* === PROGRESS INDICATORS === */
.progress-ring {
  width: 48px;
  height: 48px;
}

.progress-ring circle {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.35s;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.progress-ring-background {
  stroke: var(--glass-border);
}

.progress-ring-progress {
  stroke: var(--accent-primary);
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
}

/* === RIPPLE EFFECT === */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s, opacity 0.6s;
  opacity: 0;
}

.ripple:active::after {
  width: 300px;
  height: 300px;
  opacity: 0;
  transition: width 0.6s, height 0.6s, opacity 0s;
}

/* === GLOW EFFECTS === */
.glow-on-hover {
  transition: box-shadow var(--transition-base);
}

.glow-on-hover:hover {
  box-shadow: 0 0 20px var(--accent-glow);
}

.glow-active {
  box-shadow: 0 0 20px var(--accent-glow);
}

/* === SMOOTH SCROLL === */
.smooth-scroll {
  scroll-behavior: smooth;
}

/* === FOCUS VISIBLE (Accesibilidad) === */
*:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

/* === RESPONSIVE ANIMATIONS === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

