/* ==============================================
   ANIMACIONES DE CARGA Y ESQUELETOS (SKELETONS)
   ============================================== */
@keyframes pulse {
  50% { opacity: 0.6; }
}
.skeleton {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
  background-color: #e2e8f0;
  border-radius: 0.75rem;
}

/* ==============================================
   PANTALLA DE CARGA GLOBAL
   ============================================== */
#global-loader {
    position: fixed; inset: 0;
    background-color: #f8fafc;
    z-index: 100; display: flex;
    justify-content: center; align-items: center;
    transition: opacity 0.7s ease, visibility 0.7s ease;
}
#global-loader.hidden { opacity: 0; visibility: hidden; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader-spinner {
  width: 50px; height: 50px;
  border: 5px solid #d1d5db;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 1s ease-in-out infinite;
}

/* ==============================================
   ANIMACIONES DE ENTRADA (STAGGER)
   ============================================== */
@keyframes slide-in-fade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.stagger-in > * {
  opacity: 0;
  transform: translateY(20px);
  animation: slide-in-fade 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  animation-delay: var(--stagger-delay, 0s);
}
.stagger-in > *:nth-child(1) { animation-delay: calc(var(--stagger-delay, 0s) + 0.1s); }
.stagger-in > *:nth-child(2) { animation-delay: calc(var(--stagger-delay, 0s) + 0.2s); }
.stagger-in > *:nth-child(3) { animation-delay: calc(var(--stagger-delay, 0s) + 0.3s); }
.stagger-in > *:nth-child(4) { animation-delay: calc(var(--stagger-delay, 0s) + 0.4s); }

/* ==============================================
   ANIMACIONES DE COMPONENTES GENERALES
   ============================================== */
@keyframes component-fade-in-keyframes {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.component-fade-in {
    animation: component-fade-in-keyframes 0.5s ease-out backwards;
}

/* ==============================================
   ANIMACIONES PÁGINA DE LOGIN Y LANDING
   ============================================== */
@keyframes bg-pan {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.animated-gradient {
  background: linear-gradient(75deg, #f1f5f9, #e0e7ff, #f1f5f9);
  background-size: 200% 200%;
  animation: bg-pan 15s ease infinite;
}
@keyframes fade-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.form-fade-scale-in {
  animation: fade-scale-in 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.aurora-effect {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 1200px;
    height: 400px; overflow: hidden;
    filter: blur(100px);
    z-index: -1;
}
.aurora-element {
    position: absolute; width: 600px; height: 600px;
    background-image: radial-gradient(circle, rgba(79, 70, 229, 0.2), rgba(56, 189, 248, 0.2), transparent 60%);
    border-radius: 50%;
    animation: rotate-aurora 20s linear infinite;
}
@keyframes rotate-aurora {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

/* ==============================================
   ANIMACIONES DASHBOARD Y PERFIL
   ============================================== */
@keyframes dashboard-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.dashboard-content-enter {
    animation: dashboard-enter 0.5s 0.2s ease-out forwards;
    opacity: 0;
}
@keyframes item-enter-anim {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
.item-enter {
    animation: item-enter-anim 0.4s ease-out backwards;
}
@keyframes item-remove-anim {
    from { opacity: 1; transform: scale(1); }
    to { opacity: 0; transform: scale(0.9); }
}
.item-remove-active {
    animation: item-remove-anim 0.3s ease-in forwards;
}

/* Animación de entrada para los componentes */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.component-fade-in {
    opacity: 0; /* Oculto por defecto para que la animación funcione */
    animation: fadeIn 0.5s ease-out forwards;
}

/* ============================================ */
/* INICIO DE CAMBIOS PARA FASE 2                */
/* ============================================ */

/* Animación para nuevas menciones que llegan en tiempo real */
.mention-new {
    animation: fadeInHighlight 1.5s ease-in-out;
}

@keyframes fadeInHighlight {
    0% {
        opacity: 0;
        transform: translateY(-10px);
        background-color: #ecfdf5; /* Color verde muy claro */
    }
    50% {
        opacity: 1;
        transform: translateY(0);
        background-color: #d1fae5; /* Color verde un poco más oscuro */
    }
    100% {
        background-color: transparent; /* Vuelve al fondo normal */
    }
}

/* ============================================ */
/* FIN DE CAMBIOS PARA FASE 2                   */
/* ============================================ */